diff --git a/xCAT-UI/css/monitor.css b/xCAT-UI/css/monitor.css index 7087e5b37..f5fd54b1e 100644 --- a/xCAT-UI/css/monitor.css +++ b/xCAT-UI/css/monitor.css @@ -40,6 +40,7 @@ float: left; width: 180px; padding-left: 15px; + border-right: 1px solid gray; } #settings @@ -99,7 +100,8 @@ fieldset { display: block; position: relative; z-index: 1; - font-size: 1.3em; + font-size: 0.9em; + color: green; padding-right: 1em; line-height: 1; padding: .5em 0 .5em 30px; @@ -141,7 +143,7 @@ fieldset { float:left; display: block; width: 94%; - border: 1px solid lime; + border: 1px solid gray; } #avail_cond { @@ -149,7 +151,7 @@ fieldset { margin: 3px; padding: 3px; float: left; - border: 1px solid lime; + border: 1px solid gray; } #avail_resp { @@ -157,7 +159,7 @@ fieldset { margin: 3px; padding: 3px; float: left; - border: 1px solid lime; + border: 1px solid gray; } /*For the RMC resources and their attributes*/ diff --git a/xCAT-UI/js/monitor.js b/xCAT-UI/js/monitor.js index db2ee3e90..2592cc958 100644 --- a/xCAT-UI/js/monitor.js +++ b/xCAT-UI/js/monitor.js @@ -195,7 +195,7 @@ function clearEventDisplay() $(':input[name=responses][checked]').attr('checked', false); } -//control_RMCAssoc() +//function control_RMCAssoc() //is used to update the association table in rmc_event_define.php function control_RMCAssoc(cond, node, resp, action) { @@ -204,7 +204,7 @@ function control_RMCAssoc(cond, node, resp, action) $.get("monitor/updateCondResp.php", {c: cond, n: node, r: resp, a: action}, function(data) { - $("#association").html(data); + $("#association table tbody").load("monitor/updateCondRespTable.php"); } ); } diff --git a/xCAT-UI/lib/monitor_display.php b/xCAT-UI/lib/monitor_display.php index 24c99a552..ef317e255 100644 --- a/xCAT-UI/lib/monitor_display.php +++ b/xCAT-UI/lib/monitor_display.php @@ -132,41 +132,12 @@ TOS6; //TODO: insert the button here echo ""; if($record[7] == "Active") { - echo ""; + echo ""; }else { - echo ""; + echo ""; } echo ""; echo ""; -// $association = explode("=", $data); -// -// $ooe = 0; -// $line = 0; -// foreach($association as $elem) { -// $ooe = $ooe%2; -// //the format should be -// //"NodeReachability"\t"EmailRootOffShift"\t"hv8plus01.ppd.pok.ibm.com"\t"Active" -// $record = explode("\"", $elem); -// $cond = $record[1]; -// $resp = $record[3]; -// $node = $record[5]; -// $state = $record[7]; -// echo ""; -// echo "$cond"; -// echo "$resp"; -// echo "$node"; -// echo "$state"; -// echo ""; -// if($state == "Active") { -// insertButtons(array('label'=>'DeActivate', 'id'=>'deactivate', 'onclick'=>"control_RMCAssoc(\"$cond\", \"$node\", \"$resp\", \"stop\")")); -// }else if($state == "Not active"){ -// insertButtons(array('label'=>'Activate', 'id'=>'activate', 'onclick'=>"control_RMCAssoc(\"$cond\", \"$node\", \"$resp\", \"start\")")); -// } -// echo ""; -// echo ""; -// $ooe++; -// $line++; -// } } echo ""; return 0; @@ -271,7 +242,7 @@ JS00; echo "
"; echo << -

Click here if you want to create new associations...

+

Click here if you want to create new associations...

TOS00; echo "
"; echo "
"; @@ -280,8 +251,8 @@ TOS00; echo "
"; echo <<
BTN00; echo "
"; @@ -359,26 +330,25 @@ function displayRMCEvnetLog() echo '
'; echo << -$("#lseventLog").dataTable({ - "bLengthChange": false, +$("#lseventLog table").dataTable({ + "bLengthChange": true, "bFilter": true, "bSort": true }); TOS8; echo << + - - + + TOS9; RMCEventLogToTable(); echo "
Time CategoryMessageDescriptionTime
"; - //TODO: the following javascript doesn't work well. echo "
"; } diff --git a/xCAT-UI/monitor/monlist.php b/xCAT-UI/monitor/monlist.php index 432f6c506..63ee6f776 100644 --- a/xCAT-UI/monitor/monlist.php +++ b/xCAT-UI/monitor/monlist.php @@ -69,7 +69,7 @@ $(function() { }); -
+
diff --git a/xCAT-UI/monitor/rmc_lsevent.php b/xCAT-UI/monitor/rmc_lsevent.php index 790768966..7e7aab0f4 100644 --- a/xCAT-UI/monitor/rmc_lsevent.php +++ b/xCAT-UI/monitor/rmc_lsevent.php @@ -15,9 +15,7 @@ $name = $_REQUEST['name']; //echo $name; -displayMapper(array('home'=>'main.php', 'monitor' =>'')); - -displayTips(array("You can view the latest 60 RMC events here")); +displayMapper(array('home'=>'main.php', 'monitor' =>'monitor/monlist.php', 'RMC EventLog' => '')); //Following the "Syslog Entries" web page displayRMCEvnetLog(); diff --git a/xCAT-UI/monitor/updateCondResp.php b/xCAT-UI/monitor/updateCondResp.php index 0a584a8d6..04e1a6e59 100644 --- a/xCAT-UI/monitor/updateCondResp.php +++ b/xCAT-UI/monitor/updateCondResp.php @@ -1,7 +1,10 @@ ; +// For RMC Event control; +// use "startcondresp" and "stopcondresp" commands to activate/deactivate the specified condition&response; +// the file "updateCondRespTable.php" is used to update the contents in the table of "association". + + if(!isset($TOPDIR)) { $TOPDIR="..";} require_once "$TOPDIR/lib/security.php"; @@ -10,7 +13,7 @@ require_once "$TOPDIR/lib/display.php"; require_once "$TOPDIR/lib/monitor_display.php"; $cond = '"' . $_REQUEST['c'] . '"'; -$node = '"' . $_REQUEST['n'] . '"'; +$node = $_REQUEST['n']; $resp = '"' . $_REQUEST['r'] . '"'; $action = $_REQUEST['a']; @@ -24,60 +27,8 @@ if(getXmlErrors($xml,$errors)) { echo "

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

"; exit; } - -//the following code is copied from displayAssociation() in the file: monitor_display.php -echo <<Available Condition/Response Associations - - - - - - - - - - - -TOS5; -$xml = docmd("webrun", "", array("lscondresp")); -if(getXmlErrors($xml,$errors)) { - echo "

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

"; +else { + echo "successful"; exit; } -//get all the condition&response associations for RMC -foreach ($xml->children() as $response) foreach($response->children() as $data) { - //get the data from xcatd - $association = explode("=", $data); - - $ooe = 0; - $line = 0; - foreach($association as $elem) { - $ooe = $ooe%2; - //the format should be - //"NodeReachability"\t"EmailRootOffShift"\t"hv8plus01.ppd.pok.ibm.com"\t"Active" - $record = explode("\"", $elem); - $cond = $record[1]; - $resp = $record[3]; - $node = $record[5]; - $state = $record[7]; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - $ooe++; - $line++; - } -} -echo "
ConditionResponseNodeStateAction
$cond$resp$node$state"; - if($state == "Active") { - insertButtons(array('label'=>'DeActivate', 'id'=>'deactivate', 'onclick'=>"control_RMCAssoc(\"$cond\", \"$node\", \"$resp\", \"stop\")")); - }else if($state == "Not active"){ - insertButtons(array('label'=>'Activate', 'id'=>'activate', 'onclick'=>"control_RMCAssoc(\"$cond\", \"$node\", \"$resp\", \"start\")")); - } - echo "
"; - ?> diff --git a/xCAT-UI/monitor/updateCondRespTable.php b/xCAT-UI/monitor/updateCondRespTable.php index 06f9553ea..462104354 100644 --- a/xCAT-UI/monitor/updateCondRespTable.php +++ b/xCAT-UI/monitor/updateCondRespTable.php @@ -10,73 +10,31 @@ require_once "$TOPDIR/lib/security.php"; require_once "$TOPDIR/lib/display.php"; require_once "$TOPDIR/js/jsonwrapper.php"; -//echo << -// -// -// Condition -// Response -// Node -// State -// Action -// -// -// -//TOS5; - $xml = docmd("webrun", "", array("lscondresp")); - if(getXmlErrors($xml,$errors)) { - echo "

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

"; - exit; - } - //get all the condition&response associations for RMC - foreach ($xml->children() as $response) foreach($response->children() as $data) { - //get the data from xcatd - $record = split('"',$data); - echo ""; +$xml = docmd("webrun", "", array("lscondresp")); +if(getXmlErrors($xml,$errors)) { + echo "

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

"; + exit; +} +//get all the condition&response associations for RMC +foreach ($xml->children() as $response) foreach($response->children() as $data) { + //get the data from xcatd + $record = split('"',$data); + echo ""; echo <<$record[1] - $record[3] - $record[5] - $record[7] + $record[1] + $record[3] + $record[5] + $record[7] TOS6; - //TODO: insert the button here - echo ""; - if($record[7] == "Active") { - echo ""; - }else { - echo ""; - } - echo ""; - echo ""; -// $association = explode("=", $data); -// -// $ooe = 0; -// $line = 0; -// foreach($association as $elem) { -// $ooe = $ooe%2; -// //the format should be -// //"NodeReachability"\t"EmailRootOffShift"\t"hv8plus01.ppd.pok.ibm.com"\t"Active" -// $record = explode("\"", $elem); -// $cond = $record[1]; -// $resp = $record[3]; -// $node = $record[5]; -// $state = $record[7]; -// echo ""; -// echo "$cond"; -// echo "$resp"; -// echo "$node"; -// echo "$state"; -// echo ""; -// if($state == "Active") { -// insertButtons(array('label'=>'DeActivate', 'id'=>'deactivate', 'onclick'=>"control_RMCAssoc(\"$cond\", \"$node\", \"$resp\", \"stop\")")); -// }else if($state == "Not active"){ -// insertButtons(array('label'=>'Activate', 'id'=>'activate', 'onclick'=>"control_RMCAssoc(\"$cond\", \"$node\", \"$resp\", \"start\")")); -// } -// echo ""; -// echo ""; -// $ooe++; -// $line++; -// } + //TODO: insert the button here + echo ""; + if($record[7] == "Active") { + echo ""; + }else { + echo ""; } + echo ""; + echo ""; +} // echo ""; ?>