diff --git a/xCAT-UI/js/custom/zvm.js b/xCAT-UI/js/custom/zvm.js index 4dddec20d..8ae35f6d2 100644 --- a/xCAT-UI/js/custom/zvm.js +++ b/xCAT-UI/js/custom/zvm.js @@ -319,7 +319,7 @@ zvmPlugin.prototype.loadInventory = function(data) { attrNames['nic'] = 'NICs:'; // Create hash table for node attributes - var attrs = getNodeAttrs(keys, attrNames, inv); + var attrs = getAttrs(keys, attrNames, inv); // Create division to hold user entry var ueDivId = node + 'UserEntry'; diff --git a/xCAT-UI/js/custom/zvmUtils.js b/xCAT-UI/js/custom/zvmUtils.js index 4b4aa79d3..778d4cfd6 100644 --- a/xCAT-UI/js/custom/zvmUtils.js +++ b/xCAT-UI/js/custom/zvmUtils.js @@ -935,7 +935,7 @@ function getZResources(data) { * Data from HTTP request * @return Hash table of property values */ -function getNodeAttrs(keys, propNames, data) { +function getAttrs(keys, propNames, data) { // Create hash table for property values var attrs = new Object(); diff --git a/xCAT-UI/js/nodes/nodes.js b/xCAT-UI/js/nodes/nodes.js index 1aaa35123..a58b4141f 100644 --- a/xCAT-UI/js/nodes/nodes.js +++ b/xCAT-UI/js/nodes/nodes.js @@ -278,7 +278,7 @@ function loadNodes(data) { cloneLnk.bind('click', function(event) { var tgtNodes = getNodesChecked('nodesDataTable').split(','); for ( var i = 0; i < tgtNodes.length; i++) { - var mgt = getNodeMgt(tgtNodes[i]); + var mgt = getNodeAttr(tgtNodes[i], 'mgt'); // Create an instance of the plugin var plugin; @@ -557,7 +557,7 @@ function loadNode(e) { // Get node that was clicked var node = (e.target) ? e.target.id : e.srcElement.id; - var mgt = getNodeMgt(node); + var mgt = getNodeAttr(node, 'mgt'); // Create an instance of the plugin var plugin; @@ -1125,26 +1125,27 @@ function runScript(inst) { } /** - * Get the hardware management of a given node + * Get an attribute of a given node * * @param node * The node - * @return The hardware management of the node + * @param attrName + * The attribute + * @return The attribute of the node */ -function getNodeMgt(node) { - // Get the row, - // may be node contain special char(such as '.' '#'),so we can not use $('#') directly +function getNodeAttr(node, attrName) { + // Get the row var row = $('[id=' + node + ']').parent().parent(); - // Search for the mgt column - var mgtCol = row.parent().parent().find('th:contains("mgt")'); - // Get the mgt column index - var mgtIndex = mgtCol.index(); + // Search for the column containing the attribute + var attrCol = row.parent().parent().find('th:contains("' + attrName + '")'); + // Get the attribute column index + var attrIndex = attrCol.index(); - // Get the mgt for the given node - var mgt = row.find('td:eq(' + mgtIndex + ')'); + // Get the attribute for the given node + var attr = row.find('td:eq(' + attrIndex + ')'); - return mgt.text(); + return attr.text(); } /** diff --git a/xCAT-UI/js/nodes/nodeset.js b/xCAT-UI/js/nodes/nodeset.js index 2f06bcc9d..6134376af 100644 --- a/xCAT-UI/js/nodes/nodeset.js +++ b/xCAT-UI/js/nodes/nodeset.js @@ -1,11 +1,11 @@ /** * Load nodeset page * - * @param trgtNodes + * @param tgtNodes * Targets to run nodeset against * @return Nothing */ -function loadNodesetPage(trgtNodes) { +function loadNodesetPage(tgtNodes) { // Get OS images $.ajax( { url : 'lib/cmd.php', @@ -51,7 +51,7 @@ function loadNodesetPage(trgtNodes) { nodesetForm.append(infoBar); // Create target node or group - var tgt = $('
'); + var tgt = $('
'); nodesetForm.append(tgt); // Create boot method drop down diff --git a/xCAT-UI/js/nodes/rnetboot.js b/xCAT-UI/js/nodes/rnetboot.js index 7ef6188cd..b2caa3a4a 100644 --- a/xCAT-UI/js/nodes/rnetboot.js +++ b/xCAT-UI/js/nodes/rnetboot.js @@ -77,7 +77,7 @@ function loadNetbootPage(tgtNodes) { // Determine plugin var tmp = tgtNodes.split(','); for ( var i = 0; i < tmp.length; i++) { - var mgt = getNodeMgt(tmp[i]); + var mgt = getNodeAttr(tmp[i], 'mgt'); // If it is zvm if (mgt == 'zvm') { // Add IPL input diff --git a/xCAT-UI/js/nodes/updatenode.js b/xCAT-UI/js/nodes/updatenode.js index 95f5c57ce..45e5e27fe 100644 --- a/xCAT-UI/js/nodes/updatenode.js +++ b/xCAT-UI/js/nodes/updatenode.js @@ -18,6 +18,9 @@ function loadUpdatenodePage(tgtNodes) { newTabId = 'updatenodeTab' + inst; } + // Get node OS + // They could be AIX, rh*, centos*, fedora*, or sles* + // Create updatenode form var updatenodeForm = $('
');