From d71ffa4c4fe39d77d60efefa46847724c59c7a7f Mon Sep 17 00:00:00 2001 From: bp-sawyers Date: Fri, 3 Oct 2008 13:11:57 +0000 Subject: [PATCH] Fix menu in IE and started frame view page. git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@2279 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-web/images/blade-front-blue.jpg | Bin 974 -> 2595 bytes xCAT-web/images/blade-front-green.jpg | Bin 986 -> 2648 bytes xCAT-web/images/blade-front-red.jpg | Bin 980 -> 2645 bytes xCAT-web/images/blade-front-yellow.jpg | Bin 984 -> 2651 bytes xCAT-web/lib/GroupNodeTable.class.php | 15 +- xCAT-web/lib/functions.php | 271 +++++++++----- xCAT-web/lib/style.css | 132 ++++--- xCAT-web/machines/frames.css | 19 + xCAT-web/machines/frames.js | 109 ++++++ xCAT-web/machines/frames.php | 495 ++++++++----------------- xCAT-web/machines/groups.php | 28 +- 11 files changed, 543 insertions(+), 526 deletions(-) create mode 100644 xCAT-web/machines/frames.css create mode 100644 xCAT-web/machines/frames.js diff --git a/xCAT-web/images/blade-front-blue.jpg b/xCAT-web/images/blade-front-blue.jpg index b7972542c9aaa7784c4929c84c90529885411de0..e12f15825f2d6fcfd1590fa49ac6586fb9298221 100644 GIT binary patch delta 2168 zcmbtT`#YNn7XC7AwQB0px)g1-(_)HH>yj;zv^8Zhp|quql9rl^6g4i%y5#FsTv}#o zTeGZW)g@F&MS`MC5!qS2NeH57qSX;Zz7FxVav9xc=O5TT=Xsy^ea`c|@A>7N7n`e0 zLEV_{4PYGT7vKjV5D4J>dILHs@ZE6=@jCzr2yg(l006KNutIDC5bFxF4(tDFzjggJ zV#9ytU#x3a#20|^ItQ=gbDdwuXU`ve;sP-#%{ln^sl6F)&TgK7ZUO*(Kd=42YCXmG ze-1GH!>RijFxdi}0>0dU_^SCK9|5Xcq2k3`Q16=5pO4$|v@AKFx?6p^L-S9n8(ai> z4|E(KD3Lx+2aD*g!`c2)0~h@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Z2Uqo}&)Ywh@_iwxVu0@nxaRbTVAe$pnPZ!c3mb}xFI zlhfhx&f)o2i$7Z2GCB1%xySx9ywG-DvM@tU>P@(iCR?RX|9!oq$Fl4njZN9pX77LAR>AT`|7FCl z>VB06ALsigdPr=}&RqFwny|W%iehR2A9L#Fp1)aJcmBPw>}qTER2^O4+--YJcb-$6 ztT+p?5uP ziiFv}uKIT3p4YqA4ySi*?Gc;Rdg;&{NoJWjpF)IxO%8tX&G7Gpx8(sU2}}?8_IqvJ Js9*g5CIGF1+ZX@< diff --git a/xCAT-web/images/blade-front-red.jpg b/xCAT-web/images/blade-front-red.jpg index d0af03eaea974b816194f8c8393428dafeff02d1..49bd300fdf9843d45ca4d40fa359a7e27fc97f67 100644 GIT binary patch delta 2219 zcmbtS{Xf%-9{)-zmFuzA;jnW<9p#}q9?Ih>7iou)GKP&@F|(XP8;$Sjkf+GG+&EEN z4<5p@u#u-JW8JPJCu3}AOnKgHCBDsUXWiF5|G>SU&+GmAykGCn>;3-x@)_PfVg#zj zR8xT78E;>2Ktn?Vh*USAng%Xumb>qt$?wH7NDVK?rNC)mwT)Ew;G!N z(YL7iQH?Eto_hML@uecw_~Q9<21Ma5CENOYo%`nMcedX-0;+KU^!#%6|0;Eg=l>jF z^rutx9MInZoC9`iYV2>U>(c-g@0&NDvi1u}$d_`9_QbplQ>bNW?K-q1a!YzGqXjLv zo0Op-_RN4!u=GY*){K;Or@GIaRC1R0$xaV1U@Ge$$D;?D41r*feV>L)9Oq=tqN0o7De=D8<7m2?JwcnKwo@y*U ziZi1UOq;_vyu_=msC8kc3iz63N%mxH*0LO-Bz7srto6+&4*|Q6vX=>?=yi>(TxgX! z6_SY}YA)s|W5`;8s#-LbR7gLb;rcU0K8@VSrbc(m#*%OzBW`xc1T)uZxe=u}FO^)c zdDRd?LJM?315bE<=Wz#cYkbDnZB(}LZAwx_%P+F^1Ko7ww$JM0@vSVi$Zazz){`}*7d3SC~qBcpr zqgcwaAL%{^cR{V+k21j>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WU427CLs?ZbOH%_&9RovskRgm5oSfWT z++sXDV*2vZ^7@!S8&e2Hx>Dt3C+oD4jiy|&61uWp<-}7~L;=h&q@BM3<=yUxeGs|^d^ZN5VA2?scU)uQP zyPW62$9D4$O)yNmb~*T}j+&o}htsJAGHj>QC4XJbF8;mHcQw~{t%#`E*|}BO#dDlh zx{O~i9*t=J8?fxa{;DpU;Ie}So+^+3?W~{wdDhb0e@inNvpzi&`>6U@?9l36lPaF5 z@xKmzJ8{p{yVn}0mu5@onsP5~wJ>6{w0yEc{j1vYi*J&DE8cpyz~cbx0ol5#*-3HF H|K9`vB4pbm diff --git a/xCAT-web/lib/GroupNodeTable.class.php b/xCAT-web/lib/GroupNodeTable.class.php index cbdb694f6..b20299f54 100644 --- a/xCAT-web/lib/GroupNodeTable.class.php +++ b/xCAT-web/lib/GroupNodeTable.class.php @@ -57,7 +57,7 @@ EOS; * @param String nodeGroup The group. */ function insertGroupTableRow($nodeGroupName, $status) { -$img_string = getStatusImage(GroupNodeTable::determineStatus($status)); +$img_string = getStatusImage(mapStatus($status)); //echo ''; echo ''; @@ -120,18 +120,5 @@ function getNodeTableRow($nodeName, $attrs) { return $html; } -/** - * @param String nodestatStr The status of the node as output by the nodestat command - * @return "good", "bad", "warning", or "unknown" - */ -function determineStatus($statStr) { - $status = NULL; - if ($statStr == "alive" || $statStr == "ready" || $statStr == "pbs" || $statStr == "sshd") { $status = "good"; } - else if ($statStr == "noping") { $status = "bad"; } - else if ($statStr == "ping") { $status = "warning"; } - else { $status = "unknown"; } - return $status; -} - } // end the class ?> diff --git a/xCAT-web/lib/functions.php b/xCAT-web/lib/functions.php index c9882dffd..27f1e48d4 100644 --- a/xCAT-web/lib/functions.php +++ b/xCAT-web/lib/functions.php @@ -55,8 +55,8 @@ echo "\n"; echo << - - + + EOS; @@ -64,7 +64,7 @@ EOS; insertMenus($currents); -echo "\n"; +echo "\n"; //echo "\n"; // end the top div } // end insertHeader @@ -132,7 +132,7 @@ $MENU = array( 'manpages' => array('label' => 'Man Pages', 'url' => getDocURL('manpage')), 'maillist' => array('label' => 'Mail List', 'url' => getDocURL('web','mailinglist')), 'wiki' => array('label' => 'Wiki', 'url' => getDocURL('web','wiki')), - 'suggest' => array('label' => 'Suggestions', 'url' => "$TOPDIR/support/suggest.php"), + 'suggest' => array('label' => 'Suggest', 'url' => "$TOPDIR/support/suggest.php"), 'about' => array('label' => 'About', 'url' => "$TOPDIR/support/about.php"), ) ), @@ -145,7 +145,7 @@ $MENU = array( function insertMenus($currents) { global $TOPDIR; global $MENU; - echo "\n"; + echo "
\n"; insertMenuRow($currents[0], 1, $MENU); @@ -160,13 +160,15 @@ function insertMenus($currents) { function insertMenuRow($current, $isTop, $items) { global $TOPDIR; //$img = "$TOPDIR/images/h3bg_new.gif"; - $menuRowClass = $isTop ? '' : 'class=MenuRowBottom'; - $menuItemClass = $isTop ? 'class=MenuItemTop' : ''; - $currentClass = $isTop ? 'class=CurrentMenuItemTop' : ''; + //$menuRowClass = $isTop ? '' : 'class=MenuRowBottom'; + $menuItemClass = $isTop ? '' : 'class=MenuItemBottom'; + //$currentClass = $isTop ? 'class=CurrentMenuItemTop' : ''; //echo "\n"; //echo "
\n"; - echo "
  • $label

  • "; + //echo "
  • $label

  • "; + //echo "
  • $label

  • "; + //echo "

    $label

    "; + echo "$label"; } else { //echo "\n"; - echo "
  • $label
  • "; + //echo "
  • $label
  • "; + echo "$label"; } } //echo "\n"; //echo "\n"; - echo "\n\n"; + //echo "\n\n"; + echo "\n\n"; } @@ -471,76 +478,125 @@ function getDocURL($book, $section = NULL) { } +$HWTypeInfo = array ( + 'x335' => array ( 'image'=>'330.gif', 'rackimage'=>'x335-front', 'u'=>1, 'aliases'=>'8676' ), + 'x336' => array ( 'image'=>'330.gif', 'rackimage'=>'x335-front', 'u'=>1, 'aliases'=>'8837' ), + 'x306' => array ( 'image'=>'330.gif', 'rackimage'=>'x335-front', 'u'=>1, 'aliases'=>'8836' ), + 'x306m' => array ( 'image'=>'330.gif', 'rackimage'=>'x335-front', 'u'=>1, 'aliases'=>'8849,8491' ), + 'x3550' => array ( 'image'=>'330.gif', 'rackimage'=>'x335-front', 'u'=>1, 'aliases'=>'7978' ), + 'e325' => array ( 'image'=>'330.gif', 'rackimage'=>'x335-front', 'u'=>1, 'aliases'=>'8835' ), + 'e326' => array ( 'image'=>'330.gif', 'rackimage'=>'x335-front', 'u'=>1, 'aliases'=>'8848' ), + 'e326m' => array ( 'image'=>'330.gif', 'rackimage'=>'x335-front', 'u'=>1, 'aliases'=>'7969' ), + 'e327' => array ( 'image'=>'330.gif', 'rackimage'=>'x335-front', 'u'=>1, 'aliases'=>'' ), + 'x3250' => array ( 'image'=>'330.gif', 'rackimage'=>'x335-front', 'u'=>1, 'aliases'=>'4190,4194' ), + 'x3350' => array ( 'image'=>'330.gif', 'rackimage'=>'x335-front', 'u'=>1, 'aliases'=>'4192,4193,hmc' ), # just guessed about hmc + 'x3450' => array ( 'image'=>'330.gif', 'rackimage'=>'x335-front', 'u'=>1, 'aliases'=>'7948' ), + 'x3455' => array ( 'image'=>'330.gif', 'rackimage'=>'x335-front', 'u'=>1, 'aliases'=>'7940,ipmi,xseries,default' ), + 'x3550' => array ( 'image'=>'330.gif', 'rackimage'=>'x335-front', 'u'=>1, 'aliases'=>'7978' ), + + 'x340' => array ( 'image'=>'342.gif', 'rackimage'=>'x345-front', 'u'=>2, 'aliases'=>'8656' ), + 'x342' => array ( 'image'=>'342.gif', 'rackimage'=>'x345-front', 'u'=>2, 'aliases'=>'8669' ), + 'x345' => array ( 'image'=>'342.gif', 'rackimage'=>'x345-front', 'u'=>2, 'aliases'=>'8670' ), + 'x346' => array ( 'image'=>'342.gif', 'rackimage'=>'x345-front', 'u'=>2, 'aliases'=>'8840' ), + 'x3650' => array ( 'image'=>'342.gif', 'rackimage'=>'x345-front', 'u'=>2, 'aliases'=>'7979' ), + 'x3655' => array ( 'image'=>'342.gif', 'rackimage'=>'x345-front', 'u'=>2, 'aliases'=>'7943' ), + + 'x360' => array ( 'image'=>'342.gif', 'rackimage'=>'x366-front', 'u'=>3, 'aliases'=>'8686' ), + 'x365' => array ( 'image'=>'342.gif', 'rackimage'=>'x366-front', 'u'=>3, 'aliases'=>'8862' ), + 'x366' => array ( 'image'=>'342.gif', 'rackimage'=>'x366-front', 'u'=>3, 'aliases'=>'8863' ), + 'x445' => array ( 'image'=>'342.gif', 'rackimage'=>'x366-front', 'u'=>3, 'aliases'=>'' ), + 'x450' => array ( 'image'=>'342.gif', 'rackimage'=>'x366-front', 'u'=>3, 'aliases'=>'' ), + 'x455' => array ( 'image'=>'342.gif', 'rackimage'=>'x366-front', 'u'=>3, 'aliases'=>'' ), + 'x460' => array ( 'image'=>'342.gif', 'rackimage'=>'x366-front', 'u'=>3, 'aliases'=>'' ), + + 'x3755' => array ( 'image'=>'342.gif', 'rackimage'=>'x366-front', 'u'=>4, 'aliases'=>'7163,8877' ), + 'x3850' => array ( 'image'=>'342.gif', 'rackimage'=>'x366-front', 'u'=>4, 'aliases'=>'7141,7233' ), + 'x3950' => array ( 'image'=>'342.gif', 'rackimage'=>'x366-front', 'u'=>4, 'aliases'=>'' ), # 7141,7233 + + 'hs20' => array ( 'image'=>'blade.gif', 'rackimage'=>'blade-front', 'u'=>7, 'aliases'=>'8678,8843,7981,blade' ), # removed 8832 because it is older and it made this entry to wide in the drop down boxes + 'hs12' => array ( 'image'=>'blade.gif', 'rackimage'=>'blade-front', 'u'=>7, 'aliases'=>'8014,8028' ), + 'hs21' => array ( 'image'=>'blade.gif', 'rackimage'=>'blade-front', 'u'=>7, 'aliases'=>'7995,8853' ), + 'js20' => array ( 'image'=>'blade.gif', 'rackimage'=>'blade-front', 'u'=>7, 'aliases'=>'8842' ), + 'js12' => array ( 'image'=>'blade.gif', 'rackimage'=>'blade-front', 'u'=>7, 'aliases'=>'799860X' ), + 'js21' => array ( 'image'=>'blade.gif', 'rackimage'=>'blade-front', 'u'=>7, 'aliases'=>'8844,7998J21' ), + 'js22' => array ( 'image'=>'blade.gif', 'rackimage'=>'blade-front', 'u'=>7, 'aliases'=>'799861X' ), + 'qs21' => array ( 'image'=>'blade.gif', 'rackimage'=>'blade-front', 'u'=>7, 'aliases'=>'0792' ), + 'qs22' => array ( 'image'=>'blade.gif', 'rackimage'=>'blade-front', 'u'=>7, 'aliases'=>'0793' ), + 'ls20' => array ( 'image'=>'blade.gif', 'rackimage'=>'blade-front', 'u'=>7, 'aliases'=>'8850' ), + 'ls21' => array ( 'image'=>'blade.gif', 'rackimage'=>'blade-front', 'u'=>7, 'aliases'=>'7971' ), + 'ls22' => array ( 'image'=>'blade.gif', 'rackimage'=>'blade-front', 'u'=>7, 'aliases'=>'7901' ), + 'hs40' => array ( 'image'=>'blade2.gif', 'rackimage'=>'blade2-front', 'u'=>7, 'aliases'=>'8839' ), + 'ls41' => array ( 'image'=>'blade2.gif', 'rackimage'=>'blade2-front', 'u'=>7, 'aliases'=>'7972' ), + 'ls42' => array ( 'image'=>'blade2.gif', 'rackimage'=>'blade2-front', 'u'=>7, 'aliases'=>'7902' ), + + # POWER 4 servers + 'p610' => array ( 'image'=>'520.gif', 'rackimage'=>'x335-front', 'u'=>5, 'aliases'=>'7028' ), + 'p615' => array ( 'image'=>'520.gif', 'rackimage'=>'x335-front', 'u'=>4, 'aliases'=>'7029' ), + 'p630' => array ( 'image'=>'520.gif', 'rackimage'=>'x335-front', 'u'=>4, 'aliases'=>'' ), # 7026 + 'p640' => array ( 'image'=>'520.gif', 'rackimage'=>'x335-front', 'u'=>5, 'aliases'=>'7026' ), + 'p650' => array ( 'image'=>'520.gif', 'rackimage'=>'x335-front', 'u'=>8, 'aliases'=>'7038' ), + 'p655' => array ( 'image'=>'590.gif', 'rackimage'=>'x335-front', 'u'=>42, 'aliases'=>'7039' ), + 'p670' => array ( 'image'=>'590.gif', 'rackimage'=>'x335-front', 'u'=>42, 'aliases'=>'' ), # 7040 + 'p690' => array ( 'image'=>'590.gif', 'rackimage'=>'x335-front', 'u'=>42, 'aliases'=>'7040' ), + + # OpenPOWER servers + 'p710' => array ( 'image'=>'342.gif', 'rackimage'=>'x335-front', 'u'=>2, 'aliases'=>'9123' ), + 'p720' => array ( 'image'=>'520.gif', 'rackimage'=>'x345-front', 'u'=>4, 'aliases'=>'9124' ), + + # POWER 5 servers + 'p5-505' => array ( 'image'=>'330.gif', 'rackimage'=>'x335-front', 'u'=>1, 'aliases'=>'' ), # 9115 + 'p5-505Q' => array ( 'image'=>'330.gif', 'rackimage'=>'x335-front', 'u'=>1, 'aliases'=>'9115' ), + + 'p5-510' => array ( 'image'=>'342.gif', 'rackimage'=>'x345-front', 'u'=>2, 'aliases'=>'9110' ), + 'p5-510Q' => array ( 'image'=>'342.gif', 'rackimage'=>'x345-front', 'u'=>2, 'aliases'=>'' ), # 9110 + 'p5-575' => array ( 'image'=>'342.gif', 'rackimage'=>'x345-front', 'u'=>2, 'aliases'=>'9118' ), + + 'p5-520' => array ( 'image'=>'520.gif', 'rackimage'=>'p5-520-front', 'u'=>4, 'aliases'=>'9111' ), + 'p5-520Q' => array ( 'image'=>'520.gif', 'rackimage'=>'p5-520-front', 'u'=>4, 'aliases'=>'9131' ), + 'p5-550' => array ( 'image'=>'520.gif', 'rackimage'=>'p5-520-front', 'u'=>4, 'aliases'=>'9113' ), + 'p5-550Q' => array ( 'image'=>'520.gif', 'rackimage'=>'p5-520-front', 'u'=>4, 'aliases'=>'9133' ), + 'p5-560' => array ( 'image'=>'520.gif', 'rackimage'=>'p5-520-front', 'u'=>4, 'aliases'=>'9116' ), + 'p5-560Q' => array ( 'image'=>'520.gif', 'rackimage'=>'p5-520-front', 'u'=>4, 'aliases'=>'' ), # 9116 + 'p5-570' => array ( 'image'=>'520.gif', 'rackimage'=>'p5-520-front', 'u'=>4, 'aliases'=>'' ), # 9117 + + 'p5-590' => array ( 'image'=>'590.gif', 'rackimage'=>'p5-590-front', 'u'=>42, 'aliases'=>'' ), # 9119 + 'p5-595' => array ( 'image'=>'590.gif', 'rackimage'=>'p5-590-front', 'u'=>42, 'aliases'=>'' ), # 9119 + + # POWER 6 servers + '520' => array ( 'image'=>'520.gif', 'rackimage'=>'p5-520-front', 'u'=>4, 'aliases'=>'8203' ), + '550' => array ( 'image'=>'520.gif', 'rackimage'=>'p5-520-front', 'u'=>4, 'aliases'=>'8204' ), + '570' => array ( 'image'=>'520.gif', 'rackimage'=>'p5-520-front', 'u'=>4, 'aliases'=>'9117' ), + '575' => array ( 'image'=>'342.gif', 'rackimage'=>'x345-front', 'u'=>2, 'aliases'=>'9125' ), + '595' => array ( 'image'=>'590.gif', 'rackimage'=>'p5-590-front', 'u'=>42, 'aliases'=>'9119' ), + ); + + //----------------------------------------------------------------------------- // This returns important display info about each type of hardware, so we can easily add new hw types. -function getHWTypeInfo($hwtype, $attr) { - //todo: get the aliases to be keys in this hash too - $hwhash = array ( - 'x335' => array ( 'image'=>'330.gif', 'rackimage'=>'x335-front', 'u'=>1, 'aliases'=>'8676' ), - 'x336' => array ( 'image'=>'330.gif', 'rackimage'=>'x335-front', 'u'=>1, 'aliases'=>'8837' ), - 'x306' => array ( 'image'=>'330.gif', 'rackimage'=>'x335-front', 'u'=>1, 'aliases'=>'8836' ), - 'x306m' => array ( 'image'=>'330.gif', 'rackimage'=>'x335-front', 'u'=>1, 'aliases'=>'8849,8491' ), - 'x3550' => array ( 'image'=>'330.gif', 'rackimage'=>'x335-front', 'u'=>1, 'aliases'=>'7978' ), - 'e325' => array ( 'image'=>'330.gif', 'rackimage'=>'x335-front', 'u'=>1, 'aliases'=>'8835' ), - 'e326' => array ( 'image'=>'330.gif', 'rackimage'=>'x335-front', 'u'=>1, 'aliases'=>'8848' ), - 'e326m' => array ( 'image'=>'330.gif', 'rackimage'=>'x335-front', 'u'=>1, 'aliases'=>'7969' ), - 'e327' => array ( 'image'=>'330.gif', 'rackimage'=>'x335-front', 'u'=>1, 'aliases'=>'' ), +function getHWTypeInfo($hwtype, $attr=NULL) { +global $HWTypeInfo; - 'x340' => array ( 'image'=>'342.gif', 'rackimage'=>'x345-front', 'u'=>2, 'aliases'=>'8656' ), - 'x342' => array ( 'image'=>'342.gif', 'rackimage'=>'x345-front', 'u'=>2, 'aliases'=>'8669' ), - 'x345' => array ( 'image'=>'342.gif', 'rackimage'=>'x345-front', 'u'=>2, 'aliases'=>'8670' ), - 'x346' => array ( 'image'=>'342.gif', 'rackimage'=>'x345-front', 'u'=>2, 'aliases'=>'8840' ), - 'x3650' => array ( 'image'=>'342.gif', 'rackimage'=>'x345-front', 'u'=>2, 'aliases'=>'7979' ), +// Get the aliases defined as keys, if we have not done that yet +if (!array_key_exists('9119',$HWTypeInfo)) { + $keys = array_keys($HWTypeInfo); // make a copy of the keys, because we will be adding some in the loop below + foreach ($keys as $key) { + $value = $HWTypeInfo[$key]; + if (array_key_exists('aliases',$value) && !empty($value['aliases'])) { + $aliases = explode(',', $value['aliases']); + foreach ($aliases as $a) { + if (array_key_exists($a,$HWTypeInfo)) { msg('W', "Internal warning: Duplicate alias in HWTypeInfo array: $a"); } + else { $HWTypeInfo[$a] = $value; } + } + } + } +} - 'x360' => array ( 'image'=>'342.gif', 'rackimage'=>'x366-front', 'u'=>3, 'aliases'=>'8686' ), - 'x365' => array ( 'image'=>'342.gif', 'rackimage'=>'x366-front', 'u'=>3, 'aliases'=>'8862' ), - 'x366' => array ( 'image'=>'342.gif', 'rackimage'=>'x366-front', 'u'=>3, 'aliases'=>'8863' ), - 'x3850' => array ( 'image'=>'342.gif', 'rackimage'=>'x366-front', 'u'=>3, 'aliases'=>'8863' ), - 'x445' => array ( 'image'=>'342.gif', 'rackimage'=>'x366-front', 'u'=>3, 'aliases'=>'' ), - 'x450' => array ( 'image'=>'342.gif', 'rackimage'=>'x366-front', 'u'=>3, 'aliases'=>'' ), - 'x455' => array ( 'image'=>'342.gif', 'rackimage'=>'x366-front', 'u'=>3, 'aliases'=>'' ), - 'x460' => array ( 'image'=>'342.gif', 'rackimage'=>'x366-front', 'u'=>3, 'aliases'=>'' ), - 'x3950' => array ( 'image'=>'342.gif', 'rackimage'=>'x366-front', 'u'=>3, 'aliases'=>'' ), - - 'hs20' => array ( 'image'=>'blade.gif', 'rackimage'=>'blade-front', 'u'=>7, 'aliases'=>'8678,8843,7981' ), # removed 8832 because it is older and it made this entry to wide in the drop down boxes - 'js20' => array ( 'image'=>'blade.gif', 'rackimage'=>'blade-front', 'u'=>7, 'aliases'=>'8842' ), - 'js21' => array ( 'image'=>'blade.gif', 'rackimage'=>'blade-front', 'u'=>7, 'aliases'=>'8844' ), - 'ls20' => array ( 'image'=>'blade.gif', 'rackimage'=>'blade-front', 'u'=>7, 'aliases'=>'8850' ), - 'hs40' => array ( 'image'=>'blade2.gif', 'rackimage'=>'blade2-front', 'u'=>7, 'aliases'=>'8839' ), - - 'p5-505' => array ( 'image'=>'330.gif', 'rackimage'=>'x335-front', 'u'=>1, 'aliases'=>'9115' ), - 'p5-505Q' => array ( 'image'=>'330.gif', 'rackimage'=>'x335-front', 'u'=>1, 'aliases'=>'9115' ), - - 'p5-510' => array ( 'image'=>'342.gif', 'rackimage'=>'x345-front', 'u'=>2, 'aliases'=>'9110' ), - 'p5-510Q' => array ( 'image'=>'342.gif', 'rackimage'=>'x345-front', 'u'=>2, 'aliases'=>'9110' ), - 'p5-575' => array ( 'image'=>'342.gif', 'rackimage'=>'x345-front', 'u'=>2, 'aliases'=>'9118' ), - - 'p5-520' => array ( 'image'=>'520.gif', 'rackimage'=>'p5-520-front', 'u'=>4, 'aliases'=>'9111' ), - 'p5-520Q' => array ( 'image'=>'520.gif', 'rackimage'=>'p5-520-front', 'u'=>4, 'aliases'=>'9131' ), - 'p5-550' => array ( 'image'=>'520.gif', 'rackimage'=>'p5-520-front', 'u'=>4, 'aliases'=>'9113' ), - 'p5-550Q' => array ( 'image'=>'520.gif', 'rackimage'=>'p5-520-front', 'u'=>4, 'aliases'=>'9133' ), - 'p5-560' => array ( 'image'=>'520.gif', 'rackimage'=>'p5-520-front', 'u'=>4, 'aliases'=>'9116' ), - 'p5-560Q' => array ( 'image'=>'520.gif', 'rackimage'=>'p5-520-front', 'u'=>4, 'aliases'=>'9116' ), - 'p5-570' => array ( 'image'=>'520.gif', 'rackimage'=>'p5-520-front', 'u'=>4, 'aliases'=>'9117' ), - - 'p5-590' => array ( 'image'=>'590.gif', 'rackimage'=>'p5-590-front', 'u'=>42, 'aliases'=>'9119' ), - 'p5-595' => array ( 'image'=>'590.gif', 'rackimage'=>'p5-590-front', 'u'=>42, 'aliases'=>'9119' ), - - 'p710' => array ( 'image'=>'342.gif', 'rackimage'=>'x335-front', 'u'=>2, 'aliases'=>'9123' ), - 'p720' => array ( 'image'=>'520.gif', 'rackimage'=>'x345-front', 'u'=>4, 'aliases'=>'9124' ), - - 'p610' => array ( 'image'=>'520.gif', 'rackimage'=>'x335-front', 'u'=>5, 'aliases'=>'7028' ), - 'p615' => array ( 'image'=>'520.gif', 'rackimage'=>'x335-front', 'u'=>4, 'aliases'=>'7029' ), - 'p630' => array ( 'image'=>'520.gif', 'rackimage'=>'x335-front', 'u'=>4, 'aliases'=>'7026' ), - 'p640' => array ( 'image'=>'520.gif', 'rackimage'=>'x335-front', 'u'=>5, 'aliases'=>'7026' ), - 'p650' => array ( 'image'=>'520.gif', 'rackimage'=>'x335-front', 'u'=>8, 'aliases'=>'7038' ), - 'p655' => array ( 'image'=>'590.gif', 'rackimage'=>'x335-front', 'u'=>42, 'aliases'=>'7039' ), - 'p670' => array ( 'image'=>'590.gif', 'rackimage'=>'x335-front', 'u'=>42, 'aliases'=>'7040' ), - 'p690' => array ( 'image'=>'590.gif', 'rackimage'=>'x335-front', 'u'=>42, 'aliases'=>'7040' ), - ); - $info = $hwhash[strtolower($hwtype)]; - if (isset($attr)) { return $info[$attr]; } - else { return $info; } +// Now return the info requested +$k = strtolower($hwtype); +if (!array_key_exists($k,$HWTypeInfo)) { return NULL; } +$info = $HWTypeInfo[$k]; +if (isset($attr)) { return $info[$attr]; } +else { return $info; } } @@ -549,19 +605,57 @@ function getHWTypeInfo($hwtype, $attr) { function getHWTypeImage($hwtype, $powermethod) { # 1st try to match the hw type $info = getHWTypeInfo($hwtype, 'image'); - if ($info) { return $info['image']; } + if (!empty($info)) { return $info; } # No matches yet. Use the power method to get a generic type. if (isset($powermethod)) { - $powermethod = strtolower($powermethod); - if ($powermethod == 'blade') { return getHWTypeInfo('hs20', 'image'); } - elseif ($powermethod == 'hmc') { return getHWTypeInfo('p5-520', 'image'); } - elseif ($powermethod == 'bmc') { return getHWTypeInfo('x335','image'); } - elseif ($powermethod == 'xseries') { return getHWTypeInfo('x335', 'image'); } + $info = getHWTypeInfo($powermethod, 'image'); + if (!empty($info)) { return $info; } } # As a last resort, return the most common node image - return getHWTypeInfo('x335', 'image'); + return getHWTypeInfo('default', 'image'); +} + + +//----------------------------------------------------------------------------- +// Map the many possible values of nodelist.status into one of four: good, bad, warning, unknown +//todo: update this list from Lings new status work +function mapStatus($statStr) { + $status = NULL; + if ($statStr == "alive" || $statStr == "ready" || $statStr == "pbs" || $statStr == "sshd") { $status = "good"; } + else if ($statStr == "noping" || $statStr=='unreachable') { $status = "bad"; } + else if ($statStr == "ping") { $status = "warning"; } + else { $status = "unknown"; } + return $status; +} + + +//----------------------------------------------------------------------------- +// For 2 status strings from nodestat or nodelist.status, return the "lowest" (worst). +// Use this function when trying to aggregate multiple status values into one. +//todo: update this list from Lings new status work +function minStatus($s1, $s2) { + $statnum = array( 'unknown' => 0, + 'unreachable' => 1, + 'noping' => 1, + 'ping' => 2, + 'snmp' => 3, + 'sshd' => 4, + 'pbs' => 5, + 'ready' => 6, + 'alive' => 6, + ); + + // if either value is empty, just return the other one + if (!isset($s1)) { return $s2; } + if (!isset($s2)) { return $s1; } + + // if either value does not map into the hash, then return unknown + if (!isset($statnum[$s1]) || !isset($statnum[$s2])) { return 'unknown'; } + + if ($statnum[$s1] < $statnum[$s2]) { return $s1; } + else { return $s2; } } @@ -599,13 +693,16 @@ function getNodes($noderange, $attrs) { //my ($hostname, $type, $osname, $distro, $version, $mode, $status, $conport, $hcp, $nodeid, $pmethod, $location, $comment) = split(/:\|:/, $na); //$nodes[] = array('hostname'=>"node$i.cluster.com", 'type'=>'x3655', 'osname'=>'Linux', 'distro'=>'RedHat', 'version'=>'4.5', 'status'=>1, 'conport'=>$i, 'hcp'=>"node$i-bmc.cluster.com", 'nodeid'=>'', 'pmethod'=>'bmc', 'location'=>"frame=1 u=$", 'comment'=>''); $nodes = array(); + if (empty($noderange)) { $nodrange = '/.*'; } //$xml = docmd('nodels',$noderange,implode(' ',$attrs)); $xml = docmd('nodels',$noderange,$attrs); - $output = $xml->xcatresponse->children(); // technically, we should iterate over the xcatresponses, because there can be more than one - foreach ($output as $o) { + //$output = $xml->xcatresponse->children(); // technically, we should iterate over the xcatresponses, because there can be more than one + //foreach ($output as $o) { + foreach ($xml->children() as $response) foreach ($response->children() as $o) { $nodename = (string)$o->name; $data = $o->data; $attrval = (string)$data->contents; + if (empty($attrval)) { continue; } $attrname = (string)$data->desc; //echo "

    $attrname = $attrval

    \n"; //echo "

    "; print_r($nodename); echo "

    \n"; diff --git a/xCAT-web/lib/style.css b/xCAT-web/lib/style.css index 62d1f7ee4..1d07940c2 100644 --- a/xCAT-web/lib/style.css +++ b/xCAT-web/lib/style.css @@ -3,10 +3,11 @@ /* background-color: #002432; */ } -.TopTop { background: #FFF url(../images/toptop.jpg) repeat-x top; } -.TopMiddle { background: #FFF url(../images/top2.jpg) repeat-x top; padding-top: 1px; } +.TopMiddle { background: #FFF url(../images/top2.jpg) repeat-x top; } /* +.TopTop { background: #FFF url(../images/toptop.jpg) repeat-x top; } + #top { margin: 0 auto 10px auto; padding: 0; @@ -29,91 +30,102 @@ */ #xcatImage { - /* float: left; */ - margin: 10px 8px 5px 0px; - /* height: 30px; todo: create a smaller icon instead of scaling this on the fly */ + margin: 3px 8px 5px 0px; } -.MenuRowBottom { /* this is to help with the white border around the current menu items */ - border-left: 2px solid white; - border-right: 2px solid white; + +/* The next 7 (or so) classes are for the menu at the top of each window. + See lib/functions.php insertMenus() for the code that uses these. */ + +.MenuTable { /* the table that holds all the menu items */ + padding-top: 2px; + font-family: Sans-Serif; + font-size: 8pt; + font-weight: bold; + margin: 0px; +} +.MenuTable TR { padding-top: 0px; } /* avoid the inheritance */ + +.CurrentMenuItem { /* the menu items that are currently selected */ + display: inline-block; /* display: block; */ + padding: 0 1em; /*2em;*/ + background: #0F5B7F; /*#116893;*/ /* #0B4360; #09334b; */ + color: white; /* #fafafa; */ + border-left: 1px solid #273942; + line-height: 2.15em; /*2.5em;*/ } -#mainNav { /* the UL that contains the LIs of one row of menu items */ - /* position: absolute; - float: left; */ +.MenuTable a { /* the non-current menu items */ + display: inline-block; /* display: block; */ + /* float: left; IE/Mac 5.2 Fix */ + padding: 0 1em; /*2em;*/ + text-decoration: none; + color: #a1a1a1; + border-left: 1px solid #273942; + cursor: pointer; + line-height: 2.15em; /*2.5em;*/ +} + +.MenuTable a:hover { /* when the mouse is over a non-current menu item */ + background: #0F5B7F; /*#116893;*/ /* #0B4360; #09334b; */ + color: white; /* #fafafa; */ +} + +.MenuItemBottom { /* the non-current LIs in the bottom row */ + /* border-bottom: 2px solid white; */ + background-color: #0F5B7F; /*#116893;*/ + } + +/* The rest of these menu-related styles are not used... + +#mainNav { the UL that contains the LIs of one row of menu items list-style: none; margin: 0px; padding: 0px; } -#mainNav li { /* each menu item */ - /* float: left; */ - /* Start: cross-browser inline-block */ - display: -moz-inline-stack; /* firefox specific */ - display: inline-block; /* the right way (standards compliant browsers) */ - zoom: 1; /* internet explorer specific */ - *display: inline; /* internet explorer specific */ - /* End: cross-browser inline-block */ - line-height: 2.15em; /*2.5em;*/ +#mainNav li { each menu item + Start cross-browser inline-block + display: -moz-inline-stack; firefox specific + display: inline-block; the right way (standards compliant browsers) + zoom: 1; internet explorer specific + *display: inline; internet explorer specific + End cross-browser inline-block + line-height: 2.15em; font-weight: bold; - /* border: 1px solid white; */ } -#mainNav p { /* the LIs that are currently selected */ - display: block; - padding: 0 2em; /*2em;*/ - margin: 0px; - background: #0B4360; /* #09334b; */ - color: #fafafa; +IE/Win 5.x Fix +* html #mainNav a { + width: 1px; } -.CurrentMenuItemTop { /* additional style for the current LI in the top menu row */ +#mainNav li a.active { not sure if this is needed + color: white; +} + +.MenuRowBottom { this is to help with the white border around the current menu items + border-left: 2px solid white; + border-right: 2px solid white; +} + +.CurrentMenuItemTop { additional style for the current LI in the top menu row border-left: 2px solid white; border-top: 2px solid white; border-right: 2px solid white; - /* border-bottom: 2px solid #09334b; */ + background-color: #0F5B7F; } -.MenuItemTop { /* the non-current LIs in the top row */ - /* border-top: 2px solid black; */ +.MenuItemTop { the non-current LIs in the top row border-bottom: 2px solid white; } -#mainNav a { /* the non-current menu items */ - display: block; - /* float: left; IE/Mac 5.2 Fix */ - padding: 0 2em; /*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: #0B4360; /* #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; @@ -155,6 +167,8 @@ BODY { } IMG { vertical-align: middle; } +.ImgBaseline { vertical-align: baseline; } +.ImgTop { vertical-align: top; } INPUT {vertical-align : middle; font-size : 8pt; font-family : sans-serif; font-weight : bold;} 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;} diff --git a/xCAT-web/machines/frames.css b/xCAT-web/machines/frames.css new file mode 100644 index 000000000..7c8c217f1 --- /dev/null +++ b/xCAT-web/machines/frames.css @@ -0,0 +1,19 @@ + +/* Styles specific to the frames.php page */ + +.AllRacksTable { padding-top: 10px; } + +.RackTable { + background-color: #303030; + border: 2px solid #303030; +} + +.RackTable TD { + white-space: nowrap; + font-size: 1px; +} + +.RackTable IMG { vertical-align: baseline; } + +.RackEmptyCell { background-color: #999999; } + diff --git a/xCAT-web/machines/frames.js b/xCAT-web/machines/frames.js new file mode 100644 index 000000000..2df405a57 --- /dev/null +++ b/xCAT-web/machines/frames.js @@ -0,0 +1,109 @@ +// Javascript functions needed by the frames (racks) page, mostly +// to handle the check boxes that are actually images. + +function imageCBClick(image, mode) +{ +if (mode==1 || (mode==2 && (image.checked === undefined || !image.checked))) { + image.src = '../images/checked-box.gif'; + image.checked = true; +} else { + image.src = '../images/unchecked-box.gif'; + image.checked = false; + var s=image.alt.split(/-/); + var rackCB = document.frameForm['selAll'+s[0]+'Checkbox']; + rackCB.checked = false; +} +} + + +function selectAll(element, rack) // element is the select all checkbox, rack is the rack # +{ + var sel = element.checked; + for (var i=0; i < document.images.length; i++) { + var image = document.images[i]; + if (image.src.search(/checked-box\.gif$/)>-1 && image.alt.search('^'+rack+'-')>-1) { imageCBClick(image,sel); } + } +} + +/* +function isNodeSelected(form) +{ +if (document.paramForm.rack.checked) { return (form.Nodes.value.length>0 || form.rackNodes.value.length>0); } +// we only continue here if it is the non-rack display +for(var i = 0; i < form.length; i++) + { + var e = form.elements[i]; + if (e.type == "checkbox" && e.name.search(/^node\d/) > -1 && e.checked) { return true; } + } +return false; +} + +function numNodesSelected(form) +{ +if (document.paramForm.rack.checked) { + if (form.Nodes.value.length>0) { return 2; } // just have to guess that the group or range has more than 1 + var val = form.rackNodes.value; + var matches = val.match(/,/g); + if (!matches) { return (val.length>0 ? 1 : 0); } + else { return matches.length + 1; } +} +// we only continue here if it is the non-rack display +var j = 0; +for(var i = 0; i < form.length; i++) + { + var e = form.elements[i]; + if (e.type == "checkbox" && e.name.search(/^node\d/) > -1 && e.checked) + { + if (++j == 2) { return j; } + } + } +return j; +} + +function gatherRackNodes(form) +{ + if (allSelected(form)) { + if (document.paramForm.nodeRange.value.length > 0) { form.Nodes.value = document.paramForm.nodeRange.value; } + else { form.Nodes.value = '+' + document.paramForm.nodegrps.value; } + form.rackNodes.value=''; + return; + } + else { form.Nodes.value=''; } + if (!document.paramForm.rack.checked) { form.rackNodes.value=''; return; } + + var nodes=''; + for (var i=0; i < document.images.length; i++) { + var image = document.images[i]; + if (image.checked) { var s=image.alt.split(/-/); nodes += s[1] + ','; } + } + form.rackNodes.value = nodes.replace(/,$/, ''); +} + +function allSelected(form) +{ +if (document.paramForm.rack.checked) { + for(var i = 0; i < form.length; i++) + { + var e = form.elements[i]; + if (e.type=="checkbox" && e.name.search(/^selAll\d+Checkbox/)>-1 && !e.checked) { return false; } + } + return true; +} +else { return form.selAllCheckbox.checked; } // non-rack display +} + +function frameFormSubmit(form) { +gatherRackNodes(form); +if (form.nodesNeeded === undefined || form.nodesNeeded == 2) { // need 1 or more nodes + if (isNodeSelected(form)) { return true; } + else { alert('Select one or more nodes before pressing an action button.'); return false; } +} +else if (form.nodesNeeded == 1) { // need exactly 1 node + if (numNodesSelected(form) == 1) { return true; } + else { alert('Exactly one node must be selected for this action.'); form.nodesNeeded=undefined; return false; } +} +else if (form.nodesNeeded == 0) { return true; } // 0 or more nodes is ok +else { return true; } +} +*/ + diff --git a/xCAT-web/machines/frames.php b/xCAT-web/machines/frames.php index ff4888994..99d3b5d51 100644 --- a/xCAT-web/machines/frames.php +++ b/xCAT-web/machines/frames.php @@ -2,353 +2,168 @@ /* session_start(); */ $TOPDIR = '..'; require_once "$TOPDIR/lib/functions.php"; -insertHeader('xCAT Frame Node List', NULL, NULL, array('machines','frames')); +insertHeader('xCAT Frames and Nodes', array('frames.css'), array('frames.js'), array('machines','frames')); if (isAIX()) { $aixDisabled = 'disabled'; } -insertNotDoneYet(); -echo ''; -/* This was copied from the csm web interface and can be used as the beginning code - for the frame view. - - -
    -

    -

    Node List on Management Server

    - -
    - - - - - - - - - - - -
    -

    Which Nodes:

    -
     Group:  or  Node Range:
    - Show Nodes in Racks (have to first set the physical location)
    -
    - - -
    - - - - - - - - - - - \n"; -echo "\n"; -echo "\n"; -$index =0; -?> - -

    Node
    Actions:

    - - - - -
    - - - - - - - -
    - - - - -
    - - - - - - - - -
    -
    - -
    Select All   NameHW TypeOSModeStatusHW Ctrl PtComment
    \n" ?> - - - - - - - -
    - -

    Tips:

    -
      -
    • Select 1 or more nodes & click on an action button.  Or choose - 1 of the main tasks on the left.  The Help link at the top left really does help.  It describes what all these buttons do. -
    • The Status colors:  green=reachable, red=not reachable, yellow=unknown/error, blue=node not managed. -
    • If too many nodes are displayed, use the Group or Node Range selections - to focus what is displayed. -
    • The Console/Settings link at the top left is the way to set preferences.  There is a verbose - option there to have this interface display the commands it is running. -
    • If you are running this over a phone line, we recommend using the Old Webmin theme (which is now the default) for faster loading.  Of course, the MSC Linux theme looks nicer.  (If you change the theme, you will have to navigate - back to this page in the Cluster category.) -
    • Did you know you can run as many browser windows with this interface as - you want?  This can be handy to view information from multiple pages of this interface - at the same time. -
    -

    CSM Version: $rpmVersions{'csm.server'}       CSM Web Interface Version: $rpmVersions{'xcsm.web'}

    -
    - - + ?> diff --git a/xCAT-web/machines/groups.php b/xCAT-web/machines/groups.php index 45ace52eb..f671e18f9 100644 --- a/xCAT-web/machines/groups.php +++ b/xCAT-web/machines/groups.php @@ -8,7 +8,7 @@ if (isAIX()) { $aixDisabled = 'disabled'; } require_once("$TOPDIR/lib/GroupNodeTable.class.php"); -insertHeader('Groups', array('groups.css'), +insertHeader('xCAT Groups and Nodes', array('groups.css'), array("$TOPDIR/lib/GroupNodeTableUpdater.js","$TOPDIR/js/prototype.js","$TOPDIR/js/scriptaculous.js?load=effects"), array('machines','groups')); @@ -100,7 +100,7 @@ function getGroupStatus() { preg_match('/^"([^"]*)"/', $rest, $status); if (count($status) < 2) { $status[1] = 'unknown'; } foreach ($grplist as $g) { - if (array_key_exists($g,$groups)) { $groups[$g] = minstat($groups[$g], $status[1]); } + if (array_key_exists($g,$groups)) { $groups[$g] = minStatus($groups[$g], $status[1]); } else { $groups[$g] = $status[1]; } } } @@ -109,28 +109,4 @@ function getGroupStatus() { } -//----------------------------------------------------------------------------- -// For 2 status strings from nodestat or nodelist.status, return the "lowest". -function minstat($s1, $s2) { - $statnum = array( 'unknown' => 0, - 'noping' => 1, - 'ping' => 2, - 'snmp' => 3, - 'sshd' => 4, - 'pbs' => 5, - 'ready' => 6, - ); - - // if either value is empty, just return the other one - if (!isset($s1)) { return $s2; } - if (!isset($s2)) { return $s1; } - - // if either value does not map into the hash, then return unknown - if (!isset($statnum[$s1]) || !isset($statnum[$s2])) { return 'unknown'; } - - if ($statnum[$s1] < $statnum[$s2]) { return $s1; } - else { return $s2; } -} - - ?> \ No newline at end of file