');
- area.append(tree_area);
- tree_area.jstree({
- themes : {
- "theme" : "default",
- "dots" : false, // No dots
- "icons" : false // No icons
- }
- });
+ createGraphical(bpaList, fspList, $('#graphTab'));
}
+function fillList(nodeName){
+ var parentName = nodeList[nodeName]['parent'];
+ var mtm = nodeList[nodeName]['mtm'];
+ var status = nodeList[nodeName]['status'];
+
+ switch(nodeList[nodeName]['type']){
+ case 'bpa': {
+ if (undefined == bpaList[nodeName]){
+ bpaList[nodeName] = new Array();
+ }
+ }
+ break;
+ case 'lpar,osi': {
+ if ('' == parentName){
+ break;
+ }
+
+ if (undefined == fspList[parentName]){
+ fillList(parentName);
+ }
+
+ fspList[parentName]['children'].push(nodeName);
+ lparList[nodeName] = status;
+ }
+ break;
+ case 'fsp': {
+ if (undefined != fspList[nodeName]){
+ break;
+ }
+
+ fspList[nodeName] = new Array();
+ fspList[nodeName]['children'] = new Array();
+ fspList[nodeName]['mtm'] = mtm;
+
+ if ('' == parentName){
+ break;
+ }
+
+ if (undefined == bpaList[parentName]){
+ fillList(parentName);
+ }
+
+ bpaList[parentName].push(nodeName);
+ }
+ break;
+ default:
+ break;
+ }
+}
/**
* create the physical graphical layout
*
@@ -176,9 +122,7 @@ function createTree(bpa, fsp, area){
*/
function createGraphical(bpa, fsp, area){
var usedFsp = new Object();
- var graphField = $('');
- graphField.append('');
- var graphTable = $('
');
+ var graphTable = $('
');
var elementNum = 0;
var row;
for (var bpaName in bpa){
@@ -187,7 +131,7 @@ function createGraphical(bpa, fsp, area){
graphTable.append(row);
}
elementNum ++;
- var td = $('
');
+ var td = $('
');
var frameDiv = $('');
frameDiv.append('
' + bpaName + '
');
for (var fspIndex in bpa[bpaName]){
@@ -235,15 +179,12 @@ function createGraphical(bpa, fsp, area){
}
elementNum ++;
- var td = $('
');
+ var td = $('
');
td.append(createFspDiv(fspName, fsp[fspName]['mtm'], fsp));
td.append(createFspTip(fspName, fsp[fspName]['mtm'], fsp));
row.append(td);
}
- graphField.append(graphTable);
-
- var graphical_area = $('');
var selectLparDiv = $('');
var temp = 0;
for (var i in selectLpar){
@@ -259,9 +200,13 @@ function createGraphical(bpa, fsp, area){
else{
updateSelectLparDiv();
}
- graphical_area.append(selectLparDiv);
- graphical_area.append(graphField);
- area.append(graphical_area);
+
+ //add buttons
+ var tempDiv = $('');
+ tempDiv.append(createActionMenu());
+ area.append(tempDiv);
+ area.append(selectLparDiv);
+ area.append(graphTable);
$('.tooltip input[type = checkbox]').bind('click', function(){
var lparName = $(this).attr('name');
@@ -274,14 +219,17 @@ function createGraphical(bpa, fsp, area){
}
else{
delete selectLpar[lparName];
- $('#graphTable [name=' + lparName + ']').css('border-color', 'transparent');
+ $('#graphTable [name=' + lparName + ']').css('border-color', '#BDBDBD');
}
updateSelectLparDiv();
});
$('.fspDiv2, .fspDiv4, .fspDiv42').tooltip({
-
+ position: "top center",
+ relative : true,
+ offset : [20, 40],
+ effect: "fade"
});
$('.fspDiv2, .fspDiv4, .fspDiv42').bind('click', function(){
@@ -301,7 +249,7 @@ function showSelectDialog(lpars){
var diaDiv = $('');
if (0 == lpars.length){
- diaDiv.append(createInfoBar('There is not any lpars defined.'));
+ diaDiv.append(createInfoBar('There is not any lpars be selected(defined).'));
}
else{
//add the dialog content
@@ -368,23 +316,10 @@ function showSelectDialog(lpars){
function updateSelectLparDiv(){
var temp = 0;
$('#selectLparDiv').empty();
-
- for (var LparName in selectLpar){
- temp ++;
- break;
- }
-
- if (0 == temp){
- $('#selectLparDiv').append(createInfoBar('Click CEC and select lpars to do operations.'));
- return;
- }
-
- temp =0;
+
//add buttons
- var tempDiv = $('');
- tempDiv.append(createActionMenu());
- $('#selectLparDiv').append(tempDiv);
- $('#selectLparDiv').append(' Lpars: ');
+
+ $('#selectLparDiv').append('Lpars: ');
for(var lparName in selectLpar){
$('#selectLparDiv').append(lparName + ' ');
temp ++;
@@ -589,9 +524,13 @@ function createFspDiv(fspName, mtm, fsp){
var lparStatusRow = '';
for (var lparIndex in fsp[fspName]['children']){
+ //show 8 lpars on one cec at most.
+ if (lparIndex >= 8){
+ break;
+ }
var lparName = fsp[fspName]['children'][lparIndex];
var color = statusMap(lparList[lparName]);
- lparStatusRow += '
1
';
+ lparStatusRow += '
1
';
}
//select the backgroud
@@ -632,8 +571,8 @@ function createFspTip(fspName, mtm, fsp){
var lparName = fsp[fspName]['children'][lparIndex];
var color = statusMap(lparList[lparName]);
var row = '