diff options
author | artem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2007-12-12 09:42:46 +0000 |
---|---|---|
committer | artem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2007-12-12 09:42:46 +0000 |
commit | c0529a72a421c43e903376c9c2661cf9b2e221d8 (patch) | |
tree | c1597b558cb9a46961d204e9461d5c2a6eea59e6 /frontends/php/history.php | |
parent | 1e32b65c56449dba7140c470a2e18024a05063d4 (diff) | |
download | zabbix-c0529a72a421c43e903376c9c2661cf9b2e221d8.tar.gz zabbix-c0529a72a421c43e903376c9c2661cf9b2e221d8.tar.xz zabbix-c0529a72a421c43e903376c9c2661cf9b2e221d8.zip |
- [ZBX-208] html output parsing (Artem)
git-svn-id: svn://svn.zabbix.com/trunk@5164 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/history.php')
-rw-r--r-- | frontends/php/history.php | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/frontends/php/history.php b/frontends/php/history.php index b851a5e3..d77d74fc 100644 --- a/frontends/php/history.php +++ b/frontends/php/history.php @@ -127,7 +127,7 @@ include_once "include/page_header.php"; $main_header = $item_data["host"].": ".item_description($item_data["description"],$item_data["key_"]); if(isset($_REQUEST["plaintext"])) - echo $main_header.BR; + echo $main_header.SBR; if($_REQUEST["action"]=="showgraph") { @@ -239,8 +239,10 @@ include_once "include/page_header.php"; $till = time(null) - $_REQUEST["from"] * 3600; $hours=$effectiveperiod / 3600; - $l_header = "Showing history of ".$effectiveperiod." seconds($hours h)".BR. - "[from: ".date("Y.M.d H:i:s",$time)."] [till: ".date("Y.M.d H:i:s",$till)."]"; + $l_header = array('Showing history of '.$effectiveperiod.' seconds('.$hours.' h)', + BR(), + '[from: '.date('Y.M.d H:i:s',$time).'] [till: '.date('Y.M.d H:i:s',$till).']' + ); } else { @@ -460,7 +462,7 @@ include_once "include/page_header.php"; { $table = new CTableInfo(); $table->SetHeader(array(S_TIMESTAMP, S_VALUE)); - + $table->AddOption('id','graph'); $table->ShowStart(); // to solve memory leak we call 'Show' method by steps } else @@ -504,10 +506,13 @@ COpt::profiling_start("history"); echo "\t".$row["clock"]."\t".$row["value"]."\n"; } } - if(!isset($_REQUEST["plaintext"])) + if(!isset($_REQUEST["plaintext"])){ $table->ShowEnd(); // to solve memory leak we call 'Show' method by steps - else + echo SBR; + } + else{ echo "</pre>"; + } COpt::profiling_stop("history"); } } @@ -517,6 +522,7 @@ COpt::profiling_stop("history"); if(in_array($_REQUEST["action"],array("showvalues","showgraph"))){ $stime = get_min_itemclock_by_itemid($_REQUEST["itemid"]); + $stime = (is_null($stime))?0:$stime; $bstime = time()-$effectiveperiod; if(isset($_REQUEST['stime'])){ @@ -525,8 +531,9 @@ COpt::profiling_stop("history"); } $script = 'scrollinit(0,0,0,'.$effectiveperiod.','.$stime.',0,'.$bstime.'); - showgraphmenu("graph"); - graph_zoom_init("'.$dom_graph_id.'",'.$bstime.','.$effectiveperiod.',ZBX_G_WIDTH, 200);'; + showgraphmenu("graph");'; + if(isset($dom_graph_id)) + $script.='graph_zoom_init("'.$dom_graph_id.'",'.$bstime.','.$effectiveperiod.',ZBX_G_WIDTH, 200);'; zbx_add_post_js($script); |