begin the code for "view by graph"
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@4099 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
parent
c2b52d1a50
commit
4070e8e830
@ -513,8 +513,12 @@ function show_monshow_graph() {
|
||||
if($(":input[@checked]").size() != 0) {
|
||||
$("#monshow_data").empty();
|
||||
$("#monshow_opt").hide("slow");
|
||||
$("#back_btn").show("slow");
|
||||
$(":input[@checked]").each(function(i) {
|
||||
//generate graphics for all the attributes in "checked" status
|
||||
$.get("monitor/rmc_monshow_data_source.php", {mode: "graph", value: $(this).attr("value")}, function(data) {
|
||||
$("#monshow_data").append(data);
|
||||
});
|
||||
});
|
||||
} else {
|
||||
}
|
||||
@ -524,8 +528,9 @@ function show_monshow_text() {
|
||||
if($(":input[@checked]").size() != 0) {
|
||||
$("#monshow_data").empty();
|
||||
$("#monshow_opt").hide("slow");
|
||||
$("#back_btn").show("slow");
|
||||
$(":input[@checked]").each(function(i) {
|
||||
$.get("monitor/rmc_monshow_data_source.php", {value: $(this).attr("value")}, function(data) {
|
||||
$.get("monitor/rmc_monshow_data_source.php", {mode: "text", value: $(this).attr("value")}, function(data) {
|
||||
$("#monshow_data").append(data);
|
||||
});
|
||||
});
|
||||
@ -534,10 +539,15 @@ function show_monshow_text() {
|
||||
}
|
||||
}
|
||||
|
||||
function init_rmc_monshow_back_btn() {
|
||||
$("#back_btn").hide();
|
||||
}
|
||||
|
||||
function rmc_monshow_back_to_opts() {
|
||||
//clear the <div id='monshow_data'>
|
||||
//and, display <div id='monshow_opts'>
|
||||
$("#monshow_data").empty();
|
||||
$("#back_btn").hide("slow");
|
||||
$("#monshow_opt").show("slow");
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,7 @@ insertDiv("rmc_tree");
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(init_rmc_ositree());
|
||||
$(init_rmc_ositree(),init_rmc_monshow_back_btn());
|
||||
</script>
|
||||
|
||||
<?php
|
||||
@ -29,7 +29,11 @@ echo "<div id='monshow_opt'></div>";
|
||||
//if the user clicks the "View by Text" button, the div named "monshow_data" will show
|
||||
// the text data from the "monshow" command;
|
||||
//and , if the "view by Graphics" button is clicked, the "monshow_data" div will display the pictures, the pictures is generated by "rrdtool" right now, but in the future, some jQuery plugin will be used to generate the graphics for the "monshow" data
|
||||
echo "<div id='monshow_data'></div>";
|
||||
echo "<div id='back_btn'>";
|
||||
insertButtons(array('label'=>'Back To the Attributes\' Page', 'id'=>'back_btn', 'onclick'=>'rmc_monshow_back_to_opts()'));
|
||||
echo "</div>";
|
||||
echo "<div id='monshow_data'>";
|
||||
echo "</div>";
|
||||
echo "</div>";
|
||||
|
||||
?>
|
||||
|
@ -7,13 +7,16 @@ require_once "$TOPDIR/lib/functions.php";
|
||||
require_once "$TOPDIR/lib/display.php";
|
||||
require_once "$TOPDIR/lib/monitor_display.php";
|
||||
|
||||
$mode = $_REQUEST['mode'];
|
||||
$value = $_REQUEST['value'];
|
||||
|
||||
echo "<div>";
|
||||
insertButtons(array('label'=>'Back', 'id'=>'back_btn', 'onclick'=>'rmc_monshow_back_to_opts()'));
|
||||
echo "</div>";
|
||||
displayRMCMonshowAttr($value);
|
||||
|
||||
if($mode == "text") {
|
||||
displayRMCMonshowAttr($value);
|
||||
} elseif($mode == "graph") {
|
||||
//display the pictures generated by "rrdtool";
|
||||
//in the feture, the pictures will be generated by jQuery plug-ins;
|
||||
displayRMCMonshowGraph($value);
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
|
Loading…
Reference in New Issue
Block a user