Added refresh button for monitoring and nodes table in self-service portal.

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@10892 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
phamt 2011-10-26 03:31:22 +00:00
parent 4b7f92d496
commit 971bed5ddf
3 changed files with 37 additions and 7 deletions

View File

@ -207,10 +207,15 @@ zvmPlugin.prototype.loadServiceInventory = function(data) {
* Monitoring section
*/
fieldSet = $('<fieldset id="' + node + '_monitor"></fieldset>');
legend = $('<legend>Monitoring</legend>');
legend = $('<legend>Monitoring [<a style="font-weight: normal; color: blue; text-decoration: none;">Refresh</a>]</legend>');
fieldSet.append(legend);
getMonitorMetrics(node);
// Refresh monitoring charts on-click
legend.find('a').click(function() {
getMonitorMetrics(node);
});
// Append to inventory form
invDiv.append(fieldSet);

View File

@ -548,9 +548,34 @@ function loadNodesTable(data) {
var actionBar = $('<div class="actionBar"></div>');
// Prepend menu to datatable
var actionsLnk = '<a>Actions</a>';
var actionsLnk = $('<a>Actions</a>');
var refreshLnk = $('<a>Refresh</a>');
refreshLnk.click(function() {
var userName = $.cookie('srv_usrname');
var userNodes = $.cookie(userName + '_usrnodes');
if (userNodes) {
// Get nodes definitions
$.ajax( {
url : 'lib/srv_cmd.php',
dataType : 'json',
data : {
cmd : 'lsdef',
tgt : '',
args : userNodes,
msg : ''
},
success : loadNodesTable
});
} else {
// Clear the tab before inserting the table
$('#manageTab').children().remove();
$('#manageTab').append(createWarnBar('You are not managing any node. Try to provision a node.'));
}
});
var actionMenu = createMenu([cloneLnk, deleteLnk, monitorOnLnk, monitorOffLnk, powerOnLnk, powerOffLnk, unlockLnk]);
var menu = createMenu([[actionsLnk, actionMenu]]);
var menu = createMenu([[actionsLnk, actionMenu], refreshLnk]);
menu.superfish();
actionBar.append(menu);
@ -771,7 +796,7 @@ function loadNode(e) {
// Get node that was clicked
var node = (e.target) ? e.target.id : e.srcElement.id;
// Create a new tab to show inventory
var tabId = node + '_inventory';
@ -1573,7 +1598,7 @@ function saveNodeLoad(status){
function getMonitorMetrics(node) {
// Inventory tab should have this fieldset already created
// e.g. <fieldset id="gpok123_monitor"></fieldset>
$('#' + node + '_monitor').children().remove();
$('#' + node + '_monitor').children('div').remove();
// Before trying to get the metrics, check if Ganglia is running
$.ajax({

View File

@ -770,8 +770,8 @@ function createIFrame(src) {
var iframe = $('<iframe></iframe>').attr('src', src).css({
'display': 'inline-block',
'border': '0px',
'margin': '10px 20px',
'width': '95%'
'margin': '10px',
'width': '90%'
});
var loader = createLoader('iLoader').css({