diff --git a/xCAT-UI/css/style.css b/xCAT-UI/css/style.css index 52b723f08..80561eb6b 100644 --- a/xCAT-UI/css/style.css +++ b/xCAT-UI/css/style.css @@ -633,7 +633,6 @@ table a:hover { } .fspDiv2 { - margin: 0px 12px 2px 17px; font-size: 12px; height: 20px; line-height: 20px; @@ -643,10 +642,10 @@ table a:hover { border-style: solid; border-width: 1px; cursor: pointer; + display: inline-block; } .fspDiv4 { - margin: 0px 12px 2px 17px; font-size: 12px; height: 44px; line-height: 44px; @@ -656,6 +655,7 @@ table a:hover { border-style: solid; border-width: 1px; cursor: pointer; + display: inline-block; } .fspDiv42 { @@ -679,6 +679,10 @@ table a:hover { height: 5px; } +.fspcheckbox{ + padding: 0px; +} + /*--------------- Discovery section ---------------*/ .discoverstep { width: 200px; diff --git a/xCAT-UI/js/nodes/physical.js b/xCAT-UI/js/nodes/physical.js index 9cd4ac8b5..42cb43faf 100644 --- a/xCAT-UI/js/nodes/physical.js +++ b/xCAT-UI/js/nodes/physical.js @@ -138,7 +138,7 @@ function createGraphical(bpa, fsp, area){ elementNum ++; var td = $(''); var frameDiv = $('
'); - frameDiv.append('
' + bpaName + '
'); + frameDiv.append('
'); for (var fspIndex in bpa[bpaName]){ var fspName = bpa[bpaName][fspIndex]; usedFsp[fspName] = 1; @@ -184,7 +184,7 @@ 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); @@ -265,71 +265,19 @@ function createGraphical(bpa, fsp, area){ updateSelectNodeDiv(); }); -} - -/** - * show the fsp's information in a dialog - * - * @param fspName : fsp's name - * - * @return - */ -function showSelectDialog(lpars){ - var diaDiv = $('
'); - if (0 == lpars.length){ - diaDiv.append(createInfoBar('There is not any lpars be selected(defined).')); - } - else{ - //add the dialog content - var selectTable = $('
'); - selectTable.append('NameStatus'); - for (var lparIndex in lpars){ - var row = $(''); - var lparName = lpars[lparIndex]; - var color = statusMap(lparList[lparName]); - - if (selectNode[lparName]){ - row.append(''); - } - else{ - row.append(''); - } - row.append('' + lparName + ''); - row.append('' + lparList[lparName] + ''); - selectTable.append(row); + $('.fspcheckbox').bind('click', function(){ + var itemName = $(this).attr('name'); + name = itemName.substr(6); + + if ($(this).attr('checked')){ + selectNode[name] = 1; } - diaDiv.append(selectTable); - } - - diaDiv.dialog({ - modal: true, - width: 400, - close: function(event, ui){ - $(this).remove(); - }, - buttons: { - cancel : function(){ - $(this).dialog('close'); - }, - ok : function(){ - $('#selectNodeTable input[type=checkbox]').each(function(){ - var lparName = $(this).attr('name'); - if ('' == lparName){ - //continue - return true; - } - if (true == $(this).attr('checked')){ - changeNode(lparName, 'select'); - } - else{ - changeNode(lparName, 'unselect'); - } - }); - updateSelectNodeDiv(); - $(this).dialog('close'); - } + else{ + delete selectNode[name]; } + + updateSelectNodeDiv(); }); } @@ -355,13 +303,6 @@ function updateSelectNodeDiv(){ break; } } - - var reselectButton = createButton('Reselect'); - $('#selectNodeDiv').append(reselectButton); - reselectButton.bind('click', function(){ - reselectNodes(); - }); - } /** @@ -566,7 +507,8 @@ function createFspDiv(fspName, mtm, fsp){ } //create return value - var retHtml = '
'; + var retHtml = ''; + retHtml += '
'; retHtml += '
' + lparStatusRow + '
'; return retHtml; } @@ -668,23 +610,6 @@ function getSelectNodes(){ return ret.substring(0, ret.length-1); } -/** - * show all lpars' for users to delete - * - * @param - - * @return - */ -function reselectNodes(){ - var temp = new Array(); - - for (var lparName in selectNode){ - temp.push(lparName); - } - - showSelectDialog(temp); -} - /** * when the node is selected or unselected, then update the area on cec, update the global * list and update the tooltip table