From 75117330a20082fe52d4e966a86508cc1c687830 Mon Sep 17 00:00:00 2001 From: mxi1 Date: Wed, 19 Aug 2009 09:12:58 +0000 Subject: [PATCH] fixed some little defects git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@4011 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-UI/js/xcat.js | 25 ++++++------ xCAT-UI/lib/display.php | 14 ++++++- xCAT-UI/lib/monitor_display.php | 6 +++ xCAT-UI/monitor/monlist.php | 9 ++--- xCAT-UI/monitor/rmc_event_define.php | 2 +- xCAT-UI/monitor/rmc_lsevent.php | 26 ++++++++++++ xCAT-UI/monitor/rmc_resource_define.php | 2 +- xCAT-UI/monitor/updateMonList.php | 54 ++++++++++--------------- 8 files changed, 84 insertions(+), 54 deletions(-) create mode 100644 xCAT-UI/monitor/rmc_lsevent.php diff --git a/xCAT-UI/js/xcat.js b/xCAT-UI/js/xcat.js index a935e2fee..772d436ba 100644 --- a/xCAT-UI/js/xcat.js +++ b/xCAT-UI/js/xcat.js @@ -435,19 +435,6 @@ function showRMCAttrib() } } -function monsetupAction(plugin, action_val) -{ - //plugin = the name of plugin - //action = "start" or "stop" or "restart" - $.get("monitor/setup.php", {name: plugin, action: action_val}, function(data) { - - - $.get("monitor/updateMonList.php", {}, function(data) { - $("#monlist").html(data); - }); - - }); -} function showPluginOptions() { @@ -469,6 +456,18 @@ function showPluginDescription() }) }); } +function monsetupAction(plugin, action_val) +{ + //plugin = the name of plugin + //action = "start" or "stop" or "restart" + $.get("monitor/setup.php", {name: plugin, action: action_val}, function(data) { + $.get("monitor/updateMonList.php", {}, function(data) { + $("#monlist_table").html(data); + }); + + }); +} + // load progress bar myBar.loaded('xcat.js'); diff --git a/xCAT-UI/lib/display.php b/xCAT-UI/lib/display.php index 39b4c4016..0423a2cf9 100644 --- a/xCAT-UI/lib/display.php +++ b/xCAT-UI/lib/display.php @@ -98,11 +98,17 @@ echo <<provision
  • - monitor + monitor
  • @@ -512,6 +518,12 @@ echo <<

    Monitor

    diff --git a/xCAT-UI/lib/monitor_display.php b/xCAT-UI/lib/monitor_display.php index a228edfb2..a5ed01a3e 100644 --- a/xCAT-UI/lib/monitor_display.php +++ b/xCAT-UI/lib/monitor_display.php @@ -98,6 +98,12 @@ function displayMonTable() TOS1; +echo << + showPluginOptions(); + showPluginDescription(); + +TOS9; echo ''; displayMonitorLists(); echo ""; diff --git a/xCAT-UI/monitor/monlist.php b/xCAT-UI/monitor/monlist.php index 9881db183..442ae84ca 100644 --- a/xCAT-UI/monitor/monlist.php +++ b/xCAT-UI/monitor/monlist.php @@ -6,12 +6,9 @@ if(!isset($TOPDIR)) { $TOPDIR="/opt/xcat/ui";} require_once "$TOPDIR/lib/monitor_display.php"; ?> - + 'main.php', 'monitor'=>'monitor/monlist.php')); +displayMapper_mon(array('home'=>'main.php', 'monitor' =>'monitor/monlist.php')); 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 ", @@ -22,4 +19,6 @@ displayMonTable(); insertDiv("plugin_desc"); insertDiv("options"); + +insetDiv("view"); //display options to the users for viewing event log & performance in text/graphics format ?> \ No newline at end of file diff --git a/xCAT-UI/monitor/rmc_event_define.php b/xCAT-UI/monitor/rmc_event_define.php index 0efbdc96d..4380e9439 100644 --- a/xCAT-UI/monitor/rmc_event_define.php +++ b/xCAT-UI/monitor/rmc_event_define.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_mon(array('home'=>'main.php', 'monitor' =>'monitor/monlist.php')); 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 new file mode 100644 index 000000000..efb8a18f2 --- /dev/null +++ b/xCAT-UI/monitor/rmc_lsevent.php @@ -0,0 +1,26 @@ +'main.php', 'monitor' =>'monitor/monlist.php')); + +displayTips(array("")); + + +displayStatus(); + +insertButtons(array('label' => 'Next', 'id'=> 'next', 'onclick'=>'')); +?> diff --git a/xCAT-UI/monitor/rmc_resource_define.php b/xCAT-UI/monitor/rmc_resource_define.php index db67f4c65..7ac223d7b 100644 --- a/xCAT-UI/monitor/rmc_resource_define.php +++ b/xCAT-UI/monitor/rmc_resource_define.php @@ -10,7 +10,7 @@ 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_mon(array('home'=>'main.php', 'monitor' =>'monitor/monlist.php')); 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/updateMonList.php b/xCAT-UI/monitor/updateMonList.php index d9628203e..ac4b00ac8 100644 --- a/xCAT-UI/monitor/updateMonList.php +++ b/xCAT-UI/monitor/updateMonList.php @@ -11,38 +11,26 @@ require_once "$TOPDIR/lib/functions.php"; require_once "$TOPDIR/lib/display.php"; require_once "$TOPDIR/lib/monitor_display.php"; -$xml = docmd("monls"," ", array('-a')); - if(getXmlErrors($xml,$errors)) { - echo "

    ",implode(' ', $errors), "

    "; - exit; - } - #then, parse the xml data - $ooe = 0; - $line = 0; - foreach($xml->children() as $response) foreach($response->children() as $data) { - list($name, $stat, $nodemonstatus) = preg_split("/\s+/", $data); - $ooe = $ooe%2; - echo ""; - echo ""; - echo "$name"; - echo "$stat"; - if(isset($nodemonstatus)) { echo "Enabled";}else {echo "Disabled";} - echo ""; - $name_str = "\"$name\""; - if($stat == "monitored") { - $act_str = "\"stop\""; - insertButtons(array('label'=>'Stop', 'id'=>'stop', 'onclick'=>"monsetupAction($name_str, $act_str)")); - $act_str = "\"restart\""; - insertButtons(array('label'=>'Restart', 'id'=>'restart', 'onclick'=>"monsetupAction($name_str, $act_str)")); - }else { - $act_str = "\"start\""; - insertButtons(array('label' => 'Start', 'id'=>'start', 'onclick' => "monsetupAction($name_str, $act_str)")); - } - echo ""; - echo " "; - $ooe++; - $line++; - //echo "$name$stat$name"; - } +echo << + + + + Plug-in Name + Status + Node Status Monitoring + Action + + +TOS1; +echo << + showPluginOptions(); + showPluginDescription(); + +TOS9; + echo ''; + displayMonitorLists(); + echo ""; ?>