From 610808e298f701b9bce188509e88d5a3b0b0e772 Mon Sep 17 00:00:00 2001 From: xq2005 Date: Mon, 24 Jan 2011 09:55:59 +0000 Subject: [PATCH] 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 --- xCAT-UI/css/style.css | 3 +- xCAT-UI/js/nodes/mtm.js | 3 +- xCAT-UI/js/nodes/physical.js | 55 ++++++++++++++++++++++++++++++++++-- 3 files changed, 57 insertions(+), 4 deletions(-) diff --git a/xCAT-UI/css/style.css b/xCAT-UI/css/style.css index c0ca8d416..e0d3ca29a 100644 --- a/xCAT-UI/css/style.css +++ b/xCAT-UI/css/style.css @@ -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 ---------------*/ diff --git a/xCAT-UI/js/nodes/mtm.js b/xCAT-UI/js/nodes/mtm.js index be55a9b19..af55dd308 100644 --- a/xCAT-UI/js/nodes/mtm.js +++ b/xCAT-UI/js/nodes/mtm.js @@ -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 }; \ No newline at end of file diff --git a/xCAT-UI/js/nodes/physical.js b/xCAT-UI/js/nodes/physical.js index e20f0231e..87c65b61f 100644 --- a/xCAT-UI/js/nodes/physical.js +++ b/xCAT-UI/js/nodes/physical.js @@ -204,13 +204,26 @@ function createGraphical(bpa, fsp, area){ var td = $(''); var frameDiv = $('
'); frameDiv.append('
'); + //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 = $('
'); + 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 = ''; + var retHtml = ''; retHtml += '
'; retHtml += '
' + lparStatusRow + '
'; 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; + } } \ No newline at end of file