diff --git a/xCAT-UI/css/main.css b/xCAT-UI/css/main.css index 2b77bde3d..148a162c1 100644 --- a/xCAT-UI/css/main.css +++ b/xCAT-UI/css/main.css @@ -385,54 +385,6 @@ padding:10px 2px; display: block; } -#condresp { - width: 770px; - margin: 10px; - padding: 10px; - float: left; - display: block; - border-bottom: 1px dotted #555; -} - -#assocaition { - margin: 10px; - padding: 10px; - float:left; - display: block; - width: 720px; - border-bottom: 1px dotted #555; -} -#avail_cond { - width: 275px; - margin: 5px; - padding: 10px; - float: left; - background-color: #ffee33; -} - -#avail_cond tbody { - height: 640px; - overflow-y: scroll; - overflow-x: hide; -} - -#condition .ui-selecting {background: #FECA40;} -#condition .ui-selected { background: #F39814; color: white; } -#condition {list-style-type: none; margin: 0; padding: 0;} - -#avail_resp { - width: 425px; - margin: 5px; - padding: 10px; - float: left; - background-color: #eeffee; -} - -#avail_resp tbody { - height: 640px; - overflow-y: scroll; - overflow-x: hide; -} #monsetting_tips { width: 920px; diff --git a/xCAT-UI/css/monitor.css b/xCAT-UI/css/monitor.css index 3b01e044c..c3c126368 100644 --- a/xCAT-UI/css/monitor.css +++ b/xCAT-UI/css/monitor.css @@ -126,3 +126,49 @@ fieldset { outline: 1px dotted #ccc; } +#condresp { + width: 71%; + margin: 5px; + padding: 5px; + float: left; + display: block; + border: 1px solid orange; +} + +#assocaition { + margin: 5px; + padding: 5px; + float:left; + display: block; + border: 1px solid lime; +} + +#avail_cond { + width: 33%; + margin: 5px; + padding: 5px; + float: left; + background-color: #ffee33; +} + +#avail_cond tbody { + overflow-y: scroll; + overflow-x: hide; +} + +#condition .ui-selecting {background: #FECA40;} +#condition .ui-selected { background: #F39814; color: white; } +#condition {list-style-type: none; margin: 0; padding: 0;} + +#avail_resp { + width: 60%; + margin: 5px; + padding: 5px; + float: left; + background-color: #eeffee; +} + +#avail_resp tbody { + overflow-y: scroll; + overflow-x: hide; +} \ No newline at end of file diff --git a/xCAT-UI/js/loading.js b/xCAT-UI/js/loading.js index 28e44837c..e3d44de25 100644 --- a/xCAT-UI/js/loading.js +++ b/xCAT-UI/js/loading.js @@ -99,7 +99,8 @@ var xStart = function(){ myBar.addScript("jsTree/jquery.cookie.js"); myBar.addScript("jsTree/css.js"); myBar.addScript("jquery.form.js"); - myBar.addScript("jquery.jeditable.mini.js"); + myBar.addScript("jquery.jeditable.mini.js"); + myBar.addScript("jquery.dataTables.min.js"); myBar.addScript("hoverIntent.js"); myBar.addScript("superfish.js"); myBar.addScript("jquery.tablesorter.js"); diff --git a/xCAT-UI/js/monitor.js b/xCAT-UI/js/monitor.js index 3e2fc9937..6eb19af12 100644 --- a/xCAT-UI/js/monitor.js +++ b/xCAT-UI/js/monitor.js @@ -114,6 +114,30 @@ function monPluginSetStat() ); } +/*setMonsettingTab is used to initialize the configuration of monsetting in the monlist */ +function setMonsettingTab() +{ + makeEditable('monsetting','.editme', '.Ximg', '.Xlink'); + $("#reset").click(function() { + alert('You sure you want to discard changes?'); + $("#settings").tabs("load",1); //reload the "config" tabs + $("#settings .ui-tabs-panel #accordion").accordion('activate',1);//activate the "monsetting" accordion + }); + $("#monsettingaddrow").click(function() { + var line = $(".mContent #tabTable tbody tr").length + 1; + var newrow = formRow(line, 6, line%2); + $(".mContent #tabTable tbody").append($(newrow)); + makeEditable('monsetting', '.editme2', '.Ximg2', '.Xlink2'); + }); + $("#saveit").click(function() { + var plugin=$('.pluginstat.ui-state-active').attr('id'); + $.get("monitor/options.php",{name:plugin, opt:"savetab"},function(data){ + $("#settings").tabs("load",1); //reload the "config" tabs + $("#settings .ui-tabs-panel #accordion").accordion('activate',1);//activate the "monsetting" accordion + }); + }); +} + function nodemonSetStat() { //enable/disable buttons for setting of the Node monitoring status @@ -130,5 +154,52 @@ function appmonSetStat() //TODO } +//create the associations for the condition & response +//which is be used in the PHP function displayCondResp() in rmc_event_define.php +function mkCondResp() +{ + //get the name of the selected condition + //then, get the response in "checked" status + //then, run the command "mkcondresp" + var cond_val = $(':input[name=conditions][checked]').val(); + if(cond_val) { + //get the response in "checked" status + var resps_obj = $(':input[name=responses][checked]'); + if(resps_obj) { + $.each(resps_obj,function(i,n) { + //i is the index + //n is the content + //TODO:add one new php file to handle "mkcondresp" command + $.get("monitor/makecondresp.php", {cond: cond_val, resp: n.value}, function(data) { + $("#devstatus").html(data); + }); + }); + $("#association").load("monitor/updateCondRespTable.php"); + } + } +} + +//clearEventDisplay() +//is used to clear the selection in the page for configuring the condtion&response association +function clearEventDisplay() +{ + $(':input[name=conditions][checked]').attr('checked', false); + $(':input[name=responses][checked]').attr('checked', false); +} + +//control_RMCAssoc() +//is used to update the association table in rmc_event_define.php +function control_RMCAssoc(cond, node, resp, action) +{ + //TODO:for define_rmc_event + //control the RMC Association: startcondresp & stopcondresp; + $.get("monitor/updateCondResp.php", + {c: cond, n: node, r: resp, a: action}, + function(data) { + $("#association").html(data); + } + ); +} + // for the progress bar myBar.loaded('monitor.js'); \ No newline at end of file diff --git a/xCAT-UI/js/xcat.js b/xCAT-UI/js/xcat.js index 652720e30..4873043c0 100644 --- a/xCAT-UI/js/xcat.js +++ b/xCAT-UI/js/xcat.js @@ -400,48 +400,6 @@ function goto_next() } } -function mkCondResp() -{ - //get the name of the selected condition - //then, get the response in "checked" status - //then, run the command "mkcondresp" - var cond_val = $('input[@name=conditions][@checked]').val(); - if(cond_val) { - //get the response in "checked" status - var resps_obj = $('input[@name=responses][@checked]'); - if(resps_obj) { - $.each(resps_obj,function(i,n) { - //i is the index - //n is the content - //TODO:add one new php file to handle "mkcondresp" command - $.get("monitor/makecondresp.php", {cond: cond_val, resp: n.value}, function(data) { - $("#devstatus").html(data); - }); - }); - $("#association").load("monitor/updateCondRespTable.php"); - } - } -} - -function control_RMCAssoc(cond, node, resp, action) -{ - //TODO:for define_rmc_event - //control the RMC Association: startcondresp & stopcondresp; - $.get("monitor/updateCondResp.php", - {c: cond, n: node, r: resp, a: action}, - function(data) { - $("#association").html(data); - } - ); -} - -function clearEventDisplay() -{ - $('input[@name=conditions][@checked]').attr('checked', false); - $('input[@name=responses][@checked]').attr('checked', false); -} - - function showRMCAttrib() { var class_val = $('input[@name=classGrp][@checked]').val(); @@ -452,32 +410,6 @@ function showRMCAttrib() } } -//TODO: when mouse hover the list of monitor plugins, the .ListLine_hover style will -//be applied on the
",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 "Condition | -Response | -Node | -State | -Action | +
Condition + | Response + | Node + | State + | Action |
---|---|---|---|---|
$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 "
$record[3] | +$record[5] | +$record[7] | +TOS6; + //TODO: insert the button here + echo "Button | "; + 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 "
- | Conditions | ++ | Conditions |
---|---|---|---|
"; - echo " | $elem | "; - echo "+ | $tmp[1] | + +TOS99; } +// $ooe = 0; +// $line = 0; +// foreach($conditions as $elem) { +// $ooe = $ooe%2; +// echo "
"; +// echo " | $elem | "; +// echo "
RMC Event configuration is independent from the monstart/monstop command
+To make your change effect, you don't need to restart RMC plugin
+click the REDIRECT button to go to the configure web page
"; + echo ""; + echo ""; + echo "For your convenience, all the available RMC Resources and their attributes will list here
+ + +TOS15; + } + echo ""; +} + +/* showRMCAssocTab() + * is used to display all the current associations of RMC conditions&responses + */ +function showRMCAssocTab() +{ + echo ""; echo ""; diff --git a/xCAT-UI/monitor/rmc_event_define.php b/xCAT-UI/monitor/rmc_event_define.php index d682932d3..c3bc32225 100644 --- a/xCAT-UI/monitor/rmc_event_define.php +++ b/xCAT-UI/monitor/rmc_event_define.php @@ -19,8 +19,9 @@ displayTips(array( "Use \"mkcondition\" and \"mkresponse\" to create new conditions and new responses", "Select the condition, and response to create condition/response association" )); +echo "