diff options
author | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2005-09-01 11:06:42 +0000 |
---|---|---|
committer | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2005-09-01 11:06:42 +0000 |
commit | 180d85520fa4c856e46b58153bc0c7f1f8b48d98 (patch) | |
tree | e7fa123de29e5736316ec801c1a6b94255eb7763 /frontends/php | |
parent | b05fb551802790f9cf490ffbcab80b734db2d4b8 (diff) | |
download | zabbix-180d85520fa4c856e46b58153bc0c7f1f8b48d98.tar.gz zabbix-180d85520fa4c856e46b58153bc0c7f1f8b48d98.tar.xz zabbix-180d85520fa4c856e46b58153bc0c7f1f8b48d98.zip |
Improvements for navigation bar.
git-svn-id: svn://svn.zabbix.com/trunk@2016 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php')
-rw-r--r-- | frontends/php/charts.php | 2 | ||||
-rw-r--r-- | frontends/php/history.php | 4 | ||||
-rw-r--r-- | frontends/php/include/config.inc.php | 4 | ||||
-rw-r--r-- | frontends/php/include/graphs.inc.php | 83 | ||||
-rw-r--r-- | frontends/php/screens.php | 8 |
5 files changed, 75 insertions, 26 deletions
diff --git a/frontends/php/charts.php b/frontends/php/charts.php index 6f3be261..c4d26d50 100644 --- a/frontends/php/charts.php +++ b/frontends/php/charts.php @@ -36,12 +36,14 @@ { show_header($page["title"],0,$nomenu); } + navigation_bar_calc(); ?> <?php $_GET["hostid"]=@iif(isset($_GET["hostid"]),$_GET["hostid"],get_profile("web.latest.hostid",0)); update_profile("web.latest.hostid",$_GET["hostid"]); + update_profile("web.menu.view.last",$page["file"]); ?> <?php diff --git a/frontends/php/history.php b/frontends/php/history.php index 64b20277..788a0bc3 100644 --- a/frontends/php/history.php +++ b/frontends/php/history.php @@ -78,6 +78,10 @@ ?> <?php + navigation_bar_calc(); +?> + +<?php if($_GET["action"]=="plaintext") { $from=mktime($_GET["fromhour"],$_GET["frommin"],0,$_GET["frommonth"],$_GET["fromday"],$_GET["fromyear"]); diff --git a/frontends/php/include/config.inc.php b/frontends/php/include/config.inc.php index 696f2862..bbc3a32a 100644 --- a/frontends/php/include/config.inc.php +++ b/frontends/php/include/config.inc.php @@ -1271,6 +1271,10 @@ echo "</head>"; { $sql="select clock,value from history where itemid=$itemid and clock>$from and clock<$till order by clock"; } + if($item["value_type"]==ITEM_VALUE_TYPE_LOG) + { + $sql="select clock,value from history_log where itemid=$itemid and clock>$from and clock<$till order by clock"; + } else { $sql="select clock,value from history_str where itemid=$itemid and clock>$from and clock<$till order by clock"; diff --git a/frontends/php/include/graphs.inc.php b/frontends/php/include/graphs.inc.php index 3dfa5b83..227a2c7b 100644 --- a/frontends/php/include/graphs.inc.php +++ b/frontends/php/include/graphs.inc.php @@ -202,6 +202,32 @@ } } + function navigation_bar_calc() + { + if(!isset($_GET["period"])) $_GET["period"]=3600; + if(!isset($_GET["from"])) $_GET["from"]=0; + + if(isset($_GET["inc"])) $_GET["period"]= $_GET["period"]+$_GET["inc"]; + if(isset($_GET["dec"])) $_GET["period"]= $_GET["period"]-$_GET["dec"]; + + if(isset($_GET["left"])) $_GET["from"]= $_GET["from"]+$_GET["left"]; + if(isset($_GET["right"])) $_GET["from"]= $_GET["from"]-$_GET["right"]; + + unset($_GET["inc"]); + unset($_GET["dec"]); + unset($_GET["left"]); + unset($_GET["right"]); + + if($_GET["from"]<=0) $_GET["from"]=0; + if($_GET["period"]<=0) $_GET["period"]=3600; + + if(isset($_GET["reset"])) + { + $_GET["period"]=3600; + $_GET["from"]=0; + } + } + function navigation_bar($url) { $h1=S_NAVIGATE; @@ -217,17 +243,8 @@ $h2=$h2.form_select("period",31*24*3600,"month"); $h2=$h2.form_select("period",365*24*3600,"year"); $h2=$h2."</select>"; - $h2=$h2."<select class=\"biginput\" name=\"inc\" onChange=\"submit()\">"; - $h2=$h2.form_select("inc",3600,S_INCREASE); - $h2=$h2.form_select("inc",3600,"+1h"); - $h2=$h2.form_select("inc",4*3600,"+4h"); - $h2=$h2.form_select("inc",24*3600,"+24h"); - $h2=$h2.form_select("inc",7*24*3600,"+week"); - $h2=$h2.form_select("inc",31*24*3600,"+month"); - $h2=$h2.form_select("inc",365*24*3600,"+year"); - $h2=$h2."</select>"; $h2=$h2."<select class=\"biginput\" name=\"dec\" onChange=\"submit()\">"; - $h2=$h2.form_select("dec",3600,S_DECREASE); + $h2=$h2.form_select("dec",0,S_DECREASE); $h2=$h2.form_select("dec",3600,"-1h"); $h2=$h2.form_select("dec",4*3600,"-4h"); $h2=$h2.form_select("dec",24*3600,"-24h"); @@ -235,29 +252,39 @@ $h2=$h2.form_select("dec",31*24*3600,"-month"); $h2=$h2.form_select("dec",365*24*3600,"-year"); $h2=$h2."</select>"; + $h2=$h2."<select class=\"biginput\" name=\"inc\" onChange=\"submit()\">"; + $h2=$h2.form_select("inc",0,S_INCREASE); + $h2=$h2.form_select("inc",3600,"+1h"); + $h2=$h2.form_select("inc",4*3600,"+4h"); + $h2=$h2.form_select("inc",24*3600,"+24h"); + $h2=$h2.form_select("inc",7*24*3600,"+week"); + $h2=$h2.form_select("inc",31*24*3600,"+month"); + $h2=$h2.form_select("inc",365*24*3600,"+year"); + $h2=$h2."</select>"; $h2=$h2." ".S_MOVE." "; $h2=$h2."<select class=\"biginput\" name=\"left\" onChange=\"submit()\">"; - $h2=$h2.form_select("left",3600,S_LEFT_DIR); - $h2=$h2.form_select("left",3600,"+1h"); - $h2=$h2.form_select("left",4*3600,"+4h"); - $h2=$h2.form_select("left",24*3600,"+24h"); - $h2=$h2.form_select("left",7*24*3600,"+week"); - $h2=$h2.form_select("left",31*24*3600,"+month"); - $h2=$h2.form_select("left",365*24*3600,"+year"); + $h2=$h2.form_select("left",0,S_LEFT_DIR); + $h2=$h2.form_select("left",1,"-1h"); + $h2=$h2.form_select("left",4,"-4h"); + $h2=$h2.form_select("left",24,"-24h"); + $h2=$h2.form_select("left",7*24,"-week"); + $h2=$h2.form_select("left",31*24,"-month"); + $h2=$h2.form_select("left",365*24,"-year"); $h2=$h2."</select>"; $h2=$h2."<select class=\"biginput\" name=\"right\" onChange=\"submit()\">"; - $h2=$h2.form_select("right",3600,S_RIGHT_DIR); - $h2=$h2.form_select("right",3600,"-1h"); - $h2=$h2.form_select("right",4*3600,"-4h"); - $h2=$h2.form_select("right",24*3600,"-24h"); - $h2=$h2.form_select("right",7*24*3600,"-week"); - $h2=$h2.form_select("right",31*24*3600,"-month"); - $h2=$h2.form_select("right",365*24*3600,"-year"); + $h2=$h2.form_select("right",0,S_RIGHT_DIR); + $h2=$h2.form_select("right",1,"+1h"); + $h2=$h2.form_select("right",4,"+4h"); + $h2=$h2.form_select("right",24,"+24h"); + $h2=$h2.form_select("right",7*24,"+week"); + $h2=$h2.form_select("right",31*24,"+month"); + $h2=$h2.form_select("right",365*24,"+year"); $h2=$h2."</select>"; $h2=$h2." "; $h2=$h2."<input name=\"stime\" size=18 class=\"biginput\" value=\"yyyymmddhhmm\" size=12>"; $h2=$h2." "; $h2=$h2."<input class=\"button\" type=\"submit\" name=\"action\" value=\"go\">"; + $h2=$h2."<input class=\"button\" type=\"submit\" name=\"reset\" value=\"reset\">"; if(isset($_GET["graphid"])&&($_GET["graphid"]!=0)) { @@ -271,6 +298,14 @@ { $h2=$h2."<input name=\"action\" type=\"hidden\" value=\"".$_GET["action"]."\" size=22>"; } + if(isset($_GET["from"])) + { + $h2=$h2."<input name=\"from\" type=\"hidden\" value=\"".$_GET["from"]."\" size=22>"; + } + if(isset($_GET["fullscreen"])) + { + $h2=$h2."<input name=\"fullscreen\" type=\"hidden\" value=\"".$_GET["fullscreen"]."\" size=22>"; + } show_header2($h1,$h2,"<form name=\"form2\" method=\"get\" action=\"$url\">","</form>"); diff --git a/frontends/php/screens.php b/frontends/php/screens.php index 2dbeb441..020d9673 100644 --- a/frontends/php/screens.php +++ b/frontends/php/screens.php @@ -39,6 +39,10 @@ ?> <?php + navigation_bar_calc(); +?> + +<?php $_GET["screenid"]=@iif(isset($_GET["screenid"]),$_GET["screenid"],get_profile("web.screens.screenid",0)); update_profile("web.screens.screenid",$_GET["screenid"]); update_profile("web.menu.view.last",$page["file"]); @@ -143,11 +147,11 @@ { if($resource == 0) { - echo "<a href=charts.php?graphid=$resourceid><img src='chart2.php?graphid=$resourceid&width=$width&height=$height&period=3600&border=0' border=0></a>"; + echo "<a href=charts.php?graphid=$resourceid><img src='chart2.php?graphid=$resourceid&width=$width&height=$height&".url_param("period").url_param("from")."border=0' border=0></a>"; } else if($resource == 1) { - echo "<a href=history.php?action=showhistory&itemid=$resourceid><img src='chart.php?itemid=$resourceid&width=$width&height=$height&period=3600&border=0' border=0></a>"; + echo "<a href=history.php?action=showhistory&itemid=$resourceid><img src='chart.php?itemid=$resourceid&width=$width&height=$height&".url_param("period").url_param("from")."border=0' border=0></a>"; } else if($resource == 2) { |