mirror of
https://github.com/xcat2/xcat-core.git
synced 2025-05-29 17:23:08 +00:00
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@10487 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
parent
b81c987415
commit
e2abdd2181
@ -213,21 +213,19 @@ function loadSummaryDetail(ev, seriesIndex, pointIndex, data){
|
||||
case 'os':
|
||||
case 'arch':
|
||||
case 'provmethod':
|
||||
case 'nodetype':{
|
||||
case 'nodetype':
|
||||
table = 'nodetype';
|
||||
}
|
||||
break;
|
||||
case 'status': {
|
||||
break;
|
||||
case 'status':
|
||||
table = 'nodelist';
|
||||
}
|
||||
break;
|
||||
break;
|
||||
}
|
||||
|
||||
var args = table + '.' + temp + '==';
|
||||
if (data[0] != 'unknown') {
|
||||
args += data[0];
|
||||
}
|
||||
|
||||
|
||||
drawNodesArea('', args, '');
|
||||
}
|
||||
|
||||
@ -288,91 +286,97 @@ function drawNodesArea(targetgroup, cmdargs, message){
|
||||
// Clear nodes division
|
||||
$('#nodes').empty();
|
||||
|
||||
// Create loader
|
||||
var loader = $('<center></center>').append(createLoader());
|
||||
|
||||
// Create a tab for this group
|
||||
var tab = new Tab('nodesPageTabs');
|
||||
setNodesTab(tab);
|
||||
tab.init();
|
||||
$('#nodes').append(tab.object());
|
||||
tab.add('summaryTab', 'Summary', '', false);
|
||||
tab.add('nodesTab', 'Nodes', loader, false);
|
||||
tab.add('nodesTab', 'Nodes', '', false);
|
||||
tab.add('graphTab', 'Graphic', '', false);
|
||||
|
||||
$('#nodesPageTabs').bind('tabsselect', function(event, ui){
|
||||
// For the graphical tab, check the graphical data first
|
||||
if (ui.index == 2){
|
||||
createPhysicalLayout(nodesList);
|
||||
}
|
||||
});
|
||||
|
||||
// Load group's summary pie charts
|
||||
loadPieSummary(targetgroup);
|
||||
|
||||
// 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
|
||||
|
||||
// Load nodes table when tab is selected
|
||||
$('#nodesPageTabs').bind('tabsselect', function(event, ui){
|
||||
if (!$('#nodesTab').children().length && ui.index == 1) {
|
||||
// Create loader
|
||||
$('#nodesTab').append($('<center></center>').append(createLoader()));
|
||||
|
||||
// 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 : 'lsdef',
|
||||
tgt : '',
|
||||
args : nodes,
|
||||
msg : targetgroup
|
||||
cmd : 'nodels',
|
||||
tgt : targetgroup,
|
||||
args : cmdargs,
|
||||
msg : message
|
||||
},
|
||||
|
||||
success : loadNodes
|
||||
/**
|
||||
* 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
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
// Load graphical layout when tab is selected
|
||||
$('#nodesPageTabs').bind('tabsselect', function(event, ui){
|
||||
// For the graphical tab, check the graphical data first
|
||||
if (!$('#graphTab').children().length && ui.index == 2) {
|
||||
createPhysicalLayout(nodesList);
|
||||
}
|
||||
});
|
||||
|
||||
// Load group's summary pie charts (default)
|
||||
loadPieSummary(targetgroup);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -394,8 +398,8 @@ function mkAddNodeLink() {
|
||||
+ '<select id="mgt" name="mgt">'
|
||||
+ '<option value="ipmi">iDataPlex</option>'
|
||||
+ '<option value="blade">BladeCenter</option>'
|
||||
+ '<option value="hmc">System P</option>'
|
||||
+ '<option value="zvm">System Z</option>'
|
||||
+ '<option value="hmc">System p</option>' // Documentation refers to 'IBM System p' (where p is NOT capitalized)
|
||||
+ '<option value="zvm">System z</option>' // Documentation refers to 'IBM System z' (where z is NOT capitalized)
|
||||
+ '</select>'
|
||||
+ '</div>');
|
||||
|
||||
@ -840,7 +844,7 @@ function loadNodes(data) {
|
||||
|
||||
// Provision
|
||||
var provLnk = '<a>Provision</a>';
|
||||
var provMenu = createMenu([ boot2NetworkLnk, setBootStateLnk, rcons, provisionLnk]);
|
||||
var provMenu = createMenu([boot2NetworkLnk, setBootStateLnk, rcons, provisionLnk]);
|
||||
|
||||
// Create an action menu
|
||||
var actionsMenu = createMenu([ [ actionsLnk, actsMenu ], [ configLnk, configMenu ], [ provLnk, provMenu ] ]);
|
||||
@ -3321,8 +3325,14 @@ function jump2Provision(tgtNodes){
|
||||
*/
|
||||
function adjustColumnSize() {
|
||||
var cols = $('#' + nodesTableId).find('tbody tr:eq(0) td');
|
||||
for (var i in cols) {
|
||||
var header = $('#' + nodesTableId + '_wrapper .dataTables_scrollHead .datatable thead tr th').eq(i);
|
||||
header.css('width', cols.eq(i).outerWidth());
|
||||
}
|
||||
|
||||
// If the column size is zero, wait until table is initialized
|
||||
if (!cols.eq(1).outerWidth()) {
|
||||
adjustColumnSize();
|
||||
} else {
|
||||
for (var i in cols) {
|
||||
var headers = $('#' + nodesTableId + '_wrapper .dataTables_scrollHead .datatable thead tr th').eq(i);
|
||||
headers.css('width', cols.eq(i).outerWidth());
|
||||
}
|
||||
}
|
||||
}
|
@ -456,17 +456,12 @@ function updateSelectNodeDiv(){
|
||||
* @return action menu object
|
||||
*/
|
||||
function createActionMenu(){
|
||||
//create action bar
|
||||
// Create action bar
|
||||
var actionBar = $('<div class="actionBar"></div>');
|
||||
|
||||
/**
|
||||
* The following actions are available to perform against a given node:
|
||||
* power, clone, delete, unlock, and advanced
|
||||
*/
|
||||
var powerLnk = $('<a>Power</a>');
|
||||
//power on
|
||||
// Power on
|
||||
var powerOnLnk = $('<a>Power on</a>');
|
||||
powerOnLnk.bind('click', function(event) {
|
||||
powerOnLnk.click(function() {
|
||||
var tgtNodes = getSelectNodes();
|
||||
$.ajax({
|
||||
url : 'lib/cmd.php',
|
||||
@ -479,10 +474,10 @@ function createActionMenu(){
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
//power off
|
||||
|
||||
// Power off
|
||||
var powerOffLnk = $('<a>Power off</a>');
|
||||
powerOffLnk.bind('click', function(event) {
|
||||
powerOffLnk.click(function() {
|
||||
var tgtNodes = getSelectNodes();
|
||||
$.ajax({
|
||||
url : 'lib/cmd.php',
|
||||
@ -495,133 +490,96 @@ function createActionMenu(){
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
//clone
|
||||
var cloneLnk = $('<a>Clone</a>');
|
||||
cloneLnk.bind('click', function(event) {
|
||||
/*
|
||||
for (var name in selectNode) {
|
||||
var mgt = graphicalNodeList[name]['mgt'];
|
||||
|
||||
//create an instance of the plugin
|
||||
var plugin;
|
||||
switch(mgt) {
|
||||
case "blade":
|
||||
plugin = new bladePlugin();
|
||||
break;
|
||||
case "fsp":
|
||||
plugin = new fspPlugin();
|
||||
break;
|
||||
case "hmc":
|
||||
plugin = new hmcPlugin();
|
||||
break;
|
||||
case "ipmi":
|
||||
plugin = new ipmiPlugin();
|
||||
break;
|
||||
case "ivm":
|
||||
plugin = new ivmPlugin();
|
||||
break;
|
||||
case "zvm":
|
||||
plugin = new zvmPlugin();
|
||||
break;
|
||||
}
|
||||
|
||||
plugin.loadClonePage(name);
|
||||
}
|
||||
*/
|
||||
});
|
||||
|
||||
//delete
|
||||
|
||||
// Delete
|
||||
var deleteLnk = $('<a>Delete</a>');
|
||||
deleteLnk.bind('click', function(event) {
|
||||
deleteLnk.click(function() {
|
||||
var tgtNodes = getSelectNodes();
|
||||
if (tgtNodes) {
|
||||
loadDeletePage(tgtNodes);
|
||||
}
|
||||
});
|
||||
|
||||
//unlock
|
||||
// Unlock
|
||||
var unlockLnk = $('<a>Unlock</a>');
|
||||
unlockLnk.bind('click', function(event) {
|
||||
unlockLnk.click(function() {
|
||||
var tgtNodes = getSelectNodes();
|
||||
if (tgtNodes) {
|
||||
loadUnlockPage(tgtNodes);
|
||||
}
|
||||
});
|
||||
|
||||
//run script
|
||||
// Run script
|
||||
var scriptLnk = $('<a>Run script</a>');
|
||||
scriptLnk.bind('click', function(event) {
|
||||
scriptLnk.click(function() {
|
||||
var tgtNodes = getSelectNodes();
|
||||
if (tgtNodes) {
|
||||
loadScriptPage(tgtNodes);
|
||||
}
|
||||
});
|
||||
|
||||
//update node
|
||||
// Update
|
||||
var updateLnk = $('<a>Update</a>');
|
||||
updateLnk.bind('click', function(event) {
|
||||
updateLnk.click(function() {
|
||||
var tgtNodes = getSelectNodes();
|
||||
if (tgtNodes) {
|
||||
loadUpdatenodePage(tgtNodes);
|
||||
}
|
||||
});
|
||||
|
||||
//set boot state
|
||||
// Set boot state
|
||||
var setBootStateLnk = $('<a>Set boot state</a>');
|
||||
setBootStateLnk.bind('click', function(event) {
|
||||
setBootStateLnk.click(function() {
|
||||
var tgtNodes = getSelectNodes();
|
||||
if (tgtNodes) {
|
||||
loadNodesetPage(tgtNodes);
|
||||
}
|
||||
});
|
||||
|
||||
//boot to network
|
||||
// Boot to network
|
||||
var boot2NetworkLnk = $('<a>Boot to network</a>');
|
||||
boot2NetworkLnk.bind('click', function(event) {
|
||||
boot2NetworkLnk.click(function() {
|
||||
var tgtNodes = getSelectNodes();
|
||||
if (tgtNodes) {
|
||||
loadNetbootPage(tgtNodes);
|
||||
}
|
||||
});
|
||||
|
||||
//remote console
|
||||
var rcons = $('<a>Open console</a>');
|
||||
rcons.bind('click', function(event){
|
||||
|
||||
// Remote console
|
||||
var rconLnk = $('<a>Open console</a>');
|
||||
rconLnk.bind('click', function(event){
|
||||
var tgtNodes = getSelectNodes();
|
||||
if (tgtNodes) {
|
||||
loadRconsPage(tgtNodes);
|
||||
}
|
||||
});
|
||||
|
||||
//edit properties
|
||||
// Edit properties
|
||||
var editProps = $('<a>Edit properties</a>');
|
||||
editProps.bind('click', function(event){
|
||||
for (var node in selectNode) {
|
||||
loadEditPropsPage(node);
|
||||
}
|
||||
});
|
||||
|
||||
// Actions
|
||||
var actionsLnk = '<a>Actions</a>';
|
||||
var actsMenu = createMenu([deleteLnk, powerOnLnk, powerOffLnk, scriptLnk]);
|
||||
|
||||
var advancedLnk = $('<a>Advanced</a>');
|
||||
// Configurations
|
||||
var configLnk = '<a>Configuration</a>';
|
||||
var configMenu = createMenu([unlockLnk, updateLnk, editProps]);
|
||||
|
||||
//power actions
|
||||
var powerActions = [ powerOnLnk, powerOffLnk ];
|
||||
var powerActionMenu = createMenu(powerActions);
|
||||
// Provision
|
||||
var provLnk = '<a>Provision</a>';
|
||||
var provMenu = createMenu([boot2NetworkLnk, setBootStateLnk, rconLnk]);
|
||||
|
||||
//advanced actions
|
||||
var advancedActions;
|
||||
advancedActions = [ boot2NetworkLnk, scriptLnk, setBootStateLnk, updateLnk, rcons, editProps ];
|
||||
var advancedActionMenu = createMenu(advancedActions);
|
||||
|
||||
/**
|
||||
* create an action menu
|
||||
*/
|
||||
var actionsDIV = $('<div></div>');
|
||||
var actions = [ [ powerLnk, powerActionMenu ], deleteLnk, unlockLnk, [ advancedLnk, advancedActionMenu ] ];
|
||||
var actionMenu = createMenu(actions);
|
||||
actionMenu.superfish();
|
||||
actionsDIV.append(actionMenu);
|
||||
actionBar.append(actionsDIV);
|
||||
// Create an action menu
|
||||
var actionsMenu = createMenu([ [ actionsLnk, actsMenu ], [ configLnk, configMenu ], [ provLnk, provMenu ] ]);
|
||||
actionsMenu.superfish();
|
||||
actionsMenu.css('display', 'inline-block');
|
||||
actionBar.append(actionsMenu);
|
||||
actionBar.css('margin-top', '10px');
|
||||
|
||||
return actionBar;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user