diff --git a/xCAT-UI/css/style.css b/xCAT-UI/css/style.css
index 19420bbe1..f40a28c39 100644
--- a/xCAT-UI/css/style.css
+++ b/xCAT-UI/css/style.css
@@ -4,7 +4,7 @@
font: 12px verdana, arial, helvetica, sans-serif;
}
-.ui-dialog label,.ui-dialog input,.ui-dialog p,.ui-dialog button {
+.ui-dialog label,.ui-dialog input,.ui-dialog p,.ui-dialog button,.ui-dialog td {
font: 12px verdana, arial, helvetica, sans-serif;
}
@@ -31,6 +31,46 @@
margin: 0px;
}
+/*--------------- login dialog ---------*/
+#logdialog {
+ width: 600px;
+}
+
+#logdialog td{
+ width: 110px;
+ height: 30px;
+ color: #0078AE;
+ font-size: 14px;
+ font-weight: bold;
+}
+
+#logdialog input{
+ width: 219px;
+ border: solid 1px #0078AE;
+ font-size: 14px;
+}
+
+#logdialog p{
+
+ font-size: 18px;
+}
+
+#logdialog button{
+ font-weight: bold;
+ width: 90px;
+}
+
+#loginput {
+ background-color: #f5f5f5;
+ height: 260px;
+}
+
+#loginfo{
+ text-align:right;
+ color: #f5f5f5;
+ font-weight:bold;
+}
+
/*--------------- Header ---------------*/
#header {
height: 40px;
@@ -123,45 +163,73 @@ body {
overflow: auto;
}
+#content .ui-widget-header {
+ border-color: #4297D7 #4297D7 #7BB642;
+ border-width: 1px 1px 4px;
+}
+
/*--------------- Groups ---------------*/
#groups {
width: 150px;
vertical-align: top;
float: left;
position: relative;
- margin: 15px 0px 15px 15px;
-}
-
-#groups ul {
- list-style: none;
+ margin-top: 10px;
}
#groups ul h3 {
text-transform: uppercase;
- font: 12px verdana, arial, helvetica, sans-serif;
- font-weight: bold;
color: #424242;
display: inline-table;
}
#groups a {
- font: 12px verdana, arial, helvetica, sans-serif;
color: #0000FF;
display: inline-table;
- padding: 5px 15px 5px 15px; /* Top right bottom left */
+ padding: 5px 0px 5px 20px; /* Top right bottom left */
text-decoration: none;
cursor: pointer;
}
-#groups a:hover {
- color: #FF0000;
+#groups .grouplabel {
+ padding: 5px 0px 5px 10px;
+ font-weight: bold;
+ font-size: 15px;
+}
+
+#groups .groupdiv{
+ padding-left: 10px;
+}
+
+#groups .groupdiv div:hover {
+ background: #E7EBFF;
+ cursor: pointer;
+}
+
+#groups .selectgroup {
+ background: #E6E6F2;
+ font-weight: bold;
+}
+
+#groups .actionDiv{
+ text-align: right;
+ padding-right: 5px;
+ border-top: thin solid #E7EBFF;
}
/*--------------- Nodes section ---------------*/
#nodes {
- width: 700px;
- margin: 20px;
- display: inline-table;
+ width: 790px;
+ min-height: 570px;
+ margin: 10px 0px 0px 0px;
+ padding: 0px 0px 0px 5px;
+ display: inline-block;
+ border-left: medium solid #E6E6F2;
+}
+
+#nodes .summarypie {
+ width: 370px;
+ height: 280px;
}
/*--------------- Info/warning bar ---------------*/
@@ -205,6 +273,7 @@ span.ui-icon-info {
.tab a {
cursor: pointer;
+ color: #0000FF;
}
.tab .ui-icon-close {
@@ -279,7 +348,7 @@ legend {
.tab li {
list-style: none;
padding: 5px;
- margin: 0;
+ margin: 1;
}
.tab textarea {
@@ -291,36 +360,56 @@ legend {
height: 300px;
}
-/*--------------- Actions bar ---------------*/
+/*--------------- menu Div Actions bar ---------------*/
+.menuDiv {
+ background:none repeat scroll 0 0 #79B7E7;
+ padding: 0.5em;
+}
+
+.sf-menu {
+ background : none repeat scroll 0 0 #79B7E7;
+ border :1px solid #f5f5f5;
+ border-radius :0.5em 0.5em 0.5em 0.5em;
+ margin-bottom: 0;
+}
+
+.sf-sub-indicator{
+ right:0;
+}
+
.actionBar {
display: inline-table;
+ width:50%;
}
.actionBar div {
padding: 10px 0px;
}
-.actionBar span {
- padding: 0px 10px;
+.actionBar a {
+ color: #FFFFFF;
+ font-weight: bold;
}
-.actionBar a {
- color: #2E6E9E;
- font-weight: bold;
- cursor: pointer;
+.actionBar a:hover {
+ color: #026890;
}
.actionBar li {
list-style: none;
- padding: 5px;
+ padding: 2px;
margin: 0;
}
/*--------------- jQuery datatable ---------------*/
.dataTables_wrapper {
overflow: auto;
- width: 700px;
- margin: 0px auto;
+ width: auto;
+ margin: 10px auto;
+ -moz-border-radius:5px;
+ -webkit-border-radius:5px;
+ border-radius:5px;
+ background-color: #f5f5f5;
}
/*** Show X entries ***/
@@ -333,11 +422,10 @@ legend {
/*** Search ***/
.dataTables_filter {
- width: 50%;
+ width: 40%;
display: block;
float: right;
text-align: right;
- padding: 10px 10px;
}
.tab input,select {
@@ -364,7 +452,7 @@ legend {
/*** Table ***/
.datatable {
- width: 660px;
+ width: 100%;
border-width: 1px;
border-spacing: 0px;
border-style: solid;
@@ -595,6 +683,47 @@ table a:hover {
}
/*--------------- Provision and monitor forms ---------------*/
+.rmcnormal {
+ border: 2px outset #7FFFD4;
+ background: #66CD00;
+ cursor: pointer;
+}
+
+.rmcwarning {
+ background: #FFD700;
+ border: 2px outset #EEEE00;
+ cursor: pointer;
+}
+
+.rmcerror {
+ background: #FF3030;
+ border: 2px outset #FF4040;
+}
+
+.rmcunknown {
+ background: #8B8B7A;
+ border: 2px outset #858585;
+}
+
+.rmcnodeli {
+ width: 16px;
+ height: 16px;
+ float: left;
+}
+
+.rmcsumdiv {
+ width: 300px;
+ height: 150px;
+ float: left;
+ margin: 0px 0px 10px 0px;
+}
+
+.rmcnodediv {
+ width: 240px;
+ height: 120px;
+ margin: 0px 0px 15px 0px;
+}
+
.provision div,.monitor div {
margin: 10px 0;
display: block;
@@ -609,19 +738,6 @@ table a:hover {
height: 150px;
}
-.monitorsumdiv {
- width: 300px;
- height: 150px;
- float: left;
- margin: 0px 0px 10px 0px;
-}
-
-.monitornodediv {
- width: 240px;
- height: 120px;
- margin: 0px 0px 15px 0px;
-}
-
/*--------------- Physical layout section ---------------*/
.frameDiv {
width: 179px;
@@ -685,28 +801,25 @@ table a:hover {
/*--------------- Discovery section ---------------*/
.discoverstep {
- width: 220px;
+ width: 960px;
vertical-align: top;
- float: left;
- position: relative;
- overflow: auto;
background-color: #A9D0F5;
- padding: 5px 0px;
+ padding: 0px 0px 0px 5px;
-moz-border-radius: .5em;
-webkit-border-radius: .5em;
border-radius: .5em;
}
-.discoverstep span {
+.discovercurrentstep{
+ background-color: yellow;
font: normal bold 12px/ 35px verdana, arial, helvetica, sans-serif;
padding: 5px;
- margin: 0px 5px; /* Top right left bottom*/
}
.discovercontent {
- width: 700px;
+ width: 960px;
display: inline-table;
- padding: 0 0 0 20px;
+ padding: 0;
}
.discovercontent table{
diff --git a/xCAT-UI/guide.php b/xCAT-UI/guide.php
new file mode 100644
index 000000000..8529d430a
--- /dev/null
+++ b/xCAT-UI/guide.php
@@ -0,0 +1,17 @@
+
\ No newline at end of file
diff --git a/xCAT-UI/images/logo.png b/xCAT-UI/images/logo.png
new file mode 100644
index 000000000..a4dd30cb9
Binary files /dev/null and b/xCAT-UI/images/logo.png differ
diff --git a/xCAT-UI/js/configure/discover.js b/xCAT-UI/js/configure/discover.js
index 96f14b51d..18a96f32d 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',
+var steps = ['Platform',
+ 'Patterns',
+ 'Supernode',
+ 'More patterns',
'Power on hardware',
'Discover frames',
- 'Prepare management node',
- 'Update definitions',
- 'Create LPARs',
+ 'Management node',
+ 'Update',
+ 'LPARs',
'Complete'];
/*associate the function with step number*/
@@ -70,10 +70,11 @@ function updateDiscoverStep(){
for (var index in steps){
showString += '' + steps[index] + '
';
+ showString += '>' + steps[index] + '->';
}
+ showString = showString.substr(0, showString.length - 2);
$('#discoverStepDiv').html(showString);
}
@@ -183,7 +184,7 @@ function createBackButton(){
function getDiscoverEnv(envName){
if (discoverEnv[envName]){
return discoverEnv[envName];
- }
+ }
else{
return '';
}
@@ -330,7 +331,6 @@ function initSelectPlatform(){
temp += '
This wizard will guide you through the process of defining the naming conventions within' +
'your cluster, discovering the hardware on your network, and automatically defining it in the xCAT' +
'database.
Choose which type of hardware you want to discover, and then click Next.
' +
+ $('#discoverContentDiv #siteTableStat div').html('Current network interface configuration:
' +
data.rsp + '
');
}
});
@@ -810,6 +810,7 @@ function calcEndIp(ipStart, num){
ipArray[0] = ipArray[0] + parseInt(sum / 255);
return (ipArray.join('.'));
}
+
/**
* Step 4: check the input are all filled
*
@@ -887,7 +888,7 @@ function initDiscoverFrames(){
+ ' ');
if (getDiscoverEnv('framemtmsmap')){
- $('#framedisc').html('Mapping the frame name and mtms which discovered by lsslp.
' +
+ $('#framedisc div').html('Mapping the frame name and mtms which discovered by lsslp.
' +
'Select the frame name, then select the mtms.');
var mapArray = getDiscoverEnv('framemtmsmap').split(':');
for(var i in mapArray){
@@ -899,7 +900,7 @@ function initDiscoverFrames(){
return;
}
- statBar.append('Discovering all Frames by lsslp.').append(createLoader());
+ statBar.find('div').append('Discovering all Frames by lsslp.').append(createLoader());
//use lsslp to find all bpas in cluster
$.ajax({
url : 'lib/cmd.php',
@@ -914,7 +915,7 @@ function initDiscoverFrames(){
success : function(data){
var tempInfo = data.rsp[0];
if (-1 != tempInfo.indexOf('Error')){
- $('#framedisc').html(tempInfo);
+ $('#framedisc div').html(tempInfo);
createDiscoverButtons();
return;
}
@@ -923,19 +924,18 @@ function initDiscoverFrames(){
var frameArray = expandNR(getDiscoverEnv('frameName'));
//chech the defined number and discovered number
if (mtmsArray.length != frameArray.length){
- $('#framedisc').html('Error: Definded Number is ' + frameArray.length +
+ $('#framedisc div').html('Error: Definded Number is ' + frameArray.length +
', but lsslp discovered Number is ' + mtmsArray.length + ', please check your configure!');
createDiscoverButtons();
return;
}
- $('#framedisc').html('Mapping the frame name and mtms which discovered by lsslp.
' +
+ $('#framedisc div').html('Mapping the frame name and mtms which discovered by lsslp.
' +
'Select the frame name, then select the mtms.');
for (var i in frameArray){
$('#frameTd').append('' +
frameArray[i] + '
');
-
}
for (var i in mtmsArray){
@@ -1081,6 +1081,7 @@ function initConfig(operType){
createSetupFile();
}
+
/**
* Step 7: create the xcat configure file
*
@@ -1174,6 +1175,7 @@ function runSetup(){
}
});
}
+
/**
* Step 7: create the dhcp configure file
*
@@ -1340,9 +1342,9 @@ function lsslpWriteHMC(){
tempSpan.addClass('ui-icon-check');
lsslpWriteCec();
}
- });
+ });
}
- });
+ });
}
});
}
diff --git a/xCAT-UI/js/configure/update.js b/xCAT-UI/js/configure/update.js
index 240de1fbe..f64199516 100644
--- a/xCAT-UI/js/configure/update.js
+++ b/xCAT-UI/js/configure/update.js
@@ -241,9 +241,9 @@ function updateRpm() {
});
$('#update').show();
- $('#update').empty();
- $('#update').append("Updating " + rpms + " from " + rpmPath + "
");
- $('#update').append("
");
+ $('#update div').empty();
+ $('#update div').append("Updating " + rpms + " from " + rpmPath + "
");
+ $('#update div').append("
");
$('#rpm button').attr('disabled', 'true');
// Send the update command to server
@@ -276,29 +276,29 @@ 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 div').append('' + resArray[resArray.length - 2] + '
');
} else {
- $('#update').append('' + resArray[resArray.length - 1] + '
');
+ $('#update div').append('' + resArray[resArray.length - 1] + '
');
}
// Create link to show details
- $('#update').append('
Show details');
- $('#update a').css( {
+ $('#update div').append('
Show details');
+ $('#update div a').css( {
'color' : '#0000FF',
'cursor' : 'pointer'
}).bind('click', function() {
// Toggle details and change text
$('#resDetail').toggle();
- if ($('#update a').text() == 'Show details') {
- $('#update a').text('Hide details');
+ if ($('#update div a').text() == 'Show details') {
+ $('#update div a').text('Hide details');
} else {
- $('#update a').text('Show details');
+ $('#update div a').text('Show details');
}
});
var resDetail = $('');
resDetail.hide();
- $('#update').append(resDetail);
+ $('#update div').append(resDetail);
for (temp = 0; temp < resArray.length; temp++) {
resDetail.append(resArray[temp] + '
');
}
diff --git a/xCAT-UI/js/custom/blade.js b/xCAT-UI/js/custom/blade.js
index 404a2f9f0..968126daf 100644
--- a/xCAT-UI/js/custom/blade.js
+++ b/xCAT-UI/js/custom/blade.js
@@ -126,7 +126,7 @@ bladePlugin.prototype.loadProvisionPage = function(tabId) {
// Create loader
var loader = createLoader('bladeProvisionLoader' + inst).hide();
- statBar.append(loader);
+ statBar.find('div').append(loader);
// Create info bar
var infoBar = createInfoBar('Provision a node on BladeCenter.');
@@ -201,5 +201,184 @@ bladePlugin.prototype.loadResources = function() {
* @return Nothing
*/
bladePlugin.prototype.addNode = function() {
- openDialog('info', 'Under construction');
-};
\ No newline at end of file
+ var nodeTypeSelectDia = $('');
+ nodeTypeSelectDia.append('');
+ //append the mm div
+ var mmStr = '' +
+ '
' +
+ '' +
+ '';
+
+ //append the blade div
+ var bladeStr = '' +
+ '
' +
+ '
' +
+ '
' +
+ 'JSLS
' +
+ '';
+ nodeTypeSelectDia.append(mmStr);
+ nodeTypeSelectDia.append(bladeStr);
+
+ nodeTypeSelectDia.find('#nodeTypeSelect').bind('change', function(){
+ $('#nodeTypeSelectDia .ui-state-error').remove();
+ $('#mmNode').toggle();
+ $('#bladeNode').toggle();
+ if ('mm' == $(this).val()){
+ return;
+ }
+
+ //get all mm nodes from the server side
+ $('#bladeNode select').empty();
+ $('#bladeNode').append(createLoader());
+
+ $.ajax({
+ url : 'lib/cmd.php',
+ dataType : 'json',
+ data : {
+ cmd : 'lsdef',
+ tgt : '',
+ args : '-t;node;-w;mgt==blade;-w;id==0',
+ msg : ''
+ },
+ success : function(data){
+ var position = 0;
+ var tempStr = '';
+ var options = '';
+ //remove the loading image
+ $('#bladeNode img').remove();
+
+ //check return result
+ if (1 > data.rsp.length){
+ $('#nodeTypeSelectDia').prepend(createWarnBar('Please define MM node first!'));
+ return;
+ }
+
+ //add all mm nodes to select
+ for (var i in data.rsp){
+ tempStr = data.rsp[i];
+ position = tempStr.indexOf(' ');
+ tempStr = tempStr.substring(0, position);
+ options += '';
+ }
+
+ $('#bladeNode select').append(options);
+ }
+ });
+ });
+
+ nodeTypeSelectDia.dialog( {
+ modal : true,
+ width : 400,
+ title : 'Select Node Type',
+ open : function(event, ui) {
+ $(".ui-dialog-titlebar-close").hide();
+ },
+ buttons : {
+ 'Ok' : function() {
+ //remove all error bar
+ $('#nodeTypeSelectDia .ui-state-error').remove();
+
+ if ($('#nodeTypeSelect').attr('value') == "mm") {
+ addMmNode();
+ }
+ else {
+ addBladeNode();
+ }
+ },
+ 'Cancel' : function() {
+ $(this).remove();
+ }
+ }
+ });
+};
+
+function addMmNode(){
+ var name = $('#ammName').val();
+ var ip = $('#ammIp').val();
+
+ if ((!name) || (!ip)){
+ $('#nodeTypeSelectDia').prepend(createWarnBar("You are missing some inputs!"));
+ return;
+ }
+
+ //add the loader
+ $('#nodeTypeSelectDia').prepend(createLoader());
+ $('.ui-dialog-buttonpane .ui-button').attr('disabled', true);
+ var argsTmp = '-t;node;-o;' + name +
+ ';id=0;nodetype=mm;groups=mm;mgt=blade;mpa=' + name + ';ip=' + ip;
+ $.ajax( {
+ url : 'lib/cmd.php',
+ dataType : 'json',
+ data : {
+ cmd : 'chdef',
+ tgt : '',
+ args : argsTmp,
+ msg : ''
+ },
+ success : function(data) {
+ $('#nodeTypeSelectDia').find('img').remove();
+ var messages = data.rsp;
+ var notes = "";
+ for ( var i = 0; i < messages.length; i++) {
+ notes += messages[i];
+ }
+ var info = createInfoBar(notes);
+ $('#nodeTypeSelectDia').prepend(info);
+ $('#nodeTypeSelectDia').dialog("option", "buttons", {
+ "close" : function() {
+ $('#nodeTypeSelectDia').remove();
+ }
+ });
+ }
+ });
+}
+
+function addBladeNode(){
+ var name = $('#bladeName').val();
+ var group = $('#bladeGroup').val();
+ var id = $('#bladeId').val();
+ var series = $("#bladeNode :checked").val();
+ var mpa = $('#mpaSelect').val();
+
+ var argsTmp = '-t;node;-o;' + name + ';id=' + id +
+ ';nodetype=osi;groups=' + group + ';mgt=blade;mpa=' + mpa + ';serialflow=hard';
+ if (series != 'js') {
+ argsTmp += ';serialspeed=19200;serialport=1';
+ }
+
+ if ((!name) || (!group) || (!id) || (!mpa)){
+ $('#nodeTypeSelectDia').prepend(createWarnBar("You miss some inputs."));
+ return;
+ }
+
+ //add loader and disable buttons
+ $('#nodeTypeSelectDia').prepend(createLoader());
+ $('.ui-dialog-buttonpane .ui-button').attr('disabled', true);
+ $.ajax( {
+ url : 'lib/cmd.php',
+ dataType : 'json',
+ data : {
+ cmd : 'chdef',
+ tgt : '',
+ args : argsTmp,
+ msg : ''
+ },
+ success : function(data) {
+ $('#nodeTypeSelectDia').find('img').remove();
+ var messages = data.rsp;
+ var notes = "";
+ for ( var i = 0; i < messages.length; i++) {
+ notes += messages[i];
+ }
+
+ $('#nodeTypeSelectDia').prepend(createInfoBar(notes));
+ $('#nodeTypeSelectDia').dialog("option", "buttons", {
+ "close" : function() {
+ $('#nodeTypeSelectDia').remove();
+ }
+ });
+ }
+ });
+
+}
\ No newline at end of file
diff --git a/xCAT-UI/js/custom/hmc.js b/xCAT-UI/js/custom/hmc.js
index 370927d09..33ba91f3b 100644
--- a/xCAT-UI/js/custom/hmc.js
+++ b/xCAT-UI/js/custom/hmc.js
@@ -162,7 +162,7 @@ hmcPlugin.prototype.loadProvisionPage = function(tabId) {
// Create loader
var loader = createLoader('loader').hide();
- statBar.append(loader);
+ statBar.find('div').append(loader);
// Create info bar
var infoBar = createInfoBar('Provision a node on System p.');
@@ -463,7 +463,7 @@ function pProvisionExisting(data) {
else if (cmd == 'nodeset') {
// Write ajax response to status bar
var prg = writeRsp(rsp, '');
- tempTab.find('#statBar').append(prg);
+ tempTab.find('#statBar div').append(prg);
// If there was an error, do not continue
if (prg.html().indexOf('Error') > -1) {
@@ -495,7 +495,7 @@ function pProvisionExisting(data) {
else if (cmd == 'rnetboot') {
// Write ajax response to status bar
var prg = writeRsp(rsp, '');
- tempTab.find('#statBar').append(prg);
+ tempTab.find('#statBar div').append(prg);
tempTab.find('#loader').remove();
}
}
diff --git a/xCAT-UI/js/custom/ipmi.js b/xCAT-UI/js/custom/ipmi.js
index a9c4f3a14..498465203 100644
--- a/xCAT-UI/js/custom/ipmi.js
+++ b/xCAT-UI/js/custom/ipmi.js
@@ -126,7 +126,7 @@ ipmiPlugin.prototype.loadProvisionPage = function(tabId) {
// Create loader
var loader = createLoader('ipmiProvisionLoader' + inst).hide();
- statBar.append(loader);
+ statBar.find('div').append(loader);
// Create info bar
var infoBar = createInfoBar('Provision a node on iDataPlex.');
@@ -201,5 +201,97 @@ ipmiPlugin.prototype.loadResources = function() {
* @return Nothing
*/
ipmiPlugin.prototype.addNode = function() {
- openDialog('info', 'Under construction');
-};
\ No newline at end of file
+ var diaDiv = $('');
+ var showStr = '' +
+ '' +
+ '' +
+ '' +
+ '' +
+ '' +
+ '';
+
+ diaDiv.append(showStr);
+ diaDiv.dialog({
+ modal: true,
+ width: 400,
+ close: function(){$(this).remove();},
+ buttons: {
+ "OK" : function(){addidataplexNode();},
+ "Cancel": function(){$(this).dialog('close');}
+ }
+ });
+};
+
+function addidataplexNode(){
+ var tempArray = new Array();
+ var errormessage = '';
+ var attr = '';
+ var args = '';
+
+ //remove the warning bar
+ $('#addIdpDiv .ui-state-error').remove();
+
+ //get all inputs' value
+ $('#addIdpDiv input').each(function(){
+ attr = $(this).val();
+ if (attr){
+ tempArray.push($(this).val());
+ }
+ else{
+ errormessage = "You are missing some input!";
+ return false;
+ }
+ });
+
+ if ('' != errormessage){
+ $('#addIdpDiv').prepend(createWarnBar(errormessage));
+ return;
+ }
+
+ //add the loader
+ $('#addIdpDiv').append(createLoader());
+
+ //change the dialog button
+ $('#addIdpDiv').dialog('option', 'buttons', {'Close':function(){$('#addIdpDiv').dialog('close');}});
+
+ //compose all args into chdef for node
+ args = '-t;node;-o;' + tempArray[0] + ';mac=' + tempArray[1] + ';ip=' + tempArray[2] + ';groups=' +
+ tempArray[3] + ';mgt=ipmi;chain="runcmd=bmcsetup";netboot=xnba;nodetype=osi;profile=compute;' +
+ 'bmc=' + tempArray[4];
+
+ $.ajax({
+ url : 'lib/cmd.php',
+ dataType : 'json',
+ data : {
+ cmd : 'chdef',
+ tgt : '',
+ args : args,
+ msg : ''
+ }
+ });
+
+ //compose all args into chdef for bmc
+ args = '-t;node;-o;' + tempArray[4] + ';ip=' + tempArray[5] + ';groups=' + tempArray[6];
+
+ $.ajax({
+ url : 'lib/cmd.php',
+ dataType : 'json',
+ data : {
+ cmd : 'chdef',
+ tgt : '',
+ args : args,
+ msg : ''
+ },
+ success: function(data){
+ $('#addIdpDiv img').remove();
+ var message = '';
+ for (var i in data.rsp){
+ message += data.rsp[i];
+ }
+
+ if ('' != message){
+ $('#addIdpDiv').prepend(createInfoBar(message));
+ }
+ }
+ });
+}
\ No newline at end of file
diff --git a/xCAT-UI/js/custom/zvm.js b/xCAT-UI/js/custom/zvm.js
index 7911eabc0..2fffae09a 100644
--- a/xCAT-UI/js/custom/zvm.js
+++ b/xCAT-UI/js/custom/zvm.js
@@ -263,7 +263,7 @@ zvmPlugin.prototype.loadClonePage = function(node) {
// Create loader
var loader = createLoader('');
- $('#' + statBarId).append(loader);
+ $('#' + statBarId).find('div').append(loader);
$('#' + statBarId).show();
// Disable clone button
@@ -309,7 +309,7 @@ zvmPlugin.prototype.loadInventory = function(data) {
// Add loader to status bar and hide it
var loader = createLoader(node + 'StatusBarLoader').hide();
- statBar.append(loader);
+ statBar.find('div').append(loader);
statBar.hide();
// Create array of property keys
@@ -841,7 +841,7 @@ zvmPlugin.prototype.loadProvisionPage = function(tabId) {
// Create loader
var loader = createLoader('zProvisionLoader' + inst).hide();
- statBar.append(loader);
+ statBar.find('div').append(loader);
// Create info bar
var infoBar = createInfoBar('Provision a node on System z.');
diff --git a/xCAT-UI/js/custom/zvmUtils.js b/xCAT-UI/js/custom/zvmUtils.js
index 14b0ef39e..616b63e0a 100644
--- a/xCAT-UI/js/custom/zvmUtils.js
+++ b/xCAT-UI/js/custom/zvmUtils.js
@@ -364,9 +364,9 @@ function updateZProvisionNewStatus(data) {
// If there was an error, do not continue
if (rsp.length) {
$('#' + loaderId).hide();
- $('#' + statBarId).append('(Error) Failed to create node definition
');
+ $('#' + statBarId).find('div').append('(Error) Failed to create node definition
');
} else {
- $('#' + statBarId).append('Node definition created for ' + node + '
');
+ $('#' + statBarId).find('div').append('Node definition created for ' + node + '
');
$.ajax( {
url : 'lib/cmd.php',
dataType : 'json',
@@ -389,9 +389,9 @@ function updateZProvisionNewStatus(data) {
// If there was an error, do not continue
if (rsp.length) {
$('#' + loaderId).hide();
- $('#' + statBarId).append('(Error) Failed to update /etc/hosts
');
+ $('#' + statBarId).find('div').append('(Error) Failed to update /etc/hosts
');
} else {
- $('#' + statBarId).append('/etc/hosts updated
');
+ $('#' + statBarId).find('div').append('/etc/hosts updated
');
$.ajax( {
url : 'lib/cmd.php',
dataType : 'json',
@@ -416,7 +416,7 @@ function updateZProvisionNewStatus(data) {
// Write ajax response to status bar
var prg = writeRsp(rsp, '');
- $('#' + statBarId).append(prg);
+ $('#' + statBarId).find('div').append(prg);
// Get user entry
var userEntry = $('#' + tabId + ' textarea').val();
@@ -443,14 +443,14 @@ function updateZProvisionNewStatus(data) {
else if (cmd == 'mkvm') {
// Write ajax response to status bar
var prg = writeRsp(rsp, '');
- $('#' + statBarId).append(prg);
+ $('#' + statBarId).find('div').append(prg);
// If there was an error, do not continue
if (prg.html().indexOf('Error') > -1) {
// Try again
var tries = parseInt($.cookie('tries4' + tabId));
if (tries < 2) {
- $('#' + statBarId).append('Trying again...
');
+ $('#' + statBarId).find('div').append('Trying again...
');
tries = tries + 1;
// One more try
@@ -532,7 +532,7 @@ function updateZProvisionNewStatus(data) {
else if (cmd == 'chvm') {
// Write ajax response to status bar
var prg = writeRsp(rsp, '');
- $('#' + statBarId).append(prg);
+ $('#' + statBarId).find('div').append(prg);
// If there was an error, do not continue
if (prg.html().indexOf('Error') > -1) {
@@ -541,7 +541,7 @@ function updateZProvisionNewStatus(data) {
// Try again
var tries = parseInt($.cookie('tries4' + tabId));
if (tries < 2) {
- $('#' + statBarId).append('Trying again...
');
+ $('#' + statBarId).find('div').append('Trying again...
');
tries = tries + 1;
// One more try
@@ -647,9 +647,9 @@ function updateZProvisionNewStatus(data) {
// If there was an error, do not continue
if (rsp.length) {
$('#' + loaderId).hide();
- $('#' + statBarId).append('(Error) Failed to set operating system
');
+ $('#' + statBarId).find('div').append('(Error) Failed to set operating system
');
} else {
- $('#' + statBarId).append('Operating system for ' + node + ' set
');
+ $('#' + statBarId).find('div').append('Operating system for ' + node + ' set
');
$.ajax( {
url : 'lib/cmd.php',
dataType : 'json',
@@ -671,7 +671,7 @@ function updateZProvisionNewStatus(data) {
else if (cmd == 'makedhcp') {
// Write ajax response to status bar
var prg = writeRsp(rsp, '');
- $('#' + statBarId).append(prg);
+ $('#' + statBarId).find('div').append(prg);
// Prepare node for boot
$.ajax( {
@@ -694,7 +694,7 @@ function updateZProvisionNewStatus(data) {
else if (cmd == 'nodeset') {
// Write ajax response to status bar
var prg = writeRsp(rsp, '');
- $('#' + statBarId).append(prg);
+ $('#' + statBarId).find('div').append(prg);
// If there was an error
// Do not continue
@@ -722,9 +722,9 @@ function updateZProvisionNewStatus(data) {
else if (cmd == 'rnetboot') {
// Write ajax response to status bar
var prg = writeRsp(rsp, '');
- $('#' + statBarId).append(prg);
+ $('#' + statBarId).find('div').append(prg);
if (prg.html().indexOf('Error') < 0) {
- $('#' + statBarId).append('Open a VNC viewer to see the installation progress. It might take a couple of minutes before you can connect.
');
+ $('#' + statBarId).find('div').append('Open a VNC viewer to see the installation progress. It might take a couple of minutes before you can connect.
');
}
// Hide loader
@@ -785,7 +785,7 @@ function updateZProvisionExistingStatus(data) {
else if (cmd == 'nodeset') {
// Write ajax response to status bar
var prg = writeRsp(rsp, '');
- $('#' + statBarId).append(prg);
+ $('#' + statBarId).find('div').append(prg);
// If there was an error, do not continue
if (prg.html().indexOf('Error') > -1) {
@@ -819,7 +819,7 @@ function updateZProvisionExistingStatus(data) {
else if (cmd == 'rnetboot') {
// Write ajax response to status bar
var prg = writeRsp(rsp, '');
- $('#' + statBarId).append(prg);
+ $('#' + statBarId).find('div').append(prg);
var loaderId = 'zProvisionLoader' + inst;
$('#' + loaderId).remove();
@@ -853,7 +853,7 @@ function updateZNodeStatus(data) {
// Write ajax response to status bar
var prg = writeRsp(rsp, '[A-Za-z0-9._-]+:');
- $('#' + statBarId).append(prg);
+ $('#' + statBarId).find('div').append(prg);
}
/**
@@ -883,9 +883,9 @@ function updateZCloneStatus(data) {
// If there was an error, do not continue
if (rsp.length) {
$('#' + out2Id).find('img').hide();
- $('#' + out2Id).append('(Error) Failed to create node definition
');
+ $('#' + out2Id).find('div').append('(Error) Failed to create node definition
');
} else {
- $('#' + out2Id).append('Node definition created for ' + node + '
');
+ $('#' + out2Id).find('div').append('Node definition created for ' + node + '
');
// If last node definition was created
var tmp = inst.split('/');
@@ -913,9 +913,9 @@ function updateZCloneStatus(data) {
// If there was an error, do not continue
if (rsp.length) {
$('#' + out2Id).find('img').hide();
- $('#' + out2Id).append('(Error) Failed to update /etc/hosts
');
+ $('#' + out2Id).find('div').append('(Error) Failed to update /etc/hosts
');
} else {
- $('#' + out2Id).append('/etc/hosts updated
');
+ $('#' + out2Id).find('div').append('/etc/hosts updated
');
$.ajax( {
url : 'lib/cmd.php',
dataType : 'json',
@@ -937,7 +937,7 @@ function updateZCloneStatus(data) {
else if (cmd == 'makedns') {
// Write ajax response to status bar
var prg = writeRsp(rsp, '');
- $('#' + out2Id).append(prg);
+ $('#' + out2Id).find('div').append(prg);
// Get clone tab
var tabId = out2Id.replace('CloneStatusBar', 'CloneTab');
@@ -997,7 +997,7 @@ function updateZCloneStatus(data) {
else if (cmd == 'mkvm') {
// Write ajax response to status bar
var prg = writeRsp(rsp, '');
- $('#' + out2Id).append(prg);
+ $('#' + out2Id).find('div').append(prg);
// Hide loader
$('#' + out2Id).find('img').hide();
diff --git a/xCAT-UI/js/monitor/gangliamon.js b/xCAT-UI/js/monitor/gangliamon.js
index 6d5b859b5..25c813ff0 100644
--- a/xCAT-UI/js/monitor/gangliamon.js
+++ b/xCAT-UI/js/monitor/gangliamon.js
@@ -2,7 +2,7 @@
* Global variables
*/
var gangliaTableId = 'nodesDatatable';
-var gangliaNodesList;
+var gangliaData;
/**
* Load Ganglia monitoring tool
@@ -31,7 +31,7 @@ function loadGangliaMon() {
gangliaTab.append(nodes);
// Create info bar
- var info = createInfoBar('Select a group to view its nodes');
+ var info = createInfoBar('Select a group to view the nodes summary');
nodes.append(info);
// Get groups
@@ -147,476 +147,111 @@ function checkGangliaRPMs(data) {
function loadGroups4Ganglia(data) {
// Remove loader
$('#groups').find('img').remove();
-
+
+ // Save group in cookie
var groups = data.rsp;
setGroupsCookies(data);
// Create a list of groups
- var ul = $('
');
- var item = $('Groups
');
- ul.append(item);
- var subUL = $('
');
- item.append(subUL);
-
+ $('#groups').append('Groups');
+ var grouplist= $('');
// Create a link for each group
- for ( var i = groups.length; i--;) {
- var subItem = $('');
- var link = $('' + groups[i] + '');
- subItem.append(link);
- subUL.append(subItem);
+ for (var i = groups.length; i--;) {
+ grouplist.append('');
}
+
+ $('#groups').append(grouplist);
+
+ // Bind the click event
+ $('#groups .groupdiv div').bind('click', function(){
+ $('#nodes .jqplot-target').remove();
+
+ // Create loader
+ var loader = createLoader();
+ loader.css('padding', '5px');
+ $('#nodes').append(loader);
+
+ var thisGroup = $(this).text();
+ $('#groups .groupdiv div').removeClass('selectgroup');
+ $(this).addClass('selectgroup');
+
+ $.ajax( {
+ url : 'lib/cmd.php',
+ dataType : 'json',
+ data : {
+ cmd : 'nodels',
+ tgt : thisGroup,
+ args : '',
+ msg : thisGroup
+ },
- // Turn groups list into a tree
- $('#groups').append(ul);
- $('#groups').jstree( {
- core : {
- "initially_open" : [ "root" ]
- },
- themes : {
- "theme" : "default",
- "dots" : false, // No dots
- "icons" : false // No icons
- }
- });
+ /**
+ * Get node definitions
+ *
+ * @param data
+ * Data returned from HTTP request
+ * @return Nothing
+ */
+ success : function(data) {
+ var group = data.msg;
+
+ // Get nodes definitions
+ $.ajax( {
+ url : 'lib/cmd.php',
+ dataType : 'json',
+ data : {
+ cmd : 'nodestat',
+ tgt : group,
+ args : '',
+ msg : group
+ },
- // Load nodes onclick
- $('#groups').bind('select_node.jstree', function(event, data) {
- // If there are subgroups, remove them
- data.rslt.obj.children('ul').remove();
- var thisGroup = jQuery.trim(data.rslt.obj.text());
- if (thisGroup) {
- // Clear nodes division
- $('#nodes').children().remove();
-
- // Create link to Ganglia
- var gangliaLnk = $('click here');
- gangliaLnk.css( {
- 'color' : 'blue',
- 'text-decoration' : 'none'
- });
- gangliaLnk.click(function() {
- // Open a new window for Ganglia
- window.open('../ganglia/');
- });
-
- // Create info bar
- var info = $('');
- info.append('');
- var msg = $('');
- msg.append('Review the nodes that are monitored by Ganglia. Install Ganglia onto a node you want to monitor by selecting it and clicking on Install. Turn on Ganglia monitoring for a node by selecting it and clicking on Monitor. If you are satisfied with the nodes you want to monitor, ');
- msg.append(gangliaLnk);
- msg.append(' to open the Ganglia page.');
- info.append(msg);
- info.css('margin-bottom', '10px');
- $('#nodes').append(info);
-
- // Create loader
- var loader = $(' ').append(createLoader());
-
- // Create a tab for this group
- var tab = new Tab();
- setNodesTab(tab);
- tab.init();
- $('#nodes').append(tab.object());
- tab.add('nodesTab', 'Nodes', loader, false);
-
- // To improve performance, get all nodes within selected group
- // Get node definitions only for first 50 nodes
- $.ajax( {
- url : 'lib/cmd.php',
- dataType : 'json',
- data : {
- cmd : 'nodels',
- tgt : thisGroup,
- args : '',
- msg : thisGroup
- },
-
- /**
- * Get node definitions for first 50 nodes
- *
- * @param data
- * Data returned from HTTP request
- * @return Nothing
- */
- success : function(data) {
- var rsp = data.rsp;
- var group = data.msg;
-
- // Save nodes in a list so it can be accessed later
- nodesList = new Array();
- for (var i in rsp) {
- if (rsp[i][0]) {
- nodesList.push(rsp[i][0]);
- }
- }
-
- // Sort nodes list
- nodesList.sort();
-
- // Get first 50 nodes
- var nodes = '';
- for (var i = 0; i < nodesList.length; i++) {
- if (i > 49) {
- break;
- }
-
- nodes += nodesList[i] + ',';
- }
-
- // Remove last comma
- nodes = nodes.substring(0, nodes.length-1);
-
- // Get nodes definitions
- $.ajax( {
- url : 'lib/cmd.php',
- dataType : 'json',
- data : {
- cmd : 'lsdef',
- tgt : '',
- args : nodes,
- msg : group
- },
-
- success : loadNodes4Ganglia
- });
- }
- });
-
- // Get subgroups within selected group
- // only when this is the parent group and not a subgroup
- if (data.rslt.obj.attr('id').indexOf('Subgroup') < 0) {
- $.ajax( {
- url : 'lib/cmd.php',
- dataType : 'json',
- data : {
- cmd : 'extnoderange',
- tgt : thisGroup,
- args : 'subgroups',
- msg : thisGroup
- },
-
- success : loadSubgroups
- });
+ success : loadGangliaSummary
+ });
}
- } // End of if (thisGroup)
+ });
});
}
/**
- * Load nodes belonging to a given group
+ * Load Ganglia summary page
*
* @param data
* Data returned from HTTP request
* @return Nothing
*/
-function loadNodes4Ganglia(data) {
+function loadGangliaSummary(data) {
// Data returned
var rsp = data.rsp;
// Group name
var group = data.msg;
// Node attributes hash
var attrs = new Object();
- // Node attributes
- var headers = new Object();
-
- // Variable to send command and request node status
- var getNodeStatus = true;
- var node, args;
+ var node, status, args;
for ( var i in rsp) {
- // Get the node
- var pos = rsp[i].indexOf('Object name:');
- if (pos > -1) {
- var temp = rsp[i].split(': ');
- node = jQuery.trim(temp[1]);
-
- // Create a hash for the node attributes
- attrs[node] = new Object();
- i++;
- }
-
// Get key and value
- args = rsp[i].split('=', 2);
- var key = jQuery.trim(args[0]);
- var val = jQuery.trim(rsp[i].substring(rsp[i].indexOf('=') + 1, rsp[i].length));
+ args = rsp[i].split(':', 2);
+ node = jQuery.trim(args[0]);
+ status = jQuery.trim(args[1]);
// Create a hash table
- attrs[node][key] = val;
- headers[key] = 1;
-
- // If the node status is available
- if (key == 'status') {
- // Do not send command to request node status
- getNodeStatus = false;
- }
+ attrs[node] = new Object();
+ attrs[node]['status'] = status;
}
- // Add nodes that are not in data returned
- for (var i in nodesList) {
- if (!attrs[nodesList[i]]) {
- // Create attributes list and save node name
- attrs[nodesList[i]] = new Object();
- attrs[nodesList[i]]['node'] = nodesList[i];
- }
- }
+ // Save node attributes hash
+ gangliaData = attrs;
- // Sort headers
- var sorted = new Array();
- for ( var key in headers) {
- // Do not put comments and status in
- if (key != 'usercomment' && key != 'status' && key.indexOf('statustime') < 0) {
- sorted.push(key);
- }
- }
- sorted.sort();
-
- // Add column for check box, node, ping, and power
- sorted.unshift('',
- 'node',
- 'status
',
- 'power
',
- 'ganglia
');
-
- // Create a datatable
- var gangliaTable = new DataTable(gangliaTableId);
- gangliaTable.init(sorted);
-
- // Go through each node
- for ( var node in attrs) {
- // Create a row
- var row = new Array();
-
- // Create a check box, node link, and get node status
- var checkBx = '';
- var nodeLink = $('' + node + '').bind('click', loadNode);
-
- // If there is no status attribute for the node, do not try to access hash table
- // Else the code will break
- var status = '';
- if (attrs[node]['status']) {
- status = attrs[node]['status'].replace('sshd', 'ping');
- }
-
- // Push in checkbox, node, status, and power
- row.push(checkBx, nodeLink, status, '', '');
-
- // Go through each header
- for ( var i = 5; i < sorted.length; i++) {
- // Add the node attributes to the row
- var key = sorted[i];
-
- // Do not put comments and status in
- if (key != 'usercomment' && key != 'status' && key.indexOf('statustime') < 0) {
- var val = attrs[node][key];
- if (val) {
- row.push(val);
- } else {
- row.push('');
- }
- }
- }
-
- // Add the row to the table
- gangliaTable.add(row);
- }
-
- // Clear the tab before inserting the table
- $('#nodesTab').children().remove();
-
- // Create action bar
- var actionBar = $('');
-
- /**
- * The following actions are available to perform against a given node:
- * power and monitor
- */
-
- /*
- * Power
- */
- var powerLnk = $('Power');
-
- // Power on
- var powerOnLnk = $('Power on');
- powerOnLnk.click(function() {
- var tgtNodes = getNodesChecked(gangliaTableId);
- if (tgtNodes) {
- powerNode(tgtNodes, 'on');
- }
- });
-
- // Power off
- var powerOffLnk = $('Power off');
- powerOffLnk.click(function() {
- var tgtNodes = getNodesChecked(gangliaTableId);
- if (tgtNodes) {
- powerNode(tgtNodes, 'off');
- }
- });
-
- // Power actions
- var powerActions = [ powerOnLnk, powerOffLnk ];
- var powerActionMenu = createMenu(powerActions);
-
- /*
- * Monitor
- */
- var monitorLnk = $('Monitor');
-
- // Turn monitoring on
- var monitorOnLnk = $('Monitor on');
- monitorOnLnk.click(function() {
- var tgtNodes = getNodesChecked(gangliaTableId);
- if (tgtNodes) {
- monitorNode(tgtNodes, 'on');
- }
- });
-
- // Turn monitoring off
- var monitorOffLnk = $('Monitor off');
- monitorOffLnk.click(function() {
- var tgtNodes = getNodesChecked(gangliaTableId);
- if (tgtNodes) {
- monitorNode(tgtNodes, 'off');
- }
- });
-
- // Install Ganglia
- var installLnk = $('Install');
- installLnk.click(function() {
- var tgtNodes = getNodesChecked(gangliaTableId);
- if (tgtNodes) {
- installGanglia(tgtNodes);
- }
- });
-
- // Power actions
- var monitorActions = [ monitorOnLnk, monitorOffLnk ];
- var monitorActionMenu = createMenu(monitorActions);
-
- // Create an action menu
- var actionsDIV = $('');
- var actions = [ [ powerLnk, powerActionMenu ], [ monitorLnk, monitorActionMenu ], installLnk ];
- var actionMenu = createMenu(actions);
- actionMenu.superfish();
- actionsDIV.append(actionMenu);
- actionBar.append(actionsDIV);
- $('#nodesTab').append(actionBar);
-
- // Insert table
- $('#nodesTab').append(gangliaTable.object());
-
- // Turn table into a datatable
- var gangliaDataTable = $('#' + gangliaTableId).dataTable({
- 'iDisplayLength': 50
- });
-
- // Filter table when enter key is pressed
- $('#' + gangliaTableId + '_filter input').unbind();
- $('#' + gangliaTableId + '_filter input').bind('keyup', function(e){
- if (e.keyCode == 13) {
- var table = $('#' + gangliaTableId).dataTable();
- table.fnFilter($(this).val());
-
- // If there are nodes found, get the node attributes
- if (!$('#' + gangliaTableId + ' .dataTables_empty').length) {
- getNodeAttrs4Ganglia(group);
- }
- }
- });
-
- // Load node definitions when next or previous buttons are clicked
- $('#' + gangliaTableId + '_next, #' + gangliaTableId + '_previous').click(function() {
- getNodeAttrs4Ganglia(group);
- });
-
- // Do not sort ping, power, and comment column
- var cols = $('#' + gangliaTableId + ' thead tr th').click(function() {
- getNodeAttrs4Ganglia(group);
- });
- var pingCol = $('#' + gangliaTableId + ' thead tr th').eq(2);
- var powerCol = $('#' + gangliaTableId + ' thead tr th').eq(3);
- var gangliaCol = $('#' + gangliaTableId + ' thead tr th').eq(4);
- pingCol.unbind('click');
- powerCol.unbind('click');
- gangliaCol.unbind('click');
-
- // Create enough space for loader to be displayed
- var style = {'min-width': '60px', 'text-align': 'center'};
- $('#' + gangliaTableId + ' tbody tr td:nth-child(3)').css(style);
- $('#' + gangliaTableId + ' tbody tr td:nth-child(4)').css(style);
- $('#' + gangliaTableId + ' tbody tr td:nth-child(5)').css(style);
-
- // Instead refresh the ping status and power status
- pingCol.find('span a').bind('click', function(event) {
- refreshNodeStatus(group, gangliaTableId);
- });
- powerCol.find('span a').bind('click', function(event) {
- refreshPowerStatus(group, gangliaTableId);
- });
- gangliaCol.find('span a').bind('click', function(event) {
- refreshGangliaStatus(group);
- });
-
- // Create tooltip for status
- var tooltipConf = {
- position: "center right",
- offset: [-2, 10],
- effect: "fade",
- opacity: 0.8,
- relative: true,
- predelay: 800
- };
-
- var pingTip = createStatusToolTip();
- pingCol.find('span').append(pingTip);
- pingCol.find('span a').tooltip(tooltipConf);
-
- // Create tooltip for power
- var powerTip = createPowerToolTip();
- powerCol.find('span').append(powerTip);
- powerCol.find('span a').tooltip(tooltipConf);
-
- // Create tooltip for ganglia
- var gangliaTip = createGangliaToolTip();
- gangliaCol.find('span').append(gangliaTip);
- gangliaCol.find('span a').tooltip(tooltipConf);
-
- /**
- * Get node and ganglia status
- */
-
- // If request to get node status is made
- if (getNodeStatus) {
- // Get the node status
- $.ajax( {
- url : 'lib/cmd.php',
- dataType : 'json',
- data : {
- cmd : 'nodestat',
- tgt : group,
- args : '',
- msg : ''
- },
-
- success : loadNodeStatus
- });
- } else {
- // Hide status loader
- var statCol = $('#' + gangliaTableId + ' thead tr th').eq(2);
- statCol.find('img').hide();
- }
-
// Get the status of Ganglia
- var nodes = getNodesShown(gangliaTableId);
+ // Then create pie chart for node and Ganglia status
$.ajax( {
url : 'lib/cmd.php',
dataType : 'json',
data : {
cmd : 'webrun',
tgt : '',
- args : 'gangliastatus;' + nodes,
+ args : 'gangliastatus;' + group,
msg : ''
},
@@ -632,448 +267,80 @@ function loadNodes4Ganglia(data) {
* @return Nothing
*/
function loadGangliaStatus(data) {
+ // Remove loader
+ $('#nodes').find('img').remove();
+
// Get datatable
- var datatable = $('#' + gangliaTableId).dataTable();
var ganglia = data.rsp;
- var rowNum, node, status, args;
+ var node, ping, monitored;
+ // Count nodes that are pingable and not pingable
+ // and nodes that are pingable and monitored by Ganglia
+ var pingWGanglia = 0;
+ var pingWOGanglia = 0;
+ var noping = 0;
for ( var i in ganglia) {
// ganglia[0] = nodeName and ganglia[1] = state
node = jQuery.trim(ganglia[i][0]);
- status = jQuery.trim(ganglia[i][1]);
-
- // Get the row containing the node
- rowNum = findRow(node, '#' + gangliaTableId, 1);
-
- // Update the power status column
- datatable.fnUpdate(status, rowNum, 4);
- }
-
- // Hide Ganglia loader
- var gangliaCol = $('#' + gangliaTableId + ' thead tr th').eq(4);
- gangliaCol.find('img').hide();
-}
-
-/**
- * Refresh the status of Ganglia for each node
- *
- * @param group
- * Group name
- * @return Nothing
- */
-function refreshGangliaStatus(group) {
- // Show ganglia loader
- var gangliaCol = $('#' + gangliaTableId + ' thead tr th').eq(4);
- gangliaCol.find('img').show();
-
- // Get power status for nodes shown
- var nodes = getNodesShown(gangliaTableId);
-
- // Get the status of Ganglia
- $.ajax( {
- url : 'lib/cmd.php',
- dataType : 'json',
- data : {
- cmd : 'webrun',
- tgt : '',
- args : 'gangliastatus;' + nodes,
- msg : ''
- },
-
- success : loadGangliaStatus
- });
-}
-
-/**
- * Turn on monitoring for a given node
- *
- * @param node
- * Node to monitor on or off
- * @param monitor
- * Monitor state, on or off
- * @return Nothing
- */
-function monitorNode(node, monitor) {
- if (monitor == 'on') {
- // Append loader to warning bar
- var gangliaLoader = createLoader('');
- var warningBar = $('#gangliamon').find('.ui-state-error p');
- if (warningBar.length) {
- warningBar.append(gangliaLoader);
- }
-
if (node) {
- // Check if ganglia RPMs are installed
- $.ajax( {
- url : 'lib/cmd.php',
- dataType : 'json',
- data : {
- cmd : 'webrun',
- tgt : '',
- args : 'gangliacheck;' + node,
- msg : node // Node range will be passed along in data.msg
- },
-
- /**
- * Start ganglia on a given node range
- *
- * @param data
- * Data returned from HTTP request
- * @return Nothing
- */
- success : function(data) {
- // Get response
- var out = data.rsp[0].split(/\n/);
-
- // Go through each line
- var warn = false;
- var warningMsg = '';
- for (var i in out) {
- // If an RPM is not installed
- if (out[i].indexOf('not installed') > -1) {
- warn = true;
-
- if (warningMsg) {
- warningMsg += '
' + out[i];
- } else {
- warningMsg = out[i];
- }
- }
- }
-
- // If there are warnings
- if (warn) {
- // Create warning bar
- var warningBar = createWarnBar(warningMsg);
- warningBar.css('margin-bottom', '10px');
- warningBar.prependTo($('#nodes'));
- } else {
- $.ajax( {
- url : 'lib/cmd.php',
- dataType : 'json',
- data : {
- cmd : 'webrun',
- tgt : '',
- args : 'gangliastart;' + data.msg,
- msg : ''
- },
-
- success : function(data) {
- // Remove any warnings
- $('#nodes').find('.ui-state-error').remove();
- $('#gangliamon').find('.ui-state-error').remove();
- }
- });
- } // End of if (warn)
- } // End of function(data)
- });
- } else {
- $.ajax( {
- url : 'lib/cmd.php',
- dataType : 'json',
- data : {
- cmd : 'webrun',
- tgt : '',
- args : 'gangliastart',
- msg : ''
- },
-
- success : function(data) {
- // Remove any warnings
- $('#gangliamon').find('.ui-state-error').remove();
- }
- });
- } // End of if (node)
- } else {
- var args;
- if (node) {
- args = 'gangliastop;' + node;
- } else {
- args = 'gangliastop';
- }
-
- $.ajax( {
- url : 'lib/cmd.php',
- dataType : 'json',
- data : {
- cmd : 'webrun',
- tgt : '',
- args : args,
- msg : ''
- },
-
- success : function(data) {
- // Do nothing
- }
- });
- }
-}
-
-/**
- * Get attributes for nodes not yet initialized
- *
- * @param group
- * Group name
- * @return Nothing
- */
-function getNodeAttrs4Ganglia(group) {
- // Get datatable headers and rows
- var headers = $('#' + gangliaTableId + ' thead tr th');
- var nodes = $('#' + gangliaTableId + ' tbody tr');
-
- // Find group column
- var head, groupsCol;
- for (var i = 0; i < headers.length; i++) {
- head = headers.eq(i).html();
- if (head == 'groups') {
- groupsCol = i;
- break;
- }
- }
-
- // Check if groups definition is set
- var node, cols;
- var tgtNodes = '';
- for (var i = 0; i < nodes.length; i++) {
- cols = nodes.eq(i).find('td');
- if (!cols.eq(groupsCol).html()) {
- node = cols.eq(1).text();
- tgtNodes += node + ',';
- }
- }
-
- // If there are node definitions to load
- if (tgtNodes) {
- // Remove last comma
- tgtNodes = tgtNodes.substring(0, tgtNodes.length-1);
-
- // Get node definitions
- $.ajax( {
- url : 'lib/cmd.php',
- dataType : 'json',
- data : {
- cmd : 'lsdef',
- tgt : '',
- args : tgtNodes,
- msg : group
- },
-
- success : addNodes2GangliaTable
- });
-
- // Create dialog to indicate table is updating
- var update = $(''
- + ' Updating table 
'
- +'');
- update.dialog({
- modal: true,
- width: 300,
- position: 'center'
- });
- }
-}
-
-/**
- * Add nodes to datatable
- *
- * @param data
- * Data returned from HTTP request
- * @return Nothing
- */
-function addNodes2GangliaTable(data) {
- // Data returned
- var rsp = data.rsp;
- // Group name
- var group = data.msg;
- // Hash of node attributes
- var attrs = new Object();
- // Node attributes
- var headers = $('#' + gangliaTableId + ' thead tr th');
-
- // Variable to send command and request node status
- var getNodeStatus = true;
-
- // Go through each attribute
- var node, args;
- for (var i in rsp) {
- // Get node name
- if (rsp[i].indexOf('Object name:') > -1) {
- var temp = rsp[i].split(': ');
- node = jQuery.trim(temp[1]);
-
- // Create a hash for node attributes
- attrs[node] = new Object();
- i++;
- }
-
- // Get key and value
- args = rsp[i].split('=', 2);
- var key = jQuery.trim(args[0]);
- var val = jQuery.trim(rsp[i].substring(rsp[i].indexOf('=') + 1, rsp[i].length));
-
- // Create a hash table
- attrs[node][key] = val;
-
- // If node status is available
- if (key == 'status') {
- // Do not request node status
- getNodeStatus = false;
- }
- }
-
- // Set the first four headers
- var headersCol = new Object();
- headersCol['node'] = 1;
- headersCol['status'] = 2;
- headersCol['power'] = 3;
- headersCol['ganglia'] = 4;
-
- // Go through each header
- for (var i = 5; i < headers.length; i++) {
- // Get the column index
- headersCol[headers.eq(i).html()] = i;
- }
-
- // Go through each node
- var datatable = $('#' + gangliaTableId).dataTable();
- var rows = datatable.fnGetData();
- for (var node in attrs) {
- // Get row containing node
- var nodeRowPos;
- for (var i in rows) {
- // If column contains node
- if (rows[i][1].indexOf('>' + node + '<') > -1) {
- nodeRowPos = i;
- break;
+ monitored = jQuery.trim(ganglia[i][1]);
+ ping = gangliaData[node]['status'];
+
+ // If the node is monitored, increment count
+ if (ping == 'sshd' && monitored == 'on') {
+ pingWGanglia++;
+ } else if (ping == 'sshd' && monitored == 'off') {
+ pingWOGanglia++;
+ } else {
+ noping++;
}
}
-
- // Get node status
- var status = '';
- if (attrs[node]['status']){
- status = attrs[node]['status'].replace('sshd', 'ping');
- }
+ }
- rows[nodeRowPos][headersCol['status']] = status;
-
- // Go through each header
- for (var key in headersCol) {
- // Do not put comments and status in twice
- if (key != 'usercomment' && key != 'status' && key.indexOf('statustime') < 0) {
- var val = attrs[node][key];
- if (val) {
- rows[nodeRowPos][headersCol[key]] = val;
- }
- }
- }
+ // Create pie chart
+ var summary = $('');
+ $('#nodes').append(summary);
+
+ // Create pie details
+ var details = $('');
+ $('#nodes').append(details);
- // Update row
- datatable.fnUpdate(rows[nodeRowPos], nodeRowPos, 0, false);
- }
-
- // Enable node link
- $('.node').bind('click', loadNode);
-
- // Close dialog for updating table
- $('.ui-dialog-content').dialog('close');
+ var pie = [['Ping + monitored', pingWGanglia], ['Ping + not monitored', pingWOGanglia], ['Noping', noping]];
+ var plot = $.jqplot('ganglia_sum',
+ [pie], {
+ seriesDefaults: {
+ renderer: $.jqplot.PieRenderer,
+ rendererOptions: {
+ padding: 5,
+ fill:true,
+ shadow:true,
+ shadowOffset: 2,
+ shadowDepth: 5,
+ shadowAlpha: 0.07,
+ dataLabels : 'value',
+ showDataLabels: true
+ }
+ },
+ legend: {
+ show: true,
+ location: 'e'
+ }
+ });
- // If request to get node status is made
- if (getNodeStatus) {
- // Get the node status
- $.ajax( {
- url : 'lib/cmd.php',
- dataType : 'json',
- data : {
- cmd : 'nodestat',
- tgt : group,
- args : '',
- msg : ''
- },
-
- success : loadNodeStatus
- });
- } else {
- // Hide status loader
- var statCol = $('#' + gangliaTableId + ' thead tr th').eq(2);
- statCol.find('img').hide();
- }
-
- // Get the status of Ganglia
- var nodes = getNodesShown(gangliaTableId);
- $.ajax( {
- url : 'lib/cmd.php',
- dataType : 'json',
- data : {
- cmd : 'webrun',
- tgt : '',
- args : 'gangliastatus;' + nodes,
- msg : ''
- },
-
- success : loadGangliaStatus
+ // Change CSS styling for legend
+ summary.find('table').css({
+ 'border-style': 'none'
+ }).find('td').css({
+ 'border-style': 'none'
});
-}
-/**
- * Create a tool tip for ganglia status
- *
- * @return Tool tip
- */
-function createGangliaToolTip() {
- // Create tooltip container
- var toolTip = $('Click here to refresh the Ganglia status').css({
- 'width': '150px'
- });
- return toolTip;
-}
-
-/**
- * Install Ganglia on a given node
- *
- * @param node
- * Node to install Ganglia on
- * @return Nothing
- */
-function installGanglia(node) {
- // (1) Find xCAT-dep repository
- $.ajax( {
- url : 'lib/cmd.php',
- dataType : 'json',
- data : {
- cmd : 'webrun',
- tgt : '',
- args : 'installganglia;' + node,
- msg : node
- },
-
- success : updateGangliaInstall
+ // Open nodes page on-click
+ $('#ganglia_sum').bind('jqplotDataClick', function(env, srIndex, ptIndex, data) {
+ window.open('../xcat/index.php');
});
-}
-
-/**
- * Update Ganglia install status
- *
- * @param data
- * Data returned from HTTP request
- * @return Nothing
- */
-function updateGangliaInstall(data) {
- // Create message in info box
- var msg = '';
- for (var i in data.rsp) {
- msg += data.rsp[i] + '
';
- }
- msg += '';
- // Create an info box
- var bar = createInfoBar(msg);
-
- // Prepend info or warning bar to tab
- bar.prependTo($('#gangliamon #nodes'));
- bar.css({
- 'overflow': 'hidden',
- 'margin-bottom': '10px',
- 'width': '750px'
- });
- bar.delay(8000).slideUp();
+ // Special note
+ // To redraw pie chart:
+ // - Use chart.series[0].data[i] to reference existing data
+ // - Use chart.redraw() to redraw chart
}
\ No newline at end of file
diff --git a/xCAT-UI/js/monitor/rmcmon.js b/xCAT-UI/js/monitor/rmcmon.js
index f751f9216..094394dbd 100644
--- a/xCAT-UI/js/monitor/rmcmon.js
+++ b/xCAT-UI/js/monitor/rmcmon.js
@@ -1,55 +1,53 @@
-var globalErrNodes;
-var globalNodesDetail;
+var globalNodesDetail= new Object();
var globalAllNodesNum = 0;
var globalFinishNodesNum = 0;
-var globalSelectedAttributes = '';
var globalTimeStamp;
var globalCondition = '';
var globalResponse = new Object();
-function loadRmcMon(){
- //find the rmcmon tab
- var rmcMonTab = $('#rmcmon');
-
- //add the stauts bar first. id = 'rmcMonStatus'
- var rmcStatusBar = createStatusBar('rmcMonStatus');
- rmcStatusBar.append(createLoader());
- rmcMonTab.append(rmcStatusBar);
-
- //add the configure button.
- var configButton = createButton('Configure');
- configButton.hide();
- configButton.click(function(){
- if ($('#rmcMonConfig').is(':hidden')){
- $('#rmcMonConfig').show();
- }
- else{
- $('#rmcMonConfig').hide();
- }
- });
- rmcMonTab.append(configButton);
-
- //add configure div
- rmcMonTab.append("");
- $('#rmcMonConfig').hide();
-
- //load the configure div's content
- loadRmcMonConfigure();
-
- //add the content of the rmcmon, id = 'rmcMonTab'
- rmcMonTab.append("");
- $('#nodeDetail').hide();
-
- //check the software work status by platform(linux and aix)
- $.ajax( {
- url : 'lib/systemcmd.php',
- dataType : 'json',
- data : {
- cmd : 'ostype'
- },
+function loadRmcMon() {
+ //find the rmcmon tab
+ var rmcMonTab = $('#rmcmon');
- success : rsctRpmCheck
- });
+ //add the stauts bar first. id = 'rmcMonStatus'
+ var rmcStatusBar = createStatusBar('rmcMonStatus');
+ rmcStatusBar.find('div').append(createLoader());
+ rmcMonTab.append(rmcStatusBar);
+
+ //add the configure button.
+ var configButton = createButton('Configure');
+ configButton.hide();
+ configButton.click(function() {
+ if ($('#rmcMonConfig').is(':hidden')) {
+ $('#rmcMonConfig').show();
+ }
+ else {
+ $('#rmcMonConfig').hide();
+ }
+ });
+ rmcMonTab.append(configButton);
+
+ //add configure div
+ rmcMonTab.append("");
+ $('#rmcMonConfig').hide();
+
+ //load the configure div's content
+ loadRmcMonConfigure();
+
+ //add the content of the rmcmon, id = 'rmcMonTab'
+ rmcMonTab.append("");
+ $('#nodeDetail').hide();
+
+ //check the software work status by platform(linux and aix)
+ $.ajax( {
+ url : 'lib/systemcmd.php',
+ dataType : 'json',
+ data : {
+ cmd : 'ostype'
+ },
+
+ success : rsctRpmCheck
+ });
}
function loadRmcMonConfigure(){
@@ -61,19 +59,19 @@ function loadRmcMonConfigure(){
var startButton = createButton('Start');
rmcmonCfgDiv.append(startButton);
startButton.click(function(){
- $('#rmcMonStatus').empty().append(createLoader());
+ $('#rmcMonStatus div').empty().append(createLoader());
$.ajax({
url : 'lib/cmd.php',
dataType : 'json',
data : {
cmd : 'webrun',
tgt : '',
- args : 'rmcstart;lpar',
+ args : 'rmcstart;compute',
msg : ''
},
success : function(data){
- $('#rmcMonStatus').empty().append(data.rsp[0]);
+ $('#rmcMonStatus div').empty().append(data.rsp[0]);
}
});
});
@@ -82,7 +80,7 @@ function loadRmcMonConfigure(){
var stopButton = createButton('Stop');
rmcmonCfgDiv.append(stopButton);
stopButton.click(function(){
- $('#rmcMonStatus').empty().append(createLoader());
+ $('#rmcMonStatus div').empty().append(createLoader());
$.ajax({
url : 'lib/cmd.php',
dataType : 'json',
@@ -94,17 +92,11 @@ function loadRmcMonConfigure(){
},
success : function(data){
- $('#rmcMonStatus').empty().append(data.rsp[0]);
+ $('#rmcMonStatus div').empty().append(data.rsp[0]);
}
});
});
- //add the attributes button
- var attrButton = createButton('Attribute Select');
- rmcmonCfgDiv.append(attrButton);
- attrButton.bind('click',function(){
- showConfigureDia();
- });
//add the cancel button
var cancelButton = createButton('Cancel');
rmcmonCfgDiv.append(cancelButton);
@@ -125,7 +117,7 @@ function rsctRpmCheck(data){
success : function(data){
if (-1 != data.rsp.indexOf("not")){
- $('#rmcMonStatus').empty().append(
+ $('#rmcMonStatus div').empty().append(
'Please install the RSCT first.
' +
'You can find more support from xCAT2-Monitoring.pdf');
}
@@ -151,24 +143,24 @@ function xcatrmcRpmCheck(){
success : function(data){
var softInstallStatus = data.rsp.split(/\n/);
var needHelp = false;
- $('#rmcMonStatus').empty();
+ $('#rmcMonStatus div').empty();
//check the xcat-rmc
if (-1 != softInstallStatus[0].indexOf("not")){
needHelp = true;
- $('#rmcMonStatus').append(
+ $('#rmcMonStatus div').append(
'Please install the xCAT-rmc first.
');
}
//check the rrdtool
if (-1 != softInstallStatus[1].indexOf("not")){
needHelp = true;
- $('#rmcMonStatus').append(
+ $('#rmcMonStatus div').append(
'Please install the RRD-tool first.
');
}
//add help info or load the rmc show
if (needHelp){
- $('#rmcMonStatus').append(
+ $('#rmcMonStatus div').append(
'You can find more support form xCAT2-Monitoring.pdf');
}
else{
@@ -179,8 +171,8 @@ function xcatrmcRpmCheck(){
}
function rmcWorkingCheck(){
- $('#rmcMonStatus').empty().append("Checking RMC working status.");
- $('#rmcMonStatus').append(createLoader());
+ $('#rmcMonStatus div').empty().append("Checking RMC working status.");
+ $('#rmcMonStatus div').append(createLoader());
$('#rmcmon button:first').show();
$.ajax({
url : 'lib/cmd.php',
@@ -194,7 +186,7 @@ function rmcWorkingCheck(){
success : function(data){
if (-1 != data.rsp[0].indexOf("not-monitored")){
- $('#rmcMonStatus').empty().append("Please start the RMC Monitoring first.");
+ $('#rmcMonStatus div').empty().append("Please start the RMC Monitoring first.");
return;
}
loadRmcMonShow();
@@ -202,17 +194,17 @@ function rmcWorkingCheck(){
});
}
+function removeStatusBar(){
+ if (globalAllNodesNum == globalFinishNodesNum){
+ $('#rmcMonStatus').remove();
+ }
+
+ $('#rmcmonDetail [title]').tooltip({position:['center','right']});
+}
+
function loadRmcMonShow(){
- $('#rmcMonStatus').empty().append("Getting monitoring Data (This step may take a long time).");
- $('#rmcMonStatus').append(createLoader());
-
- //init the selected Attributes string
- if ($.cookie('rmcmonattr')){
- globalSelectedAttributes = $.cookie('rmcmonattr');
- }
- else{
- globalSelectedAttributes = 'PctTotalTimeIdle,PctTotalTimeWait,PctTotalTimeUser,PctTotalTimeKernel,PctRealMemFree';
- }
+ $('#rmcMonStatus div').empty().append("Getting Summary Data.");
+ $('#rmcMonStatus div').append(createLoader());
//load the rmc status summary
$.ajax({
@@ -221,7 +213,7 @@ function loadRmcMonShow(){
data : {
cmd : 'webrun',
tgt : '',
- args : 'rmcshow;summary;' + globalSelectedAttributes,
+ args : 'rmcshow;summary;PctTotalTimeIdle,PctRealMemFree',
msg : ''
},
@@ -231,415 +223,286 @@ function loadRmcMonShow(){
});
}
-function showRmcSummary(returnData){
- var attributes = returnData.split(';');
- var attr;
- var attrName;
- var attrValues;
- var attrDiv;
- var summaryTable = $('
');
- var summaryRow;
- globalTimeStamp = new Array();
- //load each nodes' status
- $.ajax({
- url : 'lib/cmd.php',
- dataType : 'json',
- data : {
- cmd : 'webrun',
- tgt : '',
- args : 'rmcshow;lpar;' + globalSelectedAttributes,
- msg : ''
- },
-
- success : function(data){
- parseRmcData(data.rsp);
- }
- });
-
- //create the timestamp, the flot only use the UTC time, so had to change the value, to show the right time
- var tempDate = new Date();
- var tempOffset = tempDate.getTimezoneOffset();
- var tempTime = tempDate.getTime() - 3600000 - tempOffset * 60000;
-
- for (var i = 0; i < 60; i++){
- globalTimeStamp.push(tempTime + i * 60000);
- }
-
- //show the summary data
- $('#rmcmonSummary').empty().append('Overview
');
- $('#rmcmonSummary').append(summaryTable);
-
- for ( attr in attributes){
- var tempTd = $(' ');
- var tempArray = [];
- var temp = attributes[attr].indexOf(':');
- attrName = attributes[attr].substr(0, temp);
- attrValues = attributes[attr].substr(temp + 1).split(',');
- for (var i in attrValues){
- tempArray.push([globalTimeStamp[i], attrValues[i]]);
- }
+function showRmcSummary(returnData) {
+ var attributes = returnData.split(';');
+ var attr;
+ var attrName;
+ var attrValues;
+ var attrDiv;
+ var summaryTable = $('
');
+ var summaryRow;
+ globalTimeStamp = new Array();
- if (0 == (attr % 3)){
- summaryRow = $(' ');
- summaryTable.append(summaryRow);
- }
- summaryRow.append(tempTd);
- attrDiv = $('');
- tempTd.append(attrDiv);
- $.plot(attrDiv, [tempArray], {xaxis: {mode:"time"}});
- attrDiv.append('' + attrName + ' ');
-
- }
+ //update the rmc status area
+ $('#rmcMonStatus div').empty().append("Getting Nodes' Data").append(createLoader());
+ //load each nodes' status
+ $.ajax( {
+ url : 'lib/cmd.php',
+ dataType : 'json',
+ data : {
+ cmd : 'webrun',
+ tgt : '',
+ args : 'rmcshow;compute;PctTotalTimeIdle,PctRealMemFree',
+ msg : ''
+ },
+
+ success : function(data) {
+ parseRmcData(data.rsp);
+ }
+ });
+
+ //create the timestamp, the flot only use the UTC time, so had to change
+ //the value, to show the right time
+ var tempDate = new Date();
+ var tempOffset = tempDate.getTimezoneOffset();
+ var tempTime = tempDate.getTime() - 3600000;
+ for ( var i = 0; i < 60; i++) {
+ tempDate.setTime(tempTime + i * 60000);
+ globalTimeStamp.push(tempDate.getTime());
+ }
+
+ //show the summary data
+ $('#rmcmonSummary').empty().append('Overview
');
+ $('#rmcmonSummary').append(summaryTable);
+
+ for (attr in attributes) {
+ var tempTd = $(' ');
+ var tempArray = [];
+ var temp = attributes[attr].indexOf(':');
+ attrName = attributes[attr].substr(0, temp);
+ attrValues = attributes[attr].substr(temp + 1).split(',');
+
+ if (0 == (attr % 3)) {
+ summaryRow = $(' ');
+ summaryTable.append(summaryRow);
+ }
+ summaryRow.append(tempTd);
+ attrDiv = $('');
+ tempTd.append(attrDiv);
+ for ( var i in attrValues) {
+ tempArray.push( [ globalTimeStamp[i], Number(attrValues[i]) ]);
+ }
+
+ $.jqplot('monitorsumdiv' + attr, [ tempArray ], {
+ series : [ {
+ showMarker : false
+ } ],
+ axes : {
+ xaxis : {
+ label : attrName,
+ renderer : $.jqplot.DateAxisRenderer,
+ numberTicks : 5,
+ tickOptions : {
+ formatString : '%R',
+ show : true,
+ fontSize : '10px'
+ }
+ },
+ yaxis : {
+ tickOptions : {
+ formatString : '%.2f',
+ fontSize : '10px'
+ }
+ }
+ }
+ });
+ }
}
function parseRmcData(returnData){
- var nodeName;
- var nodeStatus;
- var nodeChat;
-
- //clean all the history data, because all of the follow variables are global
- globalAllNodesNum = returnData.length;
- globalFinishNodesNum = 0;
- globalErrNodes = {};
- globalNodesDetail = {};
-
- for (var i in returnData){
- var temp = returnData[i].indexOf(':');;
- nodeName = returnData[i].substr(0, temp);
- nodeStatus = returnData[i].substr(temp + 1).replace(/(^\s*)|(\s*$)/g, '');
-
- //not active nodes
- if ('OK' != nodeStatus){
- globalErrNodes[nodeName] = nodeStatus;
- globalFinishNodesNum ++;
- if (globalFinishNodesNum == globalAllNodesNum){
- showDetail();
- }
- continue;
- }
-
- //ok
- $.ajax({
- url : 'lib/cmd.php',
- dataType : 'json',
- data : {
- cmd : 'webrun',
- tgt : '',
- args : 'rmcshow;' + nodeName + ';' + globalSelectedAttributes,
- msg : nodeName
- },
-
- success : function(data){
- var tempObject = {};
- for (var i in data.rsp){
- var temp = data.rsp[i].indexOf(':');
- var attrName = data.rsp[i].substr(0, temp);
- tempObject[attrName] = data.rsp[i].substr(temp + 1);
- }
- globalNodesDetail[data.msg] = tempObject;
- globalFinishNodesNum++;
- if (globalFinishNodesNum == globalAllNodesNum){
- showDetail();
- }
- }
- });
- }
+ var nodeName;
+ var nodeStatus;
+
+ $('#rmcmonDetail').empty().append('Detail
');
+
+ //add the table for show nodes
+ var detailUl = $('
');
+ //update the table area
+ $('#rmcmonDetail ul').remove();
+ $('#rmcmonDetail').append(detailUl);
+
+ globalAllNodesNum = returnData.length;
+ globalFinishNodesNum = 0;
+ for(var i in returnData){
+ var temp = returnData[i].indexOf(':');;
+ nodeName = returnData[i].substr(0, temp);
+ nodeStatus = returnData[i].substr(temp + 1).replace(/(^\s*)|(\s*$)/g, '');
+
+ if ('OK' != nodeStatus){
+ globalFinishNodesNum++;
+ detailUl.append(createUnkownNode(nodeName));
+ removeStatusBar();
+ continue;
+ }
+ $.ajax({
+ url : 'lib/cmd.php',
+ dataType : 'json',
+ data : {
+ cmd : 'webrun',
+ tgt : '',
+ args : 'rmcshow;' + nodeName + ';PctTotalTimeIdle,PctRealMemFree',
+ msg : nodeName
+ },
+
+ success : function(data){
+ showRmcNodes(data.rsp, data.msg);
+ }
+ });
+ }
}
-function showDetail(){
- var nodeChat;
- var select;
-
- var detailFilter = $('');
-
- $('#rmcMonStatus').empty().append("RMC Monitoring Show");
- $('#rmcmonDetail').empty().append('Detail
');
- $('#rmcmonDetail').append(detailFilter);
-
- select = $('');
- for (var node in globalNodesDetail){
- for (var attr in globalNodesDetail[node]){
- select.append('');
- }
- break;
- }
-
- detailFilter.append('Metric: ');
- detailFilter.append(select);
- detailFilter.append(' ');
-
- //sort type
- select = $('');
- select.append('');
- select.append('');
- select.append('');
-
- detailFilter.append('Sort: ');
- detailFilter.append(select);
- detailFilter.append(' ');
-
- var filterButton = createButton('Filter');
- detailFilter.append(filterButton);
- filterButton.bind('click', function(){
- var attr = $('#metric').val();
- var type = $('#sortType').val();
- showAllNodes(attr, type);
- });
-
- filterButton.trigger('click');
+function createUnkownNode(nodeName){
+ var tempLi = 'Unknown">';
+ return tempLi;
}
-function showAllNodes(attrName, type){
- $('#rmcmonDetail table').remove();
- var detailTable = $('
');
- //remember how many nodes parsed, used for adding new table row
- var parseNum = 0;
- var detailRow;
- var sortArray = new Array();
-
- $('#rmcmonDetail').append(detailTable);
-
- for (var nodeName in globalErrNodes){
- var tempTd = $(' ');
- if (0 == (parseNum % 4)){
- detailRow = $(' ');
- detailTable.append(detailRow);
- }
- detailRow.append(tempTd);
- parseNum ++;
- nodeChat = $('');
-
- if ('NA' == globalErrNodes[nodeName]){
- nodeChat.css('background-color', '#f47a55');
- nodeChat.append(' Not Active
');
- }
- else if ('NI' == globalErrNodes[nodeName]){
- nodeChat.css('background-color', '#ffce7b');
- nodeChat.append('' + nodeName + '\'s RSCT is not installed.
');
- }
- else if ('NR' == globalErrNodes[nodeName]){
- nodeChat.css('background-color', '#ffce7b');
- nodeChat.append('' + nodeName + '\'s RSCT is not started.
');
- }
- tempTd.append(nodeChat);
- tempTd.append('' + nodeName + ' ');
- }
-
- filterSort(attrName, type, sortArray);
- for (var sortIndex in sortArray){
- var tempTd = $(' ');
- if (0 == (parseNum % 4)){
- detailRow = $(' ');
- detailTable.append(detailRow);
- }
- detailRow.append(tempTd);
- parseNum ++;
- nodeChat = $('');
- tempTd.append(nodeChat);
-
-
- var tempData = sortArray[sortIndex]['value'].split(',');
- var tempArray = [];
- for (var i in tempData){
- tempArray.push([globalTimeStamp[i], tempData[i]]);
- }
- $.plot(nodeChat, [tempArray], {xaxis: {mode:"time", tickSize: [20, "minute"]}});
-
- tempTd.append('' + sortArray[sortIndex]['name'] + ' ');
- tempTd.css('cursor', 'pointer');
- tempTd.bind('click', function(){
- showNode($('center', $(this)).html());
- });
- }
+function createErrorNode(nodeName){
+ var tempLi = 'Error">';
}
-function showNode(nodeName){
- var nodeTable = $('
');
- var backButton = createButton('Go back to all nodes');
- var nodeRow;
- var parseNum = 0;
-
- $('#rmcmonDetail').hide();
- $('#nodeDetail').empty().show();
- $('#nodeDetail').append('' + nodeName +' Detail
');
- $('#nodeDetail').append(backButton);
- backButton.bind('click', function(){
- $('#nodeDetail').hide();
- $('#rmcmonDetail').show();
- });
-
- $('#nodeDetail').append(nodeTable);
-
- for(var attr in globalNodesDetail[nodeName]){
- var tempTd = $(' ');
- var attrChat = $('');
- if (0 == parseNum % 4){
- nodeRow = $(' ');
- nodeTable.append(nodeRow);
- }
- nodeRow.append(tempTd);
- parseNum++;
-
- //data
- tempTd.append(attrChat);
- var tempData = globalNodesDetail[nodeName][attr].split(',');
- var tempArray = [];
- for (var i in tempData){
- tempArray.push([globalTimeStamp[i], tempData[i]]);
- }
-
- $.plot(attrChat, [tempArray], {xaxis: {mode:"time", tickSize: [20, "minute"]}});
- attrChat.append('' + attr +' ');
- }
+function showRmcNodes(data, nodename) {
+ var attrname = '';
+ var values = '';
+ var position = 0;
+ var index = 0;
+ var classname = '';
+ var tempObj = {};
+
+ for (index in data){
+ position = data[index].indexOf(':');
+ attrname = data[index].substr(0, position);
+ values = data[index].substr(position + 1);
+ //error node, can not get the last hour's data
+ if ('' == values){
+ $('#rmcmonDetail ul').append(createErrorNode(nodename));
+ if (globalNodesDetail[nodename]){
+ delete(globalNodesDetail[nodename]);
+ }
+ return;
+ }
+
+ //normal node, save the values
+ tempObj[attrname] = values;
+ }
+
+ globalNodesDetail[nodename] = tempObj;
+
+ //get each average
+ var cpuAvg = 0;
+ var memAvg = 0;
+ var tempSum = 0;
+ var tempArray = globalNodesDetail[nodename]['PctTotalTimeIdle'].split(',');
+ for (index = 0; index < tempArray.length; index++){
+ tempSum += Number(tempArray[index]);
+ }
+ cpuAvg = parseInt(tempSum / index);
+
+ tempArray = globalNodesDetail[nodename]['PctRealMemFree'].split(',');
+ tempSum = 0;
+ for (index = 0; index < tempArray.length; index++){
+ tempSum += Number(tempArray[index]);
+ }
+ memAvg = parseInt(tempSum / index);
+
+ if (cpuAvg >= 10 && memAvg <= 90){
+ classname = 'rmcnormal';
+ }
+ else{
+ classname = 'rmcwarning';
+ }
+
+ var normalLi = $('');
+
+ $('#rmcmonDetail ul').append(normalLi);
+ normalLi.bind('click', function() {
+ showNode($(this).attr('id'));
+ });
+
+ //check if the process finished
+ globalFinishNodesNum++;
+ removeStatusBar();
}
-function filterSort(attrName, sortType, retArray){
- var tempObj = {};
-
- for (var node in globalNodesDetail){
- tempObj['name'] = node;
- tempObj['value'] = globalNodesDetail[node][attrName];
- retArray.push(tempObj);
- }
-
- //by node name
- if (3 == sortType){
- retArray.sort(sortName);
- }
- //desend
- else if (2 == sortType){
- retArray.sort(sortDes);
- }
- //ascend
- else{
- retArray.sort(sortAsc);
- }
-
- return;
-}
+function showNode(nodeName) {
+ var nodeTable = $('
');
+ var backButton = createButton('Go back to all nodes');
+ var nodeRow;
+ var parseNum = 0;
-function sortAsc(x, y){
- if (x['value'] > y['value']){
- return 1;
- }
- else{
- return -1;
- }
-}
+ $('#rmcmonDetail').hide();
+ $('#nodeDetail').empty().show();
+ $('#nodeDetail').append('' + nodeName + ' Detail
');
+ $('#nodeDetail').append(backButton);
+ backButton.bind('click', function() {
+ $('#nodeDetail').hide();
+ $('#rmcmonDetail').show();
+ });
-function sortDes(x, y){
- if (x['value'] > y['value']){
- return -1;
- }
- else{
- return 1;
- }
-}
+ $('#nodeDetail').append(nodeTable);
-function sortName(x, y){
- if (x['name'] > y['name']){
- return 1;
- }
- else{
- return -1;
- }
-}
+ for ( var attr in globalNodesDetail[nodeName]) {
+ var tempTd = $(' ');
+ var attrChat = $('');
+ if (0 == parseNum % 4) {
+ nodeRow = $(' ');
+ nodeTable.append(nodeRow);
+ }
+ nodeRow.append(tempTd);
+ parseNum++;
-function showConfigureDia(){
- var diaDiv = $('');
- var tempArray = globalSelectedAttributes.split(',');
- var selectedAttrHash = new Object();
- var wholeAttrArray = new Array('PctTotalTimeIdle','PctTotalTimeWait','PctTotalTimeUser','PctTotalTimeKernel','PctRealMemFree');
-
- //init the selectedAttrHash
- for (var i in tempArray){
- selectedAttrHash[tempArray[i]] = 1;
- }
- var attrTable = $('
');
- for (var i in wholeAttrArray){
- var name = wholeAttrArray[i];
- var tempString = '';
- if (selectedAttrHash[name]){
- tempString += ' ';
- }
- else{
- tempString += ' ';
- }
-
- tempString += '' + name + ' ';
- attrTable.append(tempString);
- }
-
- var selectAllButton = createButton('Select All');
- selectAllButton.bind('click', function(){
- $('#rmcAttrTable input[type=checkbox]').attr('checked', true);
- });
- diaDiv.append(selectAllButton);
-
- var unselectAllButton = createButton('Unselect All');
- unselectAllButton.bind('click', function(){
- $('#rmcAttrTable input[type=checkbox]').attr('checked', false);
- });
- diaDiv.append(unselectAllButton);
-
- diaDiv.append(attrTable);
-
- diaDiv.dialog({
- modal: true,
- width: 400,
- close: function(event, ui){
- $(this).remove();
- },
- buttons: {
- cancel : function(){
- $(this).dialog('close');
- },
- ok : function(){
- //collect all attibutes' name
- var str = '';
- $('#rmcAttrTable input:checked').each(function(){
- if ('' == str){
- str += $(this).attr('name');
- }
- else{
- str += ',' + $(this).attr('name');
- }
- });
-
- //if no attribute is selected, alert the information.
- if ('' == str){
- alert('Please select one attribute at lease!');
- return;
- }
-
- //new selected attributes is different from the old, update the cookie and reload this tab
- if ($.cookie('rmcmonattr') != str){
- $.cookie('rmcmonattr', str, {path : '/xcat', expires : 10});
- //todo reload the tab
- $('#rmcmon').empty();
- loadRmcMon();
- }
- $(this).dialog('close');
- }
- }
- });
+ // data
+ tempTd.append(attrChat);
+ var tempData = globalNodesDetail[nodeName][attr].split(',');
+ var tempArray = [];
+ for ( var i in tempData) {
+ tempArray.push( [ globalTimeStamp[i], Number(tempData[i]) ]);
+ }
+
+ $.jqplot('monitornodediv' + nodeName + attr, [ tempArray ], {
+ series : [ {
+ showMarker : false
+ } ],
+ axes : {
+ xaxis : {
+ label : attr,
+ renderer : $.jqplot.DateAxisRenderer,
+ numberTicks : 5,
+ tickOptions : {
+ formatString : '%R',
+ show : true,
+ fontSize : '10px'
+ }
+ },
+ yaxis : {
+ tickOptions : {
+ formatString : '%.2f',
+ fontSize : '10px'
+ }
+ }
+ }
+ });
+ }
}
/*===========RMC Event Tab============*/
/**
* load the rmc event tab.
*
- * @param
+ * @param
*
* @return
- *
+ *
*/
function loadRmcEvent(){
//find the rmcevent tab
//add the stauts bar first. id = 'rmcMonStatus'
var rmcStatusBar = createStatusBar('rmcEventStatus');
- rmcStatusBar.append(createLoader());
+ rmcStatusBar.find('div').append(createLoader());
$('#rmcevent').append(rmcStatusBar);
$('#rmcevent').append('');
@@ -658,14 +521,14 @@ function loadRmcEvent(){
}
/**
- * get all conditions
+ * get all conditions
*
* @return
- *
+ *
*/
function getConditions(){
if ('' == globalCondition){
- $('#rmcEventStatus').empty().append('Getting predefined conditions').append(createLoader());
+ $('#rmcEventStatus div').empty().append('Getting predefined conditions').append(createLoader());
$.ajax({
url : 'lib/cmd.php',
dataType : 'json',
@@ -677,7 +540,7 @@ function getConditions(){
},
success : function (data){
- $('#rmcEventStatus').empty();
+ $('#rmcEventStatus div').empty();
$('#rmcEventButtons').show();
globalCondition = data.rsp[0];
}
@@ -689,10 +552,10 @@ function getConditions(){
}
/**
- * get all response
+ * get all response
*
* @return
- *
+ *
*/
function getResponse(){
var tempFlag = false;
@@ -726,18 +589,18 @@ function getResponse(){
}
/**
- * show all the event in the rmc event tab
+ * show all the event in the rmc event tab
*
* @param data response from the xcat server.
* @return
- *
+ *
*/
function showEventLog(data){
- $('#rmcEventStatus').empty();
- //rsct not installed.
+ $('#rmcEventStatus div').empty();
+ // rsct not installed.
if (data.rsp[0] && (-1 != data.rsp[0].indexOf('lsevent'))){
- $('#rmcEventStatus').append('Please install RSCT first!');
+ $('#rmcEventStatus div').append('Please install RSCT first!');
return;
}
var eventDiv = $('#rmcEventDiv');
@@ -777,7 +640,7 @@ function showEventLog(data){
* @param
* @return
- *
+ *
*/
function loadRmcEventConfig(){
var buttons = $('');
@@ -808,7 +671,7 @@ function loadRmcEventConfig(){
* @param
* @return
- *
+ *
*/
function mkCondRespDia(){
var diaDiv = $('');
@@ -883,6 +746,7 @@ function mkCondRespDia(){
var oldResp = new Object();
var oldString = '';
var newString = '';
+
//get the old seelected responses
var conditionName = $(this).find('#mkAssCond :checked').attr('value');
if (!conditionName){
@@ -896,6 +760,7 @@ function mkCondRespDia(){
for (var i in tempArray){
oldResp[tempArray[i]] = 1;
}
+
//get the new selected responses
$(this).find('#mkAssResp input:checked').each(function(){
var respName = $(this).attr('value');
@@ -926,7 +791,7 @@ function mkCondRespDia(){
}
if (('' != oldString) || ('' != newString)){
- $('#rmcEventStatus').empty().append('Create/Remove associations').append(createLoader());
+ $('#rmcEventStatus div').empty().append('Create/Remove associations').append(createLoader());
$.ajax({
url : 'lib/cmd.php',
dataType : 'json',
@@ -938,7 +803,7 @@ function mkCondRespDia(){
},
success : function(data){
- $('#rmcEventStatus').empty().append(data.rsp[0]);;
+ $('#rmcEventStatus div').empty().append(data.rsp[0]);;
}
});
}
@@ -954,7 +819,7 @@ function mkCondRespDia(){
* @param
* @return
- *
+ *
*/
function chCondScopeDia(){
var diaDiv = $('');
@@ -1032,7 +897,7 @@ function chCondScopeDia(){
$('#changeStatus').append(data.rsp[0]);
}
else{
- $('#rmcEventStatus').empty().append(data.rsp[0]);
+ $('#rmcEventStatus div').empty().append(data.rsp[0]);
$('#chScopeDiaDiv').remove();
}
}
@@ -1048,7 +913,7 @@ function chCondScopeDia(){
* @param
* @return
- *
+ *
*/
function mkResponseDia(){
var diaDiv = $('');
@@ -1079,7 +944,7 @@ function mkResponseDia(){
* @param
* @return
- *
+ *
*/
function startStopCondRespDia(){
var diaDiv = $('');
@@ -1169,7 +1034,7 @@ function startStopCondRespDia(){
var button = $('#divStartStopAss button[name="' + conditionName + '"]');
if (data.rsp[0]){
- $('#rmcEventStatus').empty().append('Getting associations\' status').append(createLoader());
+ $('#rmcEventStatus div').empty().append('Getting associations\' status').append(createLoader());
$('#rmcEventButtons').hide();
button.html(newOperationType);
button.parent().prev().html(associationStatus);
@@ -1193,7 +1058,7 @@ function startStopCondRespDia(){
* @param
* @return
- *
+ *
*/
function stopCondRespDia(){
var diaDiv = $('');
@@ -1236,7 +1101,7 @@ function stopCondRespDia(){
alert('Select condition name please.');
return;
}
- $('#rmcEventStatus').empty().append('Stoping monitor on ' + conditionName).append(createLoader());
+ $('#rmcEventStatus div').empty().append('Stoping monitor on ' + conditionName).append(createLoader());
$.ajax({
url : 'lib/cmd.php',
dataType : 'json',
@@ -1248,7 +1113,7 @@ function stopCondRespDia(){
},
success : function(data){
- $('#rmcEventStatus').empty().append(data.rsp[0]);
+ $('#rmcEventStatus div').empty().append(data.rsp[0]);
}
});
$(this).dialog('close');
@@ -1263,7 +1128,7 @@ function stopCondRespDia(){
* @param
* @return
- *
+ *
*/
function createConditionTd(cond){
var conditions = cond.split(';');
@@ -1286,7 +1151,7 @@ function createConditionTd(cond){
* @param
* @return
- *
+ *
*/
function createAssociationTable(cond){
var conditions = cond.split(';');
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/mtm.js b/xCAT-UI/js/nodes/mtm.js
index 5abccd693..d5bd26017 100644
--- a/xCAT-UI/js/nodes/mtm.js
+++ b/xCAT-UI/js/nodes/mtm.js
@@ -33,6 +33,6 @@ var hardwareInfo = {
'9117-MMB' : [ 'P7-770', '4' ],
'9119-FHB' : [ 'P7-795', '42' ],
'9179-MHB' : [ 'P7-780', '42' ],
- '9125-F2C' : [ 'P7-IH', '2'], //fsp
- '78AC-100' : [ 'P7-IH', '2'] //fsp
+ '9125-F2C' : [ 'Power 775', '2'],
+ '78AC-100' : [ 'Power 775', '2'] //fsp
};
\ No newline at end of file
diff --git a/xCAT-UI/js/nodes/nodes.js b/xCAT-UI/js/nodes/nodes.js
index bc577a5c4..0769e1711 100644
--- a/xCAT-UI/js/nodes/nodes.js
+++ b/xCAT-UI/js/nodes/nodes.js
@@ -11,6 +11,8 @@ var nodeAttrs;
var nodesList;
// Nodes datatable ID
var nodesTableId = 'nodesDatatable';
+// provision clock for provision progress stop
+var provisionClock;
/**
* Set node tab
@@ -83,12 +85,131 @@ function loadNodesPage() {
msg : ''
},
- success : loadGroups
+ success : function(data){
+ loadGroups(data);
+ // draw cluster's summary by group names
+ loadPieSummary();
+ }
});
-
}
}
+/**
+ * show cluster's summary in pie chats
+ *
+ * @return Nothing
+ */
+function loadPieSummary(){
+ $('#nodes').append('Cluster Summary
');
+ var summaryTable = '' +
+ '' +
+ ' ' +
+ ' ' +
+ ' ' +
+ '' +
+ ' ' +
+ ' ' +
+ '
';
+ $('#nodes').append(summaryTable);
+
+ $('#nodes .summarypie').append(createLoader());
+
+ $.ajax({
+ url : 'lib/cmd.php',
+ dataType : 'json',
+ data : {
+ cmd : 'webrun',
+ tgt : '',
+ args : 'summary',
+ msg : ''
+ },
+ success:function(data){
+ for(var i in data.rsp){
+ drawPieSummary(i, data.rsp[i]);
+ }
+ }
+ });
+}
+
+/**
+ * use nodels to get nodes' information and call jqplot to draw on the page
+ *
+ * @return Nothing
+ */
+function drawPieSummary(index, valuepair){
+ var position = 0;
+ var key = '';
+ var val = '';
+ var chattitle = '';
+ var dataArray = [];
+ var tempArray = [];
+ var container = $('#nodes .summarypie').eq(index);
+
+ position = valuepair.indexOf('=');
+ chattitle = valuepair.substr(0, position);
+ tempArray = valuepair.substr(position + 1).split(';');
+
+ for (var i in tempArray){
+ position = tempArray[i].indexOf(':');
+ key = tempArray[i].substr(0, position);
+ val = Number(tempArray[i].substr(position + 1));
+ dataArray.push([key,val]);
+ }
+
+ container.empty();
+ var plot = $.jqplot(container.attr('id'),
+ [dataArray],
+ {
+ title: chattitle,
+ seriesDefaults: {
+ renderer: $.jqplot.PieRenderer,
+ rendererOptions: {
+ padding: 5,
+ fill: true,
+ shadow: true,
+ shadowOffset: 2,
+ shadowDepth: 5,
+ shadowAlpha: 0.07,
+ dataLabels : 'value',
+ showDataLabels: true
+ }
+ },
+ legend: {
+ show:true,
+ location: 'e'
+ }
+ });
+ container.bind('jqplotDataClick',loadSummaryDetail);
+ container.bind('jqplotDataHighlight',function(){this.style.cursor='pointer';});
+ container.bind('jqplotDataUnhighlight',function(){this.style.cursor='';});
+}
+
+function loadSummaryDetail(ev, seriesIndex, pointIndex, data){
+ var temp = $(this).attr('id');
+ temp = temp.replace('pie', '');
+ var table = '';
+ switch(temp){
+ case 'os':
+ case 'arch':
+ case 'provmethod':
+ case 'nodetype':{
+ table = 'nodetype';
+ }
+ break;
+ case 'status': {
+ table = 'nodelist';
+ }
+ break;
+ }
+
+ var args = table + '.' + temp + '==';
+ if(data[0] != 'unknown'){
+ args += data[0];
+ }
+
+ drawNodesArea('', args, '');
+}
+
/**
* Load groups
*
@@ -105,144 +226,122 @@ function loadGroups(data) {
setGroupsCookies(data);
// Create a list of groups
- var list = $('
');
- var item = $('Groups
');
- var subList = $('
');
- list.append(item);
- item.append(subList);
-
+ $('#groups').append('Groups');
+ var grouplist= $('');
// Create a link for each group
for (var i = groups.length; i--;) {
- var subItem = $('');
- var link = $('' + groups[i] + '');
- subItem.append(link);
- subList.append(subItem);
+ grouplist.append('');
}
-
- // Turn groups list into a tree
- $('#groups').append(list);
- $('#groups').jstree( {
- core : { "initially_open" : [ "root" ] },
- themes : {
- "theme" : "default",
- "dots" : false, // No dots
- "icons" : false // No icons
- }
- });
- // Load nodes onclick
- $('#groups').bind('select_node.jstree', function(event, data) {
- // If there are subgroups, remove them
- data.rslt.obj.children('ul').remove();
-
- var thisGroup = jQuery.trim(data.rslt.obj.text());
- if (thisGroup) {
- // Clear nodes division
- $('#nodes').children().remove();
-
- // Create loader
- var loader = $(' ').append(createLoader());
-
- // Create a tab for this group
- var tab = new Tab('nodesPageTabs');
- setNodesTab(tab);
- tab.init();
- $('#nodes').append(tab.object());
- tab.add('nodesTab', 'Nodes', loader, false);
- tab.add('graphTab', 'Graphical', '', false);
-
- $('#nodesPageTabs').bind('tabsselect', function(event, ui){
- //for the graphical tab, we should check the graphical data first
- if (1 == ui.index){
- createPhysicalLayout(nodesList);
- }
- });
- // To improve performance, get all nodes within selected group
- // Get node definitions only for first 50 nodes
- $.ajax( {
- url : 'lib/cmd.php',
- dataType : 'json',
- data : {
- cmd : 'nodels',
- tgt : thisGroup,
- args : '',
- msg : thisGroup
- },
+ $('#groups').append(grouplist);
+
+ // bind the click event
+ $('#groups .groupdiv div').bind('click', function(){
+ var thisGroup = $(this).text();
+ $('#groups .groupdiv div').removeClass('selectgroup');
- /**
- * Get node definitions for first 50 nodes
- *
- * @param data
- * Data returned from HTTP request
- * @return Nothing
- */
- success : function(data) {
- var rsp = data.rsp;
- var group = data.msg;
-
- // Save nodes in a list so it can be accessed later
- nodesList = new Array();
- for (var i in rsp) {
- if (rsp[i][0]) {
- nodesList.push(rsp[i][0]);
- }
- }
-
- // Sort nodes list
- nodesList.sort();
-
- // Get first 50 nodes
- var nodes = '';
- for (var i = 0; i < nodesList.length; i++) {
- if (i > 49) {
- break;
- }
-
- nodes += nodesList[i] + ',';
- }
-
- // Remove last comma
- nodes = nodes.substring(0, nodes.length-1);
-
- // Get nodes definitions
- $.ajax( {
- url : 'lib/cmd.php',
- dataType : 'json',
- data : {
- cmd : 'lsdef',
- tgt : '',
- args : nodes,
- msg : group
- },
-
- success : loadNodes
- });
-
- }
- });
-
- // Get subgroups within selected group
- // only when this is the parent group and not a subgroup
- if (data.rslt.obj.attr('id').indexOf('Subgroup') < 0) {
- $.ajax( {
- url : 'lib/cmd.php',
- dataType : 'json',
- data : {
- cmd : 'extnoderange',
- tgt : thisGroup,
- args : 'subgroups',
- msg : thisGroup
- },
-
- success : loadSubgroups
- });
- }
-
- } // End of if (thisGroup)
+ $(this).addClass('selectgroup');
+ drawNodesArea(thisGroup,'',thisGroup);
});
// Make a link to add nodes
- $('#groups').append(mkAddNodeLink());
+ $('#groups').append('');
+ $('#groups #adddiv').append(mkAddNodeLink());
+}
+
+/**
+ * empty the nodes area, and add two tabs for add loading nodes result
+ *
+ * @param targetgroup: the name range for nodels command
+ * arguments: filter arguments for nodels command
+ * message: the useful information for the http request
+ *
+ * @return
+ */
+function drawNodesArea(targetgroup, cmdargs, message){
+ // Clear nodes division
+ $('#nodes').empty();
+
+ // Create loader
+ var loader = $(' ').append(createLoader());
+
+ // Create a tab for this group
+ var tab = new Tab('nodesPageTabs');
+ setNodesTab(tab);
+ tab.init();
+ $('#nodes').append(tab.object());
+ tab.add('nodesTab', 'Table', loader, false);
+ tab.add('graphTab', 'Graphic', '', false);
+
+ $('#nodesPageTabs').bind('tabsselect', function(event, ui){
+ // for the graphical tab, we should check the graphical data first
+ if (1 == ui.index){
+ createPhysicalLayout(nodesList);
+ }
+ });
+ // To improve performance, get all nodes within selected group
+ // Get node definitions only for first 50 nodes
+ $.ajax( {
+ url : 'lib/cmd.php',
+ dataType : 'json',
+ data : {
+ cmd : 'nodels',
+ tgt : targetgroup,
+ args : cmdargs,
+ msg : message
+ },
+
+ /**
+ * Get node definitions for first 50 nodes
+ *
+ * @param data
+ * Data returned from HTTP request
+ * @return Nothing
+ */
+ success : function(data) {
+ var rsp = data.rsp;
+ var group = data.msg;
+
+ // Save nodes in a list so it can be accessed later
+ nodesList = new Array();
+ for (var i in rsp) {
+ if (rsp[i][0]) {
+ nodesList.push(rsp[i][0]);
+ }
+ }
+
+ // Sort nodes list
+ nodesList.sort();
+
+ // Get first 50 nodes
+ var nodes = '';
+ for (var i = 0; i < nodesList.length; i++) {
+ if (i > 49) {
+ break;
+ }
+
+ nodes += nodesList[i] + ',';
+ }
+
+ // Remove last comma
+ nodes = nodes.substring(0, nodes.length-1);
+
+ // Get nodes definitions
+ $.ajax( {
+ url : 'lib/cmd.php',
+ dataType : 'json',
+ data : {
+ cmd : 'lsdef',
+ tgt : '',
+ args : nodes,
+ msg : targetgroup
+ },
+
+ success : loadNodes
+ });
+
+ }
+ });
}
/**
@@ -252,7 +351,7 @@ function loadGroups(data) {
*/
function mkAddNodeLink() {
// Create link to add nodes
- var addNodeLink = $('Add node');
+ var addNodeLink = $('+ Add Node');
addNodeLink.click(function() {
// Create info bar
var info = createInfoBar('Select the hardware management for the new node range');
@@ -262,16 +361,19 @@ function mkAddNodeLink() {
addNodeForm.append(info);
addNodeForm.append(''
+ ''
+ '');
// Create advanced link to set advanced node properties
var advanced = $('');
- var advancedLnk = $('Advanced').css('cursor', 'pointer');
+ var advancedLnk = $('Advanced').css({
+ 'cursor': 'pointer',
+ 'color': '#0000FF'
+ });
advancedLnk.click(function() {
// Get node attributes
$.ajax( {
@@ -309,6 +411,8 @@ function mkAddNodeLink() {
addNodeForm.dialog({
modal: true,
width: 400,
+ title:'Add Node',
+ close: function(){$(this).remove();},
buttons: {
'Ok': function(){
// Get hardware management
@@ -396,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 = '';
@@ -452,11 +554,12 @@ function loadNodes(data) {
}
sorted.sort();
- // Add column for check box, node, ping, power, and comments
+ // Add column for check box, node, ping, power, monitor, and comments
sorted.unshift('',
'node',
'status
',
'power
',
+ 'monitor
',
'comments');
// Create a datatable
@@ -479,8 +582,8 @@ function loadNodes(data) {
status = attrs[node]['status'].replace('sshd', 'ping');
}
- // Push in checkbox, node, status, and power
- row.push(checkBx, nodeLink, status, '');
+ // Push in checkbox, node, status, monitor, and power
+ row.push(checkBx, nodeLink, status, '', '');
// If the node attributes are known (i.e the group is known)
if (attrs[node]['groups']) {
@@ -523,7 +626,7 @@ function loadNodes(data) {
}
// Go through each header
- for (var i = 5; i < sorted.length; i++) {
+ for (var i = 6; i < sorted.length; i++) {
// Add the node attributes to the row
var key = sorted[i];
@@ -546,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
@@ -557,8 +660,6 @@ function loadNodes(data) {
* power, clone, delete, unlock, and advanced
*/
- var powerLnk = $('Power');
-
// Power on
var powerOnLnk = $('Power on');
powerOnLnk.click(function() {
@@ -576,6 +677,26 @@ function loadNodes(data) {
powerNode(tgtNodes, 'off');
}
});
+
+ var monitorLnk = $('Monitor');
+
+ // Turn monitoring on
+ var monitorOnLnk = $('Monitor on');
+ monitorOnLnk.click(function() {
+ var tgtNodes = getNodesChecked(nodesTableId);
+ if (tgtNodes) {
+ monitorNode(tgtNodes, 'on');
+ }
+ });
+
+ // Turn monitoring off
+ var monitorOffLnk = $('Monitor off');
+ monitorOffLnk.click(function() {
+ var tgtNodes = getNodesChecked(nodesTableId);
+ if (tgtNodes) {
+ monitorNode(tgtNodes, 'off');
+ }
+ });
// Clone
var cloneLnk = $('Clone');
@@ -654,7 +775,6 @@ function loadNodes(data) {
if (tgtNodes) {
loadNodesetPage(tgtNodes);
}
-
});
// Boot to network
@@ -665,6 +785,14 @@ function loadNodes(data) {
loadNetbootPage(tgtNodes);
}
});
+
+ var provisionLnk = $('Provision');
+ provisionLnk.click(function(){
+ var tgtNodes = getNodesChecked(nodesTableId);
+ if (tgtNodes){
+ openQuickProvisionDia(tgtNodes);
+ }
+ });
// Remote console
var rcons = $('Open console');
@@ -684,57 +812,39 @@ function loadNodes(data) {
}
});
- // Power actions
- var powerActions = [ powerOnLnk, powerOffLnk ];
- var powerActionMenu = createMenu(powerActions);
-
+ // Install Ganglia
+ var installMonLnk = $('Install monitoring');
+ installMonLnk.click(function() {
+ var tgtNodes = getNodesChecked(nodesTableId);
+ if (tgtNodes) {
+ installGanglia(tgtNodes);
+ }
+ });
+
+ // actions (power monitor)
+ var powerLnk = 'Actions';
+ var powerActionMenu = createMenu([cloneLnk, deleteLnk, monitorOnLnk, monitorOffLnk, powerOnLnk, powerOffLnk, scriptLnk]);
+
+ // configurations
+ var configLnk = 'Configuration';
+ var configMenu = createMenu([unlockLnk, updateLnk, editProps, installMonLnk]);
// Advanced actions
- var advancedLnk = $('Advanced');
- var advancedActions;
- if ('compute' == group) {
- advancedActions = [ boot2NetworkLnk, scriptLnk, setBootStateLnk, updateLnk, rcons, editProps ];
- } else {
- advancedActions = [ boot2NetworkLnk, scriptLnk, setBootStateLnk, updateLnk, editProps ];
- }
- var advancedActionMenu = createMenu(advancedActions);
+ var advancedLnk = 'Provision';
+ var advancedActionMenu = createMenu([ boot2NetworkLnk, setBootStateLnk, rcons, provisionLnk]);
// Create an action menu
- var actionsDiv = $('');
- var actions = [ [ powerLnk, powerActionMenu ], cloneLnk, deleteLnk, unlockLnk, [ advancedLnk, advancedActionMenu ] ];
- var actionsMenu = createMenu(actions);
+ var actionsMenu = createMenu([ [ powerLnk, powerActionMenu ], [ configLnk, configMenu ], [ advancedLnk, advancedActionMenu ] ]);
actionsMenu.superfish();
- actionsDiv.append(actionsMenu);
- actionBar.append(actionsDiv);
+ actionsMenu.css('display', 'inline-block');
+ 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();
- });
-
- // It will be hidden until a change is made
- var tableActionsMenu = createMenu([saveLnk, undoLnk]).hide();
- tableActionsMenu.css('margin-left', '90px');
- tableActionsMenu.attr('id', 'tableActionMenu');
- actionsDiv.append(tableActionsMenu);
-
+
// Turn table into a datatable
var nodesDatatable = $('#' + nodesTableId).dataTable({
- 'iDisplayLength': 50
+ 'iDisplayLength': 50,
+ 'bLengthChange': false
});
// Filter table when enter key is pressed
@@ -766,62 +876,68 @@ function loadNodes(data) {
});
var pingCol = $('#' + nodesTableId + ' thead tr th').eq(2);
var powerCol = $('#' + nodesTableId + ' thead tr th').eq(3);
- var commentCol = $('#' + nodesTableId + ' thead tr th').eq(4);
+ var monitorCol = $('#' + nodesTableId + ' thead tr th').eq(4);
+ var commentCol = $('#' + nodesTableId + ' thead tr th').eq(5);
pingCol.unbind('click');
powerCol.unbind('click');
+ monitorCol.unbind('click');
commentCol.unbind('click');
// Create enough space for loader to be displayed
- $('#' + nodesTableId + ' tbody tr td:nth-child(3)').css('min-width', '60px');
- $('#' + nodesTableId + ' tbody tr td:nth-child(4)').css('min-width', '60px');
-
// Center align power, ping, and comments
- $('#' + nodesTableId + ' tbody tr td:nth-child(3)').css('text-align', 'center');
- $('#' + nodesTableId + ' tbody tr td:nth-child(4)').css('text-align', 'center');
- $('#' + nodesTableId + ' tbody tr td:nth-child(5)').css('text-align', 'center');
+ $('#' + nodesTableId + ' td:nth-child(3),td:nth-child(4),td:nth-child(5)').css({
+ 'min-width': '65px',
+ 'text-align': 'center'
+ });
- // Instead refresh the node status and power status
+ // No minimum width for comments column
+ $('#' + nodesTableId + ' tbody tr td:nth-child(6)').css('text-align', 'center');
+
+ // Instead refresh the node, power, and monitor status
pingCol.find('span a').click(function() {
refreshNodeStatus(group, nodesTableId);
});
powerCol.find('span a').click(function() {
refreshPowerStatus(group, nodesTableId);
});
+ monitorCol.find('span a').click(function() {
+ refreshGangliaStatus(group, nodesTableId);
+ });
+ var menuDiv=$('');
+ $('#' + nodesTableId + '_wrapper').prepend(menuDiv);
+ menuDiv.append(actionBar);
+ $('#'+nodesTableId+'_filter').appendTo(menuDiv);
// Create tooltip for status
+ var tooltipConf = {
+ position: "center right",
+ offset: [-2, 10],
+ effect: "fade",
+ opacity: 0.8,
+ relative: true,
+ predelay: 800
+ };
+
var pingTip = createStatusToolTip();
pingCol.find('span').append(pingTip);
- pingCol.find('span a').tooltip({
- position: "center right",
- offset: [-2, 10],
- effect: "fade",
- opacity: 0.8,
- relative: true,
- predelay: 800
- });
+ pingCol.find('span a').tooltip(tooltipConf);
// Create tooltip for power
var powerTip = createPowerToolTip();
powerCol.find('span').append(powerTip);
- powerCol.find('span a').tooltip({
- position: "center right",
- offset: [-2, 10],
- effect: "fade",
- opacity: 0.8,
- relative: true,
- predelay: 800
- });
+ powerCol.find('span a').tooltip(tooltipConf);
+
+ // Create tooltip for monitor
+ var monitorTip = createMonitorToolTip();
+ monitorCol.find('span').append(monitorTip);
+ monitorCol.find('span a').tooltip(tooltipConf);
/**
* 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(
+ // 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;
@@ -832,16 +948,34 @@ 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',
@@ -891,51 +1025,10 @@ function loadNodes(data) {
});
/**
- * Additional ajax requests need to be made for zVM
- */
-
- // Get index of hcp column
- var i = $.inArray('hcp', sorted);
- var archCol = $.inArray('arch', sorted);
- if (i) {
- // Get hardware control point
- var rows = nodesTable.object().find('tbody tr');
- var hcps = new Object();
- var rowsNum = rows.size();
- for (var j = 0; j < rowsNum; j++) {
- var val = rows.eq(j).find('td').eq(i).html();
- var archval = rows.eq(j).find('td').eq(archCol).html();
- if (-1 == archval.indexOf('390')){
- continue;
- }
- hcps[val] = 1;
- }
-
- var args;
- for (var h in hcps) {
- // Get node without domain name
- args = h.split('.');
-
- // If there are no disk pools or network names cookie for this hcp
- if (!$.cookie(args[0] + 'diskpools') || !$.cookie(args[0] + 'networks')) {
- // Check if SMAPI is online
- $.ajax( {
- url : 'lib/cmd.php',
- dataType : 'json',
- data : {
- cmd : 'lsvm',
- tgt : args[0],
- args : '',
- msg : 'group=' + group + ';hcp=' + args[0]
- },
-
- // Load hardware control point specific info
- // Get disk pools and network names
- success : loadHcpInfo
- });
- }
- } // End of for
- } // End of if
+ * Additional ajax requests need to be made for zVM
+ * load advanced information based on hardware architecture
+ */
+ advancedLoad(group);
}
/**
@@ -1049,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) {
@@ -1132,11 +1222,11 @@ function addNodes2Table(data) {
datatable.fnUpdate(rows[nodeRowPos], nodeRowPos, 0, false);
// Insert node comments
- // This is done after datatable is updated because
+ // This is done after datatable is updated because
// you cannot insert an object using fnUpdate()
var comments = attrs[node]['usercomment'];
- // If no comments exists, show 'No comments' and
+ // If no comments exists, show 'No comments' and
// set icon image source
var iconSrc;
if (!comments) {
@@ -1181,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;
@@ -1198,16 +1285,34 @@ 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',
@@ -1239,41 +1344,67 @@ function addNodes2Table(data) {
/**
* Additional ajax requests need to be made for zVM
*/
- // If there is an hcp column
- if (headersCol['hcp']) {
- // Get hardware control point
- var rows = $('#' + nodesTableId + ' tbody tr');
- var hcps = new Object();
- for (var j in rows) {
- var val = rows.eq(j).find('td').eq(headersCol['hcp']).html();
- hcps[val] = 1;
- }
+ advancedLoad(group);
+}
- var args;
- for (var h in hcps) {
- // Get node without domain name
- args = h.split('.');
-
- // If there are no disk pools or network names cookie for this hcp
- if (!$.cookie(args[0] + 'diskpools') || !$.cookie(args[0] + 'networks')) {
- // Check if SMAPI is online
- $.ajax( {
- url : 'lib/cmd.php',
- dataType : 'json',
- data : {
- cmd : 'lsvm',
- tgt : args[0],
- args : '',
- msg : 'group=' + group + ';hcp=' + args[0]
- },
-
- // Load hardware control point specific info
- // Get disk pools and network names
- success : loadHcpInfo
- });
- }
- } // End of for
- } // End of if
+/**
+ * Load the status of Ganglia for a given group
+ *
+ * @param data
+ * Data returned from HTTP request
+ * @return Nothing
+ */
+function loadGangliaStatus(data) {
+ // Get datatable
+ var datatable = $('#' + nodesTableId).dataTable();
+ var ganglia = data.rsp;
+ var rowNum, node, status, args;
+
+ for ( var i in ganglia) {
+ // ganglia[0] = nodeName and ganglia[1] = state
+ node = jQuery.trim(ganglia[i][0]);
+ status = jQuery.trim(ganglia[i][1]);
+
+ // Get the row containing the node
+ rowNum = findRow(node, '#' + nodesTableId, 1);
+
+ // Update the power status column
+ datatable.fnUpdate(status, rowNum, 4);
+ }
+
+ // Hide Ganglia loader
+ var gangliaCol = $('#' + nodesTableId + ' thead tr th').eq(4);
+ gangliaCol.find('img').hide();
+}
+
+/**
+ * Refresh the status of Ganglia for each node
+ *
+ * @param group
+ * Group name
+ * @return Nothing
+ */
+function refreshGangliaStatus(group) {
+ // Show ganglia loader
+ var gangliaCol = $('#' + nodesTableId + ' thead tr th').eq(4);
+ gangliaCol.find('img').show();
+
+ // Get power status for nodes shown
+ var nodes = getNodesShown(nodesTableId);
+
+ // Get the status of Ganglia
+ $.ajax( {
+ url : 'lib/cmd.php',
+ dataType : 'json',
+ data : {
+ cmd : 'webrun',
+ tgt : '',
+ args : 'gangliastatus;' + nodes,
+ msg : ''
+ },
+
+ success : loadGangliaStatus
+ });
}
/**
@@ -1312,7 +1443,7 @@ function loadPowerStatus(data) {
* @param group
* Group name
* @param tableId
- * Table to update node status
+ * Table to update node status
* @return Nothing
*/
function refreshPowerStatus(group, tableId) {
@@ -1376,7 +1507,7 @@ function loadNodeStatus(data) {
* @param group
* Group name
* @param tableId
- * Table to update node status
+ * Table to update node status
* @return Nothing
*/
function refreshNodeStatus(group, tableId) {
@@ -1506,7 +1637,7 @@ function loadUnlockPage(tgtNodes) {
// Create loader
var loader = createLoader('');
- statusBar.append(loader);
+ statusBar.find('div').append(loader);
// Create info bar
var infoBar = createInfoBar('Give the root password for this node range to setup its SSH keys.');
@@ -1606,7 +1737,7 @@ function loadScriptPage(tgtNodes) {
// Create loader
var loader = createLoader('scriptLoader' + inst);
- statBar.append(loader);
+ statBar.find('div').append(loader);
// Create info bar
var infoBar = createInfoBar('Load a script to run against this node range.');
@@ -1747,7 +1878,7 @@ function loadDeletePage(tgtNodes) {
// Create loader
var loader = createLoader('');
- statBar.append(loader);
+ statBar.find('div').append(loader);
statBar.hide();
// Create target nodes string
@@ -1846,7 +1977,7 @@ function updateStatusBar(data) {
// Write ajax response to status bar
var prg = writeRsp(rsp, '');
- $('#' + statBarId).append(prg);
+ $('#' + statBarId).find('div').append(prg);
} else if (cmd == 'rmvm') {
// Get data table
var dTable = $('#' + nodesTableId).dataTable();
@@ -1857,7 +1988,7 @@ function updateStatusBar(data) {
// Write ajax response to status bar
var prg = writeRsp(rsp, '');
- $('#' + statBarId).append(prg);
+ $('#' + statBarId).find('div').append(prg);
// If there was an error, do not continue
if (prg.html().indexOf('Error') > -1) {
@@ -1878,7 +2009,7 @@ function updateStatusBar(data) {
$('#' + statBarId).find('img').hide();
// Write ajax response to status bar
- var prg = $('');
+ var prg = $('');
for (var i in rsp) {
for (var j in tgts) {
rsp[i] = rsp[i].replace(new RegExp(tgts[j] + ':', 'g'), '');
@@ -1887,7 +2018,7 @@ function updateStatusBar(data) {
prg.append(rsp[i]);
prg.append('
');
}
- $('#' + statBarId).append(prg);
+ $('#' + statBarId).find('div').append(prg);
// Enable fields
$('#' + statBarId).parent().find('input').removeAttr('disabled');
@@ -1901,7 +2032,7 @@ function updateStatusBar(data) {
// Write ajax response to status bar
var prg = writeRsp(rsp, '[A-Za-z0-9._-]+:');
- $('#' + statBarId).append(prg);
+ $('#' + statBarId).find('div').append(prg);
}
}
@@ -2046,7 +2177,7 @@ function setOSImageCookies(data) {
var profilePos = 0;
var osversPos = 0;
var osarchPos = 0;
- //get the column value
+ // get the column value
var colNameArray = rsp[0].substr(1).split(',');
for (var i in colNameArray){
switch (colNameArray[i]){
@@ -2191,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();
@@ -2225,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
*
@@ -2510,6 +2499,19 @@ function createPowerToolTip() {
return toolTip;
}
+/**
+ * Create a tool tip for monitoring status
+ *
+ * @return Tool tip
+ */
+function createMonitorToolTip() {
+ // Create tooltip container
+ var toolTip = $('Click here to refresh the monitoring status').css({
+ 'width': '150px'
+ });
+ return toolTip;
+}
+
/**
* Open dialog to configure xCAT monitor
*
@@ -2661,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
@@ -2969,4 +2970,397 @@ function openSetAttrsDialog() {
}
}
});
+}
+
+/**
+ * Turn on monitoring for a given node
+ *
+ * @param node
+ * Node to monitor on or off
+ * @param monitor
+ * Monitor state, on or off
+ * @return Nothing
+ */
+function monitorNode(node, monitor) {
+ if (monitor == 'on') {
+ // Append loader to warning bar
+ var gangliaLoader = createLoader('');
+ var warningBar = $('#nodesTab').find('.ui-state-error p');
+ if (warningBar.length) {
+ warningBar.append(gangliaLoader);
+ }
+
+ if (node) {
+ // Check if ganglia RPMs are installed
+ $.ajax( {
+ url : 'lib/cmd.php',
+ dataType : 'json',
+ data : {
+ cmd : 'webrun',
+ tgt : '',
+ args : 'gangliacheck;' + node,
+ msg : node // Node range will be passed along in data.msg
+ },
+
+ /**
+ * Start ganglia on a given node range
+ *
+ * @param data
+ * Data returned from HTTP request
+ * @return Nothing
+ */
+ success : function(data) {
+ // Get response
+ var out = data.rsp[0].split(/\n/);
+
+ // Go through each line
+ var warn = false;
+ var warningMsg = '';
+ for (var i in out) {
+ // If an RPM is not installed
+ if (out[i].indexOf('not installed') > -1) {
+ warn = true;
+
+ if (warningMsg) {
+ warningMsg += '
' + out[i];
+ } else {
+ warningMsg = out[i];
+ }
+ }
+ }
+
+ // If there are warnings
+ if (warn) {
+ // Create warning bar
+ var warningBar = createWarnBar(warningMsg);
+ warningBar.css('margin-bottom', '10px');
+ warningBar.prependTo($('#nodesTab'));
+ } else {
+ $.ajax( {
+ url : 'lib/cmd.php',
+ dataType : 'json',
+ data : {
+ cmd : 'webrun',
+ tgt : '',
+ args : 'gangliastart;' + data.msg,
+ msg : ''
+ },
+
+ success : function(data) {
+ // Remove any warnings
+ $('#nodesTab').find('.ui-state-error').remove();
+ }
+ });
+ } // End of if (warn)
+ } // End of function(data)
+ });
+ } else {
+ $.ajax( {
+ url : 'lib/cmd.php',
+ dataType : 'json',
+ data : {
+ cmd : 'webrun',
+ tgt : '',
+ args : 'gangliastart',
+ msg : ''
+ },
+
+ success : function(data) {
+ // Remove any warnings
+ $('#nodesTab').find('.ui-state-error').remove();
+ }
+ });
+ } // End of if (node)
+ } else {
+ var args;
+ if (node) {
+ args = 'gangliastop;' + node;
+ } else {
+ args = 'gangliastop';
+ }
+
+ $.ajax( {
+ url : 'lib/cmd.php',
+ dataType : 'json',
+ data : {
+ cmd : 'webrun',
+ tgt : '',
+ args : args,
+ msg : ''
+ },
+
+ success : function(data) {
+ // Do nothing
+ }
+ });
+ }
+}
+
+/**
+ * Install Ganglia on a given node
+ *
+ * @param node
+ * Node to install Ganglia on
+ * @return Nothing
+ */
+function installGanglia(node) {
+ var iframe = createIFrame('lib/cmd.php?cmd=webrun&tgt=&args=installganglia;' + node + '&msg=' + node + '&opts=flush');
+ iframe.prependTo($('#nodesTab'));
+
+ // Turn on Ganglia for node
+ monitorNode(node, 'on');
+}
+
+/**
+ * when nodes are loaded, based on different hardware architecture, should load different informations
+ *
+ * @return Nothing
+ */
+function advancedLoad(group){
+ var tempIndex = 0;
+ var tableHeaders = $('#' + nodesTableId + ' th');
+ var colNameHash = new Object();
+ var colName = '';
+ var archCol = 0, hcpCol = 0;
+ // 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 (header.find('a').size() > 0){
+ continue;
+ }
+
+ colName = header.text();
+
+ if (colName){
+ colNameHash[colName] = tempIndex;
+ }
+ }
+
+ // there is not arch column, can not distinguish hardware type return directly
+ if (!colNameHash['arch']){
+ return;
+ }
+
+ if (!colNameHash['hcp']){
+ return;
+ }
+ archCol = colNameHash['arch'];
+ hcpCol = colNameHash['hcp'];
+
+ // Get hardware control point
+ var rows = $('#' + nodesTableId + ' tbody tr');
+ var hcps = new Object();
+ var rowsNum = rows.size();
+ for (var j = 0; j < rowsNum; j++) {
+ var val = rows.eq(j).find('td').eq(hcpCol).html();
+ var archval = rows.eq(j).find('td').eq(archCol).html();
+ if (-1 == archval.indexOf('390')){
+ continue;
+ }
+ hcps[val] = 1;
+ }
+
+ var args;
+ for (var h in hcps) {
+ // Get node without domain name
+ args = h.split('.');
+
+ // If there are no disk pools or network names cookie for this hcp
+ if (!$.cookie(args[0] + 'diskpools') || !$.cookie(args[0] + 'networks')) {
+ // Check if SMAPI is online
+ $.ajax( {
+ url : 'lib/cmd.php',
+ dataType : 'json',
+ data : {
+ cmd : 'lsvm',
+ tgt : args[0],
+ args : '',
+ msg : 'group=' + group + ';hcp=' + args[0]
+ },
+
+ // Load hardware control point specific info
+ // Get disk pools and network names
+ success : loadHcpInfo
+ });
+ }
+ } // End of for
+}
+
+/**
+ * when click the provison button, show this dislog for provision
+ * this is the quick way to deploy on the nodes page.
+ *
+ * @return Nothing
+ */
+function openQuickProvisionDia(tgtnodes){
+ var nodeArray = tgtnodes.split(',');
+ var nodeName = '';
+ var index = 0;
+ var archtype = '';
+ var errormessage = '';
+ var diaDiv = $('');
+ // check the first node's arch type
+ for (index in nodeArray){
+ nodeName = nodeArray[index];
+ // does not have arch
+ if (!origAttrs[nodeName]['arch']){
+ errormessage = 'All nodes should define arch first!';
+ break;
+ }
+
+ if (0 == index){
+ archtype = origAttrs[nodeName]['arch'];
+ }
+
+ // all nodes should have same archtype
+ if (archtype != origAttrs[nodeName]['arch']){
+ errormessage = 'All nodes should belong to same arch!
';
+ break;
+ }
+ }
+
+ // check the mac address
+ for (index in nodeArray){
+ if (!origAttrs[nodeName]['mac'] || !origAttrs[nodeName]['ip']){
+ errormessage += 'All nodes should define ip and mac!
';
+ break;
+ }
+ }
+
+ if (-1 != archtype.indexOf('390')){
+ errormessage += 'System Z should use provision page.';
+ }
+
+ // error message should show in a dialog
+ if ('' != errormessage){
+ diaDiv.append(createWarnBar(errormessage));
+ diaDiv.dialog({
+ modal: true,
+ width: 400,
+ buttons: {
+ 'Close': function(){
+ $(this).dialog('destroy');
+ }
+ }
+ });
+
+ return;
+ }
+
+ // organize the provison dialog
+ var showstr = '';
+ showstr += 'Target node: ';
+ showstr += 'Arch: ';
+ showstr += 'Image: ';
+ showstr += 'Install Nic: ';
+ showstr += 'Primary Nic: ';
+ showstr += 'xCAT Master: ';
+ showstr += 'TFTP Server: ';
+ showstr += 'NFS Server: ';
+ showstr += '
';
+ showstr += '';
+ diaDiv.append(showstr);
+ diaDiv.dialog({
+ modal: true,
+ width: 400,
+ height: 480,
+ close: function(){$(this).remove();},
+ buttons: {
+ 'Close': function(){$(this).remove();}
+ }
+ });
+
+ $('#deployDiv select').parent().append(createLoader());
+
+ $.ajax({
+ url : 'lib/cmd.php',
+ dataType : 'json',
+ data : {
+ cmd : 'lsdef',
+ tgt : '',
+ args : '-t;osimage',
+ msg : ''
+ },
+
+ success : function(data){
+ var index = 0;
+ var imagename = 0;
+ var position = 0;
+ $('#deployDiv img').remove();
+ if (data.rsp.lenght < 1){
+ $('#deployDiv').append(createWarnBar('Please copycds and genimage in provision page first!'));
+ return;
+ }
+
+ for (index in data.rsp){
+ imagename = data.rsp[index];
+ position = imagename.indexOf(' ');
+ imagename = imagename.substr(0, position);
+
+ $('#deployDiv select').append('');
+ }
+
+ $('#deployDiv').dialog( "option", "buttons", {'Ok': function(){quickProvision();},
+ 'Cancel': function(){$(this).remove();}}
+ );
+ }
+ });
+}
+
+/**
+ * get all needed field for provsion and send the command to server
+ *
+ * @return Nothing
+ */
+function quickProvision(){
+ var errormessage = '';
+ var argsArray = new Array();
+ var nodesName = '';
+ var provisionArg = '';
+ var provisionFrame;
+ var imageName = '';
+ var url = '';
+ $('#deployDiv .ui-state-error').remove();
+ $('#deployDiv input').each(function(){
+ if ('' == $(this).val()){
+ errormessage = 'You are missing input!';
+ return false;
+ }
+ });
+
+ if ('' != errormessage){
+ $('#deployDiv').prepend('' + errormessage + '
');
+ return;
+ }
+
+ $('#deployDiv input').each(function(){
+ argsArray.push($(this).val());
+ });
+
+ nodesName = argsArray.shift();
+ imageName = $('#deployDiv select').val();
+ provisionArg = argsArray.join(',');
+ url = 'lib/cmd.php?cmd=webrun&tgt=&args=provision;' + nodesName + ';' + imageName + ';' + provisionArg + '&msg=&opts=flush';
+
+ // show the result
+ $('#deployDiv').empty().append(createLoader()).append('
');
+ $('#deployDiv').dialog( "option", "buttons", {'Close': function(){$(this).remove();clearTimeout(provisionClock);}});
+ $('#deployDiv').dialog( "option", "width", 600);
+ provisionFrame = $('');
+ $('#deployDiv').append(provisionFrame);
+
+ provisionFrame.attr('src', url);
+ provisionStopCheck();
+}
+
+function provisionStopCheck(){
+ var content = $('#provisionFrame').contents().find('body').text();
+ if (-1 != content.indexOf('provision stop')){
+ $('#deployDiv img').remove();
+ clearTimeout(provisionClock);
+ }
+ else{
+ provisionClock = setTimeout('provisionStopCheck()', 5000);
+ }
}
\ No newline at end of file
diff --git a/xCAT-UI/js/nodes/nodeset.js b/xCAT-UI/js/nodes/nodeset.js
index dbe52f756..43c6428c0 100644
--- a/xCAT-UI/js/nodes/nodeset.js
+++ b/xCAT-UI/js/nodes/nodeset.js
@@ -42,10 +42,10 @@ function loadNodesetPage(tgtNodes) {
// Create loader
var loader = createLoader('nodesetLoader');
- statBar.append(loader);
+ statBar.find('div').append(loader);
// Create info bar
- var infoBar = createInfoBar('Set the boot state for a node range.');
+ var infoBar = createInfoBar('Set the boot state for a node range');
nodesetForm.append(infoBar);
// Create target node or group
@@ -249,7 +249,7 @@ function updateNodesetStatus(data) {
if (cmd == 'nodeadd') {
if (rsp.length) {
$('#' + statBarId).find('img').hide();
- $('#' + statBarId).append('(Error) Failed to create node definition
');
+ $('#' + statBarId).find('div').append('(Error) Failed to create node definition
');
} else {
// Create target nodes string
var tgtNodesStr = '';
@@ -277,7 +277,7 @@ function updateNodesetStatus(data) {
}
}
- $('#' + statBarId).append('Node definition created for ' + tgtNodesStr + '
');
+ $('#' + statBarId).find('div').append('Node definition created for ' + tgtNodesStr + '
');
$.ajax( {
url : 'lib/cmd.php',
dataType : 'json',
@@ -299,9 +299,9 @@ function updateNodesetStatus(data) {
else if (cmd == 'makehosts') {
// If no output, no errors occurred
if (rsp.length) {
- $('#' + statBarId).append('(Error) Failed to update /etc/hosts
');
+ $('#' + statBarId).find('div').append('(Error) Failed to update /etc/hosts
');
} else {
- $('#' + statBarId).append('/etc/hosts updated
');
+ $('#' + statBarId).find('div').append('/etc/hosts updated
');
}
// Update DNS
@@ -325,7 +325,7 @@ function updateNodesetStatus(data) {
else if (cmd == 'makedns') {
// Write ajax response to status bar
var prg = writeRsp(rsp, '');
- $('#' + statBarId).append(prg);
+ $('#' + statBarId).find('div').append(prg);
// Update DHCP
$.ajax( {
@@ -348,7 +348,7 @@ function updateNodesetStatus(data) {
else if (cmd == 'makedhcp') {
// Write ajax response to status bar
var prg = writeRsp(rsp, '');
- $('#' + statBarId).append(prg);
+ $('#' + statBarId).find('div').append(prg);
// Prepare node for boot
$.ajax( {
@@ -371,7 +371,7 @@ function updateNodesetStatus(data) {
else if (cmd == 'nodeset') {
// Write ajax response to status bar
var prg = writeRsp(rsp, '');
- $('#' + statBarId).append(prg);
+ $('#' + statBarId).find('div').append(prg);
// Hide loader
$('#' + statBarId).find('img').hide();
diff --git a/xCAT-UI/js/nodes/physical.js b/xCAT-UI/js/nodes/physical.js
index dfd595353..aedadc4eb 100644
--- a/xCAT-UI/js/nodes/physical.js
+++ b/xCAT-UI/js/nodes/physical.js
@@ -89,6 +89,11 @@ function extractGraphicalData(data){
graphicalNodeList[nodeName] = new Object();
}
+ if('' == nodeName){
+ tempNullNodes = 'all,';
+ break;
+ }
+
switch (data.msg.substr(5, 1)){
case '0':
case '1':{
@@ -122,10 +127,6 @@ function extractGraphicalData(data){
}
function createPhysicalLayout(nodeList){
- bpaList = new Object();
- fspList = new Object();
- lparList = new Object();
- selectNode = new Object();
var flag = false;
//no nodes are selected.
@@ -154,6 +155,10 @@ function createPhysicalLayout(nodeList){
//there is not graphical data, get the info now
if (!flag){
graphicalNodeList = new Object();
+ bpaList = new Object();
+ fspList = new Object();
+ lparList = new Object();
+ selectNode = new Object();
initGraphicalData(0);
}
else{
@@ -224,6 +229,7 @@ function fillList(nodeName){
break;
}
}
+
/**
* create the physical graphical layout
*
@@ -243,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 = $('');
@@ -264,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);
@@ -350,7 +360,8 @@ function createGraphical(bpa, fsp, area){
position: "center right",
relative : true,
offset : [10, -40],
- effect: "fade"
+ effect: "fade",
+ opacity: 0.9
});
$('.tooltip a').bind('click', function(){
@@ -412,7 +423,6 @@ function updateSelectNodeDiv(){
$('#selectNodeDiv').empty();
//add buttons
-
$('#selectNodeDiv').append('Nodes: ');
for(var lparName in selectNode){
$('#selectNodeDiv').append(lparName + ' ');
@@ -593,7 +603,7 @@ function createActionMenu(){
* create an action menu
*/
var actionsDIV = $('');
- var actions = [ [ powerLnk, powerActionMenu ], cloneLnk, deleteLnk, unlockLnk, [ advancedLnk, advancedActionMenu ] ];
+ var actions = [ [ powerLnk, powerActionMenu ], deleteLnk, unlockLnk, [ advancedLnk, advancedActionMenu ] ];
var actionMenu = createMenu(actions);
actionMenu.superfish();
actionsDIV.append(actionMenu);
@@ -665,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/nodes/rnetboot.js b/xCAT-UI/js/nodes/rnetboot.js
index 56e1de127..aa13aafc6 100644
--- a/xCAT-UI/js/nodes/rnetboot.js
+++ b/xCAT-UI/js/nodes/rnetboot.js
@@ -39,7 +39,7 @@ function loadNetbootPage(tgtNodes) {
// Create loader
var loader = createLoader('netbootLoader');
- statusBar.append(loader);
+ statusBar.find('div').append(loader);
// Create info bar
var infoBar = createInfoBar('Cause the range of nodes to boot to network');
diff --git a/xCAT-UI/js/nodes/updatenode.js b/xCAT-UI/js/nodes/updatenode.js
index e5414e75d..6c06b9e88 100644
--- a/xCAT-UI/js/nodes/updatenode.js
+++ b/xCAT-UI/js/nodes/updatenode.js
@@ -53,7 +53,7 @@ function loadUpdatenodePage(tgtNodes) {
// Create loader
var loader = createLoader('updatenodeLoader');
- statusBar.append(loader);
+ statusBar.find('div').append(loader);
// Create info bar
var infoBar = createInfoBar('Update nodes in an xCAT environment');
diff --git a/xCAT-UI/js/provision/images.js b/xCAT-UI/js/provision/images.js
index 5a66e1797..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
*
@@ -414,12 +261,13 @@ function setImageDefAttrs(data) {
// Get attribute name and description
key = jQuery.trim(attr.substring(0, attr.indexOf(':')));
descr = jQuery.trim(attr.substring(attr.indexOf(':') + 1));
-
+ descr = descr.replace(new RegExp('<', 'g'), '[').replace(new RegExp('>', 'g'), ']');
+
// Set hash table where key = attribute name and value = description
defAttrs[key] = descr;
} else {
// Append description to hash table
- defAttrs[key] = defAttrs[key] + '\n' + attr;
+ defAttrs[key] = defAttrs[key] + '\n' + attr.replace(new RegExp('<', 'g'), '[').replace(new RegExp('>', 'g'), ']');
}
} // End of if
} // End of for
@@ -444,6 +292,8 @@ function loadCreateImage() {
var showStr = '';
var imageOsvers = $.cookie("osvers").split(",");
var imageArch = $.cookie("osarchs").split(",");
+ var profileArray = $.cookie("profiles").split(",");
+ var index = 0;
// Create set properties form
var setPropsForm = $('');
@@ -454,24 +304,28 @@ function loadCreateImage() {
// OS version selector
showStr += '';
// OS arch selector
showStr += '';
// Netboot interface input
showStr += '';
// Profile selector
- showStr += '';
+ showStr += '';
// Boot method selector
- showStr += '';
+ showStr += '';
setPropsForm.append(showStr);
createHpcSelect(setPropsForm);
@@ -483,39 +337,13 @@ function loadCreateImage() {
// If they are valid, show the hpc stack select area.
hpcShow();
- $.ajax( {
- url : 'lib/systemcmd.php',
- dataType : 'json',
- data : {
- cmd : 'lsb_release -d;uname -p'
- },
- success : function(data) {
- var tempArray = data.rsp.split("\n");
- var mnOs = tempArray[0];
- var mnArch = tempArray[1];
- tempArray = mnOs.split(" ");
-
- // 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("Create Image");
- createImageBtn.bind('click', function(event) {
- createImage();
- });
-
- $('#createImageTab').append(createImageBtn);
-
- // Check the option and decide to show the hpcsoft or not
- hpcShow();
- }
- });
+ // The button used to create images is created here
+ var createImageBtn = createButton("Create Image");
+ createImageBtn.bind('click', function(event) {
+ createImage();
+ });
+ $('#createImageTab').append(createImageBtn);
}
/**
@@ -546,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",
@@ -662,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] + " ";
@@ -775,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) {
@@ -1043,7 +871,7 @@ function loadCopyCdPage() {
// Create loader
var loader = createLoader('');
- statBar.append(loader);
+ statBar.find('div').append(loader);
// Create info bar
var infoBar = createInfoBar('Copy Linux distributions and service levels from CDs or DVDs to the install directory.');
@@ -1154,13 +982,13 @@ function loadCopyCdPage() {
var tabId = statBarId.replace('copyLinuxStatusBar', 'copyLinuxTab');
// Go through output and append to paragraph
- var prg = $('');
+ var prg = $('');
for (var i in out) {
if (out[i].length > 6) {
- prg.append(out[i] + '
');
+ prg.append(out[i] + '
');
}
}
- $('#' + statBarId).append(prg);
+ $('#' + statBarId).find('div').append(prg);
// Hide loader
$('#' + statBarId).find('img').hide();
diff --git a/xCAT-UI/js/ui.js b/xCAT-UI/js/ui.js
index 3d20383a2..902076758 100644
--- a/xCAT-UI/js/ui.js
+++ b/xCAT-UI/js/ui.js
@@ -304,7 +304,38 @@ DataTable.prototype.add = function(rowCont) {
* @return Status bar
*/
function createStatusBar(barId) {
- var statusBar = $('').css('padding', '10px');
+ var statusBar = $('').css({
+ 'margin-bottom': '5px',
+ 'min-height': '30px'
+ });
+
+ // Create info icon
+ var icon = $('').css({
+ 'display': 'inline-block',
+ 'margin': '10px 5px'
+ });
+
+ // Create message section
+ var msg = $('').css({
+ 'display': 'inline-block',
+ 'margin': '10px 0px',
+ 'width': '90%'
+ });
+
+ // Create hide button
+ var hide = $('').css({
+ 'display': 'inline-block',
+ 'float': 'right',
+ 'margin': '10px 5px',
+ 'cursor': 'pointer'
+ }).click(function() {
+ // Remove info box on-click
+ $(this).parent().hide();
+ });
+
+ statusBar.append(icon);
+ statusBar.append(msg);
+ statusBar.append(hide);
return statusBar;
}
@@ -409,7 +440,6 @@ function createMenu(items) {
'border-left' : '1px solid #BDBDBD'
});
}
-
menu.append(item);
}
@@ -431,10 +461,12 @@ 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");
+ includeJs("js/jquery/jqplot.pieRenderer.min.js");
+ includeJs("js/jquery/jqplot.dateAxisRenderer.min.js");
+
// Page plugins
includeJs("js/configure/configure.js");
includeJs("js/monitor/monitor.js");
@@ -456,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');
@@ -480,7 +503,18 @@ function initPage() {
includeJs("js/monitor/gangliamon.js");
headers.eq(3).css('background-color', '#A9D0F5');
loadMonitorPage();
+ } else if (page == 'guide.php') {
+ includeJs("js/guide/guide.js");
+ 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");
+ includeJs("js/nodes/updatenode.js");
+ includeJs("js/nodes/physical.js");
+ includeJs("js/nodes/mtm.js");
headers.eq(0).css('background-color', '#A9D0F5');
loadNodesPage();
}
@@ -520,17 +554,18 @@ function includeJs(file) {
*/
function writeRsp(rsp, pattern) {
// Create paragraph to hold ajax response
- var prg = $('');
+ var prg = $('');
+
for ( var i in rsp) {
if (rsp[i]) {
// Create regular expression for given pattern
// Replace pattern with break
if (pattern) {
- rsp[i] = rsp[i].replace(new RegExp(pattern, 'g'), '
');
+ rsp[i] = rsp[i].replace(new RegExp(pattern, 'g'), '
');
prg.append(rsp[i]);
} else {
prg.append(rsp[i]);
- prg.append('
');
+ prg.append('
');
}
}
}
@@ -582,19 +617,34 @@ function openDialog(type, msg) {
*/
function createIFrame(src) {
// Put an iframe inside an info box
- var infoBar = $('');
+ var infoBar = $('').css({
+ 'margin-bottom': '5px'
+ });
+
+ // Create info and close icons
var icon = $('').css({
'display': 'inline-block',
'margin': '10px 5px'
});
+ var close = $('').css({
+ 'display': 'inline-block',
+ 'float': 'right',
+ 'margin': '10px 5px'
+ }).click(function() {
+ // Remove info box on-click
+ $(this).parent().remove();
+ });
+
var iframe = $('').attr('src', src).css({
'display': 'inline-block',
'border': '0px',
'margin': '10px 0px',
- 'width': '95%'
+ 'width': '90%'
});
infoBar.append(icon);
infoBar.append(iframe);
+ infoBar.append(close);
+
return infoBar;
}
diff --git a/xCAT-UI/js/xcatauth.js b/xCAT-UI/js/xcatauth.js
index 68cb88dc7..abdd36f4b 100644
--- a/xCAT-UI/js/xcatauth.js
+++ b/xCAT-UI/js/xcatauth.js
@@ -2,28 +2,39 @@
* Open login dialog
*/
$(document).ready(function() {
- $("#logdialog").dialog( {
- modal : true,
- closeOnEscape : false,
- closebutton : false,
- height : 300,
- width : 350,
- autoOpen : true,
- buttons : {
- "Log in" : authenticate
- },
- open : function(type, dialog) {
- if (document.location.protocol == "http:") {
- $("#logstatus").html("You are using an unencrypted session!");
- $("#logstatus").css("color", "#ff0000");
- }
- if ($("#username").val() == "") {
- $("#username").focus();
- } else {
- $("#password").focus();
- }
- }
- });
+ $('#header').remove();
+ $('#content').remove();
+
+ var winheight = document.body.clientHeight;
+ 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 {
+ tempheight = parseInt((winheight - diaheight - 50) / 2);
+ }
+
+ $('#logdialog').css('margin', tempheight + 'px auto');
+ $('button').bind('click', function(){
+ authenticate();
+ });
+
+ $('button').button();
+
+ if (document.location.protocol == "http:") {
+ $("#logstatus").html("You are using an unencrypted session!");
+ $("#logstatus").css("color", "#ff0000");
+ }
+
+ if ($("#username").val() == "") {
+ $("#username").focus();
+ } else {
+ $("#password").focus();
+ }
// When enter is hit while in username, advance to password
$("#username").keydown(function(event) {
@@ -54,10 +65,21 @@ function onlogin(data, txtStatus) {
$("#password").val("");
if (data.authenticated == "yes") {
$("#logstatus").text("Login successful");
- $("#logdialog").dialog("close");
- // Remembered what page they were trying to go to
- window.location = 'index.php';
+ // Not the first time to log
+ if ($.cookie('logonflag')){
+ // Remembered what page they were trying to go to
+ window.location = window.location.pathname;
+ } else {
+ window.location = 'guide.php';
+ }
+
+ // Set the logonflag
+ $.cookie('logonflag', 'yes', {
+ path : '/xcat',
+ expires : 100
+ });
+
} else {
$("#logstatus").text("Authentication failure");
$("#logstatus").css("color", "#FF0000");
diff --git a/xCAT-UI/lib/functions.php b/xCAT-UI/lib/functions.php
index 8aa88130f..6416c4040 100644
--- a/xCAT-UI/lib/functions.php
+++ b/xCAT-UI/lib/functions.php
@@ -110,6 +110,7 @@ function submit_request($req, $skipVerify, $opts_array){
} else {
// Print out output by default
echo $tmp . '
';
+ ob_flush();
flush();
}
}
diff --git a/xCAT-UI/lib/ui.php b/xCAT-UI/lib/ui.php
index bc7ec98b8..6e14f3387 100644
--- a/xCAT-UI/lib/ui.php
+++ b/xCAT-UI/lib/ui.php
@@ -12,13 +12,14 @@ function loadPage(){
xCAT Console
-
+
+
-
-
+
+
';
@@ -32,6 +33,7 @@ function loadPage(){
Configure
Provision
Monitor
+ Guide
';
// User name and log out section
@@ -79,16 +81,21 @@ function login() {
// xcatauth.js will open a dialog box
// asking for the user name and password
echo
- '
-
- Give the user name and password for the xCAT management node
-
-
+ '
+
+
+
+
+
+ 
eXtreme Cloud Administration Toolkit
+
+
+
+
+
+
+
+ Open Source. EPL License
';
}
?>
\ No newline at end of file
diff --git a/xCAT-UI/xCAT-UI.spec b/xCAT-UI/xCAT-UI.spec
index 00de81eae..4b1876dec 100644
--- a/xCAT-UI/xCAT-UI.spec
+++ b/xCAT-UI/xCAT-UI.spec
@@ -126,6 +126,18 @@ set -x
fi
if [ "$1" = 1 ] # Install
+ then
+ # Update apache conf
+ /bin/rm -f /etc/$apachedaemon/conf.d/xcat-ui.conf
+ /bin/ln -s %{prefix}/ui/etc/apache2/conf.d/xcat-ui.conf /etc/$apachedaemon/conf.d/xcat-ui.conf
+
+ # Automatically put encrypted password into the xCAT passwd database
+ %{prefix}/sbin/chtab key=xcat,username=root passwd.password=`grep root /etc/shadow|cut -d : -f 2`
+
+ echo "To use xCAT-UI, point your browser to http://"`hostname -f`"/xcat"
+ fi
+
+ if [ "$1" = 1 ] || [ "$1" = 2 ] # Install or upgrade
then
# Copy php.ini file into /opt/xcat/ui and turn off output_buffering
if [ -e "/etc/redhat-release" ]; then
@@ -134,21 +146,8 @@ set -x
/bin/sed /etc/php5/apache2/php.ini -e 's/output_buffering = 4096/output_buffering = Off/g' > %{prefix}/ui/php.ini
fi
- # Update apache conf
- /bin/rm -f /etc/$apachedaemon/conf.d/xcat-ui.conf
- /bin/ln -s %{prefix}/ui/etc/apache2/conf.d/xcat-ui.conf /etc/$apachedaemon/conf.d/xcat-ui.conf
- /etc/init.d/$apachedaemon reload
-
- # Automatically put encrypted password into the xCAT passwd database
- %{prefix}/sbin/chtab key=xcat,username=root passwd.password=`grep root /etc/shadow|cut -d : -f 2`
-
- echo "To use xCAT-UI, point your browser to http://"`hostname -f`"/xcat"
- fi
-
- if [ "$1" = 1 ] || [ "$1" = 2 ] # Install or upgrade
- then
- # Uncomment this if we change xcat-ui.conf again
- # /etc/init.d/$apachedaemon reload
+ # Restart Apache Web Server
+ /etc/init.d/$apachedaemon reload
true
fi
%else # AIX