Cleaned up some of the navigation and the mapper (bread crumbs)

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@4075 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
bp-sawyers 2009-09-01 20:25:18 +00:00
parent 4f07f92e51
commit cd8d231ef3
18 changed files with 55 additions and 57 deletions

View File

@ -1,5 +1,5 @@
<?php
if(!isset($TOPDIR)) { $TOPDIR='/opt/xcat/ui';}
if(!isset($TOPDIR)) { $TOPDIR='.';}
require_once "$TOPDIR/lib/security.php";
function displayHeader() {
@ -107,7 +107,7 @@ echo <<<EOS4
<a href="monitor/monlist.php">Monitor Setup</a>
</li>
<li>
<a href="#">View Events</a>
<a href="monitor/rmc_lsevent.php">View Events</a>
</li>
</ul>
</li>
@ -156,7 +156,28 @@ EOS3;
}
// Create the bread crumb links. The mapper arg is a hash of label/url pairs, where
// the final url is usually ''.
function displayMapper($mapper)
{
echo "<div class=mapper><span>";
$first = 1;
foreach ($mapper as $key => $value) {
if (!$first) { echo " / "; }
$first = 0;
if (!strlen($value)) { echo $key; }
else {
if ($value == 'main.php') { $href = '#'; }
else { $href = "#$value"; }
echo "<a href='$href' onclick='loadMainPage(\"$value\")'>$key</a>";
}
}
echo "</span></div>";
}
function displayTabMain(){
displayMapper(array('home'=>'main.php', 'config' =>''));
/*
echo <<<MAPPER
<div class='mapper'>
<span>
@ -164,9 +185,10 @@ echo <<<MAPPER
config
</span>
</div>
<div class='mContent'>
MAPPER;
*/
echo <<<EOS
<div class='mContent'>
<h1>Configuration Menu</h1>
xCAT is configured by several tables. Each of the tables below
tweeks a setting in xCAT. Click on a table below to configure xCAT
@ -184,15 +206,18 @@ EOS;
}
function displayTab($tab){
echo <<<MAPPER
displayMapper(array('home'=>'main.php', 'config' =>'config.php', "$tab"=>''));
/*
echo <<<MAPPER
<div class='mapper'>
<span>
<a href='#' onclick='loadMainPage("main.php")'>home</a> /
<a href='#' onclick='loadMainPage("config.php")'>config</a> /
<a href='#config.php' onclick='loadMainPage("config.php")'>config</a> /
$tab
</span>
</div>
MAPPER;
*/
echo "<div class='mContent'>";
echo "<h1>$tab</h1>\n";
insertButtons(array('label' => 'Save','id' => 'saveit'),
@ -316,13 +341,7 @@ EOS7;
// Functions to control display of trees and control functions
function displayCtrlPage($cmd){
echo <<<MAPPER
<div class='mapper'>
<span>
<a href='#' onclick='loadMainPage("main.php")'>home</a> /
control
</span>
MAPPER;
displayMapper(array('home'=>'main.php', 'control' =>''));
echo "<div class='nrcmd'>";
echo "<div id='nrcmdnoderange'>Noderange:</div>";
echo "<div id='nrcmdcmd'>Action: $cmd</div>";
@ -539,6 +558,7 @@ function displayLogTable(){
if(($line = getLastLine('')) === 0){
return;
};
displayMapper(array('home'=>'main.php', 'syslog' =>''));
echo <<<EOS
<div class='mContent'>
<h1>Syslog Entries</h1>
@ -605,13 +625,7 @@ FOO;
# a - arch (x86, x86_64)
# p - profile (compute, or user defined)
function displayProvisionPage($m,$o,$a,$p){
echo <<<MAPPER
<div class='mapper'>
<span>
<a href='#' onclick='loadMainPage("main.php")'>home</a> /
provision
</span>
MAPPER;
displayMapper(array('home'=>'main.php', 'provision' =>''));
echo "<div class='nrcmd'>";
echo "<div id='nrcmdnoderange'>Noderange:</div>";
echo "<div id='nrcmdos'>Operating System: $o</div>";

View File

@ -2,22 +2,6 @@
/*
* All the <html> code related with monitor interface is put here.
*/
function displayMapper_mon($mapper)
{
//display the Mapper for monitoring interface;
//the argument $mapper is an array
//$mapper = {
// "home" => "main.php",
// "Monitor" => "monitor/monlist.php",
//};
echo "<div class='mapper' align='left'>";
echo "<span>";
foreach ($mapper as $key => $value) {
echo "<a href='#' onclick='loadMainPage(\"$value\")'>$key</a>";
echo "/";
}
echo "</span></div>";
}
#displayMonitorLists() will generate all the monitoring plug-ins,
#the user can select the plug-ins he wants to operate on,

View File

@ -4,7 +4,7 @@
* this file is invoked by the file "stat_mon.php"
* update the table "monitoring",
*/
if(!isset($TOPDIR)) { $TOPDIR="/opt/xcat/ui";}
if(!isset($TOPDIR)) { $TOPDIR="..";}
require_once "$TOPDIR/lib/security.php";
require_once "$TOPDIR/lib/functions.php";

View File

@ -3,7 +3,7 @@
* makecondresp.php
* run the command "mkcondresp" and return the value
*/
if(!isset($TOPDIR)) { $TOPDIR="/opt/xcat/ui";}
if(!isset($TOPDIR)) { $TOPDIR="..";}
require_once "$TOPDIR/lib/security.php";
require_once "$TOPDIR/lib/functions.php";

View File

@ -1,5 +1,5 @@
<?php
if(!isset($TOPDIR)) { $TOPDIR="/opt/xcat/ui";}
if(!isset($TOPDIR)) { $TOPDIR="..";}
require_once "$TOPDIR/lib/security.php";
require_once "$TOPDIR/lib/functions.php";
require_once "$TOPDIR/lib/display.php";
@ -8,7 +8,7 @@ if(!isset($TOPDIR)) { $TOPDIR="/opt/xcat/ui";}
?>
<?php
displayMapper_mon(array('home'=>'main.php', 'monitor' =>'monitor/monlist.php'));
displayMapper(array('home'=>'main.php', 'monitor' =>''));
displayTips(array("Click the name of each plugin, you can get the plugin's description.",
"Select one plugin, choose the options for set up monitoring ",

View File

@ -4,7 +4,7 @@
* to display the web page for the command "monstart" and the command "monstop" for the selected plugins
* the link looks like "monitor/monstart.php?name=rmcmon".
*/
if(!isset($TOPDIR)) { $TOPDIR="/opt/xcat/ui";}
if(!isset($TOPDIR)) { $TOPDIR="..";}
require_once "$TOPDIR/lib/security.php";
require_once "$TOPDIR/lib/functions.php";
@ -15,7 +15,7 @@ $name = $_REQUEST['name'];
//echo $name;
displayMapper_mon(array('home'=>'main.php', 'monitor'=>'monitor/monlist.php'));
displayMapper(array('home'=>'main.php', 'monitor'=>''));
displayTips(array(""));

View File

@ -1,6 +1,6 @@
<?php
if(!isset($TOPDIR)) { $TOPDIR="/opt/xcat/ui";}
if(!isset($TOPDIR)) { $TOPDIR="..";}
require_once "$TOPDIR/lib/security.php";
require_once "$TOPDIR/lib/functions.php";

View File

@ -4,7 +4,7 @@
* to provide the JSON-style data to the function init_ositree();
*/
if(!isset($TOPDIR)) { $TOPDIR="/opt/xcat/ui";}
if(!isset($TOPDIR)) { $TOPDIR="..";}
require_once "$TOPDIR/lib/functions.php";
require_once "$TOPDIR/lib/security.php";

View File

@ -1,5 +1,5 @@
<?php
if(!isset($TOPDIR)) { $TOPDIR="/opt/xcat/ui";}
if(!isset($TOPDIR)) { $TOPDIR="..";}
require_once "$TOPDIR/lib/security.php";
require_once "$TOPDIR/lib/functions.php";
require_once "$TOPDIR/lib/display.php";

View File

@ -4,7 +4,7 @@
* to define the events for RMC
* the url is: monitor/rmc_event_define.php
*/
if(!isset($TOPDIR)) { $TOPDIR="/opt/xcat/ui";}
if(!isset($TOPDIR)) { $TOPDIR="..";}
require_once "$TOPDIR/lib/security.php";
require_once "$TOPDIR/lib/functions.php";
@ -12,7 +12,7 @@ require_once "$TOPDIR/lib/display.php";
require_once "$TOPDIR/lib/monitor_display.php";
displayMapper_mon(array('home'=>'main.php', 'monitor' =>'monitor/monlist.php'));
displayMapper(array('home'=>'main.php', 'monitor' =>''));
displayTips(array(
"All the conditions and the responses are here;",

View File

@ -4,7 +4,7 @@
* to display the web page for the command "monstart" and the command "monstop" for the selected plugins
* the link looks like "monitor/monstart.php?name=rmcmon".
*/
if(!isset($TOPDIR)) { $TOPDIR="/opt/xcat/ui";}
if(!isset($TOPDIR)) { $TOPDIR="..";}
require_once "$TOPDIR/lib/security.php";
require_once "$TOPDIR/lib/functions.php";
@ -15,7 +15,7 @@ $name = $_REQUEST['name'];
//echo $name;
displayMapper_mon(array('home'=>'main.php', 'monitor' =>'monitor/monlist.php'));
displayMapper(array('home'=>'main.php', 'monitor' =>''));
displayTips(array(""));

View File

@ -4,7 +4,7 @@
* and open the template in the editor.
*/
if(!isset($TOPDIR)) { $TOPDIR="/opt/xcat/ui";}
if(!isset($TOPDIR)) { $TOPDIR="..";}
require_once "$TOPDIR/lib/security.php";
require_once "$TOPDIR/lib/functions.php";

View File

@ -3,14 +3,14 @@
* define the performance monitoring using RMC
*/
if(!isset($TOPDIR)) { $TOPDIR="/opt/xcat/ui";}
if(!isset($TOPDIR)) { $TOPDIR="..";}
require_once "$TOPDIR/lib/security.php";
require_once "$TOPDIR/lib/functions.php";
require_once "$TOPDIR/lib/display.php";
require_once "$TOPDIR/lib/monitor_display.php";
displayMapper_mon(array('home'=>'main.php', 'monitor' =>'monitor/monlist.php'));
displayMapper(array('home'=>'main.php', 'monitor' =>''));
displayTips(array("All the available RMC resources are listed here;",
"Edit this table to define the RMC performance monitoring;",

View File

@ -4,7 +4,7 @@
* and open the template in the editor.
*/
if(!isset($TOPDIR)) { $TOPDIR="/opt/xcat/ui";}
if(!isset($TOPDIR)) { $TOPDIR="..";}
require_once "$TOPDIR/lib/security.php";
require_once "$TOPDIR/lib/functions.php";

View File

@ -3,7 +3,7 @@
* This web page is for "Node status Monitoring" and "Application Status Monitioring",
* The user can enable/disable "Node/Application Status Monitoring" from this page.
*/
if(!isset($TOPDIR)) { $TOPDIR="/opt/xcat/ui";}
if(!isset($TOPDIR)) { $TOPDIR="..";}
require_once "$TOPDIR/lib/security.php";
require_once "$TOPDIR/lib/functions.php";
@ -13,7 +13,7 @@ require_once "$TOPDIR/lib/monitor_display.php";
//get the name of the selected plug-in
$name = $_REQUEST['name'];
displayMapper_mon(array('home'=>'main.php', 'monitor'=>'monitor/monlist.php'));
displayMapper(array('home'=>'main.php', 'monitor'=>''));
displayTips(array(
"Enable/disable Node/App Status Monitoring by clicking the button",
"In order to take affect, you have to START/RESTART the desired plugin"));

View File

@ -2,7 +2,7 @@
//activate/deactivate the specified condition&response association;
//then, update the content of the table in <div id="association">;
if(!isset($TOPDIR)) { $TOPDIR="/opt/xcat/ui";}
if(!isset($TOPDIR)) { $TOPDIR="..";}
require_once "$TOPDIR/lib/security.php";
require_once "$TOPDIR/lib/functions.php";

View File

@ -3,7 +3,7 @@
* update the condition&response association
*/
if(!isset($TOPDIR)) { $TOPDIR="/opt/xcat/ui";}
if(!isset($TOPDIR)) { $TOPDIR="..";}
require_once "$TOPDIR/lib/functions.php";
require_once "$TOPDIR/lib/security.php";

View File

@ -4,7 +4,7 @@
* and open the template in the editor.
*/
if(!isset($TOPDIR)) { $TOPDIR="/opt/xcat/ui";}
if(!isset($TOPDIR)) { $TOPDIR="..";}
require_once "$TOPDIR/lib/security.php";
require_once "$TOPDIR/lib/functions.php";