From a347829161cf32312f359d72c8b71653a6eccf4b Mon Sep 17 00:00:00 2001 From: bp-sawyers Date: Fri, 17 Oct 2008 01:45:03 +0000 Subject: [PATCH] Added the skeleton of the system p hw discovery wizard. git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@2354 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-web/lib/functions.php | 9 +- xCAT-web/lib/style.css | 2 +- xCAT-web/lib/wizard.css | 29 ++++++ xCAT-web/lib/wizard.php | 91 +++++++++++++++++ xCAT-web/machines/discover.css | 11 +++ xCAT-web/machines/discover.php | 173 +++++++++++++++++++++++++++++++++ xCAT-web/support/about.php | 8 +- xCAT-web/support/diagnose.php | 2 +- xCAT-web/support/suggest.php | 46 ++------- xCAT-web/support/updategui.php | 24 +---- 10 files changed, 326 insertions(+), 69 deletions(-) create mode 100644 xCAT-web/lib/wizard.css create mode 100644 xCAT-web/lib/wizard.php create mode 100644 xCAT-web/machines/discover.css create mode 100644 xCAT-web/machines/discover.php diff --git a/xCAT-web/lib/functions.php b/xCAT-web/lib/functions.php index ebb91206d..8ea0a5aba 100644 --- a/xCAT-web/lib/functions.php +++ b/xCAT-web/lib/functions.php @@ -76,10 +76,9 @@ $MENU = array( 'default' => 'groups', 'list' => array( 'lab' => array('label' => 'Lab Floor', 'url' => "$TOPDIR/machines/lab.php"), - 'frames' => array('label' => 'Frames', 'url' => "$TOPDIR/machines/frames.php"), - 'groups' => array('label' => 'Groups', 'url' => "$TOPDIR/machines/groups.php"), - 'nodes' => array('label' => 'Nodes', 'url' => "$TOPDIR/machines/nodes.php"), - 'layout' => array('label' => 'Layout', 'url' => "$TOPDIR/machines/layout.php"), + 'frames' => array('label' => 'Racks', 'url' => "$TOPDIR/machines/frames.php"), + 'groups' => array('label' => 'Groups/Nodes', 'url' => "$TOPDIR/machines/groups.php"), + 'discover' => array('label' => 'Discover', 'url' => "$TOPDIR/machines/discover.php"), ) ), 'manage' => array( @@ -127,7 +126,7 @@ $MENU = array( 'default' => 'diagnose', 'list' => array( 'diagnose' => array('label' => 'Diagnose', 'url' => "$TOPDIR/support/diagnose.php"), - 'update' => array('label' => 'Update', 'url' => "$TOPDIR/support/update.php"), + 'update' => array('label' => 'Update', 'url' => "$TOPDIR/support/updategui.php"), 'howtos' => array('label' => 'HowTos', 'url' => getDocURL('howto')), 'manpages' => array('label' => 'Man Pages', 'url' => getDocURL('manpage')), 'maillist' => array('label' => 'Mail List', 'url' => getDocURL('web','mailinglist')), diff --git a/xCAT-web/lib/style.css b/xCAT-web/lib/style.css index 1d07940c2..898dc571f 100644 --- a/xCAT-web/lib/style.css +++ b/xCAT-web/lib/style.css @@ -221,7 +221,7 @@ a.button { background: transparent url('../images/bg_button_a.gif') no-repeat scroll top right; color: #444; display: block; - float: left; + /* float: left; */ font: normal 12px arial, sans-serif; height: 24px; margin-right: 6px; diff --git a/xCAT-web/lib/wizard.css b/xCAT-web/lib/wizard.css new file mode 100644 index 000000000..046881670 --- /dev/null +++ b/xCAT-web/lib/wizard.css @@ -0,0 +1,29 @@ + +/* Styles specific to the wizards */ + +#outerWizardPane { + /* position: relative; so the h3 inside can be absolute to this div */ + /* border: 1px solid black; */ + background-color: #CCCCFF; + margin: 0px 20px 15px 20px; + padding: 5px 0px; +} + +#wizardHeading { /* the inner pane where the wizard page contents goes */ + /* position: absolute; move this up so it is part of the outerWizardPane border + top: -25px; + left: 50px; + background-color: white; + padding: 0px 5px; */ + margin-bottom: 5px; +} + +#wizardPane { + background-color: white; + padding: 10px 0px; + margin-bottom: 5px; +} + +.NonCurrentSummaryItem {} + +.CurrentSummaryItem { background-color: yellow; } diff --git a/xCAT-web/lib/wizard.php b/xCAT-web/lib/wizard.php new file mode 100644 index 000000000..2041cfc7f --- /dev/null +++ b/xCAT-web/lib/wizard.php @@ -0,0 +1,91 @@ + 'Page One', + 'two' => 'Page Two', + 'three' => 'Page Three', + ); +*/ + +function displayWizard($pages) { +$keys = array_keys($pages); + +if (isset($_REQUEST['page'])) { // navigate to another page in the wizard + $page = $_REQUEST['page']; + $action = $_REQUEST['action']; + + // Figure out the function for this page. Search the keys. + $k = array_search($page, $keys); + if ($k === FALSE) { msg('E',"Page $page not found in the wizard."); exit; } + if ($action == 'back') { + $k--; + if ($k < 0) { msg('E',"Can't go backward past the 1st page ($page)."); exit; } + } + elseif ($action == 'next') { + $k++; + if ($k >= count($pages)) { $k = 0; } // this was the Finish button - go back to the beginning + } + elseif ($action == 'cancel') { + $k = 0; + //todo: unset all the _SESSION variables + } + + // Run the function for this page + $keys[$k](); + configureButtons($k, $pages); +} + +else { // initial display of the wizard - show the 1st page + +echo "
\n"; +echo "

"; +$text = array(); +foreach ($keys as $k => $key) { $text[] = "$pages[$key]"; } +echo implode(' -> ', $text); +echo "

\n"; +echo "

", $pages[$keys[0]], "

\n"; + +echo "
\n"; +// The contents of the specific page goes in here +$keys[0](); +echo "
\n"; // end the inner wizard pane + +// Add the wizard decorations +insertButtons( + array('label' => 'Back', 'otherattrs' => 'id=backButton', 'onclick' => '$("#wizardPane").load("?page="+document.currentPage+"&action=back");'), + array('label' => 'Next', 'otherattrs' => 'id=nextButton', 'onclick' => '$("#wizardPane").load("?page="+document.currentPage+"&action=next");'), + array('label' => 'Cancel', 'onclick' => '$("#wizardPane").load("?page="'.$keys[0].'"&action=cancel");') + ); +configureButtons(0, $pages); +echo "
\n"; // end the outer wizard pane +} +} // end of displayWizard() + + +//----------------------------------------------------------------------------- +// Disable buttons as appropriate and set current page +function configureButtons($k, $arr) { +$keys = array_keys($arr); +echo "\n"; +} +?> \ No newline at end of file diff --git a/xCAT-web/machines/discover.css b/xCAT-web/machines/discover.css new file mode 100644 index 000000000..6310c98fc --- /dev/null +++ b/xCAT-web/machines/discover.css @@ -0,0 +1,11 @@ + +/* Styles specific to the Discover page. */ + +#wizardPane H3 { + margin-top: 20px; + margin-bottom: 2px; +} + +P#wizardDone {font-weight : bold; } + +.wizardProgressTable { margin: 10px 0px; } diff --git a/xCAT-web/machines/discover.php b/xCAT-web/machines/discover.php new file mode 100644 index 000000000..c48849674 --- /dev/null +++ b/xCAT-web/machines/discover.php @@ -0,0 +1,173 @@ + 'Discover Hardware', + 'patterns' => 'Cluster Patterns', + 'patterns2' => 'More Cluster Patterns', + 'preparemn' => 'Prepare Management Node', + 'prediscover' => 'Power On Hardware', + 'discover' => 'Discover HW Control Points', + 'updatedefs' => 'Update Definitions', + 'configurehcps' => 'Configure HW Control Points', + 'createnodes' => 'Create Nodes', + 'testhcps' => 'Test HW Control', + 'done' => 'Complete', + ); + +if (isset($_REQUEST['page'])) { displayWizard($pages); } + +else { // initial display of the wizard, show the whole page +insertHeader('Discover New Nodes', array('discover.css',"$TOPDIR/lib/wizard.css"), array("$TOPDIR/jq/jquery.min.js"), array('machines','discover')); +echo "
\n"; +displayWizard($pages); +echo "
\n"; // end the content div +insertFooter(); +} + + +//----------------------------------------------------------------------------- +function intro() { +echo "

This wizard will guide you through the process of defining the naming conventions within your cluster, discovering the hardware on your network, and automatically defining it in the xCAT database."; +echo " Choose which type of hardware you want to discover, and then click Next.

\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "
\n"; +} + + +//----------------------------------------------------------------------------- +function patterns() { +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; + +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; + +echo "\n"; +echo "\n"; +echo "\n"; + +echo "\n"; +echo "\n"; +echo "\n"; +echo "

Switch Patterns

HMCs

Frame (BPA) Patterns

Drawer (FSP/CEC) Patterns

\n"; + +//todo: get HCP userids/pws +} + + +//----------------------------------------------------------------------------- +function patterns2() { +echo "\n"; +echo "\n"; +echo "\n"; +echo ""; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; + +echo "\n"; +echo "\n"; +echo "

Building Blocks

(Subnet address in each Building Block)

LPAR Information

\n"; +// do we need to get any info about the resources that should be in each lpar, or do we just divide them evenly? +} + + +//----------------------------------------------------------------------------- +function preparemn() { +global $TOPDIR; +echo "\n"; +echo "\n"; +echo "\n"; // run makenetworks and update the dynamic range for the service LAN +echo "\n"; // run makedhcp and show progress +echo "
Write Cluster Topology Configuration File.
Define networks.
Configure DHCP.
\n"; +} + + +//----------------------------------------------------------------------------- +function prediscover() { +//todo: there's a better way to get this list left justified, but have the block in the center, but don't feel like figuring it out right now. +echo "
\n"; +echo "
  1. Power on all of the HMCs.
  2. Then power on all of frames.
  3. Then click Next to discover the hardware on the service network.
\n"; +echo "
\n"; +} + + +//----------------------------------------------------------------------------- +function discover() { +global $TOPDIR; +//todo: run lsslp and show progress +echo "\n"; +echo "\n"; +echo "
Discovering HMCs, BPAs, and FSPs...
\n"; +echo "

(This will show the list of hw discovered & located, including nodenames and IP addresses assigned, and then save all info to the DB.)

\n"; +} + + +//----------------------------------------------------------------------------- +function updatedefs() { +global $TOPDIR; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; // run makedhosts and makedns +echo "
Determine which CECs each HMC should manage.
Assign frame numbers, supernode numbers, and building block numbers.
Assign building block subnets.
Update name resolution.
\n"; +} + + +//----------------------------------------------------------------------------- +function configurehcps() { +global $TOPDIR; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "
Assign CECs to their HMC.
Set frame numbers in BPAs.
Power on CECs to Standby.
\n"; + +//todo: set HCP userids/pws +} + + +//----------------------------------------------------------------------------- +function createnodes() { +global $TOPDIR; +echo "\n"; +echo "\n"; +echo "\n"; +echo "
Create LPARs in each CEC.
Save node definitions in xCAT database.
\n"; +} + + +//----------------------------------------------------------------------------- +function testhcps() { +global $TOPDIR; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "
(Output for rpower stat for sample nodes)
(Output for rinv for sample nodes)
(Output for rvitals for sample nodes)
\n"; +} + + +//----------------------------------------------------------------------------- +function done() { +global $TOPDIR; +echo "

Cluster set up successfully completed!

\n"; +echo "

You can now start to deploy nodes.

\n"; +} +?> \ No newline at end of file diff --git a/xCAT-web/support/about.php b/xCAT-web/support/about.php index 6b483df59..a526bd035 100644 --- a/xCAT-web/support/about.php +++ b/xCAT-web/support/about.php @@ -5,7 +5,7 @@ $TOPDIR = '..'; require_once "$TOPDIR/lib/functions.php"; -insertHeader('About', NULL, NULL, array('support','about')); +insertHeader('About xCAT Web Interface', NULL, NULL, array('support','about')); ?>

xCAT Web Interface version: ???

@@ -14,7 +14,7 @@ insertHeader('About', NULL, NULL, array('support','about')); - - + + \ No newline at end of file diff --git a/xCAT-web/support/diagnose.php b/xCAT-web/support/diagnose.php index 20966fd88..1f5bafb00 100644 --- a/xCAT-web/support/diagnose.php +++ b/xCAT-web/support/diagnose.php @@ -7,5 +7,5 @@ require_once "$TOPDIR/lib/functions.php"; insertHeader('Diagnose', NULL, NULL, array('support','diagnose')); insertNotDoneYet(); -echo ''; +insertFooter(); ?> diff --git a/xCAT-web/support/suggest.php b/xCAT-web/support/suggest.php index 201f51e5d..00c63e600 100644 --- a/xCAT-web/support/suggest.php +++ b/xCAT-web/support/suggest.php @@ -1,6 +1,6 @@ -

Send Sugestions to the CSM Development Team

+

Send Sugestions to the xCAT Development Team

Suggestions, bug reports, bug fixes, etc., are always welcome. Please post them to the xCAT mailing list. Contributions are also welcome, such as minor new features, better -images, or even whole new pages. -See xCAT on SourceForge. Thanks!

+images, whole new pages, or enhancements to base xCAT. +See the xCAT contribution guidelines +for more information.

-

Todo List

+

To see what is already on our todo list for this web interface, or to request a new feature, +go to the Web Interface Wish List.

-

The following items are already on our todo list, in -approximately priority order:

- - - -

Known Defects and Limitations

- - - -

The Change Log describing recent enhancements is in the xcat-web spec file.

- - + \ No newline at end of file diff --git a/xCAT-web/support/updategui.php b/xCAT-web/support/updategui.php index 497e87f31..7e375bb2b 100644 --- a/xCAT-web/support/updategui.php +++ b/xCAT-web/support/updategui.php @@ -1,28 +1,12 @@ - -
- -
- - - -
-
- - +require_once "$TOPDIR/lib/functions.php"; +insertHeader('Update xCAT Web Interface', NULL, NULL, array('support','update')); +insertNotDoneYet(); +insertFooter(); - -