show pie chat summary for each group
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@10402 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
parent
56679e79f1
commit
d75e392427
@ -233,11 +233,15 @@ body {
|
||||
border-left: medium solid #E6E6F2;
|
||||
}
|
||||
|
||||
#nodes .summarypie {
|
||||
.summarypie {
|
||||
width: 370px;
|
||||
height: 280px;
|
||||
}
|
||||
|
||||
#summaryTab td{
|
||||
border: 0px;
|
||||
padding: 0px;
|
||||
}
|
||||
/*--------------- Info/warning bar ---------------*/
|
||||
span.ui-icon-info {
|
||||
float: left;
|
||||
|
@ -31,7 +31,7 @@ var hardwareInfo = {
|
||||
'8233-E8B' : [ 'P7-750', '4' ],
|
||||
'8236-E8C' : [ 'P7-755', '4' ],
|
||||
'9117-MMB' : [ 'P7-770', '4' ],
|
||||
'9119-FHB' : [ 'P7-795', '42' ],
|
||||
'9119-FHB' : [ 'P7-795', '4' ],
|
||||
'9179-MHB' : [ 'P7-780', '42' ],
|
||||
'9125-F2C' : [ 'Power 775', '2'],
|
||||
'78AC-100' : [ 'Power 775', '2'] //fsp
|
||||
|
@ -87,8 +87,8 @@ function loadNodesPage() {
|
||||
|
||||
success : function(data){
|
||||
loadGroups(data);
|
||||
// draw cluster's summary by group names
|
||||
loadPieSummary();
|
||||
// triggle the first group click event
|
||||
$('#groups .groupdiv div').eq(0).trigger('click');
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -99,20 +99,19 @@ function loadNodesPage() {
|
||||
*
|
||||
* @return Nothing
|
||||
*/
|
||||
function loadPieSummary(){
|
||||
$('#nodes').append('<h3>Cluster Summary</h3><hr/>');
|
||||
var summaryTable = '<table>' +
|
||||
function loadPieSummary(groupname){
|
||||
var summaryTable = '<table style="border: 0px none;">' +
|
||||
'<tr>' +
|
||||
'<td style="border: 0px;"><div id="ospie" class="summarypie"></div></td>' +
|
||||
'<td style="border: 0px;"><div id="archpie" class="summarypie"></div></td>' +
|
||||
'<td><div id="ospie" class="summarypie"></div></td>' +
|
||||
'<td><div id="archpie" class="summarypie"></div></td>' +
|
||||
'</tr>' +
|
||||
'<tr>' +
|
||||
'<td style="border: 0px;"><div id="provmethodpie" class="summarypie"></td>' +
|
||||
'<td style="border: 0px;"><div id="nodetypepie" class="summarypie"></div></td>' +
|
||||
'<td><div id="provmethodpie" class="summarypie"></td>' +
|
||||
'<td><div id="nodetypepie" class="summarypie"></div></td>' +
|
||||
'</tr></table>';
|
||||
$('#nodes').append(summaryTable);
|
||||
$('#summaryTab').append(summaryTable);
|
||||
|
||||
$('#nodes .summarypie').append(createLoader());
|
||||
$('#summaryTab .summarypie').append(createLoader());
|
||||
|
||||
$.ajax({
|
||||
url : 'lib/cmd.php',
|
||||
@ -120,7 +119,7 @@ function loadPieSummary(){
|
||||
data : {
|
||||
cmd : 'webrun',
|
||||
tgt : '',
|
||||
args : 'summary',
|
||||
args : 'summary;' + groupname,
|
||||
msg : ''
|
||||
},
|
||||
success:function(data){
|
||||
@ -143,7 +142,7 @@ function drawPieSummary(index, valuepair){
|
||||
var chattitle = '';
|
||||
var dataArray = [];
|
||||
var tempArray = [];
|
||||
var container = $('#nodes .summarypie').eq(index);
|
||||
var container = $('#summaryTab .summarypie').eq(index);
|
||||
|
||||
position = valuepair.indexOf('=');
|
||||
chattitle = valuepair.substr(0, position);
|
||||
@ -179,9 +178,9 @@ function drawPieSummary(index, valuepair){
|
||||
location: 'e'
|
||||
}
|
||||
});
|
||||
container.bind('jqplotDataClick',loadSummaryDetail);
|
||||
container.bind('jqplotDataHighlight',function(){this.style.cursor='pointer';});
|
||||
container.bind('jqplotDataUnhighlight',function(){this.style.cursor='';});
|
||||
//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){
|
||||
@ -229,7 +228,7 @@ function loadGroups(data) {
|
||||
$('#groups').append('<div class="grouplabel">Groups</div>');
|
||||
var grouplist= $('<div class="groupdiv"></div>');
|
||||
// Create a link for each group
|
||||
for (var i = groups.length; i--;) {
|
||||
for (var i = 0; i < groups.length; i++) {
|
||||
grouplist.append('<div>' + groups[i] + '</div>');
|
||||
}
|
||||
|
||||
@ -270,15 +269,18 @@ function drawNodesArea(targetgroup, cmdargs, message){
|
||||
setNodesTab(tab);
|
||||
tab.init();
|
||||
$('#nodes').append(tab.object());
|
||||
tab.add('nodesTab', 'Table', loader, false);
|
||||
tab.add('summaryTab', 'Summary', '', false);
|
||||
tab.add('nodesTab', 'Nodes', 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){
|
||||
if (2 == ui.index){
|
||||
createPhysicalLayout(nodesList);
|
||||
}
|
||||
});
|
||||
|
||||
loadPieSummary(targetgroup);
|
||||
// To improve performance, get all nodes within selected group
|
||||
// Get node definitions only for first 50 nodes
|
||||
$.ajax( {
|
||||
@ -1003,19 +1005,21 @@ function loadNodes(data) {
|
||||
statCol.find('img').hide();
|
||||
}
|
||||
|
||||
// Get definable node attributes
|
||||
$.ajax( {
|
||||
url : 'lib/cmd.php',
|
||||
dataType : 'json',
|
||||
data : {
|
||||
cmd : 'lsdef',
|
||||
tgt : '',
|
||||
args : '-t;node;-h',
|
||||
msg : ''
|
||||
},
|
||||
if (undefined == nodeAttrs){
|
||||
// Get definable node attributes
|
||||
$.ajax( {
|
||||
url : 'lib/cmd.php',
|
||||
dataType : 'json',
|
||||
data : {
|
||||
cmd : 'lsdef',
|
||||
tgt : '',
|
||||
args : '-t;node;-h',
|
||||
msg : ''
|
||||
},
|
||||
|
||||
success : setNodeAttrs
|
||||
});
|
||||
success : setNodeAttrs
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Additional ajax requests need to be made for zVM
|
||||
|
@ -152,13 +152,14 @@ function createPhysicalLayout(nodeList){
|
||||
}
|
||||
}
|
||||
|
||||
bpaList = new Object();
|
||||
fspList = new Object();
|
||||
lparList = new Object();
|
||||
selectNode = new Object();
|
||||
|
||||
//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{
|
||||
@ -174,16 +175,29 @@ function createPhysicalLayout(nodeList){
|
||||
}
|
||||
}
|
||||
|
||||
function fillList(nodeName){
|
||||
var parentName = graphicalNodeList[nodeName]['parent'];
|
||||
var mtm = graphicalNodeList[nodeName]['mtm'];
|
||||
var status = graphicalNodeList[nodeName]['status'];
|
||||
|
||||
function fillList(nodeName, defaultnodetype){
|
||||
var parentName = '';
|
||||
var mtm = '';
|
||||
var status = '';
|
||||
var nodetype = '';
|
||||
if (!graphicalNodeList[nodeName]){
|
||||
parentName = '';
|
||||
mtm = '';
|
||||
status = '';
|
||||
nodetype = defaultnodetype;
|
||||
}
|
||||
else{
|
||||
parentName = graphicalNodeList[nodeName]['parent'];
|
||||
mtm = graphicalNodeList[nodeName]['mtm'];
|
||||
status = graphicalNodeList[nodeName]['status'];
|
||||
nodetype = graphicalNodeList[nodeName]['type'];
|
||||
}
|
||||
|
||||
if ('' == status){
|
||||
status = 'unknown';
|
||||
}
|
||||
|
||||
switch (graphicalNodeList[nodeName]['type']){
|
||||
switch (nodetype){
|
||||
case 'frame': {
|
||||
if (undefined == bpaList[nodeName]){
|
||||
bpaList[nodeName] = new Array();
|
||||
@ -198,7 +212,7 @@ function fillList(nodeName){
|
||||
}
|
||||
|
||||
if (undefined == fspList[parentName]){
|
||||
fillList(parentName);
|
||||
fillList(parentName, 'cec');
|
||||
}
|
||||
|
||||
fspList[parentName]['children'].push(nodeName);
|
||||
@ -219,7 +233,7 @@ function fillList(nodeName){
|
||||
}
|
||||
|
||||
if (undefined == bpaList[parentName]){
|
||||
fillList(parentName);
|
||||
fillList(parentName, 'frame');
|
||||
}
|
||||
|
||||
bpaList[parentName].push(nodeName);
|
||||
|
Loading…
Reference in New Issue
Block a user