Refresh nodes owned by user in self-service page
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@10894 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
parent
1dd6960652
commit
fbff1318de
@ -551,27 +551,45 @@ function loadNodesTable(data) {
|
||||
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.'));
|
||||
}
|
||||
// Get nodes owned by user
|
||||
$.ajax( {
|
||||
url : 'lib/srv_cmd.php',
|
||||
dataType : 'json',
|
||||
data : {
|
||||
cmd : 'tabdump',
|
||||
tgt : '',
|
||||
args : 'nodetype',
|
||||
msg : ''
|
||||
},
|
||||
|
||||
success : function(data) {
|
||||
// Save nodes owned by user
|
||||
setUserNodes(data);
|
||||
|
||||
// Refresh nodes table
|
||||
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]);
|
||||
|
Loading…
Reference in New Issue
Block a user