');
- // change the response field when click the condition
+ //change the response field when click the condition
diaDiv.find('input:radio').bind('click', function(){
diaDiv.find('#mkAssResp').empty().append('Getting response').append(createLoader());
$.ajax({
@@ -745,7 +746,8 @@ function mkCondRespDia(){
var oldResp = new Object();
var oldString = '';
var newString = '';
- // get the old seelected responses
+
+ //get the old seelected responses
var conditionName = $(this).find('#mkAssCond :checked').attr('value');
if (!conditionName){
return;
@@ -758,7 +760,8 @@ function mkCondRespDia(){
for (var i in tempArray){
oldResp[tempArray[i]] = 1;
}
- // get the new selected responses
+
+ //get the new selected responses
$(this).find('#mkAssResp input:checked').each(function(){
var respName = $(this).attr('value');
newResp[respName] = 1;
@@ -771,7 +774,7 @@ function mkCondRespDia(){
}
}
- // add the response which are delete.
+ //add the response which are delete.
for (var i in oldResp){
oldString += ',"' + i + '"';
}
@@ -779,7 +782,7 @@ function mkCondRespDia(){
oldString = oldString.substr(1);
}
- // add the response which are new add
+ //add the response which are new add
for (var i in newResp){
newString += ',"' + i +'"';
}
@@ -823,7 +826,7 @@ function chCondScopeDia(){
var tableContent = '
';
diaDiv.append(tableContent);
- // fieldset to show status
+ //fieldset to show status
diaDiv.append('
');
- // create the dislogue
+ //create the dislogue
diaDiv.dialog({
modal: true,
width: 500,
diff --git a/xCAT-UI/js/monitor/xcatmon.js b/xCAT-UI/js/monitor/xcatmon.js
index 025e384cc..1d2ea7a87 100644
--- a/xCAT-UI/js/monitor/xcatmon.js
+++ b/xCAT-UI/js/monitor/xcatmon.js
@@ -74,12 +74,9 @@ function loadXcatMonSetting(data){
//create contariner for new contents use for update the monsetting table
var newCont =new Object();
- newCont[0]=rsp[0].split(","); // table header
- // create container for other monsetting lines not xcatmon
+ newCont[0]=rsp[0].split(","); //table header
+ //create container for other monsetting lines not xcatmon
var otherCont =new Array();
-
-
-
$('#xcatmonTable').append(XcatmonTable.object()); //add table object
var m=1; //the count for origCont
@@ -108,7 +105,8 @@ function loadXcatMonSetting(data){
cols.push('
');
cols.unshift('
');
- //add teh column tho the table.
+
+ //add the column tho the table
XcatmonTable.add(cols);
origCont[m++]=cols;
@@ -130,6 +128,7 @@ function loadXcatMonSetting(data){
apps_flag=1; //set the flag to 1 to avoid this subroute
}
}
+
//get into the ping setting subroute
if (!ping_flag){
//check the ping-interval config
@@ -368,8 +367,6 @@ function loadXcatMonSetting(data){
//delete the last "," of the apps value
appValue=appValue.substring(0,(appValue.length-1));
apps[2]=appValue;
-
-// tmp =apps;
//newCont add the apps row
newCont[count++]=apps;
diff --git a/xCAT-UI/js/nodes/nodes.js b/xCAT-UI/js/nodes/nodes.js
index d1db37a77..0769e1711 100644
--- a/xCAT-UI/js/nodes/nodes.js
+++ b/xCAT-UI/js/nodes/nodes.js
@@ -13,6 +13,7 @@ var nodesList;
var nodesTableId = 'nodesDatatable';
// provision clock for provision progress stop
var provisionClock;
+
/**
* Set node tab
*
@@ -156,7 +157,7 @@ function drawPieSummary(index, valuepair){
}
container.empty();
- var plot=$.jqplot(container.attr('id'),
+ var plot = $.jqplot(container.attr('id'),
[dataArray],
{
title: chattitle,
@@ -164,8 +165,8 @@ function drawPieSummary(index, valuepair){
renderer: $.jqplot.PieRenderer,
rendererOptions: {
padding: 5,
- fill:true,
- shadow:true,
+ fill: true,
+ shadow: true,
shadowOffset: 2,
shadowDepth: 5,
shadowAlpha: 0.07,
@@ -233,13 +234,14 @@ function loadGroups(data) {
}
$('#groups').append(grouplist);
- //bind the click event
+
+ // bind the click event
$('#groups .groupdiv div').bind('click', function(){
- var thisgroup=$(this).text();
+ var thisGroup = $(this).text();
$('#groups .groupdiv div').removeClass('selectgroup');
$(this).addClass('selectgroup');
- drawNodesArea(thisgroup,'',thisgroup);
+ drawNodesArea(thisGroup,'',thisGroup);
});
// Make a link to add nodes
@@ -257,7 +259,7 @@ function loadGroups(data) {
* @return
*/
function drawNodesArea(targetgroup, cmdargs, message){
- // Clear nodes division
+ // Clear nodes division
$('#nodes').empty();
// Create loader
@@ -272,8 +274,7 @@ function drawNodesArea(targetgroup, cmdargs, message){
tab.add('graphTab', 'Graphic', '', false);
$('#nodesPageTabs').bind('tabsselect', function(event, ui){
- // for the graphical tab, we should check the graphical data
- // first
+ // for the graphical tab, we should check the graphical data first
if (1 == ui.index){
createPhysicalLayout(nodesList);
}
@@ -342,6 +343,7 @@ function drawNodesArea(targetgroup, cmdargs, message){
}
});
}
+
/**
* Make a link to add nodes
*
@@ -360,9 +362,9 @@ function mkAddNodeLink() {
addNodeForm.append('
Hardware management: '
+ ''
+ 'iDataPlex '
- + 'Blade Center '
- + 'hmc '
- + 'zvm '
+ + 'BladeCenter '
+ + 'System p '
+ + 'System z '
+ ' '
+ '
');
@@ -498,9 +500,7 @@ function loadNodes(data) {
// Variable to send command and request node status
var getNodeStatus = true;
-
- // Clear cookie containing list of nodes where their attributes need to be updated
- $.cookie('nodes2update', '');
+
// Clear hash table containing node attributes
origAttrs = '';
@@ -649,7 +649,7 @@ function loadNodes(data) {
$('#nodesTab').children().remove();
// Create info bar for nodes tab
- var info = createInfoBar('Click on a cell to edit. Click outside the table to write to the cell. Hit the Escape key to ignore changes. Once you are satisfied with how the table looks, click on Save.');
+ var info = createInfoBar('Click on a cell to edit. Click outside the table to save changes. Hit the Escape key to ignore changes.');
$('#nodesTab').append(info);
// Create action bar
@@ -839,35 +839,8 @@ function loadNodes(data) {
actionBar.append(actionsMenu);
// Insert action bar and nodes datatable
- //$('#nodesTab').append(actionBar);
$('#nodesTab').append(nodesTable.object());
-
- /**
- * Create menu to save and undo table changes
- */
- /*
- // Save changes
- var saveLnk = $('
Save ');
- saveLnk.bind('click', function(event){
- updateNodeAttrs(group);
- });
-
- // Undo changes
- var undoLnk = $('
Undo ');
- undoLnk.bind('click', function(event){
- restoreNodeAttrs();
- // Hide table menu actions
- tableActionsMenu.hide();
- });
-
- // It will be hidden until a change is made
- var tableActionsMenu = createMenu([saveLnk, undoLnk]);
- tableActionsMenu.css('display', 'inline-block');
- tableActionsMenu.attr('id', 'tableActionMenu');
- actionsDiv.append(tableActionsMenu.hide());
- */
-
// Turn table into a datatable
var nodesDatatable = $('#' + nodesTableId).dataTable({
'iDisplayLength': 50,
@@ -962,13 +935,9 @@ function loadNodes(data) {
/**
* Enable editable columns
*/
- /*
// Do not make 1st, 2nd, 3rd, 4th, 5th, or 6th column editable
$('#' + nodesTableId + ' td:not(td:nth-child(1),td:nth-child(2),td:nth-child(3),td:nth-child(4),td:nth-child(5),td:nth-child(6))').editable(
function(value, settings) {
- // Change text color to red
- $(this).css('color', 'red');
-
// Get column index
var colPos = this.cellIndex;
@@ -979,23 +948,41 @@ function loadNodes(data) {
// Update datatable
dTable.fnUpdate(value, rowPos, colPos, false);
+ // Get table headers
+ var headers = $('#' + nodesTableId + ' thead tr th');
+
// Get node name
var node = $(this).parent().find('td a.node').text();
+ // Get attribute name
+ var attrName = jQuery.trim(headers.eq(colPos).text());
+ // Get column value
+ var value = $(this).text();
- // Flag node to update
- flagNode2Update(node);
+ // Build argument
+ var args = attrName + '=' + value;
- // Show table menu actions
- tableActionsMenu.show();
+ // Send command to change node attributes
+ $.ajax( {
+ url : 'lib/cmd.php',
+ dataType : 'json',
+ data : {
+ cmd : 'chdef',
+ tgt : '',
+ args : '-t;node;-o;' + node + ';' + args,
+ msg : 'out=nodesTab;tgt=' + node
+ },
- return (value);
+ success: showChdefOutput
+ });
+
+ return value;
}, {
onblur : 'submit', // Clicking outside editable area submits changes
type : 'textarea',
placeholder: ' ',
height : '30px' // The height of the text area
});
- /*
+
/**
* Get the node status and definable node attributes
*/
@@ -1155,9 +1142,6 @@ function addNodes2Table(data) {
// Variable to send command and request node status
var getNodeStatus = true;
- // Clear cookie containing list of nodes where their attributes need to be updated
- $.cookie('nodes2update', '');
-
// Go through each attribute
var node, args;
for (var i in rsp) {
@@ -1287,13 +1271,10 @@ function addNodes2Table(data) {
/**
* Enable editable columns
*/
- /*
- // Do not make 1st, 2nd, 3rd, 4th, or 5th column editable
- $('#' + nodesTableId + ' td:not(td:nth-child(1),td:nth-child(2),td:nth-child(3),td:nth-child(4),td:nth-child(5))').editable(
+ alert('I am here');
+ // Do not make 1st, 2nd, 3rd, 4th, 5th, or 6th column editable
+ $('#' + nodesTableId + ' td:not(td:nth-child(1),td:nth-child(2),td:nth-child(3),td:nth-child(4),td:nth-child(5),td:nth-child(6))').editable(
function(value, settings) {
- // Change text color to red
- $(this).css('color', 'red');
-
// Get column index
var colPos = this.cellIndex;
@@ -1304,23 +1285,40 @@ function addNodes2Table(data) {
// Update datatable
dTable.fnUpdate(value, rowPos, colPos, false);
+ // Get table headers
+ var headers = $('#' + nodesTableId + ' thead tr th');
+
// Get node name
var node = $(this).parent().find('td a.node').text();
+ // Get attribute name
+ var attrName = jQuery.trim(headers.eq(colPos).text());
+ // Get column value
+ var value = $(this).text();
- // Flag node to update
- flagNode2Update(node);
+ // Build argument
+ var args = attrName + '=' + value;
- // Show table menu actions
- $('#tableActionMenu').show();
+ // Send command to change node attributes
+ $.ajax( {
+ url : 'lib/cmd.php',
+ dataType : 'json',
+ data : {
+ cmd : 'chdef',
+ tgt : '',
+ args : '-t;node;-o;' + node + ';' + args,
+ msg : 'out=nodesTab;tgt=' + node
+ },
- return (value);
+ success: showChdefOutput
+ });
+
+ return value;
}, {
onblur : 'submit', // Clicking outside editable area submits changes
type : 'textarea',
placeholder: ' ',
height : '30px' // The height of the text area
});
- */
// If request to get node status is made
if (getNodeStatus) {
@@ -2324,7 +2322,7 @@ function findRow(str, table, col){
function selectAllCheckbox(event, obj) {
// Get datatable ID
// This will ascend from
- var tableObj = obj.parent().parent().parent().parent();
+ var tableObj = obj.parents('table');
var status = obj.attr('checked');
tableObj.find(' :checkbox').attr('checked', status);
event.stopPropagation();
@@ -2358,148 +2356,6 @@ function loadRconsPage(tgtNodes){
window.open(redirectUrl + "?rconsnd=" + tgtNodes, '', "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=670,height=436");
}
-/**
- * Flag the node in the group table to update
- *
- * @param node
- * The node name
- * @return Nothing
- */
-function flagNode2Update(node) {
- // Get list containing current nodes to update
- var nodes = $.cookie('nodes2update');
-
- // If the node is not in the list
- if (nodes.indexOf(node) == -1) {
- // Add the new node to list
- nodes += node + ';';
- $.cookie('nodes2update', nodes);
- }
-}
-
-/**
- * Update node attributes
- *
- * @param group
- * The node group name
- * @return Nothing
- */
-function updateNodeAttrs(group) {
- // Get the nodes datatable
- var dTable = $('#' + nodesTableId).dataTable();
- // Get all nodes within the datatable
- var rows = dTable.fnGetNodes();
-
- // Get table headers
- var headers = $('#' + nodesTableId + ' thead tr th');
-
- // Get list of nodes to update
- var nodesList = $.cookie('nodes2update');
- var nodes = nodesList.split(';');
-
- // Create the arguments
- var args;
- var rowPos, colPos, value;
- var attrName;
- // Go through each node where an attribute was changed
- for (var i in nodes) {
- if (nodes[i]) {
- args = '';
-
- // Get the row containing the node link
- rowPos = findRow(nodes[i], '#' + nodesTableId, 1);
- $(rows[rowPos]).find('td').each(function (){
- if ($(this).css('color') == 'red' || $(this).css('color') == 'rgb(255, 0, 0)') {
- // Change color back to normal
- $(this).css('color', '');
-
- // Get column position
- colPos = $(this).parent().children().index($(this));
- // Get column value
- value = $(this).text();
-
- // Get attribute name
- attrName = jQuery.trim(headers.eq(colPos).text());
-
- // Build argument string
- if (args) {
- // Handle subsequent arguments
- args += ';' + attrName + '=' + value;
- } else {
- // Handle the 1st argument
- args += attrName + '=' + value;
- }
- }
- });
-
- // Send command to change node attributes
- $.ajax( {
- url : 'lib/cmd.php',
- dataType : 'json',
- data : {
- cmd : 'chdef',
- tgt : '',
- args : '-t;node;-o;' + nodes[i] + ';' + args,
- msg : 'out=nodesTab;tgt=' + nodes[i]
- },
-
- success: showChdefOutput
- });
- } // End of if
- } // End of for
-
- // Clear cookie containing list of nodes where
- // their attributes need to be updated
- $.cookie('nodes2update', '');
-}
-
-/**
- * Restore node attributes to their original content
- *
- * @return Nothing
- */
-function restoreNodeAttrs() {
- // Get list of nodes to update
- var nodesList = $.cookie('nodes2update');
- var nodes = nodesList.split(';');
-
- // Get the nodes datatable
- var dTable = $('#' + nodesTableId).dataTable();
- // Get table headers
- var headers = $('#' + nodesTableId + ' thead tr th');
- // Get all nodes within the datatable
- var rows = dTable.fnGetNodes();
-
- // Go through each node where an attribute was changed
- var rowPos, colPos;
- var attrName, origVal;
- for (var i in nodes) {
- if (nodes[i]) {
- // Get the row containing the node link
- rowPos = findRow(nodes[i], '#' + nodesTableId, 1);
- $(rows[rowPos]).find('td').each(function (){
- if ($(this).css('color') == 'red' || $(this).css('color') == 'rgb(255, 0, 0)') {
- // Change color back to normal
- $(this).css('color', '');
-
- // Get column position
- colPos = $(this).parent().children().index($(this));
- // Get attribute name
- attrName = jQuery.trim(headers.eq(colPos).text());
- // Get original content
- origVal = origAttrs[nodes[i]][attrName];
-
- // Update column
- dTable.fnUpdate(origVal, rowPos, colPos, false);
- }
- });
- } // End of if
- } // End of for
-
- // Clear cookie containing list of nodes where their attributes need to be updated
- $.cookie('nodes2update', '');
-}
-
/**
* Create a tool tip for comments
*
@@ -2807,8 +2663,7 @@ function setNodeAttrs(data) {
// Remove arrow brackets
descr = descr.replace(new RegExp('<|>', 'g'), '');
- // Set hash table where key = attribute name and value =
- // description
+ // Set hash table where key = attribute name and value = description
nodeAttrs[key] = descr;
} else {
// Remove arrow brackets
@@ -3267,10 +3122,10 @@ function advancedLoad(group){
var colNameHash = new Object();
var colName = '';
var archCol = 0, hcpCol = 0;
- //find out the column name and their index
+ // find out the column name and their index
for (tempIndex = 0; tempIndex < tableHeaders.size(); tempIndex++){
var header = tableHeaders.eq(tempIndex);
- //if link header(status, power, monitor) can dump to next one
+ // if link header(status, power, monitor) can dump to next one
if (header.find('a').size() > 0){
continue;
}
@@ -3282,7 +3137,7 @@ function advancedLoad(group){
}
}
- //there is not arch column, can not distinguish hardware type return directly
+ // there is not arch column, can not distinguish hardware type return directly
if (!colNameHash['arch']){
return;
}
@@ -3345,10 +3200,10 @@ function openQuickProvisionDia(tgtnodes){
var archtype = '';
var errormessage = '';
var diaDiv = $('
');
- //check the first node's arch type
+ // check the first node's arch type
for (index in nodeArray){
nodeName = nodeArray[index];
- //does not have arch
+ // does not have arch
if (!origAttrs[nodeName]['arch']){
errormessage = 'All nodes should define arch first!';
break;
@@ -3358,14 +3213,14 @@ function openQuickProvisionDia(tgtnodes){
archtype = origAttrs[nodeName]['arch'];
}
- //all nodes should have same archtype
+ // all nodes should have same archtype
if (archtype != origAttrs[nodeName]['arch']){
errormessage = 'All nodes should belong to same arch! ';
break;
}
}
- //check the mac address
+ // check the mac address
for (index in nodeArray){
if (!origAttrs[nodeName]['mac'] || !origAttrs[nodeName]['ip']){
errormessage += 'All nodes should define ip and mac! ';
@@ -3377,7 +3232,7 @@ function openQuickProvisionDia(tgtnodes){
errormessage += 'System Z should use provision page.';
}
- //error message should show in a dialog
+ // error message should show in a dialog
if ('' != errormessage){
diaDiv.append(createWarnBar(errormessage));
diaDiv.dialog({
@@ -3393,7 +3248,7 @@ function openQuickProvisionDia(tgtnodes){
return;
}
- //organize the provison dialog
+ // organize the provison dialog
var showstr = '';
showstr += 'Target node: ';
showstr += 'Arch: ';
@@ -3488,7 +3343,7 @@ function quickProvision(){
provisionArg = argsArray.join(',');
url = 'lib/cmd.php?cmd=webrun&tgt=&args=provision;' + nodesName + ';' + imageName + ';' + provisionArg + '&msg=&opts=flush';
- //show the result
+ // show the result
$('#deployDiv').empty().append(createLoader()).append(' ');
$('#deployDiv').dialog( "option", "buttons", {'Close': function(){$(this).remove();clearTimeout(provisionClock);}});
$('#deployDiv').dialog( "option", "width", 600);
diff --git a/xCAT-UI/js/nodes/physical.js b/xCAT-UI/js/nodes/physical.js
index 28a7a34b8..aedadc4eb 100644
--- a/xCAT-UI/js/nodes/physical.js
+++ b/xCAT-UI/js/nodes/physical.js
@@ -229,6 +229,7 @@ function fillList(nodeName){
break;
}
}
+
/**
* create the physical graphical layout
*
@@ -248,10 +249,13 @@ function createGraphical(bpa, fsp, area){
row = $(' ');
graphTable.append(row);
}
+
elementNum ++;
+
var td = $(' ');
var frameDiv = $('
');
frameDiv.append('
');
+
//for P7-IH, all the cecs are insert into the frame from down to up, so we had to show the cecs same as the
//physical layout.
var tempBlankDiv = $('
');
@@ -269,6 +273,7 @@ function createGraphical(bpa, fsp, area){
tempHeight += coculateBlank(fsp[fspName]['mtm']);
}
+
//now the tempHeight are all cecs' height, so we should minus bpa div height and cecs' div height
tempHeight = 428 - tempHeight;
tempBlankDiv.css('height', tempHeight);
@@ -418,7 +423,6 @@ function updateSelectNodeDiv(){
$('#selectNodeDiv').empty();
//add buttons
-
$('#selectNodeDiv').append('Nodes: ');
for(var lparName in selectNode){
$('#selectNodeDiv').append(lparName + ' ');
@@ -671,6 +675,7 @@ function createFspTip(fspName, mtm, fsp){
else{
temp = mtm;
}
+
if (hardwareInfo[temp]){
tip.append('' + fspName + '(' + hardwareInfo[temp][0] + ') ');
}
diff --git a/xCAT-UI/js/provision/images.js b/xCAT-UI/js/provision/images.js
index e01788161..51a87938e 100644
--- a/xCAT-UI/js/provision/images.js
+++ b/xCAT-UI/js/provision/images.js
@@ -43,8 +43,6 @@ function loadImages(data) {
// Image attributes
var headers = new Object();
- // Clear cookie containing list of images where their attributes need to be updated
- $.cookie('images2update', '');
// Clear hash table containing image attributes
origAttrs = '';
@@ -118,12 +116,9 @@ function loadImages(data) {
$('#imagesTab').children().remove();
// Create info bar for images tab
- var info = createInfoBar('Click on a cell to edit. Click outside the table to write to the cell. Hit the Escape key to ignore changes. Once you are satisfied with how the table looks, click on Save.');
+ var info = createInfoBar('Click on a cell to edit. Click outside the table to save changes. Hit the Escape key to ignore changes.');
$('#imagesTab').append(info);
- // Create action bar
- var actionBar = $('
');
-
/**
* The following actions are available for images:
* copy Linux distribution and edit image properties
@@ -149,28 +144,7 @@ function loadImages(data) {
loadEditImagePage(tgtImages[i]);
}
});
-
- // Create save button
- var saveBtn = createButton('Save');
- // Do not show button until table is edited
- saveBtn.css({
- 'display': 'inline',
- 'margin-left': '550px'
- }).hide();
- saveBtn.bind('click', function(event){
- updateImageAttrs();
- });
-
- // Create undo button
- var undoBtn = createButton('Undo');
- // Do not show button until table is edited
- undoBtn.css({
- 'display': 'inline'
- }).hide();
- undoBtn.bind('click', function(event){
- restoreImageAttrs();
- });
-
+
/**
* Create an action bar
*/
@@ -178,8 +152,6 @@ function loadImages(data) {
actionsBar.append(copyLinuxBtn);
actionsBar.append(newBtn);
actionsBar.append(editBtn);
- actionsBar.append(saveBtn);
- actionsBar.append(undoBtn);
$('#imagesTab').append(actionsBar);
// Insert table
@@ -203,9 +175,6 @@ function loadImages(data) {
// Do not make 1st, 2nd, 3rd, 4th, or 5th column editable
$('#imagesDataTable td:not(td:nth-child(1),td:nth-child(2))').editable(
function(value, settings) {
- // Change text color to red
- $(this).css('color', 'red');
-
// Get column index
var colPos = this.cellIndex;
@@ -218,15 +187,32 @@ function loadImages(data) {
// Get image name
var image = $(this).parent().find('td:eq(1)').text();
-
- // Flag image to update
- flagImage2Update(image);
-
- // Show table menu actions
- saveBtn.show();
- undoBtn.show();
+
+ // Get table headers
+ var headers = $('#imagesDataTable thead tr th');
- return (value);
+ // Get attribute name
+ var attrName = jQuery.trim(headers.eq(colPos).text());
+ // Get column value
+ var value = $(this).text();
+ // Build argument
+ var args = attrName + '=' + value;
+
+ // Send command to change image attributes
+ $.ajax( {
+ url : 'lib/cmd.php',
+ dataType : 'json',
+ data : {
+ cmd : 'chdef',
+ tgt : '',
+ args : '-t;osimage;-o;' + image + ';' + args,
+ msg : 'out=imagesTab;tgt=' + image
+ },
+
+ success: showChdefOutput
+ });
+
+ return value;
}, {
onblur : 'submit', // Clicking outside editable area submits changes
type : 'textarea', // Input type to use
@@ -249,145 +235,6 @@ function loadImages(data) {
});
}
-/**
- * Flag the image in the table to update
- *
- * @param image
- * The image name
- * @return Nothing
- */
-function flagImage2Update(image) {
- // Get list containing current images to update
- var images = $.cookie('images2update');
-
- // If the node is not in the list
- if (images.indexOf(image) == -1) {
- // Add the new node to list
- images += image + ';';
- $.cookie('images2update', images);
- }
-}
-
-/**
- * Update the image attributes
- *
- * @return Nothing
- */
-function updateImageAttrs() {
- // Get the nodes datatable
- var dTable = $('#imagesDataTable').dataTable();
- // Get all nodes within the datatable
- var rows = dTable.fnGetNodes();
-
- // Get table headers
- var headers = $('#imagesDataTable thead tr th');
-
- // Get list of nodes to update
- var imagesList = $.cookie('images2update');
- var images = imagesList.split(';');
-
- // Create the arguments
- var args;
- var rowPos, colPos, value;
- var attrName;
- // Go through each node where an attribute was changed
- for (var i in images) {
- if (images[i]) {
- args = '';
-
- // Get the row containing the image name
- rowPos = findRow(images[i], '#imagesDataTable', 1);
- $(rows[rowPos]).find('td').each(function (){
- if ($(this).css('color') == 'red') {
- // Change color back to normal
- $(this).css('color', '');
-
- // Get column position
- colPos = $(this).parent().children().index($(this));
- // Get column value
- value = $(this).text();
-
- // Get attribute name
- attrName = jQuery.trim(headers.eq(colPos).text());
-
- // Build argument string
- if (args) {
- // Handle subsequent arguments
- args += ';' + attrName + '=' + value;
- } else {
- // Handle the 1st argument
- args += attrName + '=' + value;
- }
- }
- });
-
- // Send command to change image attributes
- $.ajax( {
- url : 'lib/cmd.php',
- dataType : 'json',
- data : {
- cmd : 'chdef',
- tgt : '',
- args : '-t;osimage;-o;' + images[i] + ';' + args,
- msg : 'out=imagesTab;tgt=' + images[i]
- },
-
- success: showChdefOutput
- });
- } // End of if
- } // End of for
-
- // Clear cookie containing list of images where their attributes need to be updated
- $.cookie('images2update', '');
-}
-
-/**
- * Restore image attributes to their original content
- *
- * @return Nothing
- */
-function restoreImageAttrs() {
- // Get list of images to restore
- var imagesList = $.cookie('images2update');
- var images = imagesList.split(';');
-
- // Get the image datatable
- var dTable = $('#imagesDataTable').dataTable();
- // Get table headers
- var headers = $('#imagesDataTable thead tr th');
- // Get all nodes within the datatable
- var rows = dTable.fnGetNodes();
-
- // Go through each node where an attribute was changed
- var rowPos, colPos;
- var attrName, origVal;
- for (var i in images) {
- if (images[i]) {
- // Get the row containing the image name
- rowPos = findRow(images[i], '#imagesDataTable', 1);
- $(rows[rowPos]).find('td').each(function (){
- if ($(this).css('color') == 'red') {
- // Change color back to normal
- $(this).css('color', '');
-
- // Get column position
- colPos = $(this).parent().children().index($(this));
- // Get attribute name
- attrName = jQuery.trim(headers.eq(colPos).text());
- // Get original content
- origVal = origAttrs[images[i]][attrName];
-
- // Update column
- dTable.fnUpdate(origVal, rowPos, colPos);
- }
- });
- } // End of if
- } // End of for
-
- // Clear cookie containing list of images where their attributes need to be updated
- $.cookie('images2update', '');
-}
-
/**
* Set definable image attributes
*
@@ -527,6 +374,7 @@ function createHpcSelect(container) {
container.append(hpcFieldset);
}
+
var softwareList = {
"rsct" : [ "rsct.core.utils", "rsct.core", "src" ],
"pe" : [ "IBMJava2-142-ppc64-JRE", "ibm_lapi_ip_rh6p", "ibm_lapi_us_rh6p", "IBM_pe_license", "ibm_pe_rh6p", "ppe_pdb_ppc64_rh600", "sci_ppc_32bit_rh600", "sci_ppc_64bit_rh600", "vac.cmp",
@@ -643,7 +491,6 @@ function rpmCopyCheck(data) {
*/
function genRpmCmd(softwareName) {
var cmdString;
- var packageLength;
cmdString = "rpm -q ";
for (var i in softwareList[softwareName]) {
cmdString += softwareList[softwareName][i] + " ";
@@ -756,7 +603,7 @@ function loadEditImagePage(tgtImage) {
setPropsForm.append(infoBar);
// Create an input for each definable attribute
- var div, label, input, descr, value;
+ var div, label, input, value;
// Set node attribute
origAttrs[tgtImage]['imagename'] = tgtImage;
for (var key in defAttrs) {
diff --git a/xCAT-UI/js/ui.js b/xCAT-UI/js/ui.js
index 33754c29a..902076758 100644
--- a/xCAT-UI/js/ui.js
+++ b/xCAT-UI/js/ui.js
@@ -461,7 +461,6 @@ function initPage() {
includeJs("js/jquery/superfish.min.js");
includeJs("js/jquery/hoverIntent.min.js");
includeJs("js/jquery/jquery.jstree.min.js");
- includeJs("js/jquery/jquery.flot.min.js");
includeJs("js/jquery/tooltip.min.js");
includeJs("js/jquery/jquery.serverBrowser.min.js");
includeJs("js/jquery/jquery.jqplot.min.js");
@@ -489,16 +488,7 @@ function initPage() {
// Show the page
$("#content").children().remove();
- if (page == 'index.php') {
- includeJs("js/jquery/jquery.topzindex.min.js");
- includeJs("js/nodes/nodeset.js");
- includeJs("js/nodes/rnetboot.js");
- includeJs("js/nodes/updatenode.js");
- includeJs("js/nodes/physical.js");
- includeJs("js/nodes/mtm.js");
- headers.eq(0).css('background-color', '#A9D0F5');
- loadNodesPage();
- } else if (page == 'configure.php') {
+ if (page == 'configure.php') {
includeJs("js/configure/update.js");
includeJs("js/configure/discover.js");
headers.eq(1).css('background-color', '#A9D0F5');
@@ -518,6 +508,7 @@ function initPage() {
headers.eq(4).css('background-color', '#A9D0F5');
loadGuidePage();
} else {
+ // Load nodes page by default
includeJs("js/jquery/jquery.topzindex.min.js");
includeJs("js/nodes/nodeset.js");
includeJs("js/nodes/rnetboot.js");
diff --git a/xCAT-UI/js/xcatauth.js b/xCAT-UI/js/xcatauth.js
index 0d5b1cae7..abdd36f4b 100644
--- a/xCAT-UI/js/xcatauth.js
+++ b/xCAT-UI/js/xcatauth.js
@@ -9,12 +9,12 @@ $(document).ready(function() {
var diaheight = $('#logdialog').css('height');
diaheight = diaheight.substr(0, diaheight.length - 2);
diaheight = Number(diaheight);
+
// the window's height is to small to show the dialog
var tempheight = 0;
if ((winheight - 50) < diaheight){
tempheight = 0;
- }
- else{
+ } else {
tempheight = parseInt((winheight - diaheight - 50) / 2);
}
@@ -29,6 +29,7 @@ $(document).ready(function() {
$("#logstatus").html("You are using an unencrypted session!");
$("#logstatus").css("color", "#ff0000");
}
+
if ($("#username").val() == "") {
$("#username").focus();
} else {