diff --git a/xCAT-web/images/blade-front-blue.jpg b/xCAT-web/images/blade-front-blue.jpg index b7972542c..e12f15825 100644 Binary files a/xCAT-web/images/blade-front-blue.jpg and b/xCAT-web/images/blade-front-blue.jpg differ diff --git a/xCAT-web/images/blade-front-green.jpg b/xCAT-web/images/blade-front-green.jpg index 945ac8927..776a20138 100644 Binary files a/xCAT-web/images/blade-front-green.jpg and b/xCAT-web/images/blade-front-green.jpg differ diff --git a/xCAT-web/images/blade-front-red.jpg b/xCAT-web/images/blade-front-red.jpg index d0af03eae..49bd300fd 100644 Binary files a/xCAT-web/images/blade-front-red.jpg and b/xCAT-web/images/blade-front-red.jpg differ diff --git a/xCAT-web/images/blade-front-yellow.jpg b/xCAT-web/images/blade-front-yellow.jpg index be0a9c5db..82eab3272 100644 Binary files a/xCAT-web/images/blade-front-yellow.jpg and b/xCAT-web/images/blade-front-yellow.jpg differ 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 '
$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 '