Renamed getNodeMgt() to getNodeAttr() and made it get the attribute to a given node, instead of just the mgt.

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@6967 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
phamt 2010-08-03 20:44:26 +00:00
parent 8adf2018d3
commit 2e868d5c9e
6 changed files with 24 additions and 20 deletions

View File

@ -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';

View File

@ -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();

View File

@ -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();
}
/**

View File

@ -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 = $('<div><label for="target">Target node or group:</label><input type="text" name="target" value="' + trgtNodes + '"/></div>');
var tgt = $('<div><label for="target">Target node or group:</label><input type="text" name="target" value="' + tgtNodes + '"/></div>');
nodesetForm.append(tgt);
// Create boot method drop down

View File

@ -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

View File

@ -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 = $('<div class="form"></div>');