show P7 IH cec from down to up

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@8733 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
xq2005 2011-01-24 09:55:59 +00:00
parent d4ee97490a
commit 610808e298
3 changed files with 57 additions and 4 deletions

View File

@ -667,7 +667,7 @@ table a:hover {
}
.lparDiv {
margin: 5px 0px 0px 9px;
margin: 1px 0px 0px 1px;
width: 80px;
height: 10px;
opacity: 1;
@ -680,6 +680,7 @@ table a:hover {
.fspcheckbox{
padding: 0px;
margin: 3px 3px 1px 3px;
}
/*--------------- Discovery section ---------------*/

View File

@ -32,5 +32,6 @@ var hardwareInfo = {
'8236-E8C' : [ 'P7-755', '4' ],
'9117-MMB' : [ 'P7-770', '4' ],
'9119-FHB' : [ 'P7-795', '42' ],
'9179-MHB' : [ 'P7-780', '42' ]
'9179-MHB' : [ 'P7-780', '42' ],
'9125-F2C' : [ 'P7-IH', '2'] //fsp
};

View File

@ -204,13 +204,26 @@ function createGraphical(bpa, fsp, area){
var td = $('<td style="padding:0;border-color: transparent;"></td>');
var frameDiv = $('<div class="frameDiv"></div>');
frameDiv.append('<div style="height:27px;" title="' + bpaName + '"><input type="checkbox" class="fspcheckbox" name="check_'+ bpaName +'"></div>');
//for P7-IH, all the cecs are insert into the frame from down to up, so we had to show the cecs same as the
//physical layout.
var tempBlankDiv = $('<div></div>');
var tempHeight = 0;
for (var fspIndex in bpa[bpaName]){
var fspName = bpa[bpaName][fspIndex];
usedFsp[fspName] = 1;
usedFsp[fspName] = 1;
//this is the p7IH, we should add the blank at the top
if ((0 == fspIndex) && ('9125-F2C' == fsp[fspName]['mtm'])){
frameDiv.append(tempBlankDiv);
}
frameDiv.append(createFspDiv(fspName, fsp[fspName]['mtm'], fsp));
frameDiv.append(createFspTip(fspName, fsp[fspName]['mtm'], fsp));
tempHeight += coculateBlank(fsp[fspName]['mtm']);
}
//now the tempHeight are all cecs' height, so we should minus bpa div height and cecs' div height
tempHeight = 428 - tempHeight;
tempBlankDiv.css('height', tempHeight);
td.append(frameDiv);
row.append(td);
}
@ -589,7 +602,7 @@ function createFspDiv(fspName, mtm, fsp){
}
//create return value
var retHtml = '<input style="margin:3px 3px 1px 4px;padding:0;" class="fspcheckbox" type="checkbox" name="check_' + fspName + '">';
var retHtml = '<input style="padding:0;" class="fspcheckbox" type="checkbox" name="check_' + fspName + '">';
retHtml += '<div value="' + fspName + '" class="' + divClass + '">';
retHtml += '<div class="lparDiv"><table><tbody><tr>' + lparStatusRow + '</tr></tbody></table></div></div>';
return retHtml;
@ -723,4 +736,42 @@ function changeNode(lparName, status){
}
$('#graphTable [name=' + lparName + ']').css('background-image', imgUrl);
$('.tooltip input[name="' + lparName + '"]').attr('checked', checkFlag);
}
/**
* The P7-IH's cecs are insert from down to up, so we had to coculate the blank height.
*
* @param
* @return the height for the cec
*/
function coculateBlank(mtm){
if ('' == mtm){
return 24;
}
if (!hardwareInfo[mtm]){
return 24;
}
switch(hardwareInfo[mtm]){
case 1:
{
return 13;
}
break;
case 2:
{
return 24;
}
break;
case 4:
{
return 47;
}
break;
default:
return 0;
break;
}
}