diff --git a/xCAT-web/bin/getattrs b/xCAT-web/bin/getattrs deleted file mode 100644 index cdd0a19ed..000000000 --- a/xCAT-web/bin/getattrs +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/perl -use strict; -use Getopt::Long; - -$::XCATROOT = ""; -GetOptions('web' => \$::HTML, - 'h|help' => \$::HELP); - -if($::HELP){ - print "$0 --help prints this help message\n"; - print "$0 prints attributes with nodes\n"; - print "$0 --html prints attributes with nodes with html parameters\n\n" ; - exit 0; -} - - -if(-f "/etc/sysconfig/xcat"){ - $::XCATROOT=`awk -F= '{print \$2}' /etc/sysconfig/xcat`; - chomp($::XCATROOT); - if($::XCATROOT eq ""){ - print "XCATROOT not defined in /etc/sysconfig/xcat!\n"; - exit; - } -}else{ - print "file /etc/sysconfig/xcat doesn't exist\n"; - exit; -} -#print "$::XCATROOT\n"; -my $f = "$::XCATROOT/etc/nodelist.tab"; -unless(-f "$f"){ - print "$f doesn't exist!\n"; - exit 1; -} -my $nh; -open(FILE, "$f") or die "can't open $f!"; -while(my $line = ){ - chomp $line; - # skip lines that start with # or with a space and then # - if($line =~ /^\s*#/){ next; } - - # skip lines that are blank - if($line =~ /^$/){ next; } - - my ($node,$attrs) = split(/\s+/, $line); - #print "$node\n"; - my @attrs = split(/,/, $attrs); - foreach my $a (@attrs){ - #print "$a\n"; - if($a ne ""){ - push @{$nh->{$a}}, $node; - } - } -} -if($::HTML){ print "\n"; } diff --git a/xCAT-web/functions.php b/xCAT-web/functions.php index 351651390..89a5ac1f5 100644 --- a/xCAT-web/functions.php +++ b/xCAT-web/functions.php @@ -17,40 +17,36 @@ $CURRDIR = '/opt/xcat/web'; /*----------------------------------------------------------------------------------------------- Function to insert the header part of the HTML and the top part of the page ------------------------------------------------------------------------------------------------*/ -function insertHeader($title, $stylesheets, $javascripts) { +function insertHeader($title, $stylesheets, $javascripts, $currents) { global $TOPDIR; if (!$TOPDIR) $TOPDIR = '.'; -?> +echo << -<?php echo $title; ?> +$title - - - + + - - +EOS; - - - - - +/* These are only needed for popup windows, so only need it for specific pages like dsh + + + + + + + +*/ -\n"; @@ -61,165 +57,75 @@ if ($javascripts) { echo "\n"; } } -?> - - - - + - -// A few constants -/* -require_once("lib/config.php"); -$config = &Config::getInstance(); -$imagedir = $config->getValue("IMAGEDIR"); -$colTxt = "Click to collapse section"; -$exTxt = "Click to expand section"; -$bulgif = "$imagedir/h3bg_new.gif"; -$minusgif = "$imagedir/minus-sign.gif"; -$plusgif = "$imagedir/plus-sign.gif"; -*/ - - -/*------------------------------------------------------------------------------ - Create the navigation area on the left. - $currentlink is the key of the link to the page - that is currently being displayed. -------------------------------------------------------------------------------*/ - -function insertNav($currentLink) { -// A few constants -global $TOPDIR; // or could use $GLOBALS['TOPDIR'] -$colTxt = "Click to collapse section"; -$exTxt = "Click to expand section"; -$bulgif = "$TOPDIR/images/h3bg_new.gif"; -$minusgif = "$TOPDIR/images/minus-sign.gif"; -$plusgif = "$TOPDIR/images/plus-sign.gif"; - -echo ''; -} //end insertNav - - -/**-------------------------------------------------------------- - Insert one inner table in the nav area function above. - Type is the type of the menu item, i.e: close or open (plus sign/minus sign) - Level is the level of the parent menu item (can be first or second) - Id is the id property of the table. - CurrentLink is the key of the link for the current page. - List is a keyed array of href, label pairs. -----------------------------------------------------------------*/ -function insertInner($type,$level,$title, $id, $currentLink, $list) { -// A few constants -global $TOPDIR; // or could use $GLOBALS['TOPDIR'] -$colTxt = "Click to collapse section"; -$exTxt = "Click to expand section"; -$bulgif = "$TOPDIR/images/h3bg_new.gif"; -$minusgif = "$TOPDIR/images/minus-sign.gif"; -$plusgif = "$TOPDIR/images/plus-sign.gif"; - - switch($level){ - case 1: $menu_level = "menu_level1"; break; - case 2: $menu_level = "menu_level2"; break; - default: $menu_level = "menu_level1"; - } - if ($type == "open"){ - $gif = $minusgif; - $hoverTxt = $colTxt; - $style = "display:inline"; - }else { - $gif = $plusgif; - $hoverTxt = $exTxt; - $style = "display:none"; - } - -echo << -

- $title

- - -EOS; - -foreach ($list as $key => $link) { - if ($key == $currentLink){ - echo "\n"; - }else{ - echo "\n"; + if ($currents[0] == 'machines') { + insertMenuRow($currents[1], 0, array( + 'lab' => array('Lab Floor', "$TOPDIR/views/lab.php"), + 'frames' => array('Frames', "$TOPDIR/views/frames.php"), + 'groups' => array('Groups', "$TOPDIR/views/groups.php"), + 'nodes' => array('Nodes', "$TOPDIR/views/nodes.php"), + 'layout' => array('Layout', "$TOPDIR/views/layout.php") + )); } + echo "
\n"; } -echo "\n"; -} //end insertInner +// Insert one set of choices under a main choice. +function insertMenuRow($current, $isTop, $items) { + global $TOPDIR; + //$img = "$TOPDIR/images/h3bg_new.gif"; + $menuRowClass = $isTop ? '' : 'class=MenuRow'; + $menuItemClass = $isTop ? 'class=MenuItemTop' : 'class=MenuItem'; + $currentClass = $isTop ? 'CurrentMenuItemTop' : ''; + + //echo "\n"; + //echo "
\n"; + echo "
  • $link[0]
  • \n"; + } else { + //echo "\n"; + echo "
  • $link[0]
  • \n"; + } + } + + //echo "\n"; + //echo "\n"; + echo "\n"; +} /** ---------------------------------------------------------------------------------------------- @@ -290,6 +196,7 @@ function dumpGlobals() { //------------------------------------ function isInstalled($rpmfile) { //------------------------------------ $aixrpmopt = isAIX() ? '--ignoreos' : ''; $lang = isWindows() ? '' : 'LANG=C'; + $out = array(); $rc = runcmd("$lang /bin/rpm -U $aixrpmopt --test $rpmfile", 2, $out); # The rc is not reliable in this case because it will be 1 if it is already installed # of if there is some other problem like a dependency is not satisfied. So we parse the @@ -512,9 +419,12 @@ function insertTabs ($tablist, $currentTabIndex) { //--------------------------- // Create the Action buttons in a table. Buttonlist is an array of arrays of button attribute strings. function insertButtons ($buttonsets) { //------------------------------------ foreach ($buttonsets as $buttonlist) { - echo "
    "; - foreach ($buttonlist as $button) { echo ""; } - echo "
    \n"; + echo ""; + foreach ($buttonlist as $button) { + //echo ""; + echo ""; + } + echo "
    $button
    \n"; } } diff --git a/xCAT-web/globals.inc b/xCAT-web/globals.inc deleted file mode 100644 index 3ef53124f..000000000 --- a/xCAT-web/globals.inc +++ /dev/null @@ -1,6 +0,0 @@ - diff --git a/xCAT-web/header.inc b/xCAT-web/header.inc deleted file mode 100644 index ed29da30a..000000000 --- a/xCAT-web/header.inc +++ /dev/null @@ -1,39 +0,0 @@ -"; -$p = 1; -foreach ($menuArray as $key => $value){ - if($p == 1){ - echo "
  • $key\n"; - $p++; - - }else{ - echo "
  • $key\n"; - $p++; - } - echo "
      "; - $q = 0; - foreach($value as $k => $u){ - if($p == 2){ - #echo "
    • $k
    • "; - echo "
    • $k
    • "; - }else{ - #echo "
    • $k
    • "; - echo "
    • $k
    • "; - } - $q++; - } - echo "
    "; - echo "
  • "; -} -echo ""; -} - -function printNodeList(){ - system("bin/getattrs --web"); -} - -?> diff --git a/xCAT-web/images/bg_button_a.gif b/xCAT-web/images/bg_button_a.gif new file mode 100644 index 000000000..fbb5d800f Binary files /dev/null and b/xCAT-web/images/bg_button_a.gif differ diff --git a/xCAT-web/images/bg_button_span.gif b/xCAT-web/images/bg_button_span.gif new file mode 100644 index 000000000..0b7f09866 Binary files /dev/null and b/xCAT-web/images/bg_button_span.gif differ diff --git a/xCAT-web/images/top.jpg b/xCAT-web/images/top.jpg new file mode 100644 index 000000000..50fc31cca Binary files /dev/null and b/xCAT-web/images/top.jpg differ diff --git a/xCAT-web/index.php b/xCAT-web/index.php index da533653a..ed4253b16 100644 --- a/xCAT-web/index.php +++ b/xCAT-web/index.php @@ -9,14 +9,31 @@ if (isAIX()) { $aixDisabled = 'disabled'; } require_once("lib/GroupNodeTable.class.php"); require_once("lib/XCAT/XCATCommand/XCATCommandRunner.class.php"); +insertHeader('Nodes', NULL, NULL, array('machines','nodes')); -insertHeader('Nodes', NULL, NULL); -insertNav('nodes'); - -echo "

    Cluster Groups and Nodes

    "; - +echo "
    \n"; insertButtons(array( + array( + 'Attributes', + 'Create Like', + 'Create Group', + 'Ping', + //'Updatenode', + 'Run Cmd', + 'Copy Files' + ), + array( + //'Soft Maint', + 'HW Ctrl', + 'RSA/MM/FSP', + 'Install', + 'Perf Mon', + //'Webmin', + 'Diagnose', + 'Remove' + ), + /* array( 'name=propButton value="Attributes"', 'name=defineButton value="Create Like"', @@ -36,6 +53,7 @@ insertButtons(array( 'name=diagButton value="Diagnose" onclick="this.form.nodesNeeded=1;"', 'name=removeButton value="Remove"' ), + */ )); echo '
    '; @@ -46,7 +64,6 @@ GroupNodeTable::insertGroupTableHeader(); // Get all the names of the groups $xcmdr = new XCATCommandRunner(); -//$nodeGroupNames = $xcmdr->getAllGroupNames(); $nodeGroupNames = $xcmdr->getAllXCATGroups(); // Print the HTML for each of them @@ -55,14 +72,9 @@ foreach($nodeGroupNames as $key => $nodeGroupName) { } GroupNodeTable::insertGroupTableFooter(); -?> - - - + +echo << XCATEvent.doExpandNodes(); --> @@ -81,4 +93,6 @@ GroupNodeTable::insertGroupTableFooter();

    This interface is still under construction and not yet ready for use.

    - \ No newline at end of file + +EOS; +?> \ No newline at end of file diff --git a/xCAT-web/lib/GroupNodeTable.class.php b/xCAT-web/lib/GroupNodeTable.class.php index 208ac5269..a0595e452 100644 --- a/xCAT-web/lib/GroupNodeTable.class.php +++ b/xCAT-web/lib/GroupNodeTable.class.php @@ -76,6 +76,7 @@ EOE; return; } +// This is used by nodes_by_group.php /** * @param XCATNodeGroup nodeGroup The node group for which we want to generate the html. * returns the table that contains all the nodes information of that group diff --git a/xCAT-web/lib/XCAT/HTML/HTMLProducer.class.php b/xCAT-web/lib/XCAT/HTML/HTMLProducer.class.php deleted file mode 100644 index 413ab5250..000000000 --- a/xCAT-web/lib/XCAT/HTML/HTMLProducer.class.php +++ /dev/null @@ -1,152 +0,0 @@ - - - - - - - - - - -EOS; - - return $html; -} - -function getXCATNodeTableFooter() { -$html = << -EOS; - return $html; -} - -/** - * @param String nodeGroupName The name of the node group. - */ -function getToggleString($nodeGroupName) { -$colTxt = "Click to collapse section"; -$exTxt = "Click to expand section"; -$bulgif = "$TOPDIR/images/h3bg_new.gif"; -$minusgif = "$TOPDIR/images/minus-sign.gif"; -$plusgif = "$TOPDIR/images/plus-sign.gif"; - - $html = << - -EOS; - - return $html; -} - -/** - * @param String nodeGroup The group. - */ -function getXCATGroupTableRow($nodeGroup) { - -$imagedir = 'images'; -$nodeGroupName = $nodeGroup->getName(); -$img_string = XCATNodeGroupUtil::getImageString($nodeGroup->getStatus()); - -$html = << - - - - - - - - - -EOE; - return $html; -} - - /** - * @param XCATNodeGroup nodeGroup The node group for which we want to generate the html. - * returns the table that contains all the nodes information of that group - */ -function getXCATNodeGroupSection($nodeGroup) { - $imagedir = 'images'; - $right_arrow_gif = $imagedir . "/grey_arrow_r.gif"; - $left_arrow_gif = $imagedir . "/grey_arrow_l.gif"; - - $html .= << -EOS; - - $nodes = $nodeGroup->getNodes(); - - foreach($nodes as $nodeName => $node) { - $html .= HTMLProducer::getXCATNodeTableRow($node); - } - - $html .= ""; - $html .= << -EOS; - - return $html; -} - - /** - * @param XCATNode node The node for which we want to generate the html. - */ -function getXCATNodeTableRow($node) { - - $imagedir = 'images'; - - //echo $node->getName(); - $html = " - " . - "". - "". - ""; - - $stat = $node->getStatus(); - $img_string = XCATNodeGroupUtil::getImageString($stat); - - $html .= "". - "". - ""; - -EOS; - return $html; - } -} -?> diff --git a/xCAT-web/lib/XCAT/HTML/ImageResources.class.php b/xCAT-web/lib/XCAT/HTML/ImageResources.class.php deleted file mode 100644 index 25d7bb396..000000000 --- a/xCAT-web/lib/XCAT/HTML/ImageResources.class.php +++ /dev/null @@ -1,10 +0,0 @@ - \ No newline at end of file diff --git a/xCAT-web/lib/XCAT/webservice/XCATWebservice.class.php b/xCAT-web/lib/XCAT/webservice/XCATWebservice.class.php index a5b6cdf33..418bc85dc 100644 --- a/xCAT-web/lib/XCAT/webservice/XCATWebservice.class.php +++ b/xCAT-web/lib/XCAT/webservice/XCATWebservice.class.php @@ -1,6 +1,6 @@ configMap[$key]; - } - - function setValue($key, $value) { - $this->configMap[$key] = $value; - } -} -?> \ No newline at end of file diff --git a/xCAT-web/menu.css b/xCAT-web/menu.css index f61d1fed6..c6f383760 100644 --- a/xCAT-web/menu.css +++ b/xCAT-web/menu.css @@ -1,4 +1,7 @@ /* + +This file is no longer used. + Styles for the navigation area and some other general styles. Some of this came from: @@ -108,7 +111,7 @@ tr.indent td { padding:0px 0 0px 10px; } border-bottom: 1px solid #fff; font-size:11px; padding: 0px 5px 0px 15px; - width: 100%; + /* width: 100%; */ } /* #menu_level3 li { list-style: none; } */ #menu_level3 a:link, a:visited { diff --git a/xCAT-web/style.css b/xCAT-web/style.css index 99e23035e..09e936f5b 100644 --- a/xCAT-web/style.css +++ b/xCAT-web/style.css @@ -1,45 +1,104 @@ - -div#header { - /* background-color : #d8dff1; */ - position: absolute; - left: 15px; - top: 15px; +#headingTable { + margin: 0 20px 10px 20px; + /* background: #FFF url(./images/top.jpg) repeat-x top; */ + background-color: #002432; } -div#nav { - /* background-color : #d8dff1; */ - position: absolute; - left: 0px; - top: 80px; -} - -div#content { - /* background-color : #fcfaeb; */ - position: absolute; - left: 120px; - top: 80px; -} - -/* not used... -P#logo { - background-color: #d8dff1; #f5f3cf #fffdb0 - vertical-align : middle;; - padding-top: 5px; - text-align: center; - padding-bottom: 5px; - margin-bottom: 10px; +/* +#top { + margin: 0 auto 10px auto; + padding: 0; + color: #666; + background: #FFF url(./images/top.jpg) repeat-x top; + background-color: #002432; + height: 65px; } */ -#banner { - font-weight: bolder; - font-size: 16pt; - font-style: italic; - color: #6a8ab5; /* #3F5B7F; gray; */ - text-align: center; - margin: 10px; +#xcatImage { + /* float: left; */ + margin: 5px; + } + +.MenuRow { + border-left: 2px solid white; + border-right: 2px solid white; } +#mainNav { + /* position: absolute; + float: left; */ + list-style: none; + margin: 0px; +} + +#mainNav li { + float: left; + font: .8em Verdana, Arial, Sans-Serif; + line-height: 2.5em; + font-weight: bold; + /* border: 1px solid white; */ +} + +.CurrentMenuItem { + display: block; + padding: 0 2em; + background: #09334b; + color: #fafafa; +} + +.CurrentMenuItemTop { + border-left: 2px solid white; + border-top: 2px solid white; + border-right: 2px solid white; + /* border-bottom: 2px solid #09334b; */ +} + +.MenuItemTop { border-bottom: 2px solid white; } +.MenuItem { /* border-bottom: 2px solid #002432; */ } + +#mainNav a { + display: block; + float: left; /* IE/Mac 5.2 Fix */ + padding: 0 2em; + text-decoration: none; + color: #a1a1a1; + border-left: 1px solid #273942; + cursor: pointer; +} + +/* IE/Win 5.x Fix */ +* html #mainNav a { + width: 1px; +} + +#mainNav a:hover { + background: #09334b; + color: #fafafa; +} + +/* +body.home #mainNav a#home, body.tutorials #mainNav a#tutorials { + background: #09334b; + color: #fafafa; + cursor: default; +} +*/ + +#mainNav li a.active { + color: #fafafa; + +} + +/* +div#content { + background-color : #fcfaeb; + position: absolute; + left: 120px; + top: 180px; +} +*/ + #disclaimer { font-weight: bold; font-size: 9pt; @@ -48,16 +107,6 @@ P#logo { margin: 5px; } -.PageHeading { - /* font-size: 10pt; */ - font: bold 1.4em "Trebuchet MS", Helvetica, Sans-Serif; - color: white; - background-color: transparent; /* #c0c0c0; */ - border: 1px solid white; - border-bottom-style: none; - margin: 2px 2px 10px 2px; -} - .ContentForm { margin: 10px 2px 15px 2px; } BODY { @@ -76,7 +125,6 @@ INPUT {vertical-align : middle; font-size : 8pt; font-family : sans-serif; font- SELECT {vertical-align : middle; font-size : 8pt; font-family : sans-serif; font-weight : bold;} TEXTAREA {vertical-align : middle; font-size : 8pt; font-family : sans-serif; font-weight : bold;} TABLE {font-size : 10pt; font-family : Arial;} - /* pre { padding: 0px; margin: 0px; } */ .TableHeader { color: black; background-color : #fffdb0; font-weight : bold; font-size : 9pt; white-space: nowrap; } @@ -107,69 +155,44 @@ TABLE {font-size : 10pt; font-family : Arial;} .NoMargin { margin: 0px; } .NoPadding { padding: 0px; margin: 0px; border: 0px none white; } .Hidden { visibility : hidden ;} +.Txtfld {font-size : 8pt; font-family : sans-serif; font-weight : bold;} - -.but{ - background-color: #3F5B7F; /* #6a8ab5; #fbf999; */ +/* +.but { + background-color: #3F5B7F; padding: 0px; margin: 0px; } - -.txtfld {font-size : 8pt; font-family : sans-serif; font-weight : bold;} - -/* this was used to make buttons out of table cells... -.bt { - font-size : 8pt; - font-weight : bold; - font-family : sans-serif; - background-image : url(images/bt.gif); - text-align: center; -} */ -/* The rest of the styles were for the navigation area, but are not used any more... -table#navtable { - width: 105px; - font-size : 8pt; - padding-left : 1px; - border: 0px; - white-space: nowrap; + +a.button { + background: transparent url('./images/bg_button_a.gif') no-repeat scroll top right; + color: #444; + display: block; + float: left; + font: normal 12px arial, sans-serif; + height: 24px; + margin-right: 6px; + padding-right: 18px; /* sliding doors padding */ + text-decoration: none; + cursor: pointer; } -.NavCurLink { background-color: #fcfaeb; } - -#nav A{ - font-weight : bold; - font-family : sans-serif; +a.button span { + background: transparent url('./images/bg_button_span.gif') no-repeat; + display: block; + line-height: 14px; + padding: 5px 0 5px 18px; } -#nav P{ - text-indent : 0px; - padding: 0px; - margin: 0px; - font-weight : bold; - font-family : sans-serif; - cursor : default; - vertical-align : middle; +a.button:active { + background-position: bottom right; + color: #000; + outline: none; /* hide dotted outline in Firefox */ } -#nav IMG { border: 0px; } - -.InnerTable{ - margin-left : 0px; - margin-right : 0px; - margin-top : 0px; - margin-bottom : 0px; - border: 0px; - width: 100%; - font-size : 8pt; - white-space: nowrap; +a.button:active span { + background-position: bottom left; + padding: 6px 0 4px 18px; /* push text down 1px */ } - -.OuterTable{ - margin-left : 1px; - margin-right : 1px; - margin-top : 0px; - margin-bottom : 0px; -} -*/ \ No newline at end of file
    -
    - - Nodes -
    -
    HW Type
    OS
    Mode
    Status
    HW Ctrl Pt
    Comment
    -EOS; - $html .= HTMLProducer::getToggleString($nodeGroupName); - $html .= <<$nodeGroupName -
     
     
     
    $img_string
     
     
    \"Previous    \"Next  
    getName(). "\" />" .$node->getName(). "
    " . $node->getHwType(). "
    " . $node->getOs(). "
    " . $node->getMode(). "
    " . $img_string . "
    " . $node->getHwCtrlPt(). "
    " . $node->getComment(). "