/** * Global variables */ var monitorTabs; // Monitor tabs /** * Set the monitor tab * * @param o * Tab object * @return Nothing */ function setMonitorTab(o) { monitorTabs = o; } /** * Get the monitor tab * * @param Nothing * @return Tab object */ function getMonitorTab() { return monitorTabs; } /** * Load the monitor page * * @return Nothing */ function loadMonitorPage() { // If the page is already loaded if ($('#monitor_page').children().length) { // Do not reload the monitor page return; } // Create monitor tab var tab = new Tab(); setConfigTab(tab); tab.init(); $('#monitor_page').append(tab.object()); // Create provision tab var tab = new Tab(); setMonitorTab(tab); tab.init(); $('#monitor_page').append(tab.object()); /** * Monitor nodes */ var monitorForm = $('
'); // Create info bar var monitorInfoBar = createInfoBar('Under construction'); monitorForm.append(monitorInfoBar); // Create drop-down menu // Hardware available to provision - ipmi, blade, hmc, ivm, fsp, and zvm var div = $('
'); monitorForm.append(div); tab.add('monitorTab', 'Monitor', monitorForm); /** * Resources */ var resrcForm = $('
'); // Create info bar var resrcInfoBar = createInfoBar('Select a hardware to view its resources'); resrcForm.append(resrcInfoBar); // Create drop-down menu // Hardware available to provision - ipmi, blade, hmc, ivm, fsp, and zvm var div = $('
'); var label = $('Select the hardware:'); var hw = $(''); var ipmi = $(''); var blade = $(''); var hmc = $(''); var ivm = $(''); var fsp = $(''); var zvm = $(''); hw.append(ipmi); hw.append(blade); hw.append(hmc); hw.append(ivm); hw.append(fsp); hw.append(zvm); div.append(label); div.append(hw); resrcForm.append(div); /** * Ok */ var okBtn = createButton('Ok'); okBtn.bind('click', function(event) { // Get hardware that was selected var hw = $(this).parent().find('select').val(); // Generate new tab ID var newTabId = hw + 'ResourceTab'; if (!$('#' + newTabId).length) { var loader = createLoader('zvmResourceLoader'); loader = $('
').append(loader); tab.add(newTabId, hw, loader); if (hw == 'zvm') { // Reset resource table setDiskDataTable(''); setNetworkDataTable(''); // Get hardware control points $.ajax( { url : 'lib/cmd.php', dataType : 'json', data : { cmd : 'nodels', tgt : 'mgt==zvm', args : 'zvm.hcp', msg : '' }, success : getZResources }); } // TODO: Add other platforms to this section else { $('#' + newTabId).append(); } } // Select tab tab.select(newTabId); }); resrcForm.append(okBtn); tab.add('resourceTab', 'Resources', resrcForm); }