');
var rpmDiv = $('');
var statusDiv = createStatusBar("update");
@@ -14,15 +13,13 @@
$('#updateTab').append(' ');
$('#updateTab').append(repositoryDiv);
$('#updateTab').append(rpmDiv);
-
-
- var infoBar = createInfoBar('Select the Rpm and Repository, then press Update');
+
+ var infoBar = createInfoBar('Select the RPM and repository, then press Update');
repositoryDiv.append(infoBar);
-
repositoryDiv.append("");
- $.ajax( {
+ $.ajax({
url : 'lib/systemcmd.php',
dataType : 'json',
data : {
@@ -43,10 +40,10 @@
success : showRpmInfo
});
- }
+}
/**
- * Show the Rpm Repository, it can use user's last choice and input
+ * Show the RPM Repository, it can use user's last choice and input
*
* @return Nothing
*/
@@ -55,14 +52,11 @@ function showRepository(data) {
var StableRepository = "";
var Show = "";
- //get the corresponding repository by OS Type
- if ("aix" == data.rsp)
- {
+ // 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/";
- }
- else
- {
+ } else {
DevelRepository = "http://xcat.sourceforge.net/yum/devel/xcat-core/";
StableRepository = "http://xcat.sourceforge.net/yum/xcat-core/";
}
@@ -71,8 +65,7 @@ function showRepository(data) {
//display the Devel Repository, remember user's last selection
Show = Show + "
";
- }
- else
- {
+ } else {
Show = "
Other: ";
Show += "";
}
@@ -111,27 +100,24 @@ function showRepository(data) {
$('#repository fieldset').append(repoList);
}
-function showRpmInfo(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 temp = 0;
- if(null == data.rsp)
- {
+ if(null == data.rsp) {
$('#rpm fieldset').append("Get Rpm Info Error!");
return;
}
Rpms = data.rsp.split(/\n/);
- //no rpm installed, return
- if (1 > Rpms.length)
- {
+ // no rpm installed, return
+ if (1 > Rpms.length) {
$('#rpm fieldset').append("No Rpm installed!");
return;
}
- //clear the old data
+ // clear the old data
$('#rpm fieldset').children().remove();
$('#rpm fieldset').append("");
@@ -141,21 +127,18 @@ function showRpmInfo(data)
Show += "
Package Name
Version
";
Show += "";
- for (temp = 0; temp < Rpms.length; temp++)
- {
- //empty line continue
- if ("" == Rpms[temp])
- {
+ for (temp = 0; temp < Rpms.length; temp++) {
+ // empty line continue
+ if ("" == Rpms[temp]) {
continue;
}
- //the rpm is not installed, continue
- if (-1 != Rpms[temp].indexOf("not"))
- {
+ // the rpm is not installed, continue
+ if (-1 != Rpms[temp].indexOf("not")) {
continue;
}
- //show the version in table
+ // show the version in table
Show += "
";
@@ -165,22 +148,20 @@ function showRpmInfo(data)
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(){
updateRpm();
- });
+ });
}
-function updateSelectAll()
-{
+function updateSelectAll() {
var check_status = $('#selectall').attr('checked');
$('input:checkbox').attr('checked', check_status);
}
-function updateRpm()
-{
+function updateRpm() {
// Remove any warning messages
$('#updateTab').find('.ui-state-error').remove();
@@ -189,47 +170,38 @@ function updateRpm()
var rpms = "";
var temp = "";
- if(undefined == rpmPath)
- {
+ if (undefined == rpmPath) {
rpmPath = "";
}
- //select other and we should use the value in the input
- if ("" == rpmPath)
- {
+ // 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();
rpmPathType = rpmPath;
- }
- else
- {
- if(-1 == rpmPath.toLowerCase().indexOf("devel"))
- {
+ } else {
+ if(-1 == rpmPath.toLowerCase().indexOf("devel")) {
rpmPathType = "2";
- }
- else
- {
+ } else {
rpmPathType = "1";;
}
}
$("input[type=checkbox]:checked").each(function(){
temp = $(this).val();
- if("" == temp)
- {
+ if("" == temp) {
//continue;
return true;
}
+
var pattern = new RegExp("^" + temp + ",|," + temp + ",");;
- if (pattern.test(rpms))
- {
+ if (pattern.test(rpms)) {
return true;
}
rpms = rpms + temp + ",";
});
- if(0 < rpms.length)
- {
+ if (0 < rpms.length) {
rpms = rpms.slice(0, -1);
}
@@ -250,7 +222,7 @@ function updateRpm()
return;
}
- //remember users' choice and input
+ // remember users' choice and input
$.cookie('xcatrepository', rpmPathType, { path: '/xcat', expires: 10 });
$('#update').show();
@@ -274,18 +246,17 @@ function updateRpm()
});
}
-function ShowUpdateResult(data)
-{
+function ShowUpdateResult(data) {
var temp = 0;
$('#loadingpic').remove();
var resArray = data.rsp[0].split(/\n/);
- if (0 < resArray.length){
+ if (0 < resArray.length) {
// Show last lines
if (('' == resArray[resArray.length - 1]) && (resArray.length > 1)){
$('#update').append(resArray[resArray.length - 2]);
}
- else{
+ else {
$('#update').append(resArray[resArray.length - 1]);
}
@@ -305,8 +276,7 @@ function ShowUpdateResult(data)
resDetail.hide();
$('#update').append(resDetail);
- for (temp = 0; temp < resArray.length; temp++)
- {
+ for (temp = 0; temp < resArray.length; temp++) {
resDetail.append(resArray[temp] + " ");
}
}
@@ -323,5 +293,4 @@ function ShowUpdateResult(data)
});
$('#rpm button').attr('disabled', '');
-
}
\ No newline at end of file
diff --git a/xCAT-UI/js/custom/blade.js b/xCAT-UI/js/custom/blade.js
index dba5bfaac..39f08157e 100644
--- a/xCAT-UI/js/custom/blade.js
+++ b/xCAT-UI/js/custom/blade.js
@@ -61,8 +61,7 @@ bladePlugin.prototype.loadClonePage = function(node) {
if (!$('#' + newTabId).length) {
// Create status bar and hide it
var statBarId = node + 'CloneStatusBar';
- var statBar = $('')
- .hide();
+ var statBar = $('').hide();
// Create info bar
var infoBar = createInfoBar('Under construction');
@@ -154,14 +153,14 @@ bladePlugin.prototype.loadProvisionPage = function(tabId) {
/**
* Create provision new node division
*/
- // You should copy whatever is in this function here and customize it
+ // You should copy whatever is in this function, put it here, and customize it
var provNew = createProvisionNew('blade', inst);
provForm.append(provNew);
/**
* Create provision existing node division
*/
- // You should copy whatever is in this function here and customize it
+ // You should copy whatever is in this function, put it here, and customize it
var provExisting = createProvisionExisting('blade', inst);
provForm.append(provExisting);
@@ -183,11 +182,13 @@ bladePlugin.prototype.loadProvisionPage = function(tabId) {
*
* @return Nothing
*/
-bladePlugin.prototype.loadResources = function() {
- var tabID = 'bladeResourceTab'; // Resource tab ID
- var loaderID = 'bladeResourceLoader'; // Loader ID
+bladePlugin.prototype.loadResources = function() {
+ // Get resource tab ID
+ var tabID = 'bladeResourceTab';
+ // Get loader ID
+ var loaderID = 'bladeResourceLoader';
if ($('#' + loaderID).length) {
- $('#' + loaderID).remove(); // Remove loader
+ $('#' + loaderID).remove();
}
// Create info bar
diff --git a/xCAT-UI/js/custom/customUtils.js b/xCAT-UI/js/custom/customUtils.js
index bbf9947db..543a081d7 100644
--- a/xCAT-UI/js/custom/customUtils.js
+++ b/xCAT-UI/js/custom/customUtils.js
@@ -30,9 +30,9 @@ function createNodesDatatable(group, outId) {
// Data returned
var rsp = data.rsp;
- // Output ID
+ // Get output ID
var outId = data.msg;
- // Datatable ID
+ // Get datatable ID
var dTableId = outId.replace('DIV', '');
// Node attributes hash
diff --git a/xCAT-UI/js/custom/fsp.js b/xCAT-UI/js/custom/fsp.js
index 2d7561e05..cece320cb 100644
--- a/xCAT-UI/js/custom/fsp.js
+++ b/xCAT-UI/js/custom/fsp.js
@@ -61,8 +61,7 @@ fspPlugin.prototype.loadClonePage = function(node) {
if (!$('#' + newTabId).length) {
// Create status bar and hide it
var statBarId = node + 'CloneStatusBar';
- var statBar = $('')
- .hide();
+ var statBar = $('').hide();
// Create info bar
var infoBar = createInfoBar('Under construction');
@@ -154,14 +153,14 @@ fspPlugin.prototype.loadProvisionPage = function(tabId) {
/**
* Create provision new node division
*/
- // You should copy whatever is in this function here and customize it
+ // You should copy whatever is in this function, put it here, and customize it
var provNew = createProvisionNew('fsp', inst);
provForm.append(provNew);
/**
* Create provision existing node division
*/
- // You should copy whatever is in this function here and customize it
+ // You should copy whatever is in this function, put it here, and customize it
var provExisting = createProvisionExisting('fsp', inst);
provForm.append(provExisting);
@@ -184,10 +183,12 @@ fspPlugin.prototype.loadProvisionPage = function(tabId) {
* @return Nothing
*/
fspPlugin.prototype.loadResources = function() {
- var tabID = 'fspResourceTab'; // Resource tab ID
- var loaderID = 'fspResourceLoader'; // Loader ID
+ // Get resource tab ID
+ var tabID = 'fspResourceTab';
+ // Get loader ID
+ var loaderID = 'fspResourceLoader';
if ($('#' + loaderID).length) {
- $('#' + loaderID).remove(); // Remove loader
+ $('#' + loaderID).remove();
}
// Create info bar
diff --git a/xCAT-UI/js/custom/hmc.js b/xCAT-UI/js/custom/hmc.js
index f5c8428d9..e735ac215 100644
--- a/xCAT-UI/js/custom/hmc.js
+++ b/xCAT-UI/js/custom/hmc.js
@@ -94,8 +94,7 @@ hmcPlugin.prototype.loadClonePage = function(node) {
if (!$('#' + newTabId).length) {
// Create status bar and hide it
var statBarId = node + 'CloneStatusBar';
- var statBar = $('')
- .hide();
+ var statBar = $('').hide();
// Create info bar
var infoBar = createInfoBar('Under construction');
@@ -187,14 +186,14 @@ hmcPlugin.prototype.loadProvisionPage = function(tabId) {
/**
* Create provision new node division
*/
- // You should copy whatever is in this function here and customize it
+ // You should copy whatever is in this function, put it here, and customize it
var provNew = createProvisionNew('hmc', inst);
provForm.append(provNew);
/**
* Create provision existing node division
*/
- // You should copy whatever is in this function here and customize it
+ // You should copy whatever is in this function, put it here, and customize it
var provExisting = createProvisionExisting('hmc', inst);
provForm.append(provExisting);
@@ -217,10 +216,12 @@ hmcPlugin.prototype.loadProvisionPage = function(tabId) {
* @return Nothing
*/
hmcPlugin.prototype.loadResources = function() {
- var tabID = 'hmcResourceTab'; // Resource tab ID
- var loaderID = 'hmcResourceLoader'; // Loader ID
+ // Get resource tab ID
+ var tabID = 'hmcResourceTab';
+ // Get loader ID
+ var loaderID = 'hmcResourceLoader';
if ($('#' + loaderID).length) {
- $('#' + loaderID).remove(); // Remove loader
+ $('#' + loaderID).remove();
}
// Create info bar
diff --git a/xCAT-UI/js/custom/ipmi.js b/xCAT-UI/js/custom/ipmi.js
index 23a8cf796..6c2e42106 100644
--- a/xCAT-UI/js/custom/ipmi.js
+++ b/xCAT-UI/js/custom/ipmi.js
@@ -61,8 +61,7 @@ ipmiPlugin.prototype.loadClonePage = function(node) {
if (!$('#' + newTabId).length) {
// Create status bar and hide it
var statBarId = node + 'CloneStatusBar';
- var statBar = $('')
- .hide();
+ var statBar = $('').hide();
// Create info bar
var infoBar = createInfoBar('Under construction');
@@ -154,14 +153,14 @@ ipmiPlugin.prototype.loadProvisionPage = function(tabId) {
/**
* Create provision new node division
*/
- // You should copy whatever is in this function here and customize it
+ // You should copy whatever is in this function, put it here, and customize it
var provNew = createProvisionNew('ipmi', inst);
provForm.append(provNew);
/**
* Create provision existing node division
*/
- // You should copy whatever is in this function here and customize it
+ // You should copy whatever is in this function, put it here, and customize it
var provExisting = createProvisionExisting('ipmi', inst);
provForm.append(provExisting);
@@ -184,10 +183,12 @@ ipmiPlugin.prototype.loadProvisionPage = function(tabId) {
* @return Nothing
*/
ipmiPlugin.prototype.loadResources = function() {
- var tabID = 'ipmiResourceTab'; // Resource tab ID
- var loaderID = 'ipmiResourceLoader'; // Loader ID
+ // Get resource tab ID
+ var tabID = 'ipmiResourceTab';
+ // Get loader ID
+ var loaderID = 'ipmiResourceLoader';
if ($('#' + loaderID).length) {
- $('#' + loaderID).remove(); // Remove loader
+ $('#' + loaderID).remove();
}
// Create info bar
diff --git a/xCAT-UI/js/custom/ivm.js b/xCAT-UI/js/custom/ivm.js
index 772beac56..38b235f33 100644
--- a/xCAT-UI/js/custom/ivm.js
+++ b/xCAT-UI/js/custom/ivm.js
@@ -61,8 +61,7 @@ ivmPlugin.prototype.loadClonePage = function(node) {
if (!$('#' + newTabId).length) {
// Create status bar and hide it
var statBarId = node + 'CloneStatusBar';
- var statBar = $('')
- .hide();
+ var statBar = $('').hide();
// Create info bar
var infoBar = createInfoBar('Under construction');
@@ -154,14 +153,14 @@ ivmPlugin.prototype.loadProvisionPage = function(tabId) {
/**
* Create provision new node division
*/
- // You should copy whatever is in this function here and customize it
+ // You should copy whatever is in this function, put it here, and customize it
var provNew = createProvisionNew('ivm', inst);
provForm.append(provNew);
/**
* Create provision existing node division
*/
- // You should copy whatever is in this function here and customize it
+ // You should copy whatever is in this function, put it here, and customize it
var provExisting = createProvisionExisting('ivm', inst);
provForm.append(provExisting);
@@ -184,10 +183,12 @@ ivmPlugin.prototype.loadProvisionPage = function(tabId) {
* @return Nothing
*/
ivmPlugin.prototype.loadResources = function() {
- var tabID = 'ivmResourceTab'; // Resource tab ID
- var loaderID = 'ivmResourceLoader'; // Loader ID
+ // Get resource tab ID
+ var tabID = 'ivmResourceTab';
+ // Get loader ID
+ var loaderID = 'ivmResourceLoader';
if ($('#' + loaderID).length) {
- $('#' + loaderID).remove(); // Remove loader
+ $('#' + loaderID).remove();
}
// Create info bar
diff --git a/xCAT-UI/js/custom/zvm.js b/xCAT-UI/js/custom/zvm.js
index 6756f2521..fa7566e07 100644
--- a/xCAT-UI/js/custom/zvm.js
+++ b/xCAT-UI/js/custom/zvm.js
@@ -50,8 +50,7 @@ zvmPlugin.prototype.loadClonePage = function(node) {
// Create status bar and hide it
var statBarId = node + 'CloneStatusBar';
- var statBar = $('')
- .hide();
+ var statBar = $('').hide();
// Create info bar
var infoBar = createInfoBar('Clone a node');
@@ -640,8 +639,7 @@ zvmPlugin.prototype.loadInventory = function(data) {
dasdType = $('
');
// Create a new row for each DASD
dasdTabRow = $('
');
diff --git a/xCAT-UI/js/custom/zvmUtils.js b/xCAT-UI/js/custom/zvmUtils.js
index a02de226c..636669508 100644
--- a/xCAT-UI/js/custom/zvmUtils.js
+++ b/xCAT-UI/js/custom/zvmUtils.js
@@ -518,8 +518,7 @@ function updateZProvisionNewStatus(data) {
* (7) Update DHCP
*/
else if (cmd == 'noderes') {
- // If there was an error
- // Do not continue
+ // If there was an error, do not continue
if (rsp.length) {
$('#' + loaderId).hide();
$('#' + statBarId).append('
(Error) Failed to set operating system
');
@@ -662,8 +661,7 @@ function updateZProvisionExistingStatus(data) {
var prg = writeRsp(rsp, '');
$('#' + statBarId).append(prg);
- // If there was an error
- // Do not continue
+ // If there was an error, do not continue
if (prg.html().indexOf('Error') > -1) {
var loaderId = 'zProvisionLoader' + inst;
$('#' + loaderId).remove();
@@ -756,8 +754,7 @@ function updateZCloneStatus(data) {
if (cmd == 'nodeadd') {
var node = args[3].replace('node=', '');
- // If there was an error
- // Do not continue
+ // If there was an error, do not continue
if (rsp.length) {
$('#' + out2Id).find('img').hide();
$('#' + out2Id).append('
(Error) Failed to create node definition
');
@@ -787,8 +784,7 @@ function updateZCloneStatus(data) {
* (3) Update DNS
*/
else if (cmd == 'makehosts') {
- // If there was an error
- // Do not continue
+ // If there was an error, do not continue
if (rsp.length) {
$('#' + out2Id).find('img').hide();
$('#' + out2Id).append('
(Error) Failed to update /etc/hosts
');
diff --git a/xCAT-UI/js/monitor/monitor.js b/xCAT-UI/js/monitor/monitor.js
index 22d4aea3f..91e92123c 100644
--- a/xCAT-UI/js/monitor/monitor.js
+++ b/xCAT-UI/js/monitor/monitor.js
@@ -156,7 +156,7 @@ function loadMonitorPage() {
}
function loadMonitorTab(monitorName){
- //the tab is exist then we only need to select it
+ // If the tab exist, then we only need to select it
var tab = getMonitorTab();
if (0 != $("#" + monitorName).length){
tab.select(monitorName);
diff --git a/xCAT-UI/js/nodes/nodes.js b/xCAT-UI/js/nodes/nodes.js
index f5cac656a..01037fb4c 100644
--- a/xCAT-UI/js/nodes/nodes.js
+++ b/xCAT-UI/js/nodes/nodes.js
@@ -743,7 +743,7 @@ function loadNode(e) {
}
// Get tab area where a new tab will be inserted
- // The node name may contain special char(such as '.','#'), so we can not use the node name as a id.
+ // The node name may contain special characters (e.g. '.','#'), so we can not use the node name as an ID.
var myTab = getNodesTab();
var inst = 0;
var newTabId = 'nodeTab' + inst;
diff --git a/xCAT-UI/js/nodes/nodeset.js b/xCAT-UI/js/nodes/nodeset.js
index f91c0c17c..0d3be8663 100644
--- a/xCAT-UI/js/nodes/nodeset.js
+++ b/xCAT-UI/js/nodes/nodeset.js
@@ -32,8 +32,7 @@ function loadNodesetPage(tgtNodes) {
tabId = 'nodesetTab' + inst;
}
- // Open new tab
- // Create nodeset form
+ // Open new tab & create nodeset form
var nodesetForm = $('');
// Create status bar
diff --git a/xCAT-UI/lib/systemcmd.php b/xCAT-UI/lib/systemcmd.php
index 8925822a2..01ce226e3 100644
--- a/xCAT-UI/lib/systemcmd.php
+++ b/xCAT-UI/lib/systemcmd.php
@@ -6,8 +6,7 @@ require_once "$TOPDIR/lib/jsonwrapper.php";
/**
* Issue a xCAT command, e.g. rpm -qa xCAT
- * This will handle system commands. If not, you can create your
- * own .php. Look at zCmd.php for an example.
+ * This will handle system commands.
*
* @param $cmd The system command
* @return The system response. Replies are in the form of JSON