fix bugs found in BBC cluster testing on nodes page and discovery page

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@11390 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
xq2005 2012-01-17 06:17:25 +00:00
parent 6888b42c46
commit a892974279
6 changed files with 144 additions and 53 deletions

View File

@ -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;

View File

@ -38,14 +38,7 @@ function createDiscoverButtons(){
var buttonDiv = $('<div style="text-align:center;padding:20px 0px 10px 0px;"></div>');
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
*

View File

@ -1005,10 +1005,10 @@ function powerInitDiscoverFrames(){
if (getDiscoverEnv('framemtmsmap')){
$('#framedisc div').html('Mapping the frame name and mtms which discovered by lsslp.<br\>' +
'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 += '<li id="frameLine"><span class="ui-icon ' + iconClass + '"></span>Update Frames into xCAT database.</li>';
showStr += '<li id="hmcLine1"><span class="ui-icon ' + iconClass + '"></span>Discover HMCs.</li>';
showStr += '<li id="hmcLine2"><span class="ui-icon ' + iconClass + '"></span>Update HMCs into xCAT database.</li>';
showStr += '<li id="frameLine2"><span class="ui-icon ' + iconClass + '"></span>Make hardware connections for Frames.</li>';
showStr += '<li id="cecLine"><span class="ui-icon ' + iconClass + '"></span>Discover CECs and update into xCAT database.</li>';
showStr += '<li id="cecLine2"><span class="ui-icon ' + iconClass + '"></span>Make hardware connections for CECs.</li>';
showStr += '<li id="dhcpLine"><span class="ui-icon ' + iconClass + '"></span>Configured DHCP.</li>';
showStr += '</ul></div>';
@ -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();
}
});

View File

@ -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
};

View File

@ -776,7 +776,7 @@ function createFspDiv(fspName, mtm, fsp){
}
var lparName = fsp[fspName]['children'][lparIndex];
var color = statusMap(lparList[lparName]);
lparStatusRow += '<td class="lparStatus" style="background-image:url(images/nodes/' + color + '.gif);padding: 0px;" name="' + lparName + '"></td>';
lparStatusRow += '<td class="lparStatus" style="background-image:url(images/nodes/' + color + '.gif);padding: 0px;" id="' + lparName + 'status"></td>';
}
//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;

View File

@ -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!';