diff --git a/xCAT-UI/lib/display.php b/xCAT-UI/lib/display.php index 0423a2cf9..e5f8d0def 100644 --- a/xCAT-UI/lib/display.php +++ b/xCAT-UI/lib/display.php @@ -1,5 +1,5 @@ Monitor Setup
  • - View Events + View Events
  • @@ -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 "
    "; + $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 "$key"; + } + } + echo "
    "; +} + function displayTabMain(){ +displayMapper(array('home'=>'main.php', 'config' =>'')); +/* echo << @@ -164,9 +185,10 @@ echo << -
    MAPPER; +*/ echo <<

    Configuration Menu

    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 <<'main.php', 'config' =>'config.php', "$tab"=>'')); +/* + echo << home / - config / + config / $tab
    MAPPER; +*/ echo "
    "; echo "

    $tab

    \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 << - - home / - control - -MAPPER; +displayMapper(array('home'=>'main.php', 'control' =>'')); echo "
    "; echo "
    Noderange:
    "; echo "
    Action: $cmd
    "; @@ -539,6 +558,7 @@ function displayLogTable(){ if(($line = getLastLine('')) === 0){ return; }; +displayMapper(array('home'=>'main.php', 'syslog' =>'')); echo <<

    Syslog Entries

    @@ -605,13 +625,7 @@ FOO; # a - arch (x86, x86_64) # p - profile (compute, or user defined) function displayProvisionPage($m,$o,$a,$p){ -echo << - - home / - provision - -MAPPER; +displayMapper(array('home'=>'main.php', 'provision' =>'')); echo "
    "; echo "
    Noderange:
    "; echo "
    Operating System: $o
    "; diff --git a/xCAT-UI/lib/monitor_display.php b/xCAT-UI/lib/monitor_display.php index a5ed01a3e..aedd55cb2 100644 --- a/xCAT-UI/lib/monitor_display.php +++ b/xCAT-UI/lib/monitor_display.php @@ -2,22 +2,6 @@ /* * All the 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 "
    "; - echo ""; - foreach ($mapper as $key => $value) { - echo "$key"; - echo "/"; - } - echo "
    "; -} #displayMonitorLists() will generate all the monitoring plug-ins, #the user can select the plug-ins he wants to operate on, diff --git a/xCAT-UI/monitor/control_node_stat.php b/xCAT-UI/monitor/control_node_stat.php index 8a36de6c5..02c54a773 100644 --- a/xCAT-UI/monitor/control_node_stat.php +++ b/xCAT-UI/monitor/control_node_stat.php @@ -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"; diff --git a/xCAT-UI/monitor/makecondresp.php b/xCAT-UI/monitor/makecondresp.php index 015987304..d0899fdbe 100644 --- a/xCAT-UI/monitor/makecondresp.php +++ b/xCAT-UI/monitor/makecondresp.php @@ -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"; diff --git a/xCAT-UI/monitor/monlist.php b/xCAT-UI/monitor/monlist.php index 442ae84ca..229e2cd68 100644 --- a/xCAT-UI/monitor/monlist.php +++ b/xCAT-UI/monitor/monlist.php @@ -1,5 +1,5 @@ '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 ", diff --git a/xCAT-UI/monitor/monstart.php b/xCAT-UI/monitor/monstart.php index 52759b818..ccfc61311 100644 --- a/xCAT-UI/monitor/monstart.php +++ b/xCAT-UI/monitor/monstart.php @@ -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("")); diff --git a/xCAT-UI/monitor/options.php b/xCAT-UI/monitor/options.php index d319cdff0..91b197710 100644 --- a/xCAT-UI/monitor/options.php +++ b/xCAT-UI/monitor/options.php @@ -1,6 +1,6 @@ 'main.php', 'monitor' =>'monitor/monlist.php')); +displayMapper(array('home'=>'main.php', 'monitor' =>'')); displayTips(array( "All the conditions and the responses are here;", diff --git a/xCAT-UI/monitor/rmc_lsevent.php b/xCAT-UI/monitor/rmc_lsevent.php index efb8a18f2..0e4d8187e 100644 --- a/xCAT-UI/monitor/rmc_lsevent.php +++ b/xCAT-UI/monitor/rmc_lsevent.php @@ -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("")); diff --git a/xCAT-UI/monitor/rmc_resource_attr.php b/xCAT-UI/monitor/rmc_resource_attr.php index f1bc2f164..ef3599964 100644 --- a/xCAT-UI/monitor/rmc_resource_attr.php +++ b/xCAT-UI/monitor/rmc_resource_attr.php @@ -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"; diff --git a/xCAT-UI/monitor/rmc_resource_define.php b/xCAT-UI/monitor/rmc_resource_define.php index 7ac223d7b..c14a5488b 100644 --- a/xCAT-UI/monitor/rmc_resource_define.php +++ b/xCAT-UI/monitor/rmc_resource_define.php @@ -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;", diff --git a/xCAT-UI/monitor/setup.php b/xCAT-UI/monitor/setup.php index 14777caf7..b53d4ed0a 100644 --- a/xCAT-UI/monitor/setup.php +++ b/xCAT-UI/monitor/setup.php @@ -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"; diff --git a/xCAT-UI/monitor/stat_mon.php b/xCAT-UI/monitor/stat_mon.php index 2bdd450d5..392e806c5 100644 --- a/xCAT-UI/monitor/stat_mon.php +++ b/xCAT-UI/monitor/stat_mon.php @@ -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")); diff --git a/xCAT-UI/monitor/updateCondResp.php b/xCAT-UI/monitor/updateCondResp.php index c347d5db5..0a584a8d6 100644 --- a/xCAT-UI/monitor/updateCondResp.php +++ b/xCAT-UI/monitor/updateCondResp.php @@ -2,7 +2,7 @@ //activate/deactivate the specified condition&response association; //then, update the content of the table in
    ; -if(!isset($TOPDIR)) { $TOPDIR="/opt/xcat/ui";} +if(!isset($TOPDIR)) { $TOPDIR="..";} require_once "$TOPDIR/lib/security.php"; require_once "$TOPDIR/lib/functions.php"; diff --git a/xCAT-UI/monitor/updateCondRespTable.php b/xCAT-UI/monitor/updateCondRespTable.php index 126a02d63..bc28f970c 100644 --- a/xCAT-UI/monitor/updateCondRespTable.php +++ b/xCAT-UI/monitor/updateCondRespTable.php @@ -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"; diff --git a/xCAT-UI/monitor/updateMonList.php b/xCAT-UI/monitor/updateMonList.php index ac4b00ac8..33bac3aff 100644 --- a/xCAT-UI/monitor/updateMonList.php +++ b/xCAT-UI/monitor/updateMonList.php @@ -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";