From 793cc2e085dc67097d1521d58052033cfdcbfef3 Mon Sep 17 00:00:00 2001 From: hugetoad Date: Sun, 7 Apr 2002 18:21:22 +0000 Subject: Better support for non-numeric values. git-svn-id: svn://svn.zabbix.com/trunk@346 97f52cf1-0a1b-0410-bd0e-c28be96e8082 --- frontends/php/history.php | 16 ++++++++++++++-- frontends/php/include/config.inc | 12 ++++++++++-- frontends/php/latest.php | 13 ++++++++++--- frontends/php/tr_status.php | 2 ++ 4 files changed, 36 insertions(+), 7 deletions(-) diff --git a/frontends/php/history.php b/frontends/php/history.php index 44b6023c..08f705f7 100644 --- a/frontends/php/history.php +++ b/frontends/php/history.php @@ -46,7 +46,15 @@ $host : $description"; + $item=get_item_by_itemid($itemid); + if($item["value_type"] == 0) + { + echo "$host : $description"; + } + else + { + echo "$host : $description"; + } show_table_v_delimiter(); echo("
"); if($action =="showhistory") @@ -55,7 +63,11 @@ } else { - echo("Last hour graph "); + $item=get_item_by_itemid($itemid); + if($item["value_type"] == 0) + { + echo("Last hour graph "); + } } if($action =="showvalues") { diff --git a/frontends/php/include/config.inc b/frontends/php/include/config.inc index f9c3ea33..dfc9557d 100644 --- a/frontends/php/include/config.inc +++ b/frontends/php/include/config.inc @@ -759,7 +759,15 @@ } else { - $exp=$exp."{".DBget_field($res1,0,0).":".DBget_field($res1,0,1).".".DBget_field($res1,0,2)."(".DBget_field($res1,0,3).")}"; + $item=get_item_by_itemid(DBget_field($res1,0,4)); + if($item["value_type"] ==0) + { + $exp=$exp."{".DBget_field($res1,0,0).":".DBget_field($res1,0,1).".".DBget_field($res1,0,2)."(".DBget_field($res1,0,3).")}"; + } + else + { + $exp=$exp."{".DBget_field($res1,0,0).":".DBget_field($res1,0,1).".".DBget_field($res1,0,2)."(".DBget_field($res1,0,3).")}"; + } } continue; } @@ -1908,7 +1916,7 @@ show_table2_v_delimiter2(); echo "Press "; - echo " to see graph"; + echo " to see values in plain text"; show_table2_header_end(); diff --git a/frontends/php/latest.php b/frontends/php/latest.php index 175959a1..9ec4a8ec 100644 --- a/frontends/php/latest.php +++ b/frontends/php/latest.php @@ -138,10 +138,17 @@ { if(round($row["lastvalue"])==$row["lastvalue"]) { - echo ""; printf("%.0f",$row["lastvalue"]); echo ""; + if($row["value_type"] == 0 ) + { + echo ""; printf("%.0f",$row["lastvalue"]); echo ""; + } + else + { + echo ""; echo substr($row["lastvalue"],0,20)," ..."; echo ""; + } } else - { + { echo ""; printf("%.2f",$row["lastvalue"]); echo ""; } } @@ -151,7 +158,7 @@ } if( isset($row["lastvalue"]) && isset($row["prevvalue"]) && $row["lastvalue"]-$row["prevvalue"] != 0 ) { - echo "".($row["lastvalue"]-$row["prevvalue"]).""; + echo ""; echo $row["lastvalue"]-$row["prevvalue"]; echo ""; } else { diff --git a/frontends/php/tr_status.php b/frontends/php/tr_status.php index 79c139f9..de295b7b 100644 --- a/frontends/php/tr_status.php +++ b/frontends/php/tr_status.php @@ -11,11 +11,13 @@ // Number of trigger decreased if(isset($active_triggers)&&($count<$active_triggers)) { + echo "OFF"; $audio="warning_off.wav"; } // Number of trigger increased if(isset($active_triggers)&&($count>$active_triggers)) { + echo "ON"; $audio="warning_on.wav"; } -- cgit