From d6372084a72592b73f38243f5eea30fde776e554 Mon Sep 17 00:00:00 2001 From: xq2005 Date: Mon, 23 Jul 2012 10:28:14 +0000 Subject: [PATCH] modified for darpa demo git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@13332 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-UI/js/configure/discover.js | 32 +++++--- xCAT-UI/js/custom/hmc.js | 129 +++++++++++++++++++++++++++++-- xCAT-UI/js/nodes/mtm.js | 2 +- xCAT-UI/js/ui.js | 12 ++- 4 files changed, 152 insertions(+), 23 deletions(-) diff --git a/xCAT-UI/js/configure/discover.js b/xCAT-UI/js/configure/discover.js index a94aeddd2..a99b9ad09 100644 --- a/xCAT-UI/js/configure/discover.js +++ b/xCAT-UI/js/configure/discover.js @@ -90,23 +90,33 @@ function createNextButton() { */ function createBackButton() { var tempFlag = true; + var tempButton; if (0 == currentStep) return undefined; - var backButton = createButton('Back'); - backButton.bind('click', function() { - if (nextFunctions[currentStep]) - tempFlag = nextFunctions[currentStep]('back'); + if ((steps.length - 1) == currentStep){ + tempButton = createButton('Complete'); + tempButton.bind('click', function() { + window.location.href="index.php"; + }); + } + else{ + var tempButton = createButton('Back'); + tempButton.bind('click', function() { + if (nextFunctions[currentStep]) + tempFlag = nextFunctions[currentStep]('back'); - if (!tempFlag) - return; + if (!tempFlag) + return; - currentStep--; + currentStep--; - initFunctions[currentStep]('back'); - }); + initFunctions[currentStep]('back'); + }); + } + - return backButton; + return tempButton; } /** @@ -314,7 +324,7 @@ function initSelectPlatform() { selectPlatform.append(info); var hwList = $('
    Platforms available:
'); - hwList.append('
  • '); + hwList.append('
  • '); hwList.append('
  • BladeCenter
  • '); hwList.append('
  • System p hardware (P7 IH)
  • '); hwList.append('
  • System p hardware (Non P7 IH)
  • '); diff --git a/xCAT-UI/js/custom/hmc.js b/xCAT-UI/js/custom/hmc.js index 2e03bfd41..9598e965a 100644 --- a/xCAT-UI/js/custom/hmc.js +++ b/xCAT-UI/js/custom/hmc.js @@ -22,7 +22,7 @@ var hmcPlugin = function() { hmcPlugin.prototype.getStep = function() { return [ 'Basic patterns', 'Supernode', 'More patterns', 'Power on hardware', 'Discover frames', 'Management node', - 'Update definitions', 'Create LPARs' ]; + 'Discover Rest of Hardware and Update Definitions', 'Create LPARs' ]; }; hmcPlugin.prototype.getInitFunction = function() { @@ -1276,7 +1276,6 @@ function createSetupFile() { fileContent += ' hostname-range = ' + getDiscoverEnv('cecName') + '\n'; fileContent += ' delete-unused-cecs = 1\n'; fileContent += ' supernode-list = /tmp/websupernode.txt\n'; - fileContent += ' delete-unused-cecs = 1 \n'; //Building Block fileContent += 'xcat-building-blocks:\n'; @@ -1289,6 +1288,8 @@ function createSetupFile() { + '\n'; fileContent += ' hostname-range = ' + getDiscoverEnv('lparName') + '\n'; fileContent += ' starting-ip = ' + getDiscoverEnv('lparstartip') + '\n'; + fileContent += ' aliases = -hf0 \n'; + fileContent += ' otherinterfaces = -hf1:11.1.3.1,-hf2:12.1.3.1,-hf3:13.1.3.1,-hf4:14.1.3.1,-hf5:15.1.3.1,,-hf6:16.1.3.1,-hf7:17.1.3.1,-bond0:18.1.3.1 \n'; $.ajax({ url : 'lib/cmd.php', @@ -1359,11 +1360,19 @@ function powerInitUpdateDefinition(operType) { showStr += '
  • Update Frames into xCAT database.
  • '; showStr += '
  • Set up Frame(DHCP, DNS, Hardware connection).
  • '; + + '">Set up Frame DHCP, DNS.'; + showStr += '
  • Resetting networks on FRAME to get persistent IP.
  • '; + showStr += '
  • Creating hardware connection for FRAME.
  • '; showStr += '
  • Discover CECs and update into xCAT database.
  • '; showStr += '
  • Set up CEC(DHCP, DNS, Hardware connection).
  • '; + + '">Set up CEC DHCP, DNS.'; + showStr += '
  • Resetting networks on CEC to get persistent IP.
  • '; + showStr += '
  • Creating hardware connection for CEC.
  • '; showStr += ''; $('#discoverContentDiv').append(showStr); @@ -1490,7 +1499,7 @@ function lsslpWriteFrame() { } /** - * Step 8: config the frame + * Step 8: config the frame dhcp and dns */ function frameSetup() { $('#frameLine2').append(createLoader()); @@ -1502,14 +1511,67 @@ function frameSetup() { data : { cmd : 'webrun', tgt : '', - args : 'framesetup;' + tempargs, + args : 'framesetup;' + tempargs + ';1', msg : '' }, + success : function() { $('#frameLine2 img').remove(); var tempSpan = $('#frameLine2').find('span'); tempSpan.removeClass('ui-icon-gear'); tempSpan.addClass('ui-icon-check'); + frameReset(); + } + }); +} + +/** + * Step 8: reset the networks for frames + */ +function frameReset(){ + $('#frameLine3').append(createLoader()); + $.ajax({ + url : 'lib/cmd.php', + dataType : 'json', + data : { + cmd : 'rspconfig', + tgt : 'frame', + args : '--resetnet', + msg : '' + }, + + success : function() { + $('#frameLine3 img').remove(); + var tempSpan = $('#frameLine3').find('span'); + tempSpan.removeClass('ui-icon-gear'); + tempSpan.addClass('ui-icon-check'); + frameHwconn(); + } + }); +} + +/** + * Step 8: create hardware connection for frames + */ +function frameHwconn(){ + $('#frameLine4').append(createLoader()); + var tempargs = getDiscoverEnv('adminpasswd') + ';' + getDiscoverEnv('generalpasswd') + ';' + + getDiscoverEnv('hmcpasswd'); + $.ajax({ + url : 'lib/cmd.php', + dataType : 'json', + data : { + cmd : 'webrun', + tgt : '', + args : 'framesetup;' + tempargs + ';2', + msg : '' + }, + + success : function() { + $('#frameLine4 img').remove(); + var tempSpan = $('#frameLine4').find('span'); + tempSpan.removeClass('ui-icon-gear'); + tempSpan.addClass('ui-icon-check'); lsslpWriteCec(); } }); @@ -1540,7 +1602,7 @@ function lsslpWriteCec() { } /** - * Step 8: config the cec + * Step 8: config the cec dhcp and dns */ function cecsetup(){ $('#cecLine2').append(createLoader()); @@ -1552,7 +1614,7 @@ function cecsetup(){ data : { cmd : 'webrun', tgt : '', - args : 'cecsetup;' + tempargs, + args : 'cecsetup;' + tempargs + ';1', msg : '' }, success : function() { @@ -1560,6 +1622,57 @@ function cecsetup(){ var tempSpan = $('#cecLine2').find('span'); tempSpan.removeClass('ui-icon-gear'); tempSpan.addClass('ui-icon-check'); + cecReset(); + } + }); +} + +/** + * Step 8: reset the networks for cecs + */ +function cecReset(){ + $('#cecLine3').append(createLoader()); + $.ajax({ + url : 'lib/cmd.php', + dataType : 'json', + data : { + cmd : 'rspconfig', + tgt : 'cec', + args : '--resetnet', + msg : '' + }, + + success : function() { + $('#cecLine3 img').remove(); + var tempSpan = $('#cecLine3').find('span'); + tempSpan.removeClass('ui-icon-gear'); + tempSpan.addClass('ui-icon-check'); + cecHwconn(); + } + }); +} + +/** + * Step 8: config the cec + */ +function cecHwconn(){ + $('#cecLine4').append(createLoader()); + var tempargs = getDiscoverEnv('adminpasswd') + ';' + getDiscoverEnv('generalpasswd') + ';' + + getDiscoverEnv('hmcpasswd'); + $.ajax({ + url : 'lib/cmd.php', + dataType : 'json', + data : { + cmd : 'webrun', + tgt : '', + args : 'cecsetup;' + tempargs + ';2', + msg : '' + }, + success : function() { + $('#cecLine4 img').remove(); + var tempSpan = $('#cecLine4').find('span'); + tempSpan.removeClass('ui-icon-gear'); + tempSpan.addClass('ui-icon-check'); createDiscoverButtons(); } }); diff --git a/xCAT-UI/js/nodes/mtm.js b/xCAT-UI/js/nodes/mtm.js index c3149e4e9..47380cdca 100644 --- a/xCAT-UI/js/nodes/mtm.js +++ b/xCAT-UI/js/nodes/mtm.js @@ -40,5 +40,5 @@ var hardwareInfo = { '9179-MHC' : [ 'P7-780', 4 ], '8231-E2C' : [ 'P7 HE', 4 ], '9125-F2C' : [ 'Power 775', 2], - '78AC-100' : [ 'Power 775', 2] // FSP + '78AC-100' : [ 'Power 775', 2] // bpa }; \ No newline at end of file diff --git a/xCAT-UI/js/ui.js b/xCAT-UI/js/ui.js index 148f016cc..b1e059f86 100644 --- a/xCAT-UI/js/ui.js +++ b/xCAT-UI/js/ui.js @@ -307,9 +307,11 @@ DataTable.prototype.add = function(rowCont) { * @param barId Status bar ID */ function createStatusBar(barId) { - var statusBar = $('
    ').css({ + var statusBar = $('
    ').css({ 'margin-bottom': '5px', - 'min-height': '30px' + 'min-height': '30px', + 'background-color':'#7BBEDE', + 'color': '#FFFFFF' }); // Create info icon @@ -350,7 +352,11 @@ function createStatusBar(barId) { * @return Info bar */ function createInfoBar(msg) { - var infoBar = $('
    ').css('margin', '5px 0px'); + var infoBar = $('
    ').css({ + 'margin': '5px 0px', + 'background-color':'#7BBEDE', + 'color': '#FFFFFF' + }); var icon = $('').css({ 'display': 'inline-block', 'margin': '10px 5px'