From 10fe1f542fee7087df37c5c302a7354425d2acee Mon Sep 17 00:00:00 2001 From: xq2005 Date: Wed, 24 Aug 2011 10:30:30 +0000 Subject: [PATCH] quick provision from nodes page git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@10353 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-UI/js/custom/blade.js | 515 +----------------------------- xCAT-UI/js/custom/customUtils.js | 328 +++++++++++++++++++ xCAT-UI/js/custom/hmc.js | 379 +--------------------- xCAT-UI/js/custom/ipmi.js | 451 +------------------------- xCAT-UI/js/nodes/nodes.js | 168 +--------- xCAT-UI/js/provision/provision.js | 72 +++-- xCAT-UI/js/ui.js | 1 + 7 files changed, 405 insertions(+), 1509 deletions(-) diff --git a/xCAT-UI/js/custom/blade.js b/xCAT-UI/js/custom/blade.js index 4d0fc9e57..a62c813d1 100644 --- a/xCAT-UI/js/custom/blade.js +++ b/xCAT-UI/js/custom/blade.js @@ -97,50 +97,21 @@ bladePlugin.prototype.loadClonePage = function(node) { * @return Nothing */ bladePlugin.prototype.loadProvisionPage = function(tabId) { - // Get OS image names - $.ajax( { - url : 'lib/cmd.php', - dataType : 'json', - data : { - cmd : 'tabdump', - tgt : '', - args : 'osimage', - msg : '' - }, + // Create provision form + var provForm = $('
'); - success : setOSImageCookies - }); + // Create info bar + var infoBar = createInfoBar('Provision a node on Blade.'); + provForm.append(infoBar); - // Get groups - $.ajax( { - url : 'lib/cmd.php', - dataType : 'json', - data : { - cmd : 'extnoderange', - tgt : '/.*', - args : 'subgroups', - msg : '' - }, + // Append to provision tab + $('#' + tabId).append(provForm); - success : setGroupsCookies - }); - - // Get provision tab instance - var inst = tabId.replace('bladeProvisionTab', ''); - - // Create provision form - var provForm = $('
'); - - // Create info bar - var infoBar = createInfoBar('Provision a blade. This will install an operating system onto the blade.'); - provForm.append(infoBar); - - // Append to provision tab - $('#' + tabId).append(provForm); - - // Create provision existing node division - var provExisting = createBladeProvisionExisting(inst); - provForm.append(provExisting); + /** + * Create provision new node division + */ + // You should copy whatever is in this function, put it here, and customize it + createProvision('blade', provForm); }; /** @@ -351,465 +322,3 @@ function addBladeNode(){ }); } - -/** - * Create provision existing node division - * - * @param inst - * Provision tab instance - * @return Provision existing node division - */ -function createBladeProvisionExisting(inst) { - // Create provision existing division - var provExisting = $('
'); - - // Create group input - var group = $('
'); - var groupLabel = $(''); - group.append(groupLabel); - - // Turn on auto complete for group - var dTableDivId = 'bladeNodesDatatableDIV' + inst; // Division ID where nodes datatable will be appended - var groupNames = $.cookie('groups'); - if (groupNames) { - // Split group names into an array - var tmp = groupNames.split(','); - - // Create drop down for groups - var groupSelect = $(''); - groupSelect.append(''); - for ( var i in tmp) { - // Add group into drop down - var opt = $(''); - groupSelect.append(opt); - } - group.append(groupSelect); - - // Create node datatable - groupSelect.change(function() { - // Get group selected - var thisGroup = $(this).val(); - // If a valid group is selected - if (thisGroup) { - createNodesDatatable(thisGroup, dTableDivId); - } // End of if (thisGroup) - }); - } else { - // If no groups are cookied - var groupInput = $(''); - group.append(groupInput); - } - provExisting.append(group); - - // Create node input - var node = $('
'); - var nodeLabel = $(''); - var nodeDatatable = $('

Select a group to view its nodes

'); - node.append(nodeLabel); - node.append(nodeDatatable); - provExisting.append(node); - - // Create boot method drop down - var method = $('
'); - var methodLabel = $(''); - var methodSelect = $(''); - methodSelect.append('' - + '' - + '' - + '' - + '' - + '' - ); - method.append(methodLabel); - method.append(methodSelect); - provExisting.append(method); - - // Create operating system input - var os = $('
'); - var osLabel = $(''); - var osInput = $(''); - osInput.one('focus', function() { - var tmp = $.cookie('osvers'); - if (tmp) { - // Turn on auto complete - $(this).autocomplete({ - source: tmp.split(',') - }); - } - }); - os.append(osLabel); - os.append(osInput); - provExisting.append(os); - - // Create architecture input - var arch = $('
'); - var archLabel = $(''); - var archInput = $(''); - archInput.one('focus', function() { - var tmp = $.cookie('osarchs'); - if (tmp) { - // Turn on auto complete - $(this).autocomplete({ - source: tmp.split(',') - }); - } - }); - arch.append(archLabel); - arch.append(archInput); - provExisting.append(arch); - - // Create profile input - var profile = $('
'); - var profileLabel = $(''); - var profileInput = $(''); - profileInput.one('focus', function() { - var tmp = $.cookie('profiles'); - if (tmp) { - // Turn on auto complete - $(this).autocomplete({ - source: tmp.split(',') - }); - } - }); - profile.append(profileLabel); - profile.append(profileInput); - provExisting.append(profile); - - /** - * Provision existing - */ - var provisionBtn = createButton('Provision'); - provisionBtn.bind('click', function(event) { - // Remove any warning messages - $(this).parents('.ui-tabs-panel').find('.ui-state-error').remove(); - var ready = true; - var errorMessage = ''; - - // Get provision tab ID - var thisTabId = 'bladeProvisionTab' + inst; - - // Get nodes that were checked - var dTableId = 'bladeNodesDatatable' + inst; - var tgts = getNodesChecked(dTableId); - if (!tgts) { - errorMessage += 'You need to select a node. '; - ready = false; - } - - // Check booth method - var boot = $('#' + thisTabId + ' select[name=bootMethod]'); - if (!boot.val()) { - errorMessage += 'You need to select a boot method. '; - boot.css('border', 'solid #FF0000 1px'); - ready = false; - } else { - boot.css('border', 'solid #BDBDBD 1px'); - } - - // Check operating system image - var os = $('#' + thisTabId + ' input[name=os]'); - if (!os.val()) { - errorMessage += 'You need to select a operating system image. '; - os.css('border', 'solid #FF0000 1px'); - ready = false; - } else { - os.css('border', 'solid #BDBDBD 1px'); - } - - // Check architecture - var arch = $('#' + thisTabId + ' input[name=arch]'); - if (!arch.val()) { - errorMessage += 'You need to select an architecture. '; - arch.css('border', 'solid #FF0000 1px'); - ready = false; - } else { - arch.css('border', 'solid #BDBDBD 1px'); - } - - // Check profile - var profile = $('#' + thisTabId + ' input[name=profile]'); - if (!profile.val()) { - errorMessage += 'You need to select a profile. '; - profile.css('border', 'solid #FF0000 1px'); - ready = false; - } else { - profile.css('border', 'solid #BDBDBD 1px'); - } - - // If all inputs are valid, ready to provision - if (ready) { - // Disable provision button - $(this).attr('disabled', 'true'); - - // Prepend status bar - var statBar = createStatusBar('bladeProvisionStatBar' + inst); - statBar.append(createLoader('')); - statBar.prependTo($('#' + thisTabId)); - - // Disable all inputs - var inputs = $('#' + thisTabId + ' input'); - inputs.attr('disabled', 'disabled'); - - // Disable all selects - var selects = $('#' + thisTabId + ' select'); - selects.attr('disabled', 'disabled'); - - /** - * (1) Set operating system - */ - $.ajax( { - url : 'lib/cmd.php', - dataType : 'json', - data : { - cmd : 'nodeadd', - tgt : '', - args : tgts + ';noderes.netboot=xnba;nodetype.os=' + os.val() + ';nodetype.arch=' + arch.val() + ';nodetype.profile=' + profile.val(), - msg : 'cmd=nodeadd;out=' + inst - }, - - success : updateBladeProvisionExistingStatus - }); - } else { - // Show warning message - var warn = createWarnBar(errorMessage); - warn.prependTo($(this).parent().parent()); - } - }); - provExisting.append(provisionBtn); - - return provExisting; -} - -/** - * Create nodes datatable for a given group - * - * @param group - * Group name - * @param outId - * Division ID to append datatable - * @return Nodes datatable - */ -function createNodesDatatable(group, outId) { - // Get group nodes - $.ajax( { - url : 'lib/cmd.php', - dataType : 'json', - data : { - cmd : 'lsdef', - tgt : '', - args : group, - msg : outId - }, - - /** - * Create nodes datatable - * - * @param data - * Data returned from HTTP request - * @return Nothing - */ - success : function(data) { - // Data returned - var rsp = data.rsp; - - // Get output ID - var outId = data.msg; - // Get datatable ID - var dTableId = outId.replace('DIV', ''); - - // Node attributes hash - var attrs = new Object(); - // Node attributes - var headers = new Object(); - - // Clear nodes datatable division - $('#' + outId).empty(); - - // Create nodes datatable - var node, args; - for ( var i in rsp) { - // Get node - var pos = rsp[i].indexOf('Object name:'); - if (pos > -1) { - var temp = rsp[i].split(': '); - node = jQuery.trim(temp[1]); - - // Create a hash for the node attributes - attrs[node] = new Object(); - i++; - } - - // Get key and value - args = rsp[i].split('='); - var key = jQuery.trim(args[0]); - var val = jQuery.trim(args[1]); - - // Create hash table - attrs[node][key] = val; - headers[key] = 1; - } - - // Sort headers - var sorted = new Array(); - for ( var key in headers) { - sorted.push(key); - } - sorted.sort(); - - // Add column for check box and node - sorted.unshift('', 'node'); - - // Create nodes datatable - var dTable = new DataTable(dTableId); - dTable.init(sorted); - - // Go through each node - for ( var node in attrs) { - // Create a row - var row = new Array(); - // Create a check box - var checkBx = ''; - row.push(checkBx, node); - - // Go through each header - for ( var i = 2; i < sorted.length; i++) { - // Add node attributes to the row - var key = sorted[i]; - var val = attrs[node][key]; - if (val) { - row.push(val); - } else { - row.push(''); - } - } - - // Add row to table - dTable.add(row); - } - - $('#' + outId).append(dTable.object()); - $('#' + dTableId).dataTable(); - } // End of function(data) - }); -} - -/** - * Update the provision existing node status - * - * @param data - * Data returned from HTTP request - * @return Nothing - */ -function updateBladeProvisionExistingStatus(data) { - // Get ajax response - var rsp = data.rsp; - var args = data.msg.split(';'); - - // Get command invoked - var cmd = args[0].replace('cmd=', ''); - // Get provision tab instance - var inst = args[1].replace('out=', ''); - - // Get provision tab and status bar ID - var statBarId = 'bladeProvisionStatBar' + inst; - var tabId = 'bladeProvisionTab' + inst; - - /** - * (2) Remote install - */ - if (cmd == 'nodeadd') { - // Write ajax response to status bar - var prg = writeRsp(rsp, ''); - $('#' + statBarId).find('div').append(prg); - - // Get parameters - var os = $('#' + tabId + ' input[name="os"]').val(); - var profile = $('#' + tabId + ' input[name="profile"]').val(); - var arch = $('#' + tabId + ' input[name="arch"]').val(); - - // Get nodes that were checked - var dTableId = 'bladeNodesDatatable' + inst; - var tgts = getNodesChecked(dTableId); - - // Begin installation - $.ajax( { - url : 'lib/cmd.php', - dataType : 'json', - data : { - cmd : 'rbootseq', - tgt : tgts, - args : 'net,hd', - msg : 'cmd=rbootseq;out=' + inst - }, - - success : updateBladeProvisionExistingStatus - }); - } - - /** - * (3) Prepare node for boot - */ - if (cmd == 'nodeadd') { - // Get provision method - var bootMethod = $('#' + tabId + ' select[name=bootMethod]').val(); - - // Get nodes that were checked - var dTableId = 'bladeNodesDatatable' + inst; - var tgts = getNodesChecked(dTableId); - - // Prepare node for boot - $.ajax( { - url : 'lib/cmd.php', - dataType : 'json', - data : { - cmd : 'nodeset', - tgt : tgts, - args : bootMethod, - msg : 'cmd=nodeset;out=' + inst - }, - - success : updateBladeProvisionExistingStatus - }); - } - - /** - * (4) Power on node - */ - if (cmd == 'nodeset') { - var prg = writeRsp(rsp, ''); - $('#' + statBarId).find('div').append(prg); - - // Get nodes that were checked - var dTableId = 'bladeNodesDatatable' + inst; - var tgts = getNodesChecked(dTableId); - - // Prepare node for boot - $.ajax( { - url : 'lib/cmd.php', - dataType : 'json', - data : { - cmd : 'rpower', - tgt : tgts, - args : 'boot', - msg : 'cmd=rpower;out=' + inst - }, - - success : updateBladeProvisionExistingStatus - }); - } - - /** - * (5) Done - */ - else if (cmd == 'rpower') { - // Write ajax response to status bar - var prg = writeRsp(rsp, ''); - $('#' + statBarId).find('div').append(prg); - $('#' + statBarId).find('img').remove(); - - // If installation was successful - if (prg.html().indexOf('Error') == -1) { - $('#' + statBarId).find('div').append('
It will take several minutes before the nodes are up and ready. Use rcons to monitor the status of the install.
'); - } - } -} \ No newline at end of file diff --git a/xCAT-UI/js/custom/customUtils.js b/xCAT-UI/js/custom/customUtils.js index 92f68bc07..965f170de 100644 --- a/xCAT-UI/js/custom/customUtils.js +++ b/xCAT-UI/js/custom/customUtils.js @@ -7,6 +7,9 @@ * Division ID to append datatable * @return Nodes datatable */ + +var provisionClock; + function createNodesDatatable(group, outId) { // Get group nodes $.ajax( { @@ -380,4 +383,329 @@ function createProvisionNew(plugin, inst) { provNew.append(provisionBtn); return provNew; +} + +function createProvision(plugin, container){ + var showStr = ''; + + //group, nodes, arch + if ('quick' == plugin){ + container.append(createProvWithUrl()); + } + else{ + container.append(createProvNonurl(plugin)); + container.find('#' + plugin + 'group').bind('change', function(){ + var pluginname = $(this).attr('id').replace('group', ''); + $('#' + pluginname + 'SelectNodesTable').html(''); + createNodesArea($(this).val(), pluginname + 'SelectNodesTable'); + }); + } + + //image,nic,master,tftp,nfs,option + showStr = '
' + + '
' + + '
' + + '
' + + '
' + + '
' + + '
'; + + container.append(showStr); + + //add the provision button + var provisionBtn = createButton('Provision'); + provisionBtn.bind('click', function(){ + var plugin = $(this).parent().parent().attr('id').replace('ProvisionTab', ''); + quickProvision(plugin); + }); + provisionBtn.hide(); + container.append(provisionBtn); + + //bind the image select change event + container.find('#' + plugin + 'image').bind('change', function(){ + var temp = $(this).attr('id'); + temp = temp.replace('image', ''); + $('#' + temp + 'ProvisionTab #advoption').html(''); + provAdvOption($(this).val(), temp); + }); + + $.ajax({ + url : 'lib/cmd.php', + dataType : 'json', + data : { + cmd : 'lsdef', + tgt : '', + args : '-t;osimage', + msg : plugin + }, + + success : function(data){ + var containerid = data.msg + 'ProvisionTab'; + var index = 0; + var imagename = 0; + var position = 0; + var imageselect = $('#' + containerid + ' #' + data.msg + 'image'); + $('#' + containerid + ' img').remove(); + if (data.rsp.lenght < 1){ + $('#' + containerid).prepend(createWarnBar('Please copycds and genimage in provision page first!')); + return; + } + + for (index in data.rsp){ + imagename = data.rsp[index]; + position = imagename.indexOf(' '); + imagename = imagename.substr(0, position); + + imageselect.append(''); + } + //trigger the select change event + imageselect.trigger('change'); + //show provision button + $('#' + containerid + ' button').show(); + } + }); +} + +function createProvWithUrl(){ + var querystr = window.location.search; + var argarray = querystr.substr(1).split('&'); + var temphash = new Object(); + var index = 0; + var temparray; + var showstr = ''; + for (index = 0; index < argarray.length; index++){ + temparray = argarray[index].split('='); + temphash[temparray[0]] = temparray[1]; + } + + showstr += '
'; + showstr += '
'; + + return showstr; +} + +function createProvNonurl(plugin){ + // Create the group area + var strGroup = '
'; + var groupNames = $.cookie('groups'); + if (groupNames) { + strGroup += ''; + } + strGroup += '
'; + + // Create nodes area + var strNodes = '
Select a group to view its nodes
'; + + // Create architecture + var strArch = '
'; + var archName = $.cookie('osarchs'); + if ('' != archName) { + strArch += ''; + } else { + strArch += ''; + } + strArch += '
'; + + return strGroup + strNodes + strArch; +} + +/** + * get all needed field for provsion and send the command to server + * + * @return Nothing + */ +function quickProvision(plugin){ + var errormessage = ''; + var argsArray = new Array(); + var nodesName = ''; + var provisionArg = ''; + var provisionFrame; + var imageName = ''; + var url = ''; + var softwareArg = ''; + var containerid = plugin + 'ProvisionTab'; + $('#' + containerid + ' .ui-state-error').remove(); + + $('#' + containerid + ' input[type!="checkbox"]').each(function(){ + if ('' == $(this).val()){ + errormessage = 'You are missing input!'; + return false; + } + else{ + argsArray.push($(this).val()); + } + }); + + if ('' != errormessage){ + $('#' + containerid).prepend('

' + errormessage + '

'); + return; + } + + //if jumped from nodes page, get nodes name from input + if ('quick' == plugin){ + nodesName = argsArray.shift(); + } + //select the different platform, get nodes name from table checkbox + else{ + //should unshift the arch type + argsArray.unshift($('#' + containerid + ' #arch').val()); + nodesName = getCheckedByObj($('#' + containerid + ' #' + plugin + 'SelectNodesTable')); + } + + if ('' == nodesName){ + $('#' + containerid).prepend('

Please select nodes first.

'); + return; + } + + softwareArg = getCheckedByObj($('#' + containerid + ' #advoption')); + imageName = $('#' + containerid + ' #' + plugin + 'image').val(); + provisionArg = argsArray.join(','); + url = 'lib/cmd.php?cmd=webrun&tgt=&args=provision;' + nodesName + ';' + imageName + ';' + + provisionArg + ';' + softwareArg + '&msg=&opts=flush'; + + // show the result + var deployDia = $('
'); + deployDia.append(createLoader()).append('
'); + deployDia.append(''); + deployDia.dialog({ + modal: true, + width: 600, + height: 480, + title:'Provision on Nodes', + close: function(){$(this).remove();}, + buttons: { + Close : function(){$(this).dialog('close');} + } + }); + + provisionStopCheck(); +} + +function provAdvOption(imagename, plugin){ + $.ajax({ + url : 'lib/cmd.php', + dataType : 'json', + data : { + cmd : 'lsdef', + tgt : '', + args : '-t;osimage;' + imagename + ';-i;osname,provmethod', + msg : plugin + }, + + success : function(data){ + var containerid = data.msg + 'ProvisionTab'; + var index = 0; + var osname = ''; + var provmethod = ''; + var tempstr = ''; + var position = 0; + for (index = 0; index < data.rsp.length; index++){ + tempstr = data.rsp[index]; + if (-1 != tempstr.indexOf('osname')){ + position = tempstr.indexOf('='); + osname = tempstr.substr(position + 1); + } + if (-1 != tempstr.indexOf('provmethod')){ + position = tempstr.indexOf('='); + provmethod = tempstr.substr(position + 1); + } + } + + $('#' + containerid + ' #advoption').empty(); + if ('aix' == osname.toLowerCase()){ + return; + } + + if ('install' == provmethod){ + $('#' + containerid + ' #advoption').html('Install Ganglia.'); + } + } + }); +} + +/** + * Refresh the nodes area base on group selected + * + * @return Nothing + */ +function createNodesArea(groupName, areaId) { + // Get group nodes + $.ajax({ + url : 'lib/cmd.php', + dataType : 'json', + data : { + cmd : 'nodels', + tgt : groupName, + args : '', + msg : areaId + }, + + success : function(data) { + var areaObj = $('#' + data.msg); + var nodes = data.rsp; + var index; + var showStr = ''; + showStr += ''; + for (index in nodes) { + var node = nodes[index][0]; + if ('' == node) { + continue; + } + showStr += ''; + } + showStr += '
Node
' + + node + '
'; + areaObj.empty().append(showStr); + if (index > 10) { + areaObj.css('height', '300px'); + } else { + areaObj.css('height', 'auto'); + } + } // End of function(data) + }); +} + +function provisionStopCheck(){ + var content = $('#provisionFrame').contents().find('body').text(); + if (-1 != content.indexOf('provision stop')){ + $('#deployDia img').remove(); + clearTimeout(provisionClock); + } + else{ + provisionClock = setTimeout('provisionStopCheck()', 5000); + } +} + +/** + * Get all select elements' name in the obj + * + * @return All nodes name, seperate by ',' + */ +function getCheckedByObj(obj) { + var tempStr = ''; + // Get nodes that were checked + obj.find('input:checked').each(function() { + if ($(this).attr('name')) { + tempStr += $(this).attr('name') + ','; + } + }); + + if ('' != tempStr) { + tempStr = tempStr.substr(0, tempStr.length - 1); + } + + return tempStr; } \ No newline at end of file diff --git a/xCAT-UI/js/custom/hmc.js b/xCAT-UI/js/custom/hmc.js index 33ba91f3b..6b65fcfd9 100644 --- a/xCAT-UI/js/custom/hmc.js +++ b/xCAT-UI/js/custom/hmc.js @@ -118,140 +118,21 @@ hmcPlugin.prototype.loadClonePage = function(node) { * @return Nothing */ hmcPlugin.prototype.loadProvisionPage = function(tabId) { - // Get OS image names - if (!$.cookie('imagenames')) { - $.ajax({ - url : 'lib/cmd.php', - dataType : 'json', - data : { - cmd : 'tabdump', - tgt : '', - args : 'osimage', - msg : '' - }, + // Create provision form + var provForm = $('
'); - success : setOSImageCookies - }); - } + // Create info bar + var infoBar = createInfoBar('Provision a node on system P server.'); + provForm.append(infoBar); - // Get groups - if (!$.cookie('groups')) { - $.ajax( { - url : 'lib/cmd.php', - dataType : 'json', - data : { - cmd : 'extnoderange', - tgt : '/.*', - args : 'subgroups', - msg : '' - }, + // Append to provision tab + $('#' + tabId).append(provForm); - success : setGroupsCookies - }); - } - - // Get provision tab instance - var inst = tabId.replace('hmcProvisionTab', ''); - - // Create provision form - var provForm = $('
'); - - // Create status bar - var statBar = createStatusBar('statBar').hide(); - provForm.append(statBar); - - // Create loader - var loader = createLoader('loader').hide(); - statBar.find('div').append(loader); - - // Create info bar - var infoBar = createInfoBar('Provision a node on System p.'); - provForm.append(infoBar); - - // Append to provision tab - $('#' + tabId).append(provForm); - - // Create provision type drop down - provForm.append('
'); - - /** - * Create provision existing node division - */ - provForm.append(createHmcProvisionExisting(inst)); - - var hmcProvisionBtn = createButton('Provision'); - hmcProvisionBtn.bind('click', function(event) { - // Remove any warning messages - var tempTab = $(this).parent().parent(); - tempTab.find('.ui-state-error').remove(); - - var ready = true; - var errMsg = ''; - var tempNodes = ''; - - // Get nodes that were checked - tempNodes = getCheckedByObj(tempTab.find('table')); - if ('' == tempNodes) { - errMsg += 'You need to select a node.
'; - ready = false; - } else { - tempNodes = tempNodes.substr(0, tempNodes.length - 1); - } - - // If all inputs are valid, ready to provision - if (ready) { - // Disable provision button - $(this).attr('disabled', 'true'); - - // Show loader - tempTab.find('#statBar').show(); - tempTab.find('#loader').show(); - - // Disable all selects, input and checkbox - tempTab.find('input').attr('disabled', 'disabled'); - - // Get operating system image - var os = tempTab.find('#osname').val(); - var arch = tempTab.find('#arch').val(); - var profile = tempTab.find('#pro').val(); - - /** - * (1) Set operating system - */ - $.ajax({ - url : 'lib/cmd.php', - dataType : 'json', - data : { - cmd : 'nodeadd', - tgt : '', - args : tempNodes + ';noderes.netboot=yaboot;nodetype.os=' + os - + ';nodetype.arch=' + arch + ';nodetype.profile=' + profile, - msg : 'cmd=nodeadd;out=' + tempTab.attr('id') - }, - - success : pProvisionExisting - }); - } else { - // Show warning message - var warn = createWarnBar(errMsg); - warn.prependTo(tempTab); - } - }); - provForm.append(hmcProvisionBtn); - - // Update the node table on group select - provForm.find('#groupname').bind('change', function() { - var groupName = $(this).val(); - var nodeArea = $('#hmcSelectNodesTable' + inst); - nodeArea.empty(); - if (!groupName) { - nodeArea.html('Select a group to view its nodes'); - return; - } - - nodeArea.append(createLoader()); - createNodesArea(groupName, 'hmcSelectNodesTable' + inst); - }); + /** + * Create provision new node division + */ + // You should copy whatever is in this function, put it here, and customize it + createProvision('hmc', provForm); }; /** @@ -284,239 +165,3 @@ hmcPlugin.prototype.addNode = function() { openDialog('info', 'Under construction'); }; -/** - * Create hmc provision existing form - * - * @return: Form content - */ -function createHmcProvisionExisting(inst) { - // Create the group area - var strGroup = '
'; - var groupNames = $.cookie('groups'); - if (groupNames) { - strGroup += ''; - } else { - strGroup += ''; - } - strGroup += '
'; - - // Create nodes area - var strNodes = '
Select a group to view its nodes
'; - - // Create boot method - var strBoot = '
'; - - // Create operating system - var strOs = '
'; - var osName = $.cookie('osvers'); - if (osName) { - strOs += ''; - } else { - strOs += ''; - } - strOs += '
'; - - // Create architecture - var strArch = '
'; - var archName = $.cookie('osarchs'); - if ('' != archName) { - strArch += ''; - } else { - strArch += ''; - } - strArch += '
'; - - // Create profile - var strPro = '
'; - var proName = $.cookie('profiles'); - if ('' != proName) { - strPro += ''; - } else { - strPro += ''; - } - strPro += '
'; - - var strRet = strGroup + strNodes + strBoot + strOs + strArch + strPro; - return strRet; -} - -/** - * Refresh the nodes area base on group selected - * - * @return Nothing - */ -function createNodesArea(groupName, areaId) { - // Get group nodes - $.ajax({ - url : 'lib/cmd.php', - dataType : 'json', - data : { - cmd : 'nodels', - tgt : groupName, - args : '', - msg : areaId - }, - - /** - * Create nodes datatable - * - * @param data - * Data returned from HTTP request - * @return Nothing - */ - success : function(data) { - var areaObj = $('#' + data.msg); - var nodes = data.rsp; - var index; - var showStr = ''; - showStr += ''; - for (index in nodes) { - var node = nodes[index][0]; - if ('' == node) { - continue; - } - showStr += ''; - } - showStr += '
Node
' - + node + '
'; - areaObj.empty().append(showStr); - if (index > 10) { - areaObj.css('height', '300px'); - } else { - areaObj.css('height', 'auto'); - } - } // End of function(data) - }); -} - -/** - * Provision for existing system p node - * - * @return Nothing - */ -function pProvisionExisting(data) { - // Get ajax response - var rsp = data.rsp; - var args = data.msg.split(';'); - - // Get command invoked - var cmd = args[0].replace('cmd=', ''); - // Get provision tab instance - var tabId = args[1].replace('out=', ''); - - // Get tab obj - var tempTab = $('#' + tabId); - - /** - * (2) Prepare node for boot - */ - if (cmd == 'nodeadd') { - // Get operating system - var bootMethod = tempTab.find('#boot').val(); - - // Get nodes that were checked - var tgts = getCheckedByObj(tempTab.find('table')); - - // Prepare node for boot - $.ajax({ - url : 'lib/cmd.php', - dataType : 'json', - data : { - cmd : 'nodeset', - tgt : tgts, - args : bootMethod, - msg : 'cmd=nodeset;out=' + tabId - }, - - success : pProvisionExisting - }); - } - - /** - * (3) Boot node from network - */ - else if (cmd == 'nodeset') { - // Write ajax response to status bar - var prg = writeRsp(rsp, ''); - tempTab.find('#statBar div').append(prg); - - // If there was an error, do not continue - if (prg.html().indexOf('Error') > -1) { - tempTab.find('#loader').remove(); - return; - } - - // Get nodes that were checked - var tgts = getCheckedByObj(tempTab.find('table')); - - // Boot node from network - $.ajax({ - url : 'lib/cmd.php', - dataType : 'json', - data : { - cmd : 'rnetboot', - tgt : tgts, - args : '', - msg : 'cmd=rnetboot;out=' + tabId - }, - - success : pProvisionExisting - }); - } - - /** - * (4) Done - */ - else if (cmd == 'rnetboot') { - // Write ajax response to status bar - var prg = writeRsp(rsp, ''); - tempTab.find('#statBar div').append(prg); - tempTab.find('#loader').remove(); - } -} - -/** - * Get all select elements' name in the obj - * - * @return All nodes name, seperate by ',' - */ -function getCheckedByObj(obj) { - var tempStr = ''; - // Get nodes that were checked - obj.find('input:checked').each(function() { - if ($(this).attr('name')) { - tempStr += $(this).attr('name') + ','; - } - }); - - if ('' != tempStr) { - tempStr = tempStr.substr(0, tempStr.length - 1); - } - - return tempStr; -} \ No newline at end of file diff --git a/xCAT-UI/js/custom/ipmi.js b/xCAT-UI/js/custom/ipmi.js index 37df012e5..141f866ae 100644 --- a/xCAT-UI/js/custom/ipmi.js +++ b/xCAT-UI/js/custom/ipmi.js @@ -98,50 +98,21 @@ ipmiPlugin.prototype.loadClonePage = function(node) { * @return Nothing */ ipmiPlugin.prototype.loadProvisionPage = function(tabId) { - // Get OS image names - $.ajax( { - url : 'lib/cmd.php', - dataType : 'json', - data : { - cmd : 'tabdump', - tgt : '', - args : 'osimage', - msg : '' - }, - - success : setOSImageCookies - }); - - // Get groups - $.ajax( { - url : 'lib/cmd.php', - dataType : 'json', - data : { - cmd : 'extnoderange', - tgt : '/.*', - args : 'subgroups', - msg : '' - }, - - success : setGroupsCookies - }); - - // Get provision tab instance - var inst = tabId.replace('ipmiProvisionTab', ''); - // Create provision form var provForm = $('
'); // Create info bar - var infoBar = createInfoBar('Provision an iDataPlex. This will install an operating system onto the iDataPlex.'); + var infoBar = createInfoBar('Provision a node on iDataPlex.'); provForm.append(infoBar); // Append to provision tab $('#' + tabId).append(provForm); - // Create provision existing node division - var provExisting = createIpmpProvisionExisting(inst); - provForm.append(provExisting); + /** + * Create provision new node division + */ + // You should copy whatever is in this function, put it here, and customize it + createProvision('ipmi', provForm); }; /** @@ -265,413 +236,3 @@ function addidataplexNode(){ } }); } - -/** - * Create provision existing node division - * - * @param inst - * Provision tab instance - * @return Provision existing node division - */ -function createIpmpProvisionExisting(inst) { - // Create provision existing division - var provExisting = $('
'); - - // Create group input - var group = $('
'); - var groupLabel = $(''); - group.append(groupLabel); - - // Turn on auto complete for group - var dTableDivId = 'ipmiNodesDatatableDIV' + inst; // Division ID where nodes datatable will be appended - var groupNames = $.cookie('groups'); - if (groupNames) { - // Split group names into an array - var tmp = groupNames.split(','); - - // Create drop down for groups - var groupSelect = $(''); - groupSelect.append(''); - for ( var i in tmp) { - // Add group into drop down - var opt = $(''); - groupSelect.append(opt); - } - group.append(groupSelect); - - // Create node datatable - groupSelect.change(function() { - // Get group selected - var thisGroup = $(this).val(); - // If a valid group is selected - if (thisGroup) { - createNodesDatatable(thisGroup, dTableDivId); - } // End of if (thisGroup) - }); - } else { - // If no groups are cookied - var groupInput = $(''); - group.append(groupInput); - } - provExisting.append(group); - - // Create node input - var node = $('
'); - var nodeLabel = $(''); - var nodeDatatable = $('

Select a group to view its nodes

'); - node.append(nodeLabel); - node.append(nodeDatatable); - provExisting.append(node); - - // Create boot method drop down - var method = $('
'); - var methodLabel = $(''); - var methodSelect = $(''); - methodSelect.append('' - + '' - + '' - + '' - + '' - + '' - ); - method.append(methodLabel); - method.append(methodSelect); - provExisting.append(method); - - // Create operating system input - var os = $('
'); - var osLabel = $(''); - var osInput = $(''); - osInput.one('focus', function() { - var tmp = $.cookie('osvers'); - if (tmp) { - // Turn on auto complete - $(this).autocomplete({ - source: tmp.split(',') - }); - } - }); - os.append(osLabel); - os.append(osInput); - provExisting.append(os); - - // Create architecture input - var arch = $('
'); - var archLabel = $(''); - var archInput = $(''); - archInput.one('focus', function() { - var tmp = $.cookie('osarchs'); - if (tmp) { - // Turn on auto complete - $(this).autocomplete({ - source: tmp.split(',') - }); - } - }); - arch.append(archLabel); - arch.append(archInput); - provExisting.append(arch); - - // Create profile input - var profile = $('
'); - var profileLabel = $(''); - var profileInput = $(''); - profileInput.one('focus', function() { - var tmp = $.cookie('profiles'); - if (tmp) { - // Turn on auto complete - $(this).autocomplete({ - source: tmp.split(',') - }); - } - }); - profile.append(profileLabel); - profile.append(profileInput); - provExisting.append(profile); - - /** - * Provision existing - */ - var provisionBtn = createButton('Provision'); - provisionBtn.bind('click', function(event) { - // Remove any warning messages - $(this).parents('.ui-tabs-panel').find('.ui-state-error').remove(); - var ready = true; - var errorMessage = ''; - - // Get provision tab ID - var thisTabId = 'ipmiProvisionTab' + inst; - - // Get nodes that were checked - var dTableId = 'ipmiNodesDatatable' + inst; - var tgts = getNodesChecked(dTableId); - if (!tgts) { - errorMessage += 'You need to select a node. '; - ready = false; - } - - // Check booth method - var boot = $('#' + thisTabId + ' select[name=bootMethod]'); - if (!boot.val()) { - errorMessage += 'You need to select a boot method. '; - boot.css('border', 'solid #FF0000 1px'); - ready = false; - } else { - boot.css('border', 'solid #BDBDBD 1px'); - } - - // Check operating system image - var os = $('#' + thisTabId + ' input[name=os]'); - if (!os.val()) { - errorMessage += 'You need to select a operating system image. '; - os.css('border', 'solid #FF0000 1px'); - ready = false; - } else { - os.css('border', 'solid #BDBDBD 1px'); - } - - // Check architecture - var arch = $('#' + thisTabId + ' input[name=arch]'); - if (!arch.val()) { - errorMessage += 'You need to select an architecture. '; - arch.css('border', 'solid #FF0000 1px'); - ready = false; - } else { - arch.css('border', 'solid #BDBDBD 1px'); - } - - // Check profile - var profile = $('#' + thisTabId + ' input[name=profile]'); - if (!profile.val()) { - errorMessage += 'You need to select a profile. '; - profile.css('border', 'solid #FF0000 1px'); - ready = false; - } else { - profile.css('border', 'solid #BDBDBD 1px'); - } - - // If all inputs are valid, ready to provision - if (ready) { - // Disable provision button - $(this).attr('disabled', 'true'); - - // Prepend status bar - var statBar = createStatusBar('ipmiProvisionStatBar' + inst); - statBar.append(createLoader('')); - statBar.prependTo($('#' + thisTabId)); - - // Disable all inputs - var inputs = $('#' + thisTabId + ' input'); - inputs.attr('disabled', 'disabled'); - - // Disable all selects - var selects = $('#' + thisTabId + ' select'); - selects.attr('disabled', 'disabled'); - - /** - * (1) Set operating system - */ - $.ajax( { - url : 'lib/cmd.php', - dataType : 'json', - data : { - cmd : 'nodeadd', - tgt : '', - args : tgts + ';noderes.netboot=xnba;nodetype.os=' + os.val() + ';nodetype.arch=' + arch.val() + ';nodetype.profile=' + profile.val(), - msg : 'cmd=nodeadd;out=' + inst - }, - - success : updateIpmiProvisionExistingStatus - }); - } else { - // Show warning message - var warn = createWarnBar(errorMessage); - warn.prependTo($(this).parent().parent()); - } - }); - provExisting.append(provisionBtn); - - return provExisting; -} - -/** - * Create nodes datatable for a given group - * - * @param group - * Group name - * @param outId - * Division ID to append datatable - * @return Nodes datatable - */ -function createNodesDatatable(group, outId) { - // Get group nodes - $.ajax( { - url : 'lib/cmd.php', - dataType : 'json', - data : { - cmd : 'lsdef', - tgt : '', - args : group, - msg : outId - }, - - /** - * Create nodes datatable - * - * @param data - * Data returned from HTTP request - * @return Nothing - */ - success : function(data) { - // Data returned - var rsp = data.rsp; - - // Get output ID - var outId = data.msg; - // Get datatable ID - var dTableId = outId.replace('DIV', ''); - - // Node attributes hash - var attrs = new Object(); - // Node attributes - var headers = new Object(); - - // Clear nodes datatable division - $('#' + outId).empty(); - - // Create nodes datatable - var node, args; - for ( var i in rsp) { - // Get node - var pos = rsp[i].indexOf('Object name:'); - if (pos > -1) { - var temp = rsp[i].split(': '); - node = jQuery.trim(temp[1]); - - // Create a hash for the node attributes - attrs[node] = new Object(); - i++; - } - - // Get key and value - args = rsp[i].split('='); - var key = jQuery.trim(args[0]); - var val = jQuery.trim(args[1]); - - // Create hash table - attrs[node][key] = val; - headers[key] = 1; - } - - // Sort headers - var sorted = new Array(); - for ( var key in headers) { - sorted.push(key); - } - sorted.sort(); - - // Add column for check box and node - sorted.unshift('', 'node'); - - // Create nodes datatable - var dTable = new DataTable(dTableId); - dTable.init(sorted); - - // Go through each node - for ( var node in attrs) { - // Create a row - var row = new Array(); - // Create a check box - var checkBx = ''; - row.push(checkBx, node); - - // Go through each header - for ( var i = 2; i < sorted.length; i++) { - // Add node attributes to the row - var key = sorted[i]; - var val = attrs[node][key]; - if (val) { - row.push(val); - } else { - row.push(''); - } - } - - // Add row to table - dTable.add(row); - } - - $('#' + outId).append(dTable.object()); - $('#' + dTableId).dataTable(); - } // End of function(data) - }); -} - -/** - * Update the provision existing node status - * - * @param data - * Data returned from HTTP request - * @return Nothing - */ -function updateIpmiProvisionExistingStatus(data) { - // Get ajax response - var rsp = data.rsp; - var args = data.msg.split(';'); - - // Get command invoked - var cmd = args[0].replace('cmd=', ''); - // Get provision tab instance - var inst = args[1].replace('out=', ''); - - // Get provision tab and status bar ID - var statBarId = 'ipmiProvisionStatBar' + inst; - var tabId = 'ipmiProvisionTab' + inst; - - /** - * (2) Remote install - */ - if (cmd == 'nodeadd') { - // Write ajax response to status bar - var prg = writeRsp(rsp, ''); - $('#' + statBarId).find('div').append(prg); - - // Get parameters - var os = $('#' + tabId + ' input[name="os"]').val(); - var profile = $('#' + tabId + ' input[name="profile"]').val(); - var arch = $('#' + tabId + ' input[name="arch"]').val(); - - // Get nodes that were checked - var dTableId = 'ipmiNodesDatatable' + inst; - var tgts = getNodesChecked(dTableId); - - // Begin installation - $.ajax( { - url : 'lib/cmd.php', - dataType : 'json', - data : { - cmd : 'webrun', - tgt : '', - args : 'rinstall;' + os + ';' + profile + ';' + arch + ';' + tgts, - msg : 'cmd=rinstall;out=' + inst - }, - - success : updateIpmiProvisionExistingStatus - }); - } - - /** - * (3) Done - */ - else if (cmd == 'rinstall') { - // Write ajax response to status bar - var prg = writeRsp(rsp, ''); - $('#' + statBarId).find('div').append(prg); - $('#' + statBarId).find('img').remove(); - - // If installation was successful - if (prg.html().indexOf('Error') == -1) { - $('#' + statBarId).find('div').append('
It will take several minutes before the nodes are up and ready. Use nodestat to check the status of the install.
'); - } - } -} \ No newline at end of file diff --git a/xCAT-UI/js/nodes/nodes.js b/xCAT-UI/js/nodes/nodes.js index 5302a2abb..fc3c58d4e 100644 --- a/xCAT-UI/js/nodes/nodes.js +++ b/xCAT-UI/js/nodes/nodes.js @@ -769,7 +769,8 @@ function loadNodes(data) { provisionLnk.click(function(){ var tgtNodes = getNodesChecked(nodesTableId); if (tgtNodes){ - openQuickProvisionDia(tgtNodes); + //jump to the provision page directly + jumpProvision(tgtNodes); } }); @@ -3194,7 +3195,7 @@ function advancedLoad(group){ * * @return Nothing */ -function openQuickProvisionDia(tgtnodes){ +function jumpProvision(tgtnodes){ var nodeArray = tgtnodes.split(','); var nodeName = ''; var index = 0; @@ -3249,169 +3250,8 @@ function openQuickProvisionDia(tgtnodes){ return; } - // organize the provison dialog - var showstr = ''; - showstr += ''; - showstr += ''; - showstr += ''; - showstr += ''; - showstr += ''; - showstr += ''; - showstr += ''; - showstr += ''; - showstr += '
Target node:
Arch:
Image:
Install Nic:
Primary Nic:
xCAT Master:
TFTP Server:
NFS Server:
'; - showstr += '
'; - diaDiv.append(showstr); - diaDiv.dialog({ - modal: true, - width: 400, - height: 480, - close: function(){$(this).remove();}, - buttons: { - 'Close': function(){$(this).remove();} - } - }); - - $('#deployDiv select').parent().append(createLoader()); - $('#deployDiv select').bind('change', function(){ - $('#deployDiv #advoption').html(''); - provisionAdvOption($(this).val()); - }); - - $.ajax({ - url : 'lib/cmd.php', - dataType : 'json', - data : { - cmd : 'lsdef', - tgt : '', - args : '-t;osimage', - msg : '' - }, - - success : function(data){ - var index = 0; - var imagename = 0; - var position = 0; - $('#deployDiv img').remove(); - if (data.rsp.lenght < 1){ - $('#deployDiv').append(createWarnBar('Please copycds and genimage in provision page first!')); - return; - } - - for (index in data.rsp){ - imagename = data.rsp[index]; - position = imagename.indexOf(' '); - imagename = imagename.substr(0, position); - - $('#deployDiv select').append(''); - } - - $('#deployDiv select').trigger('change'); - - $('#deployDiv').dialog( "option", "buttons", {'Ok': function(){quickProvision();}, - 'Cancel': function(){$(this).remove();}} - ); - } - }); + window.location.href = 'provision.php?nodes=' + tgtnodes + '&arch=' + archtype; } - -function provisionAdvOption(imagename){ - $.ajax({ - url : 'lib/cmd.php', - dataType : 'json', - data : { - cmd : 'lsdef', - tgt : '', - args : '-t;osimage;' + imagename + ';-i;osname,provmethod', - msg : '' - }, - - success : function(data){ - var index = 0; - var osname = ''; - var provmethod = ''; - var tempstr = ''; - var position = 0; - for (index = 0; index < data.rsp.length; index++){ - tempstr = data.rsp[index]; - if (-1 != tempstr.indexOf('osname')){ - position = tempstr.indexOf('='); - osname = tempstr.substr(position + 1); - } - if (-1 != tempstr.indexOf('provmethod')){ - position = tempstr.indexOf('='); - provmethod = tempstr.substr(position + 1); - } - } - - $('#deployDiv #advoption').empty(); - if ('aix' == osname.toLowerCase()){ - return; - } - - if ('install' == provmethod){ - $('#deployDiv #advoption').html('Install Ganglia.'); - } - } - }); -} -/** - * get all needed field for provsion and send the command to server - * - * @return Nothing - */ -function quickProvision(){ - var errormessage = ''; - var argsArray = new Array(); - var nodesName = ''; - var provisionArg = ''; - var provisionFrame; - var imageName = ''; - var url = ''; - $('#deployDiv .ui-state-error').remove(); - $('#deployDiv input').each(function(){ - if ('' == $(this).val()){ - errormessage = 'You are missing input!'; - return false; - } - }); - - if ('' != errormessage){ - $('#deployDiv').prepend('

' + errormessage + '

'); - return; - } - - $('#deployDiv input').each(function(){ - argsArray.push($(this).val()); - }); - - nodesName = argsArray.shift(); - imageName = $('#deployDiv select').val(); - provisionArg = argsArray.join(','); - url = 'lib/cmd.php?cmd=webrun&tgt=&args=provision;' + nodesName + ';' + imageName + ';' + provisionArg + '&msg=&opts=flush'; - - // show the result - $('#deployDiv').empty().append(createLoader()).append('
'); - $('#deployDiv').dialog( "option", "buttons", {'Close': function(){$(this).remove();clearTimeout(provisionClock);}}); - $('#deployDiv').dialog( "option", "width", 600); - provisionFrame = $(''); - $('#deployDiv').append(provisionFrame); - - provisionFrame.attr('src', url); - provisionStopCheck(); -} - -function provisionStopCheck(){ - var content = $('#provisionFrame').contents().find('body').text(); - if (-1 != content.indexOf('provision stop')){ - $('#deployDiv img').remove(); - clearTimeout(provisionClock); - } - else{ - provisionClock = setTimeout('provisionStopCheck()', 5000); - } -} - /** * Adjust datatable column size */ diff --git a/xCAT-UI/js/provision/provision.js b/xCAT-UI/js/provision/provision.js index 06368def1..447c4baf1 100644 --- a/xCAT-UI/js/provision/provision.js +++ b/xCAT-UI/js/provision/provision.js @@ -101,38 +101,40 @@ function loadProvisionPage() { okBtn.bind('click', function(event) { // Get hardware that was selected var hw = $(this).parent().find('input[name="hw"]:checked').val(); + var newTabId = hw + 'ProvisionTab'; - // Generate new tab ID - var instance = 0; - var newTabId = hw + 'ProvisionTab' + instance; - while ($('#' + newTabId).length) { - // If one already exists, generate another one - instance = instance + 1; - newTabId = hw + 'ProvisionTab' + instance; - } + if ($('#' + newTabId).size() > 0){ + tab.select(newTabId); + } + else{ + var tabtitle = ''; + + // Create an instance of the plugin + var plugin; + switch (hw) { + case "blade": + plugin = new bladePlugin(); + tabtitle = 'Blade'; + break; + case "hmc": + plugin = new hmcPlugin(); + tabtitle = 'System P'; + break; + case "ipmi": + plugin = new ipmiPlugin(); + tabtitle = 'System X'; + break; + case "zvm": + plugin = new zvmPlugin(); + tabtitle = 'ZVM'; + break; + } - tab.add(newTabId, hw, '', true); - - // Create an instance of the plugin - var plugin; - switch (hw) { - case "blade": - plugin = new bladePlugin(); - break; - case "hmc": - plugin = new hmcPlugin(); - break; - case "ipmi": - plugin = new ipmiPlugin(); - break; - case "zvm": - plugin = new zvmPlugin(); - break; - } - - // Select tab - tab.select(newTabId); - plugin.loadProvisionPage(newTabId); + // Select tab + tab.add(newTabId, tabtitle, '', true); + tab.select(newTabId); + plugin.loadProvisionPage(newTabId); + } }); provPg.append(okBtn); @@ -143,4 +145,14 @@ function loadProvisionPage() { var loader = $('
').append(createLoader('')); tab.add('imagesTab', 'Images', loader, false); loadImagesPage(); + + //should open the quick provision tab + if (window.location.search){ + tab.add('quickProvisionTab', 'Quick Provision', '', true); + tab.select('quickProvisionTab'); + + var provForm = $('
'); + $('#quickProvisionTab').append(provForm); + createProvision('quick', provForm); + } } \ No newline at end of file diff --git a/xCAT-UI/js/ui.js b/xCAT-UI/js/ui.js index c2ec00a04..cc2af7e35 100644 --- a/xCAT-UI/js/ui.js +++ b/xCAT-UI/js/ui.js @@ -479,6 +479,7 @@ function initPage() { includeJs("js/custom/ipmi.js"); includeJs("js/custom/zvm.js"); includeJs("js/custom/hmc.js"); + includeJs("js/custom/customUtils.js"); // Get the page being loaded var url = window.location.pathname;