diff --git a/xCAT-UI/css/style.css b/xCAT-UI/css/style.css
index e0d3ca29a..6b06533ab 100644
--- a/xCAT-UI/css/style.css
+++ b/xCAT-UI/css/style.css
@@ -685,21 +685,22 @@ table a:hover {
/*--------------- Discovery section ---------------*/
.discoverstep {
- width: 200px;
+ width: 220px;
vertical-align: top;
float: left;
position: relative;
overflow: auto;
- background-color: #CCCCFF;
- padding: 10px 0px 0px 5px;
+ background-color: #A9D0F5;
+ padding: 5px 0px;
-moz-border-radius: .5em;
-webkit-border-radius: .5em;
border-radius: .5em;
}
.discoverstep span {
- font: normal bold 13px/ 35px verdana, arial, helvetica, sans-serif;
- margin: 0px 0px 10px 0px;
+ font: normal bold 12px/ 35px verdana, arial, helvetica, sans-serif;
+ padding: 5px;
+ margin: 0px 5px; /* Top right left bottom*/
}
.discovercontent {
diff --git a/xCAT-UI/js/configure/discover.js b/xCAT-UI/js/configure/discover.js
index c208103c8..96f14b51d 100644
--- a/xCAT-UI/js/configure/discover.js
+++ b/xCAT-UI/js/configure/discover.js
@@ -1,13 +1,13 @@
/*associate the step name with step number*/
-var steps = ['Discover Hardware',
- 'Cluster Patterns',
- 'Supernode Numbers',
- 'More Cluster Patterns',
- 'Power On Hardware',
- 'Discover Frames',
- 'Prepare Management Node',
- 'Update Definitions',
- 'Create Lpars',
+var steps = ['Discover hardware',
+ 'Cluster patterns',
+ 'Supernode numbers',
+ 'More cluster patterns',
+ 'Power on hardware',
+ 'Discover frames',
+ 'Prepare management node',
+ 'Update definitions',
+ 'Create LPARs',
'Complete'];
/*associate the function with step number*/
@@ -23,7 +23,7 @@ var initFunctions = [initSelectPlatform,
complete];
/*associate the function witch should be called before the page changed(when click next or back)
- * if there is no need to call functions, use undefined.*/
+ *if there is no need to call functions, use undefined.*/
var nextFunctions = [getPlatform,
checkBasicPattern,
checkSupernode,
@@ -67,7 +67,7 @@ function loadDiscoverPage(){
function updateDiscoverStep(){
$('#discoverStepDiv').empty();
var showString = '';
- for(var index in steps){
+ for (var index in steps){
showString += ' begin){
+ if (2 > begin){
retArray.push(nodeRange);
return retArray;
}
var end = tempArray[1].match(/^(\D+)(\d+)$/);
- if(2 > end){
+ if (2 > end){
retArray.push(nodeRange);
return retArray;
}
- if(begin[1] != end[1]){
+ if (begin[1] != end[1]){
retArray.push(nodeRange);
return retArray;
}
var prefix = begin[1];
var len = begin[2].length;
- for(var i = begin[2]; i <= end[2]; i++){
+ for (var i = begin[2]; i <= end[2]; i++){
var ts = i.toString();
if (ts.length < len){
ts = "000000".substring(0, (len - ts.length)) + ts;
@@ -302,7 +302,7 @@ function collectInputValue(){
$('#discoverContentDiv input[type=text]').each(function(){
var name = $(this).attr('name');
var value = $(this).attr('value');
- if('' != value){
+ if ('' != value){
setDiscoverEnv(name, value);
}
else{
@@ -514,7 +514,8 @@ function checkBasicPattern(operType){
//the input value check is finished.
if ('' != errMessage){
- $('#patternDiv').prepend('
' + errMessage + '
');
+ var warnBar = createWarnBar(errMessage);
+ $('#patternDiv').prepend(warnBar);
return false;
}
@@ -532,7 +533,8 @@ function checkBasicPattern(operType){
}
if ('' != errMessage){
- $('#patternDiv').prepend('
' + errMessage + '
');
+ var warnBar = createWarnBar(errMessage);
+ $('#patternDiv').prepend(warnBar);
return false;
}
@@ -614,8 +616,10 @@ function checkSupernode(operType){
}
}
+ var warnBar;
if (errString){
- $('#supernodeDiv').prepend('
' + errString + '
');
+ warnBar = createWarnBar(errString);
+ $('#supernodeDiv').prepend(warnBar);
return false;
}
@@ -623,7 +627,8 @@ function checkSupernode(operType){
if (eceNum != cecArray.length){
errString += 'The number of CEC calculated from supernode configure is ' + eceNum + ', but the number ' +
'calculated from CECs\' Name Range is ' + cecArray.length + '. Reconfigure the supernode please.';
- $('#supernodeDiv').prepend('
');
}
+
for (var i in mtmsArray){
$('#mtmsTd').append('
' +
mtmsArray[i] + '
');
@@ -1003,8 +1010,8 @@ function checkFrameMtms(operType){
var vpdFileCon = '';
$('#discoverShow .ui-state-error').remove();
if (0 < $('#discoverShow :radio').size()){
- $('#discoverContentDiv #discoverShow').prepend('
' +
- 'Map all of the frame with mtms.
');
+ var warnBar = createWarnBar('Map all of the frame with mtms.');
+ $('#discoverContentDiv #discoverShow').prepend(warnBar);
return false;
}
@@ -1284,12 +1291,12 @@ function lsslpWriteHMC(){
var mtmsArray = data.rsp[0].split(';');
var tempPar = '';
- if(hmcArray.length != mtmsArray.length){
+ if (hmcArray.length != mtmsArray.length){
//error info
$('#hmcLine2 img').remove();
- $('#discoverContentDiv div').append('
' +
- 'Error: Defined ' + hmcArray.length + ' hmcs, but discovered ' + mtmsArray.length +
- ' hmcs. Check the configuration please.
');
+ var warnBar = createWarnBar('Error: Defined ' + hmcArray.length + ' HMCs, but discovered ' + mtmsArray.length +
+ ' HMCs. Please check the configuration.');
+ $('#discoverContentDiv div').prepend(warnBar);
createDiscoverButtons();
return;
}
@@ -1423,13 +1430,13 @@ function ihCreateLpar(parentDiv){
var inputStr = getDiscoverEnv('partconf');
var testArray = reg.exec(inputStr);
if (!testArray || inputStr != testArray[0]){
- $('#discoverContentDiv').prepend('
' +
- '
Input the correct configuration rule.
');
+ var warnBar = createWarnBar('Input the correct configuration rule.');
+ $('#discoverContentDiv').prepend(warnBar);
return;
}
var ruleArray = inputStr.split(',');
- for(var i in ruleArray){
+ for (var i in ruleArray){
var octantCount = 0;
var octantArray = ruleArray[i].split(':');
var octantRule = Number(octantArray[1]);
@@ -1450,10 +1457,10 @@ function ihCreateLpar(parentDiv){
lparCount += octantCount * octantRule;
}
- if(getDiscoverEnv('lparNumPerCec') != lparCount){
- $('#discoverContentDiv').prepend('
' +
- '
The Lpar number per CEC is ' + getDiscoverEnv('lparNumPerCec') + ', but the configuration ' +
- 'rule calculation is ' + lparCount + '.
');
+ if (getDiscoverEnv('lparNumPerCec') != lparCount){
+ var warnBar = createWarnBar('The LPAR number per CEC is ' + getDiscoverEnv('lparNumPerCec') + ', but the configuration ' +
+ 'rule calculation is ' + lparCount + '.');
+ $('#discoverContentDiv').prepend(warnBar);
return;
}
@@ -1508,13 +1515,15 @@ function updateCreateLparDia(cecname, cecNum){
$('#createLparDiv').remove();
});
}
+
function nonihCreateLpar(parentDiv){
var showStr = 'The machine type is not P7 IH, so you had to create lpars by command line manually.';
parentDiv.append(createInfoBar(showStr));
return;
}
+
/**
- * Step 10: compelte
+ * Step 10: complete
*
* @param
*
@@ -1528,5 +1537,4 @@ function complete(){
$('#discoverContentDiv').append(showStr);
createDiscoverButtons();
-
}
\ No newline at end of file
diff --git a/xCAT-UI/js/configure/update.js b/xCAT-UI/js/configure/update.js
index fa97b11a4..240de1fbe 100644
--- a/xCAT-UI/js/configure/update.js
+++ b/xCAT-UI/js/configure/update.js
@@ -10,7 +10,7 @@ function loadUpdatePage() {
statusDiv.hide();
$('#updateTab').append(statusDiv);
- $('#updateTab').append(' ');
+ $('#updateTab').append(' ');
$('#updateTab').append(repositoryDiv);
$('#updateTab').append(rpmDiv);
@@ -52,7 +52,7 @@ function showRepository(data) {
var stableRepository = "";
var show = "";
- // get the corresponding repository by OS Type
+ // Get the corresponding repository by OS Type
if ("aix" == data.rsp) {
develRepository = "http://xcat.sourceforge.net/aix/devel/xcat-core/";
stableRepository = "http://xcat.sourceforge.net/aix/xcat-core/";
@@ -63,28 +63,30 @@ function showRepository(data) {
var repoList = $('');
- // display the Devel Repository, remember user's last selection
+ // Display the Devel Repository, remember user's last selection
show = show + "
";
- show = show + develRepository + "(Devel)
";
+ show = show + "Development: " + develRepository + "";
repoList.append(show);
- // display the Stable Repository, remember user's last selection
+ // Display the Stable Repository, remember user's last selection
show = "
";
- show = show + stableRepository + "(Stable)
";
+ show = show + "name='reporadio' value='" + stableRepository + "' checked='true'>";
+ show = show + "Stable: " + stableRepository + "";
repoList.append(show);
- // display the Input Repository, remember user's last selection
- if (($.cookie('xcatrepository')) && (1 != $.cookie('xcatrepository')) && (2 != $.cookie('xcatrepository'))) {
+ // Display the Input Repository, remember user's last selection
+ if (($.cookie('xcatrepository')) && (1 != $.cookie('xcatrepository'))
+ && (2 != $.cookie('xcatrepository'))) {
show = "
Other: ";
- show += "";
+ show += "";
} else {
show = "
Other: ";
show += "";
@@ -103,7 +105,8 @@ function showRepository(data) {
function showRpmInfo(data) {
var rpms = null;
var show = "";
- var rpmNames = new Array("xCAT-client", "perl-xCAT", "xCAT-server", "xCAT", "xCAT-rmc", "xCAT-UI");
+ var rpmNames = new Array("xCAT-client", "perl-xCAT", "xCAT-server", "xCAT", "xCAT-rmc",
+ "xCAT-UI");
var temp = 0;
if (null == data.rsp) {
$('#rpm fieldset').append("Error getting RPMs!");
@@ -111,13 +114,13 @@ function showRpmInfo(data) {
}
rpms = data.rsp.split(/\n/);
- // no rpm installed, return
+ // No rpm installed, return
if (1 > rpms.length) {
$('#rpm fieldset').append("No RPMs installed!");
return;
}
- // clear the old data
+ // Clear the old data
$('#rpm fieldset').children().remove();
$('#rpm fieldset').append("");
show = "
";
@@ -126,27 +129,28 @@ function showRpmInfo(data) {
show += "
Package Name
Version
";
show += "";
for (temp = 0; temp < rpms.length; temp++) {
- // empty line continue
+ // Empty line continue
if ("" == rpms[temp]) {
continue;
}
- // the rpm is not installed, continue
+ // The RPM is not installed, continue
if (-1 != rpms[temp].indexOf("not")) {
continue;
}
- // show the version in table
+ // Show the version in table
show += "
";
show += " ";
$('#rpm fieldset').append(show);
- // add the update button
+ // Add the update button
var updateButton = createButton('Update');
$('#rpm fieldset').append(updateButton);
updateButton.bind('click', function() {
@@ -157,6 +161,7 @@ function showRpmInfo(data) {
/**
* Select all checkboxes
*
+ * @param Nothing
* @return Nothing
*/
function updateSelectAll() {
@@ -182,7 +187,7 @@ function updateRpm() {
rpmPath = "";
}
- // select other and we should use the value in the input
+ // Select other and we should use the value in the input
if ("" == rpmPath) {
// user input the repo, and we must stroe it in the cookie
rpmPath = $('#repositoryaddr').val();
@@ -219,7 +224,7 @@ function updateRpm() {
}
if (!rpmPath) {
- errMsg += "Please select or input a repository!";
+ errMsg += "Please select or specify a repository!";
}
if (!rpms || !rpmPath) {
@@ -229,7 +234,7 @@ function updateRpm() {
return;
}
- // remember users' choice and input
+ // Remember users' choice and input
$.cookie('xcatrepository', rpmPathType, {
path : '/xcat',
expires : 10
@@ -241,7 +246,7 @@ function updateRpm() {
$('#update').append("");
$('#rpm button').attr('disabled', 'true');
- // send the update command to server
+ // Send the update command to server
$.ajax( {
url : 'lib/cmd.php',
dataType : 'json',
@@ -252,7 +257,7 @@ function updateRpm() {
msg : ''
},
- success : ShowUpdateResult
+ success : showUpdateResult
});
}
@@ -263,7 +268,7 @@ function updateRpm() {
* Data returned from HTTP request
* @return Nothing
*/
-function ShowUpdateResult(data) {
+function showUpdateResult(data) {
var temp = 0;
$('#loadingpic').remove();
@@ -271,16 +276,16 @@ function ShowUpdateResult(data) {
if (0 < resArray.length) {
// Show last lines
if (('' == resArray[resArray.length - 1]) && (resArray.length > 1)) {
- $('#update').append(resArray[resArray.length - 2]);
+ $('#update').append('
';
-
+
var strRet = strGroup + strNodes + strBoot + strOs + strArch + strPro;
return strRet;
}
/**
- * refresh the nodes area base on group selected
+ * Refresh the nodes area base on group selected
*
* @return Nothing
*/
-function createNodesArea(groupName, areaId){
+function createNodesArea(groupName, areaId) {
// Get group nodes
- $.ajax( {
+ $.ajax({
url : 'lib/cmd.php',
dataType : 'json',
data : {
@@ -406,19 +395,19 @@ function createNodesArea(groupName, areaId){
var index;
var showStr = '
';
showStr += '
Node
';
- for (index in nodes){
+ for (index in nodes) {
var node = nodes[index][0];
- if ('' == node){
+ if ('' == node) {
continue;
}
- showStr += '
' + node + '
';
+ showStr += '
'
+ + node + '
';
}
showStr += '
';
areaObj.empty().append(showStr);
- if (index > 10){
+ if (index > 10) {
areaObj.css('height', '300px');
- }
- else{
+ } else {
areaObj.css('height', 'auto');
}
} // End of function(data)
@@ -426,11 +415,11 @@ function createNodesArea(groupName, areaId){
}
/**
- * provision for existing system p node
+ * Provision for existing system p node
*
* @return Nothing
*/
-function pProvisionExisting(data){
+function pProvisionExisting(data) {
// Get ajax response
var rsp = data.rsp;
var args = data.msg.split(';');
@@ -439,21 +428,22 @@ function pProvisionExisting(data){
var cmd = args[0].replace('cmd=', '');
// Get provision tab instance
var tabId = args[1].replace('out=', '');
-
- //get tab obj
+
+ // 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( {
+ $.ajax({
url : 'lib/cmd.php',
dataType : 'json',
data : {
@@ -465,14 +455,14 @@ function pProvisionExisting(data){
success : pProvisionExisting
});
- }
-
+ }
+
/**
* (3) Boot node from network
*/
else if (cmd == 'nodeset') {
// Write ajax response to status bar
- var prg = writeRsp(rsp, '');
+ var prg = writeRsp(rsp, '');
tempTab.find('#statBar').append(prg);
// If there was an error, do not continue
@@ -480,12 +470,12 @@ function pProvisionExisting(data){
tempTab.find('#loader').remove();
return;
}
-
+
// Get nodes that were checked
var tgts = getCheckedByObj(tempTab.find('table'));
-
+
// Boot node from network
- $.ajax( {
+ $.ajax({
url : 'lib/cmd.php',
dataType : 'json',
data : {
@@ -497,36 +487,34 @@ function pProvisionExisting(data){
success : pProvisionExisting
});
- }
-
+ }
+
/**
* (4) Done
*/
else if (cmd == 'rnetboot') {
// Write ajax response to status bar
- var prg = writeRsp(rsp, '');
+ var prg = writeRsp(rsp, '');
tempTab.find('#statBar').append(prg);
-
tempTab.find('#loader').remove();
}
-
}
/**
- * get all select elements' name in the obj,
+ * Get all select elements' name in the obj
*
- * @return all nodes name, seperate by ','
+ * @return All nodes name, seperate by ','
*/
-function getCheckedByObj(obj){
+function getCheckedByObj(obj) {
var tempStr = '';
// Get nodes that were checked
- obj.find('input:checked').each(function(){
- if($(this).attr('name')){
+ obj.find('input:checked').each(function() {
+ if ($(this).attr('name')) {
tempStr += $(this).attr('name') + ',';
}
});
-
- if ('' != tempStr){
+
+ if ('' != tempStr) {
tempStr = tempStr.substr(0, tempStr.length - 1);
}
diff --git a/xCAT-UI/js/monitor/rmcmon.js b/xCAT-UI/js/monitor/rmcmon.js
index 983e21f98..f751f9216 100644
--- a/xCAT-UI/js/monitor/rmcmon.js
+++ b/xCAT-UI/js/monitor/rmcmon.js
@@ -153,14 +153,14 @@ function xcatrmcRpmCheck(){
var needHelp = false;
$('#rmcMonStatus').empty();
//check the xcat-rmc
- if(-1 != softInstallStatus[0].indexOf("not")){
+ if (-1 != softInstallStatus[0].indexOf("not")){
needHelp = true;
$('#rmcMonStatus').append(
'Please install the xCAT-rmc first. ');
}
//check the rrdtool
- if(-1 != softInstallStatus[1].indexOf("not")){
+ if (-1 != softInstallStatus[1].indexOf("not")){
needHelp = true;
$('#rmcMonStatus').append(
'Please install the RRD-tool first. ');
@@ -357,8 +357,8 @@ function showDetail(){
$('#rmcmonDetail').append(detailFilter);
select = $('');
- for(var node in globalNodesDetail){
- for(var attr in globalNodesDetail[node]){
+ for (var node in globalNodesDetail){
+ for (var attr in globalNodesDetail[node]){
select.append('');
}
break;
@@ -468,7 +468,6 @@ function showNode(nodeName){
$('#rmcmonDetail').show();
});
-
$('#nodeDetail').append(nodeTable);
for(var attr in globalNodesDetail[nodeName]){
@@ -497,18 +496,18 @@ function showNode(nodeName){
function filterSort(attrName, sortType, retArray){
var tempObj = {};
- for(var node in globalNodesDetail){
+ for (var node in globalNodesDetail){
tempObj['name'] = node;
tempObj['value'] = globalNodesDetail[node][attrName];
retArray.push(tempObj);
}
//by node name
- if(3 == sortType){
+ if (3 == sortType){
retArray.sort(sortName);
}
//desend
- else if(2 == sortType){
+ else if (2 == sortType){
retArray.sort(sortDes);
}
//ascend
@@ -520,7 +519,7 @@ function filterSort(attrName, sortType, retArray){
}
function sortAsc(x, y){
- if(x['value'] > y['value']){
+ if (x['value'] > y['value']){
return 1;
}
else{
@@ -529,7 +528,7 @@ function sortAsc(x, y){
}
function sortDes(x, y){
- if(x['value'] > y['value']){
+ if (x['value'] > y['value']){
return -1;
}
else{
@@ -538,7 +537,7 @@ function sortDes(x, y){
}
function sortName(x, y){
- if(x['name'] > y['name']){
+ if (x['name'] > y['name']){
return 1;
}
else{
@@ -560,7 +559,7 @@ function showConfigureDia(){
for (var i in wholeAttrArray){
var name = wholeAttrArray[i];
var tempString = '
';
- if(selectedAttrHash[name]){
+ if (selectedAttrHash[name]){
tempString += '
';
}
else{
@@ -599,7 +598,7 @@ function showConfigureDia(){
//collect all attibutes' name
var str = '';
$('#rmcAttrTable input:checked').each(function(){
- if('' == str){
+ if ('' == str){
str += $(this).attr('name');
}
else{
@@ -631,7 +630,7 @@ function showConfigureDia(){
* load the rmc event tab.
*
* @param
-
+ *
* @return
*
*/
@@ -661,7 +660,6 @@ function loadRmcEvent(){
/**
* get all conditions
*
- *
* @return
*
*/
@@ -678,7 +676,7 @@ function getConditions(){
msg : ''
},
- success : function(data){
+ success : function (data){
$('#rmcEventStatus').empty();
$('#rmcEventButtons').show();
globalCondition = data.rsp[0];
@@ -693,7 +691,6 @@ function getConditions(){
/**
* get all response
*
- *
* @return
*
*/
@@ -704,6 +701,7 @@ function getResponse(){
tempFlag = true;
break;
}
+
if (!tempFlag){
$.ajax({
url : 'lib/cmd.php',
@@ -717,7 +715,7 @@ function getResponse(){
success : function(data){
var resps = data.rsp[0].split(';');
- for(var i in resps){
+ for (var i in resps){
var name = resps[i];
name = name.substr(1, (name.length - 2));
globalResponse[name] = 1;
@@ -755,7 +753,7 @@ function showEventLog(data){
var eventTable = new DataTable('lsEventTable');
eventTable.init(['Time', 'Type', 'Content']);
- for(var i in data.rsp){
+ for (var i in data.rsp){
var row = data.rsp[i].split(';');
eventTable.add(row);
}
@@ -840,7 +838,7 @@ function mkCondRespDia(){
msg : ''
},
- success : function(data){
+ success : function (data){
var tempHash = new Object();
var oldSelectedResp = '';
var showStr = '';
@@ -853,8 +851,8 @@ function mkCondRespDia(){
}
}
- for(var name in globalResponse){
- if(tempHash[name]){
+ for (var name in globalResponse){
+ if (tempHash[name]){
showStr += '' + name + ' ';
oldSelectedResp += ';' + name;
}
@@ -905,7 +903,7 @@ function mkCondRespDia(){
});
for (var i in newResp){
- if(oldResp[i]){
+ if (oldResp[i]){
delete oldResp[i];
delete newResp[i];
}
@@ -915,7 +913,7 @@ function mkCondRespDia(){
for (var i in oldResp){
oldString += ',"' + i + '"';
}
- if('' != oldString){
+ if ('' != oldString){
oldString = oldString.substr(1);
}
@@ -927,7 +925,7 @@ function mkCondRespDia(){
newString = newString.substr(1);
}
- if(('' != oldString) || ('' != newString)){
+ if (('' != oldString) || ('' != newString)){
$('#rmcEventStatus').empty().append('Create/Remove associations').append(createLoader());
$.ajax({
url : 'lib/cmd.php',
@@ -1298,7 +1296,7 @@ function createAssociationTable(cond){
var showStr = '
Condition Name
Status
Start/Stop
';
showStr += '';
- for(var i in conditions){
+ for (var i in conditions){
name = conditions[i];
tempLength = name.length;
tempStatus = name.substr(tempLength - 3);
diff --git a/xCAT-UI/js/monitor/xcatmon.js b/xCAT-UI/js/monitor/xcatmon.js
index f12f0447d..025e384cc 100644
--- a/xCAT-UI/js/monitor/xcatmon.js
+++ b/xCAT-UI/js/monitor/xcatmon.js
@@ -1,36 +1,32 @@
-/*
-* Globle variable
-*
-*/
+/**
+ * global variable
+ */
var XcatmonTableId="XcatMonsettingTable";
var dataTables=new Object();
-/*
-* set datatable
-*
-*/
+/**
+ * set datatable
+ */
function setDatatable(id,obj){
dataTables[id]=obj;
}
-/*
-* get datatable from the given id
-*
-*
-*/
+
+/**
+ * get datatable from the given id
+ */
function getDatatable(id){
return dataTables[id];
}
-/*
-*
-*
-*/
+/**
+ * load xCAT monitor
+ */
function loadXcatMon(){
//find the xcat mon tab
var xcatMonTab = $('#xcatmon');
xcatMonTab.append("");
- // show the content of the table monsetting
+ //show the content of the table monsetting
$.ajax({
url:'lib/cmd.php',
dataType: 'json',
@@ -43,17 +39,16 @@ function loadXcatMon(){
success: loadXcatMonSetting
});
}
-function loadXcatMonSetting(data){
-
- var apps;// contain the xcatmon apps config
+
+function loadXcatMonSetting(data){
+ var apps; //contain the xcatmon apps config
var rsp=data.rsp;
- var apps_flag=0;// Is the apps is stored?
- var ping; // contain the xcatmon ping-interval setting
+ var apps_flag=0; //is the apps is stored?
+ var ping; //contain the xcatmon ping-interval setting
var ping_flag=0;
-
//create a infoBar
- var infoBar=createInfoBar('Click on a cell to edit,Click outside the table to write to the cell. Once you finish the xCATmon config.click on Apply.');
+ var infoBar=createInfoBar('Click on a cell to edit. Click outside the table to write to the cell. Once you are finished configuring the xCAT monitor, click on Apply.');
$('#xcatmonTable').append(infoBar);
//create xcatmonTable
@@ -62,7 +57,7 @@ function loadXcatMonSetting(data){
//create Datatable
var dTable;
- // create the xcatmonTable header
+ //create the xcatmonTable header
var header=rsp[0].split(",");
header.splice(3,2);
header.splice(0,1);
@@ -71,47 +66,44 @@ function loadXcatMonSetting(data){
header.push('');
header.unshift('');
- XcatmonTable.init(header);//create the table header
+ XcatmonTable.init(header); //create the table header
-
- // create container of original table contents
+ //create container of original table contents
var origCont= new Array();
- origCont[0]=header;// table header
+ origCont[0]=header; //table header
//create contariner for new contents use for update the monsetting table
var newCont =new Object();
- newCont[0]=rsp[0].split(",");// table header
+ 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
+ $('#xcatmonTable').append(XcatmonTable.object()); //add table object
+ var m=1; //the count for origCont
var n=0;
- for( var i=1;i');
@@ -120,56 +112,49 @@ function loadXcatMonSetting(data){
XcatmonTable.add(cols);
origCont[m++]=cols;
- }else{
-
- if(!apps_flag){//check the apps setting
- if(rsp[i].indexOf("apps") > -1){// check for is apps or not
- apps=rsp[i].split(',');//
+ } else{
+ if (!apps_flag){ //check the apps setting
+ if (rsp[i].indexOf("apps") > -1){ //check for is apps or not
+ apps=rsp[i].split(',');
- for(var j=0;j -1){
+ if (rsp[i].indexOf("ping-interval")> -1){
ping=rsp[i].split(',');
- // pair the semicolon
- for(var j=0;j');
}
}
@@ -230,185 +213,170 @@ function loadXcatMonSetting(data){
$(this).find("span:last").remove();
}
);
-
*/
-
//make the table editable
-
$('#'+XcatmonTableId+' td:not(td:nth-child(1),td:last-child)').editable(
-
- function(value,settings){
-
- var colPos=this.cellIndex;
- var rowPos=dTable.fnGetPosition(this.parentNode);
-
- dTable.fnUpdate(value,rowPos,colPos);
-
- return (value);
- },{
- onblur : 'submit',
- type : 'textarea',
- placeholder: ' ',
- height : '30px'
- }
-
- );
- //save the datatable
- dTable=$('#'+XcatmonTableId).dataTable();
- // set the datatable to the global variables datatables
- setDatatable(XcatmonTableId,dTable);
-
-
- //create button bar
- var addBar = $('');
- $('#xcatmon').append(addBar);
- // create the button add row
- var addRowBtn=createButton('Add row');
- // add the button to the page
- addBar.append(addRowBtn);
- // create the button apply
- var ApplyBtn=createButton('Apply');
- // add the apply button to the page
- addBar.append(ApplyBtn);
- // create the button Cancel
- var CancelBtn=createButton('Cancel');
- // add the cancel to the page
- addBar.append(CancelBtn);
-
- // button click function
-
- //create a empty row
- addRowBtn.bind('click',function(event){
- // create the container of the new row
- var row = new Array();
-
- // add the delete button to the row
- row.push('');
- // add the xcatmon
- // add the contain of the setting
- for(var i =0;i');
- // get the datatable of the table
- var dTable=getDatatable(XcatmonTableId);
- // add the new row to the datatable
- dTable.fnAddData(row);
-
- // make the datatable editable
- $(":checkbox[title]").tooltip();
- $('#'+XcatmonTableId+' td:not(td:nth-child(1),td:last-child)').editable(
- function(value,settings){
+ function (value,settings){
var colPos=this.cellIndex;
var rowPos=dTable.fnGetPosition(this.parentNode);
-
dTable.fnUpdate(value,rowPos,colPos);
-
return (value);
- },{
+ },{
onblur : 'submit',
type : 'textarea',
placeholder: ' ',
height : '30px'
+ }
+ );
+
+ //save the datatable
+ dTable=$('#'+XcatmonTableId).dataTable();
+ //set the datatable to the global variables datatables
+ setDatatable(XcatmonTableId,dTable);
+
+ //create button bar
+ var addBar = $('');
+ $('#xcatmon').append(addBar);
+ //create the button add row
+ var addRowBtn=createButton('Add row');
+ //add the button to the page
+ addBar.append(addRowBtn);
+ //create the button apply
+ var ApplyBtn=createButton('Apply');
+ //add the apply button to the page
+ addBar.append(ApplyBtn);
+ //create the button Cancel
+ var CancelBtn=createButton('Cancel');
+ //add the cancel to the page
+ addBar.append(CancelBtn);
+
+ //button click function
+ //create a empty row
+ addRowBtn.bind('click', function(event){
+ //create the container of the new row
+ var row = new Array();
+
+ //add the delete button to the row
+ row.push('');
+ //add the xcatmon
+ //add the contain of the setting
+ for (var i =0;i');
+ //get the datatable of the table
+ var dTable=getDatatable(XcatmonTableId);
+ //add the new row to the datatable
+ dTable.fnAddData(row);
+
+ //make the datatable editable
+ $(":checkbox[title]").tooltip();
+ $('#'+XcatmonTableId+' td:not(td:nth-child(1),td:last-child)').editable(
+ function(value,settings){
+ var colPos=this.cellIndex;
+ var rowPos=dTable.fnGetPosition(this.parentNode);
+ dTable.fnUpdate(value,rowPos,colPos);
+ return (value);
+ },{
+ onblur : 'submit',
+ type : 'textarea',
+ placeholder: ' ',
+ height : '30px'
}
-
);
-
});
-
-/*
-* apply button
-*
-*
-*
-* The Apply button is used to store the contain of the table in the page to the monsetting table
-* on the MN.
-*
-*/
- ApplyBtn.bind('click',function(event){
- // get the datatable of the page
+ /**
+ * apply button
+ *
+ * the Apply button is used to store the contain of the table in the page to
+ * the monsetting table on the MN.
+ */
+ ApplyBtn.bind('click', function(event){
+ //get the datatable of the page
var dTable=getDatatable(XcatmonTableId);
- // get the rows of the datatable
+ //get the rows of the datatable
var dRows=dTable.fnGetNodes();
var count=0;
- // create the new container of the apps' value.
+ //create the new container of the apps' value.
var appValue="";
var tableName="monsetting";
var tmp;
var tmp1;
- var closeBtn=createButton("close");
- // get the contain of the rows
+ var closeBtn=createButton("close");
+ //get the contain of the rows
for (var i =0; i< dRows.length;i++){
-
- if(dRows[i]){
- // get the columns fo the row
+ if (dRows[i]){
+ //get the columns fo the row
var cols=dRows[i].childNodes;
- // create the container of the new column
+ //create the container of the new column
var vals = new Array();
- for(var j=1;j');
- }else{
- vals_orig.push('');
- }
- // push the delete button to the row
+ //check the checkbox of the row and add different checkbox to the orignCont
+ //for the cancle button
+ if (cols.item(cols.length-1).firstChild.checked){
+ vals_orig.push('');
+ } else{
+ vals_orig.push('');
+ }
+
+ //push the delete button to the row
vals_orig.unshift('');
- // add the row to the orignCont
+ //add the row to the orignCont
origCont[i+1]=vals_orig;
//tmp1=origCont;
//tmp=newCont;
count=i+1;
- // check the checkbox fo everyrow for merging the appName to the apps values
- if(cols.item(cols.length-1).firstChild.checked){
- // the new value for the apps.get the name fo every app.
+ //check the checkbox fo everyrow for merging the appName to the apps values
+ if (cols.item(cols.length-1).firstChild.checked){
+ //the new value for the apps.get the name fo every app.
appValue=appValue.concat(cols.item(2).firstChild.nodeValue+",");
}
}
}
+
count++;
- // delete the last "," of the apps value
+ //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 add the apps row
newCont[count++]=apps;
- // newCont add the ping-interval row
+ //newCont add the ping-interval row
newCont[count++]=ping;
//tmp=otherCont;
- // add the other monitor setting of the mosetting
+ //add the other monitor setting of the mosetting
for(var j=0;jsaving the configuration ');
dialogSave.append(createLoader());
addBar.append(dialogSave);
- // open the dialog..modal is true
+ //open the dialog..modal is true
$("#saveDialog").dialog({modal: true});
- // hide the cross...
+ //hide the cross...
$('.ui-dialog-titlebar-close').hide();
- // pot the table name and the contain to the tabRestore.php
+ //put the table name and the contain to the tabRestore.php
$.ajax({
type : 'POST',
url : 'lib/tabRestore.php',
@@ -434,91 +402,71 @@ function loadXcatMonSetting(data){
table : tableName,
cont : newCont
},
- success : function (data){
- // empty the dialog.add the close button
+ success : function(data){
+ //empty the dialog.add the close button
$("#saveDialog").empty().append('
The Configure has saved!
');
$("#saveDialog").append(closeBtn);
}
});
- // close button function
- closeBtn.bind('click',function(event){
- $("#saveDialog").dialog("distroy");
- $("#saveDialog").remove();
+
+ //close button function
+ closeBtn.bind('click', function(event){
+ $("#saveDialog").dialog("distroy");
+ $("#saveDialog").remove();
+
+ });
+ //clear the newCont
+ newCont=null;
+ newCont=new Object();
+ //just for tmp=newCont;
+ newCont[0]=rsp[0].split(",");
});
- // clear the newCont
- newCont=null;
- newCont= new Object();
- //just for tet tmp=newCont;
- newCont[0]=rsp[0].split(",");
-
-
-
- }
- );
-
-
-
-
-
-/*
-* undo button
-*
-*/
- CancelBtn.bind('click',function(event){
-
- // get the datatable of the page
+ /**
+ * undo button
+ */
+ CancelBtn.bind('click', function(event){
+ //get the datatable of the page
var dTable=getDatatable(XcatmonTableId);
- // clear the datatable
+ //clear the datatable
dTable.fnClearTable();
- // add the contain of the origCont to the datatable
- for(var i=1;i');
/**
@@ -444,11 +440,11 @@ function createActionMenu(){
* power, clone, delete, unlock, and advanced
*/
var powerLnk = $('Power');
- //Power on
+ //power on
var powerOnLnk = $('Power on');
powerOnLnk.bind('click', function(event) {
var tgtNodes = getSelectNodes();
- $.ajax( {
+ $.ajax({
url : 'lib/cmd.php',
dataType : 'json',
data : {
@@ -460,11 +456,11 @@ function createActionMenu(){
});
});
- //Power off
+ //power off
var powerOffLnk = $('Power off');
powerOffLnk.bind('click', function(event) {
var tgtNodes = getSelectNodes();
- $.ajax( {
+ $.ajax({
url : 'lib/cmd.php',
dataType : 'json',
data : {
@@ -476,14 +472,14 @@ function createActionMenu(){
});
});
- //Clone
+ //clone
var cloneLnk = $('Clone');
cloneLnk.bind('click', function(event) {
/*
for (var name in selectNode) {
var mgt = graphicalNodeList[name]['mgt'];
- // Create an instance of the plugin
+ //create an instance of the plugin
var plugin;
switch(mgt) {
case "blade":
@@ -511,7 +507,7 @@ function createActionMenu(){
*/
});
- //Delete
+ //delete
var deleteLnk = $('Delete');
deleteLnk.bind('click', function(event) {
var tgtNodes = getSelectNodes();
@@ -520,7 +516,7 @@ function createActionMenu(){
}
});
- //Unlock
+ //unlock
var unlockLnk = $('Unlock');
unlockLnk.bind('click', function(event) {
var tgtNodes = getSelectNodes();
@@ -529,7 +525,7 @@ function createActionMenu(){
}
});
- //Run script
+ //run script
var scriptLnk = $('Run script');
scriptLnk.bind('click', function(event) {
var tgtNodes = getSelectNodes();
@@ -538,7 +534,7 @@ function createActionMenu(){
}
});
- //Update node
+ //update node
var updateLnk = $('Update');
updateLnk.bind('click', function(event) {
var tgtNodes = getSelectNodes();
@@ -547,7 +543,7 @@ function createActionMenu(){
}
});
- //Set boot state
+ //set boot state
var setBootStateLnk = $('Set boot state');
setBootStateLnk.bind('click', function(event) {
var tgtNodes = getSelectNodes();
@@ -556,7 +552,7 @@ function createActionMenu(){
}
});
- //Boot to network
+ //boot to network
var boot2NetworkLnk = $('Boot to network');
boot2NetworkLnk.bind('click', function(event) {
var tgtNodes = getSelectNodes();
@@ -565,7 +561,7 @@ function createActionMenu(){
}
});
- //Remote console
+ //remote console
var rcons = $('Open console');
rcons.bind('click', function(event){
var tgtNodes = getSelectNodes();
@@ -574,7 +570,7 @@ function createActionMenu(){
}
});
- //Edit properties
+ //edit properties
var editProps = $('Edit properties');
editProps.bind('click', function(event){
for (var node in selectNode) {
@@ -584,17 +580,17 @@ function createActionMenu(){
var advancedLnk = $('Advanced');
- // Power actions
+ //power actions
var powerActions = [ powerOnLnk, powerOffLnk ];
var powerActionMenu = createMenu(powerActions);
- // Advanced actions
+ //advanced actions
var advancedActions;
advancedActions = [ boot2NetworkLnk, scriptLnk, setBootStateLnk, updateLnk, rcons, editProps ];
var advancedActionMenu = createMenu(advancedActions);
/**
- * Create an action menu
+ * create an action menu
*/
var actionsDIV = $('');
var actions = [ [ powerLnk, powerActionMenu ], cloneLnk, deleteLnk, unlockLnk, [ advancedLnk, advancedActionMenu ] ];
@@ -612,8 +608,7 @@ function createActionMenu(){
* @param bpaName : fsp's key
* fsp : all fsp and there related lpars
* fspinfo : all fsps' hardwareinfo
- * @return
- *
+ * @return
*/
function createFspDiv(fspName, mtm, fsp){
//create fsp title
@@ -658,8 +653,7 @@ function createFspDiv(fspName, mtm, fsp){
* @param bpaName : fsp's key
* fsp : all fsp and there related lpars
* fspinfo : all fsps' hardwareinfo
- * @return
- *
+ * @return
*/
function createFspTip(fspName, mtm, fsp){
var tip = $('');
@@ -694,9 +688,7 @@ function createFspTip(fspName, mtm, fsp){
* map the lpar's status into a color
*
* @param status : lpar's status in nodelist table
-
- * @return
- * corresponding color name
+ * @return corresponding color name
*/
function statusMap(status){
var color = 'gainsboro';
@@ -728,9 +720,7 @@ function statusMap(status){
* select all lpars checkbox in the dialog
*
* @param
-
- * @return
- *
+ * @return
*/
function selectAllLpars(checkbox){
var temp = checkbox.attr('checked');
@@ -741,9 +731,7 @@ function selectAllLpars(checkbox){
* export all lpars' name from selectNode
*
* @param
-
- * @return lpars' string
- *
+ * @return lpars' string
*/
function getSelectNodes() {
var ret = '';
@@ -759,7 +747,6 @@ function getSelectNodes() {
* list and update the tooltip table
*
* @param
-
* @return
*/
function changeNode(lparName, status){
@@ -783,7 +770,6 @@ function changeNode(lparName, status){
* The P7-IH's cecs are insert from down to up, so we had to coculate the blank height.
*
* @param
-
* @return the height for the cec
*/
function coculateBlank(mtm){
diff --git a/xCAT-UI/js/provision/images.js b/xCAT-UI/js/provision/images.js
index b46225109..5a66e1797 100644
--- a/xCAT-UI/js/provision/images.js
+++ b/xCAT-UI/js/provision/images.js
@@ -426,329 +426,324 @@ function setImageDefAttrs(data) {
}
/**
- *Load create image page
- *
- *@param Nothing
- * Create a new image for provision
- *@return Nothing
+ * Load create image page
+ *
+ * @param Nothing
+ * @return Nothing
*/
-function loadCreateImage(){
- // get nodes tab
- var tab=getProvisionTab();
+function loadCreateImage() {
+ // Get nodes tab
+ var tab = getProvisionTab();
var tabId = 'createImageTab';
- //Generate new tab ID
- if($('#' + tabId).size()){
+ // Generate new tab ID
+ if ($('#' + tabId).size()) {
tab.select(tabId);
- return ;
+ return;
}
var showStr = '';
var imageOsvers = $.cookie("osvers").split(",");
var imageArch = $.cookie("osarchs").split(",");
-
- // Create set properties form
+
+ // Create set properties form
var setPropsForm = $('');
- //show the infomation
- var infoBar= createInfoBar('Input the image info ,you want to generate. Click generate.');
+ // Show the infomation
+ var infoBar = createInfoBar('Specify the parameters for the image you want to generate, then click Create Image.');
setPropsForm.append(infoBar);
-
- //os version selector
+
+ // OS version selector
showStr += '';
+ showStr += '';
- //os arch selector
+ // OS arch selector
showStr += '';
+ showStr += '';
- //net boot interface input
+ // Netboot interface input
showStr += '';
- //profile selector
- showStr += '';
- //boot method selector
- showStr += '';
-
+ // Profile selector
+ showStr += '';
+ // Boot method selector
+ showStr += '';
setPropsForm.append(showStr);
createHpcSelect(setPropsForm);
-
- //add and show the tab
+
+ // Add and show the tab
tab.add(tabId, 'Create Image', setPropsForm, true);
tab.select(tabId);
-
- //check the selected osver and osarch for hcp stack select, if they are validated,
- //then show the hpc stack select area.
+
+ // Check the selected osver and osarch for hcp stack select
+ // If they are valid, show the hpc stack select area.
hpcShow();
-
- $.ajax({
+
+ $.ajax( {
url : 'lib/systemcmd.php',
dataType : 'json',
data : {
cmd : 'lsb_release -d;uname -p'
},
- success : function(data){
+ success : function(data) {
var tempArray = data.rsp.split("\n");
var mnOs = tempArray[0];
- var mnArch = tempArray[1];
+ var mnArch = tempArray[1];
tempArray = mnOs.split(" ");
- // get the the version of mn
- if(mnOs.indexOf("Red Hat")!= -1 ){
- mnOs="rhels" + tempArray[6];
- }
+ // Get the the version of MN
+ if (mnOs.indexOf("Red Hat") != -1) {
+ mnOs = "rhels" + tempArray[6];
+ }
+
$('#createImageTab option[value=' + mnOs + ']').attr('selected', 'selected');
$('#createImageTab option[value=' + mnArch + ']').attr('selected', 'selected');
- // The button used to create images is created here.
- var createImageBtn=createButton("CreateImage");
- createImageBtn.bind('click',function(event){
+
+ // The button used to create images is created here
+ var createImageBtn = createButton("Create Image");
+ createImageBtn.bind('click', function(event) {
createImage();
});
-
+
$('#createImageTab').append(createImageBtn);
-
- // check the option ,Decide to show the hpcsoft or not
+
+ // Check the option and decide to show the hpcsoft or not
hpcShow();
}
});
-
+
}
-function createHpcSelect(container){
+/**
+ * Create HPC select
+ *
+ * @param container
+ * The container to hold the HPC select
+ * @return HPC select appended to the container
+ */
+function createHpcSelect(container) {
var hpcFieldset = $('');
hpcFieldset.append('');
- var str = 'Before selecting the software, you should have the following already completed for your xCAT cluster:
' +
- '1. If you are using xCAT hierarchy, your service nodes are installed and running. ' +
- '2. Your compute nodes are defined to xCAT, and you have verified your hardware control capabilities, ' +
- 'gathered MAC addresses, and done all the other necessary preparations for a diskless install. ' +
- '3. You should have a diskless image created with the base OS installed and verified on at least one test node. ' +
- '4. You should install the softwares on the management node, and copy all correponding packages into the location ' +
- '"/install/custom/otherpkgs/" based on ' +
- 'these documentations. ';
-
+ var str = 'Before selecting the software, you should have the following already completed for your xCAT cluster:
'
+ + '1. If you are using xCAT hierarchy, your service nodes are installed and running. '
+ + '2. Your compute nodes are defined to xCAT, and you have verified your hardware control capabilities, '
+ + 'gathered MAC addresses, and done all the other necessary preparations for a diskless install. '
+ + '3. You should have a diskless image created with the base OS installed and verified on at least one test node. '
+ + '4. You should install the softwares on the management node, and copy all correponding packages into the location ' + '"/install/custom/otherpkgs/" based on '
+ + 'these documentations. ';
+
hpcFieldset.append(createInfoBar(str));
- // advanced software when select the compute profile
- str = '
GPFS
' +
- '
RSCT
' +
- '
PE
' +
- '
ESSl&PESSL
' +
- '
';
- hpcFieldset.append(str);
+ // Advanced software when select the compute profile
+ str = '