diff --git a/xCAT-UI/css/style.css b/xCAT-UI/css/style.css index f8c0b2ce1..0554a661d 100644 --- a/xCAT-UI/css/style.css +++ b/xCAT-UI/css/style.css @@ -786,6 +786,19 @@ table a:hover { .bladeInsertDiv{ background: url(../images/nodes/blade.jpg); } + +.xnodeDiv{ + font-size: 12px; + height: 21px; + line-height: 21px; + width: 140px; + text-align: center; + background: url(../images/nodes/2ufsp.jpg); + border-style: solid; + border-width: 1px; + cursor: pointer; + display: inline-block; +} /*--------------- Discovery section ---------------*/ .discoverstep { width: 960px; diff --git a/xCAT-UI/js/configure/discover.js b/xCAT-UI/js/configure/discover.js index 13799c98e..8c546d7da 100644 --- a/xCAT-UI/js/configure/discover.js +++ b/xCAT-UI/js/configure/discover.js @@ -38,14 +38,7 @@ function createDiscoverButtons(){ var buttonDiv = $('
'); var backButton = createBackButton(); var nextButton = createNextButton(); - var cancelButton = createButton('Cancel'); - cancelButton.bind('click', function(){ - $('#discoverTab').empty(); - for (var name in discoverEnv){ - removeDiscoverEnv(name); - } - loadDiscoverPage(); - }); + var cancelButton = createCancelButton(); if (backButton){ buttonDiv.append(backButton); @@ -54,11 +47,35 @@ function createDiscoverButtons(){ if (nextButton){ buttonDiv.append(nextButton); } + + if (cancelButton){ + buttonDiv.append(cancelButton); + } - buttonDiv.append(cancelButton); $('#discoverContentDiv').append(buttonDiv); } +function createCancelButton(){ + if (0 == currentStep){ + return undefined; + } + + if ((steps.length - 1) == currentStep){ + return undefined; + } + + var cancelbutton = createButton('Cancel'); + cancelbutton.bind('click', function(){ + $('#discoverTab').empty(); + for (var name in discoverEnv){ + removeDiscoverEnv(name); + } + loadDiscoverPage(); + }); + + return cancelbutton; +} + /** * create the next button base on the currentStep, the last step does not need this button * diff --git a/xCAT-UI/js/custom/hmc.js b/xCAT-UI/js/custom/hmc.js index bb4c5f567..bdfc8c010 100644 --- a/xCAT-UI/js/custom/hmc.js +++ b/xCAT-UI/js/custom/hmc.js @@ -1005,10 +1005,10 @@ function powerInitDiscoverFrames(){ if (getDiscoverEnv('framemtmsmap')){ $('#framedisc div').html('Mapping the frame name and mtms which discovered by lsslp.' + 'Select the frame name, then select the mtms.'); - var mapArray = getDiscoverEnv('framemtmsmap').split(':'); + var mapArray = getDiscoverEnv('framemtmsmap').split(';'); for(var i in mapArray){ var tempArray = mapArray[i].split(','); - showMap(tempArray[0], tempArray[1] + '-' + tempArray[2]); + showMap(tempArray[0], tempArray[1]); } createDiscoverButtons(); @@ -1137,11 +1137,12 @@ function checkFrameMtms(operType){ var fname = $(this).children().eq(0).html(); var mtms = $(this).children().eq(2).html(); var pos = mtms.lastIndexOf('-'); + var startpos = mtms.indexOf(':'); - maps += (fname + ',' + mtms.substring(0, pos) + ',' + mtms.substring(pos + 1) + ':'); + maps += (fname + ',' + mtms + ';'); vpdFileCon += fname + ':\n'; vpdFileCon += ' objtype=node\n serial=' + mtms.substring(pos + 1) + '\n'; - vpdFileCon += ' mtm=' + mtms.substring(0, pos) + '\n side=A\n'; + vpdFileCon += ' mtm=' + mtms.substring(startpos + 1, pos) + '\n side=A\n'; }); maps = maps.substr(0, maps.length - 1); @@ -1318,7 +1319,9 @@ function powerInitUpdateDefinition(operType){ showStr += '
  • Update Frames into xCAT database.
  • '; showStr += '
  • Discover HMCs.
  • '; showStr += '
  • Update HMCs into xCAT database.
  • '; + showStr += '
  • Make hardware connections for Frames.
  • '; showStr += '
  • Discover CECs and update into xCAT database.
  • '; + showStr += '
  • Make hardware connections for CECs.
  • '; showStr += '
  • Configured DHCP.
  • '; showStr += ''; @@ -1405,11 +1408,12 @@ function lsslpWriteHMC(){ //create the hmc and mtms pair string for (var i in hmcArray){ var tPos = mtmsArray[i].lastIndexOf('-'); + var startPos= mtmsArray[i].indexOf(':'); if ('' == tempPar){ - tempPar += hmcArray[i] + ',' + mtmsArray[i].substring(0, tPos) + ',' +mtmsArray[i].substring(tPos + 1); + tempPar += hmcArray[i] + ',' + mtmsArray[i].substring(startPos + 1, tPos) + ',' +mtmsArray[i].substring(tPos + 1); } else{ - tempPar += ':' + hmcArray[i] + ',' + mtmsArray[i].substring(0, tPos) + ',' +mtmsArray[i].substring(tPos + 1); + tempPar += ':' + hmcArray[i] + ',' + mtmsArray[i].substring(startPos + 1, tPos) + ',' +mtmsArray[i].substring(tPos + 1); } } @@ -1439,7 +1443,7 @@ function lsslpWriteHMC(){ var tempSpan = $('#hmcLine2').find('span'); tempSpan.removeClass('ui-icon-gear'); tempSpan.addClass('ui-icon-check'); - lsslpWriteCec(); + mkhwconnFrame(); } }); } @@ -1448,6 +1452,34 @@ function lsslpWriteHMC(){ }); } +/** + * Step 8: make the hardware connection for frames. + * + * @param + * + * @return + */ +function mkhwconnFrame(){ + $('#frameLine2').append(createLoader()); + $.ajax({ + url : 'lib/cmd.php', + dataType : 'json', + data : { + cmd : 'mkhwconn', + tgt : 'frame', + args : '-t', + msg : '' + }, + success: function(){ + $('#frameLine2 img').remove(); + var tempSpan = $('#frameLine2').find('span'); + tempSpan.removeClass('ui-icon-gear'); + tempSpan.addClass('ui-icon-check'); + lsslpWriteCec(); + } + }); +} + /** * Step 8: write all the lsslp -s cec info into database * @@ -1471,6 +1503,34 @@ function lsslpWriteCec(){ var tempSpan = $('#cecLine').find('span'); tempSpan.removeClass('ui-icon-gear'); tempSpan.addClass('ui-icon-check'); + mkhwconnCec(); + } + }); +} + +/** + * Step 8: make hardware connection for cecs + * + * @param + * + * @return + */ +function mkhwconnCec(){ + $('#cecLine2').append(createLoader()); + $.ajax({ + url : 'lib/cmd.php', + dataType : 'json', + data : { + cmd : 'mkhwconn', + tgt : 'cec', + args : '-t', + msg : '' + }, + success: function(){ + $('#cecLine2 img').remove(); + var tempSpan = $('#cecLine2').find('span'); + tempSpan.removeClass('ui-icon-gear'); + tempSpan.addClass('ui-icon-check'); configDHCP(); } }); diff --git a/xCAT-UI/js/nodes/mtm.js b/xCAT-UI/js/nodes/mtm.js index b3501e652..e2aa1b038 100644 --- a/xCAT-UI/js/nodes/mtm.js +++ b/xCAT-UI/js/nodes/mtm.js @@ -1,39 +1,39 @@ var hardwareInfo = { - '7037-A50' : [ 'P5-185', '5' ], - '9115-505' : [ 'P5-505', '1' ], - '9110-510' : [ 'P5-510', '2' ], - '9110-51A' : [ 'P5-510', '2' ], - '9111-520' : [ 'P5-520', '4' ], - '913A-52A' : [ 'P5-52A', '4' ], - '9113-550' : [ 'P5-550', '4' ], - '9133-55A' : [ 'P5-55A', '4' ], - '9116-561' : [ 'P5-560Q', '4' ], - '9117-570' : [ 'P5-570', '4' ], - '9118-575' : [ 'P5-575', '42' ], - '9119-590' : [ 'P5-590', '42' ], - '9119-595' : [ 'P5-595', '42' ], + '7037-A50' : [ 'P5-185', 5 ], + '9115-505' : [ 'P5-505', 1 ], + '9110-510' : [ 'P5-510', 2 ], + '9110-51A' : [ 'P5-510', 2 ], + '9111-520' : [ 'P5-520', 4 ], + '913A-52A' : [ 'P5-52A', 4 ], + '9113-550' : [ 'P5-550', 4 ], + '9133-55A' : [ 'P5-55A', 4 ], + '9116-561' : [ 'P5-560Q', 4 ], + '9117-570' : [ 'P5-570', 4 ], + '9118-575' : [ 'P5-575', 42 ], + '9119-590' : [ 'P5-590', 42 ], + '9119-595' : [ 'P5-595', 42 ], //P6 - '8203-E4A' : [ 'P6-520', '4' ], - '9407-M15' : [ 'P6-520', '4' ], - '9408-M25' : [ 'P6-520', '4' ], - '8204-E8A' : [ 'P6-550', '4' ], - '9409-M50' : [ 'P6-550', '4' ], - '8234-EMA' : [ 'P6-560', '4' ], - '9117-MMA' : [ 'P6-570', '4' ], - '9125-F2A' : [ 'P6-575', '42' ], - '9119-FHA' : [ 'P6-595', '42' ], + '8203-E4A' : [ 'P6-520', 4 ], + '9407-M15' : [ 'P6-520', 4 ], + '9408-M25' : [ 'P6-520', 4 ], + '8204-E8A' : [ 'P6-550', 4 ], + '9409-M50' : [ 'P6-550', 4 ], + '8234-EMA' : [ 'P6-560', 4 ], + '9117-MMA' : [ 'P6-570', 4 ], + '9125-F2A' : [ 'P6-575', 42 ], + '9119-FHA' : [ 'P6-595', 42 ], //P7 - '8202-E4B' : [ 'P7-720', '4' ], - '8205-E6B' : [ 'P7-740', '4' ], - '8231-E2B' : [ 'P7-710/730', '2' ], - '8233-E8B' : [ 'P7-750', '4' ], - '8236-E8C' : [ 'P7-755', '4' ], - '9117-MMB' : [ 'P7-770', '4' ], - '9119-FHB' : [ 'P7-795', '4' ], - '9179-MHB' : [ 'P7-780', '42' ], - '8231-E2C' : [ 'P7 HE', '4' ], - '9125-F2C' : [ 'Power 775', '2'], - '78AC-100' : [ 'Power 775', '2'] //fsp + '8202-E4B' : [ 'P7-720', 4 ], + '8205-E6B' : [ 'P7-740', 4 ], + '8231-E2B' : [ 'P7-710/730', 2 ], + '8233-E8B' : [ 'P7-750', 4 ], + '8236-E8C' : [ 'P7-755', 4 ], + '9117-MMB' : [ 'P7-770', 4 ], + '9119-FHB' : [ 'P7-795', 4 ], + '9179-MHB' : [ 'P7-780', 42 ], + '8231-E2C' : [ 'P7 HE', 4 ], + '9125-F2C' : [ 'Power 775', 2], + '78AC-100' : [ 'Power 775', 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 ad7356cc4..13fc1293a 100644 --- a/xCAT-UI/js/nodes/physical.js +++ b/xCAT-UI/js/nodes/physical.js @@ -776,7 +776,7 @@ function createFspDiv(fspName, mtm, fsp){ } var lparName = fsp[fspName]['children'][lparIndex]; var color = statusMap(lparList[lparName]); - lparStatusRow += ''; + lparStatusRow += ''; } //select the backgroud @@ -854,6 +854,7 @@ function statusMap(status){ case 'pbs': case 'sshd': case 'booting': + case 'booted': case 'ping':{ color = 'green'; } @@ -917,7 +918,7 @@ function changeNode(lparName, status){ imgUrl = 'url(images/nodes/'+ statusMap(lparList[lparName]) + '.gif)'; checkFlag = false; } - $('#graphTable [name=' + lparName + ']').css('background-image', imgUrl); + $('#' + lparName + 'status').css('background-image', imgUrl); $('.tooltip input[name="' + lparName + '"]').attr('checked', checkFlag); } @@ -936,7 +937,7 @@ function coculateBlank(mtm){ return 24; } - switch(hardwareInfo[mtm]){ + switch(hardwareInfo[mtm][1]){ case 1: { return 13; diff --git a/xCAT-UI/xcat/plugins/web.pm b/xCAT-UI/xcat/plugins/web.pm index 619a0c8fa..16a7705bf 100644 --- a/xCAT-UI/xcat/plugins/web.pm +++ b/xCAT-UI/xcat/plugins/web.pm @@ -1130,7 +1130,7 @@ sub web_discover { my $retStr = ''; my $retInfo = - xCAT::Utils->runcmd( "lsslp -s -m $type 2>/dev/null | grep $type | awk '{print \$1\":\" \$2\"-\"\$3}'", + xCAT::Utils->runcmd( "lsslp -m -s $type 2>/dev/null | grep $type | awk '{print \$1\":\" \$2\"-\"\$3}'", -1, 1 ); if ( scalar(@$retInfo) < 1 ) { $retStr = 'Error: Can not discover frames in cluster!';