diff --git a/xCAT-UI/css/main.css b/xCAT-UI/css/main.css index ece578ddb..3dd224374 100644 --- a/xCAT-UI/css/main.css +++ b/xCAT-UI/css/main.css @@ -315,12 +315,106 @@ padding:10px 2px; margin: 0; padding: 0; font-size: 8pt; - paddint-right: 0; + padding-right: 0; } #ositree { float: left; width: auto; + min-height: 255px; border-right: 1px dotted #555; -} \ No newline at end of file + min-width: 130px; + /*display: none;*/ +} + +#tips { + margin-right: 10px; + margin-left: 10px; + padding: 10px; + width: 900px; + text-align: left; + display: block; + border-bottom: 1px dotted #555; + /*display: none;*/ +} + +#monlist_table { + margin-right: 30px; + margin-left: 30px; + width: 850px; + padding: 10px; + float: left; + 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; +} +#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: 888px; + margin: 5px; + padding: 5px; + float: left; +} + +#rmcSrcList { + width: 420px; + margin: 5px; + padding: 5px; + float: left; + background-color:silver; +} + +#rmcScrAttr { + width: 420px; + margin: 5px; + padding: 5px; + float: left; + background-color:silver; +} diff --git a/xCAT-UI/js/xcat.js b/xCAT-UI/js/xcat.js index a9b778918..6ef7891b4 100644 --- a/xCAT-UI/js/xcat.js +++ b/xCAT-UI/js/xcat.js @@ -369,8 +369,10 @@ function node_stat_control(plugin) } function goto_next() +//TODO: change the function name! it's too silly now! { var str = location.href; + //TODO:one bug is here. var plugin=str.slice(str.indexOf("name")+5);//get the argument from "?name=xxxxx" if(plugin == "rmcmon") { loadMainPage("monitor/rmc_event_define.php"); @@ -381,5 +383,52 @@ 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 showRMCAttrib() +{ + var class_val = $('input[@name=classGrp][@checked]').val(); + if(class_val) { + $.get("monitor/rmc_resource_attr.php", {name: class_val}, function(data) { + $("#rmcScrAttr").html(data); + }); + } +} + +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); + }); + + }); +} + // load progress bar myBar.loaded('xcat.js'); diff --git a/xCAT-UI/lib/monitor_display.php b/xCAT-UI/lib/monitor_display.php index 4d251f06b..182bf148e 100644 --- a/xCAT-UI/lib/monitor_display.php +++ b/xCAT-UI/lib/monitor_display.php @@ -40,6 +40,18 @@ function displayMapper_mon($mapper) echo "
Tips:
'; foreach ($tips as $tip) { - echo "$tip
"; echo "\n"; } echo 'This interface is still under development -use accordingly.
This interface is still under development -use accordingly.
",implode(' ', $errors), "
"; - //exit; - //} + $xml = docmd("webrun", "", array("lscondresp")); + if(getXmlErrors($xml,$errors)) { + echo "",implode(' ', $errors), "
"; + exit; + } //get all the condition&response associations for RMC -echo <<+ | Conditions | +
"; + echo " | $elem | "; + echo "
+ | Response | +
"; + echo " | $elem | "; + echo "
Can't find header line in $tab
"); } + echo "+ | Class Name | +
"; + echo " | $class | "; + echo "
Select the RMC Resource, you will see all its available attributes here.
"; +} + ?> diff --git a/xCAT-UI/monitor/makecondresp.php b/xCAT-UI/monitor/makecondresp.php new file mode 100644 index 000000000..a9d3f20b5 --- /dev/null +++ b/xCAT-UI/monitor/makecondresp.php @@ -0,0 +1,24 @@ +",implode(' ', $errors), ""; + exit; +} + +echo "$resp
"; + +?> diff --git a/xCAT-UI/monitor/monstart.php b/xCAT-UI/monitor/monstart.php index 25c3e5eeb..52759b818 100644 --- a/xCAT-UI/monitor/monstart.php +++ b/xCAT-UI/monitor/monstart.php @@ -13,7 +13,14 @@ require_once "$TOPDIR/lib/monitor_display.php"; $name = $_REQUEST['name']; -echo $name; -return 0; +//echo $name; +displayMapper_mon(array('home'=>'main.php', 'monitor'=>'monitor/monlist.php')); + +displayTips(array("")); + + +displayStatus(); + +insertButtons(array('label' => 'Next', 'id'=> 'next', 'onclick'=>'')); ?> diff --git a/xCAT-UI/monitor/osi_source.php b/xCAT-UI/monitor/osi_source.php index c3bdb95f8..d17ca6a01 100644 --- a/xCAT-UI/monitor/osi_source.php +++ b/xCAT-UI/monitor/osi_source.php @@ -12,23 +12,29 @@ require_once "$TOPDIR/lib/display.php"; require_once "$TOPDIR/js/jsonwrapper.php"; //get all the groups -$xml=docmd("lsdef","",array("-t", "group")); +//$xml=docmd("lsdef","",array("-t", "group")); +//if(getXmlErrors($xml,$errors)) { +// echo "",implode(' ', $errors), "
"; +// exit; +//} +//$groups = array(); +//$jdata = array(); +//foreach($xml->children() as $response) foreach($response->children() as $data) { + //all the groups are stored into $groups +// array_push($groups, $data); +//} + +$xml = docmd("lsdef","",array("-t", "node", "-w", "nodetype=~osi")); if(getXmlErrors($xml,$errors)) { - echo "",implode(' ', $errors), "
"; + echo "", implode(' ', $errors), "
"; exit; } -$groups = array(); -$jdata = array(); -foreach($xml->children() as $response) foreach($response->children() as $data) { - //all the groups are stored into $groups - //TODO - array_push($groups, $data); -} -//foreach($groups as $group) { - //$xml = docmd("lsdef","",array("-t", "node", "-w", "nodetype=~osi")) -//} -//print_r($groups); +$host = system("hostname|cut -f 1 -d \".\""); + +//print_r($groups); +//TODO: +//rebuild the jsTree //echo json_encode($jdata); echo <<Class Name | +
$attr | "; + echo "
",implode(' ', $errors), "
"; + exit; + } + $xml = docmd("moncfg", "", array("$plugin", "-r")); + if(getXmlErrors($xml, $errors)) { + echo "",implode(' ', $errors), "
"; + exit; + } + + $xml = docmd("monstart", "", array("$plugin", "-r")); + return 0; +} + +function monstart($plugin, $nmstat) +{ + //before starting the $plugin, + //we have to make sure that the plugin is added in the "monitoring" table + $xml = docmd("monstart", "", array("$plugin", "-r")); + return 0; +} + +?> diff --git a/xCAT-UI/monitor/stat_mon.php b/xCAT-UI/monitor/stat_mon.php index 2b1cf2954..d3ac95d75 100644 --- a/xCAT-UI/monitor/stat_mon.php +++ b/xCAT-UI/monitor/stat_mon.php @@ -42,5 +42,5 @@ display_stat_mon_table(array("$name"=> displayStatus(); -insertButtons(array('label'=>'Next', id=>'next', 'onclick'=>'goto_next()')); +insertButtons(array('label'=>'Next', id=>'next', 'onclick'=>'loadMainPage("monitor/monlist.php")')); ?> diff --git a/xCAT-UI/monitor/updateCondRespTable.php b/xCAT-UI/monitor/updateCondRespTable.php new file mode 100644 index 000000000..126a02d63 --- /dev/null +++ b/xCAT-UI/monitor/updateCondRespTable.php @@ -0,0 +1,59 @@ +Available Condition/Response Associations +Condition | +Response | +Node | +State | +
$cond | "; + echo "$resp | "; + echo "$node | "; + echo "$state | "; + echo "