Added icon and minimize button to status box. Everytime a status box is created using createStatusBar(), there will be an icon in the upper left corner, a minimize button on upper right corner, and in between is a <div> where content will go into. To write content to the status box, you must get the status box, and use find() to find the <div> to write into.
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@9421 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
parent
73daaba963
commit
b448aaf6e6
@ -671,7 +671,7 @@ function initSiteTable(operType){
|
||||
$('.tooltip').remove();
|
||||
var showDiv = $('<div style="min-height:360px" id="siteDiv"><h2>' + steps[currentStep] + '(Site info)</h2></div>');
|
||||
var statBar = createStatusBar('siteTableStat');
|
||||
statBar.append(createLoader());
|
||||
statBar.find('div').append(createLoader());
|
||||
showDiv.append(statBar);
|
||||
$('#discoverContentDiv').append(showDiv);
|
||||
|
||||
@ -770,7 +770,7 @@ function showSiteArea(){
|
||||
},
|
||||
|
||||
success : function(data){
|
||||
$('#discoverContentDiv #siteTableStat').html('Current network interface configuration:<br/><pre>' +
|
||||
$('#discoverContentDiv #siteTableStat div').html('Current network interface configuration:<br/><pre>' +
|
||||
data.rsp + '</pre>');
|
||||
}
|
||||
});
|
||||
@ -887,7 +887,7 @@ function initDiscoverFrames(){
|
||||
+ '</td><td style="width:20px"></td><td id="mtmsTd"></td></tr></table></center>');
|
||||
|
||||
if (getDiscoverEnv('framemtmsmap')){
|
||||
$('#framedisc').html('Mapping the frame name and mtms which discovered by lsslp.<br\>' +
|
||||
$('#framedisc div').html('Mapping the frame name and mtms which discovered by lsslp.<br\>' +
|
||||
'Select the frame name, then select the mtms.');
|
||||
var mapArray = getDiscoverEnv('framemtmsmap').split(':');
|
||||
for(var i in mapArray){
|
||||
@ -914,7 +914,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,13 +923,13 @@ 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.<br\>' +
|
||||
$('#framedisc div').html('Mapping the frame name and mtms which discovered by lsslp.<br\>' +
|
||||
'Select the frame name, then select the mtms.');
|
||||
|
||||
for (var i in frameArray){
|
||||
|
@ -241,9 +241,9 @@ function updateRpm() {
|
||||
});
|
||||
|
||||
$('#update').show();
|
||||
$('#update').empty();
|
||||
$('#update').append("<p>Updating <b>" + rpms + "</b> from <b>" + rpmPath + "</b></p>");
|
||||
$('#update').append("<img id='loadingpic' src='images/loader.gif'>");
|
||||
$('#update div').empty();
|
||||
$('#update div').append("<p>Updating <b>" + rpms + "</b> from <b>" + rpmPath + "</b></p>");
|
||||
$('#update div').append("<img id='loadingpic' src='images/loader.gif'>");
|
||||
$('#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('<pre>' + resArray[resArray.length - 2] + '</pre>');
|
||||
$('#update div').append('<pre>' + resArray[resArray.length - 2] + '</pre>');
|
||||
} else {
|
||||
$('#update').append('<pre>' + resArray[resArray.length - 1] + '</pre>');
|
||||
$('#update div').append('<pre>' + resArray[resArray.length - 1] + '</pre>');
|
||||
}
|
||||
|
||||
// Create link to show details
|
||||
$('#update').append('<br/><a>Show details</a>');
|
||||
$('#update a').css( {
|
||||
$('#update div').append('<br/><a>Show details</a>');
|
||||
$('#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 = $('<pre id="resDetail"></pre>');
|
||||
resDetail.hide();
|
||||
$('#update').append(resDetail);
|
||||
$('#update div').append(resDetail);
|
||||
for (temp = 0; temp < resArray.length; temp++) {
|
||||
resDetail.append(resArray[temp] + '<br/>');
|
||||
}
|
||||
|
@ -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.');
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
@ -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.');
|
||||
|
@ -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.');
|
||||
|
@ -364,9 +364,9 @@ function updateZProvisionNewStatus(data) {
|
||||
// If there was an error, do not continue
|
||||
if (rsp.length) {
|
||||
$('#' + loaderId).hide();
|
||||
$('#' + statBarId).append('<p>(Error) Failed to create node definition</p>');
|
||||
$('#' + statBarId).find('div').append('<pre>(Error) Failed to create node definition</pre>');
|
||||
} else {
|
||||
$('#' + statBarId).append('<p>Node definition created for ' + node + '</p>');
|
||||
$('#' + statBarId).find('div').append('<pre>Node definition created for ' + node + '</pre>');
|
||||
$.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('<p>(Error) Failed to update /etc/hosts</p>');
|
||||
$('#' + statBarId).find('div').append('<pre>(Error) Failed to update /etc/hosts</pre>');
|
||||
} else {
|
||||
$('#' + statBarId).append('<p>/etc/hosts updated</p>');
|
||||
$('#' + statBarId).find('div').append('<pre>/etc/hosts updated</pre>');
|
||||
$.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('<p>Trying again...</p>');
|
||||
$('#' + statBarId).find('div').append('<pre>Trying again...</pre>');
|
||||
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('<p>Trying again...</p>');
|
||||
$('#' + statBarId).find('div').append('<pre>Trying again...</pre>');
|
||||
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('<p>(Error) Failed to set operating system</p>');
|
||||
$('#' + statBarId).find('div').append('<pre>(Error) Failed to set operating system</pre>');
|
||||
} else {
|
||||
$('#' + statBarId).append('<p>Operating system for ' + node + ' set</p>');
|
||||
$('#' + statBarId).find('div').append('<pre>Operating system for ' + node + ' set</pre>');
|
||||
$.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('<p>Open a VNC viewer to see the installation progress. It might take a couple of minutes before you can connect.</p>');
|
||||
$('#' + statBarId).find('div').append('<pre>Open a VNC viewer to see the installation progress. It might take a couple of minutes before you can connect.</pre>');
|
||||
}
|
||||
|
||||
// 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('<p>(Error) Failed to create node definition</p>');
|
||||
$('#' + out2Id).find('div').append('<pre>(Error) Failed to create node definition</pre>');
|
||||
} else {
|
||||
$('#' + out2Id).append('<p>Node definition created for ' + node + '</p>');
|
||||
$('#' + out2Id).find('div').append('<pre>Node definition created for ' + node + '</pre>');
|
||||
|
||||
// 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('<p>(Error) Failed to update /etc/hosts</p>');
|
||||
$('#' + out2Id).find('div').append('<pre>(Error) Failed to update /etc/hosts</pre>');
|
||||
} else {
|
||||
$('#' + out2Id).append('<p>/etc/hosts updated</p>');
|
||||
$('#' + out2Id).find('div').append('<pre>/etc/hosts updated</pre>');
|
||||
$.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();
|
||||
|
@ -622,6 +622,53 @@ function loadNodes4Ganglia(data) {
|
||||
|
||||
success : loadGangliaStatus
|
||||
});
|
||||
|
||||
/**
|
||||
* 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 = gangliaTable.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
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1037,4 +1084,7 @@ function createGangliaToolTip() {
|
||||
function installGanglia(node) {
|
||||
var iframe = createIFrame('lib/cmd.php?cmd=webrun&tgt=&args=installganglia;' + node + '&msg=' + node + '&opts=flush');
|
||||
iframe.prependTo($('#gangliamon #nodes'));
|
||||
|
||||
// Turn on Ganglia for node
|
||||
monitorNode(node, 'on');
|
||||
}
|
@ -13,7 +13,7 @@ function loadRmcMon(){
|
||||
|
||||
//add the stauts bar first. id = 'rmcMonStatus'
|
||||
var rmcStatusBar = createStatusBar('rmcMonStatus');
|
||||
rmcStatusBar.append(createLoader());
|
||||
rmcStatusBar.find('div').append(createLoader());
|
||||
rmcMonTab.append(rmcStatusBar);
|
||||
|
||||
//add the configure button.
|
||||
@ -61,7 +61,7 @@ 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',
|
||||
@ -73,7 +73,7 @@ function loadRmcMonConfigure(){
|
||||
},
|
||||
|
||||
success : function(data){
|
||||
$('#rmcMonStatus').empty().append(data.rsp[0]);
|
||||
$('#rmcMonStatus div').empty().append(data.rsp[0]);
|
||||
}
|
||||
});
|
||||
});
|
||||
@ -82,7 +82,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,7 +94,7 @@ function loadRmcMonConfigure(){
|
||||
},
|
||||
|
||||
success : function(data){
|
||||
$('#rmcMonStatus').empty().append(data.rsp[0]);
|
||||
$('#rmcMonStatus div').empty().append(data.rsp[0]);
|
||||
}
|
||||
});
|
||||
});
|
||||
@ -125,7 +125,7 @@ function rsctRpmCheck(data){
|
||||
|
||||
success : function(data){
|
||||
if (-1 != data.rsp.indexOf("not")){
|
||||
$('#rmcMonStatus').empty().append(
|
||||
$('#rmcMonStatus div').empty().append(
|
||||
'Please install the <a href="http://www14.software.ibm.com/webapp/set2/sas/f/rsct/rmc/download/home.html" target="install_window">RSCT</a> first.<br/>' +
|
||||
'You can find more support from <a href="http://xcat.svn.sourceforge.net/viewvc/xcat/xcat-core/trunk/xCAT-client/share/doc/xCAT2-Monitoring.pdf" target="pdf_window">xCAT2-Monitoring.pdf</a>');
|
||||
}
|
||||
@ -151,24 +151,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 <a href="http://xcat.sourceforge.net/#download" target="install_window">xCAT-rmc</a> first.<br/>');
|
||||
}
|
||||
|
||||
//check the rrdtool
|
||||
if (-1 != softInstallStatus[1].indexOf("not")){
|
||||
needHelp = true;
|
||||
$('#rmcMonStatus').append(
|
||||
$('#rmcMonStatus div').append(
|
||||
'Please install the <a href="http://oss.oetiker.ch/rrdtool/download.en.html" target="install_window">RRD-tool</a> first.<br/>');
|
||||
}
|
||||
|
||||
//add help info or load the rmc show
|
||||
if (needHelp){
|
||||
$('#rmcMonStatus').append(
|
||||
$('#rmcMonStatus div').append(
|
||||
'You can find more support form <a href="http://xcat.svn.sourceforge.net/viewvc/xcat/xcat-core/trunk/xCAT-client/share/doc/xCAT2-Monitoring.pdf" target="pdf_window">xCAT2-Monitoring.pdf</a>');
|
||||
}
|
||||
else{
|
||||
@ -179,8 +179,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 +194,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();
|
||||
@ -203,8 +203,8 @@ function rmcWorkingCheck(){
|
||||
}
|
||||
|
||||
function loadRmcMonShow(){
|
||||
$('#rmcMonStatus').empty().append("Getting monitoring Data (This step may take a long time).");
|
||||
$('#rmcMonStatus').append(createLoader());
|
||||
$('#rmcMonStatus div').empty().append("Getting monitoring Data (This step may take a long time).");
|
||||
$('#rmcMonStatus div').append(createLoader());
|
||||
|
||||
//init the selected Attributes string
|
||||
if ($.cookie('rmcmonattr')){
|
||||
@ -352,7 +352,7 @@ function showDetail(){
|
||||
|
||||
var detailFilter = $('<div id="detailFilter"></div>');
|
||||
|
||||
$('#rmcMonStatus').empty().append("RMC Monitoring Show");
|
||||
$('#rmcMonStatus div').empty().append("RMC Monitoring Show");
|
||||
$('#rmcmonDetail').empty().append('<h3>Detail</h3><hr />');
|
||||
$('#rmcmonDetail').append(detailFilter);
|
||||
|
||||
@ -639,7 +639,7 @@ function loadRmcEvent(){
|
||||
|
||||
//add the stauts bar first. id = 'rmcMonStatus'
|
||||
var rmcStatusBar = createStatusBar('rmcEventStatus');
|
||||
rmcStatusBar.append(createLoader());
|
||||
rmcStatusBar.find('div').append(createLoader());
|
||||
$('#rmcevent').append(rmcStatusBar);
|
||||
$('#rmcevent').append('<div id="rmcEventDiv"></div>');
|
||||
|
||||
@ -665,7 +665,7 @@ function loadRmcEvent(){
|
||||
*/
|
||||
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 +677,7 @@ function getConditions(){
|
||||
},
|
||||
|
||||
success : function (data){
|
||||
$('#rmcEventStatus').empty();
|
||||
$('#rmcEventStatus div').empty();
|
||||
$('#rmcEventButtons').show();
|
||||
globalCondition = data.rsp[0];
|
||||
}
|
||||
@ -734,10 +734,10 @@ function getResponse(){
|
||||
*
|
||||
*/
|
||||
function showEventLog(data){
|
||||
$('#rmcEventStatus').empty();
|
||||
$('#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');
|
||||
@ -926,7 +926,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 +938,7 @@ function mkCondRespDia(){
|
||||
},
|
||||
|
||||
success : function(data){
|
||||
$('#rmcEventStatus').empty().append(data.rsp[0]);;
|
||||
$('#rmcEventStatus div').empty().append(data.rsp[0]);;
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -1032,7 +1032,7 @@ function chCondScopeDia(){
|
||||
$('#changeStatus').append(data.rsp[0]);
|
||||
}
|
||||
else{
|
||||
$('#rmcEventStatus').empty().append(data.rsp[0]);
|
||||
$('#rmcEventStatus div').empty().append(data.rsp[0]);
|
||||
$('#chScopeDiaDiv').remove();
|
||||
}
|
||||
}
|
||||
@ -1169,7 +1169,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);
|
||||
@ -1236,7 +1236,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 +1248,7 @@ function stopCondRespDia(){
|
||||
},
|
||||
|
||||
success : function(data){
|
||||
$('#rmcEventStatus').empty().append(data.rsp[0]);
|
||||
$('#rmcEventStatus div').empty().append(data.rsp[0]);
|
||||
}
|
||||
});
|
||||
$(this).dialog('close');
|
||||
|
@ -1506,7 +1506,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 +1606,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 +1747,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 +1846,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 +1857,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 +1878,7 @@ function updateStatusBar(data) {
|
||||
$('#' + statBarId).find('img').hide();
|
||||
|
||||
// Write ajax response to status bar
|
||||
var prg = $('<pre style="margin: 0px;"></pre>');
|
||||
var prg = $('<pre></pre>');
|
||||
for (var i in rsp) {
|
||||
for (var j in tgts) {
|
||||
rsp[i] = rsp[i].replace(new RegExp(tgts[j] + ':', 'g'), '');
|
||||
@ -1887,7 +1887,7 @@ function updateStatusBar(data) {
|
||||
prg.append(rsp[i]);
|
||||
prg.append('<br>');
|
||||
}
|
||||
$('#' + statBarId).append(prg);
|
||||
$('#' + statBarId).find('div').append(prg);
|
||||
|
||||
// Enable fields
|
||||
$('#' + statBarId).parent().find('input').removeAttr('disabled');
|
||||
@ -1901,7 +1901,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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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('<p>(Error) Failed to create node definition</p>');
|
||||
$('#' + statBarId).find('div').append('<pre>(Error) Failed to create node definition</pre>');
|
||||
} else {
|
||||
// Create target nodes string
|
||||
var tgtNodesStr = '';
|
||||
@ -277,7 +277,7 @@ function updateNodesetStatus(data) {
|
||||
}
|
||||
}
|
||||
|
||||
$('#' + statBarId).append('<p>Node definition created for ' + tgtNodesStr + '</p>');
|
||||
$('#' + statBarId).find('div').append('<pre>Node definition created for ' + tgtNodesStr + '</pre>');
|
||||
$.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('<p>(Error) Failed to update /etc/hosts</p>');
|
||||
$('#' + statBarId).find('div').append('<pre>(Error) Failed to update /etc/hosts</pre>');
|
||||
} else {
|
||||
$('#' + statBarId).append('<p>/etc/hosts updated</p>');
|
||||
$('#' + statBarId).find('div').append('<pre>/etc/hosts updated</pre>');
|
||||
}
|
||||
|
||||
// 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();
|
||||
|
@ -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');
|
||||
|
@ -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');
|
||||
|
@ -414,12 +414,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
|
||||
@ -1043,7 +1044,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 +1155,13 @@ function loadCopyCdPage() {
|
||||
var tabId = statBarId.replace('copyLinuxStatusBar', 'copyLinuxTab');
|
||||
|
||||
// Go through output and append to paragraph
|
||||
var prg = $('<p></p>');
|
||||
var prg = $('<pre></pre>');
|
||||
for (var i in out) {
|
||||
if (out[i].length > 6) {
|
||||
prg.append(out[i] + '<br>');
|
||||
prg.append(out[i] + '<br/>');
|
||||
}
|
||||
}
|
||||
$('#' + statBarId).append(prg);
|
||||
$('#' + statBarId).find('div').append(prg);
|
||||
|
||||
// Hide loader
|
||||
$('#' + statBarId).find('img').hide();
|
||||
|
@ -304,7 +304,38 @@ DataTable.prototype.add = function(rowCont) {
|
||||
* @return Status bar
|
||||
*/
|
||||
function createStatusBar(barId) {
|
||||
var statusBar = $('<div class="ui-state-highlight ui-corner-all" id="' + barId + '"></div>').css('padding', '10px');
|
||||
var statusBar = $('<div class="ui-state-highlight ui-corner-all" id="' + barId + '"></div>').css({
|
||||
'margin-bottom': '5px',
|
||||
'min-height': '30px'
|
||||
});
|
||||
|
||||
// Create info icon
|
||||
var icon = $('<span class="ui-icon ui-icon-circle-check"></span>').css({
|
||||
'display': 'inline-block',
|
||||
'margin': '10px 5px'
|
||||
});
|
||||
|
||||
// Create message section
|
||||
var msg = $('<div></div>').css({
|
||||
'display': 'inline-block',
|
||||
'margin': '10px 0px',
|
||||
'width': '90%'
|
||||
});
|
||||
|
||||
// Create hide button
|
||||
var hide = $('<span class="ui-icon ui-icon-minus"></span>').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;
|
||||
}
|
||||
|
||||
@ -520,17 +551,18 @@ function includeJs(file) {
|
||||
*/
|
||||
function writeRsp(rsp, pattern) {
|
||||
// Create paragraph to hold ajax response
|
||||
var prg = $('<p></p>');
|
||||
var prg = $('<pre></pre>');
|
||||
|
||||
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'), '<br>');
|
||||
rsp[i] = rsp[i].replace(new RegExp(pattern, 'g'), '<br/>');
|
||||
prg.append(rsp[i]);
|
||||
} else {
|
||||
prg.append(rsp[i]);
|
||||
prg.append('<br>');
|
||||
prg.append('<br/>');
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -582,7 +614,9 @@ function openDialog(type, msg) {
|
||||
*/
|
||||
function createIFrame(src) {
|
||||
// Put an iframe inside an info box
|
||||
var infoBar = $('<div class="ui-state-highlight ui-corner-all"></div>');
|
||||
var infoBar = $('<div class="ui-state-highlight ui-corner-all"></div>').css({
|
||||
'margin-bottom': '5px'
|
||||
});
|
||||
|
||||
// Create info and close icons
|
||||
var icon = $('<span class="ui-icon ui-icon-info"></span>').css({
|
||||
|
Loading…
x
Reference in New Issue
Block a user