diff options
author | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2002-04-07 18:21:22 +0000 |
---|---|---|
committer | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2002-04-07 18:21:22 +0000 |
commit | 793cc2e085dc67097d1521d58052033cfdcbfef3 (patch) | |
tree | 833bbc1b0fa0f93598a3c2d4e9df1dd6444fd19e | |
parent | 9a52608e23459cd737e26aed750b87224ffa85b7 (diff) | |
download | zabbix-793cc2e085dc67097d1521d58052033cfdcbfef3.tar.gz zabbix-793cc2e085dc67097d1521d58052033cfdcbfef3.tar.xz zabbix-793cc2e085dc67097d1521d58052033cfdcbfef3.zip |
Better support for non-numeric values.
git-svn-id: svn://svn.zabbix.com/trunk@346 97f52cf1-0a1b-0410-bd0e-c28be96e8082
-rw-r--r-- | frontends/php/history.php | 16 | ||||
-rw-r--r-- | frontends/php/include/config.inc | 12 | ||||
-rw-r--r-- | frontends/php/latest.php | 13 | ||||
-rw-r--r-- | 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 @@ <? show_table_header_begin(); - echo "<A HREF='latest.php?hostid=$hostid'>$host</A> : <a href='trends.php?itemid=$itemid'>$description</a>"; + $item=get_item_by_itemid($itemid); + if($item["value_type"] == 0) + { + echo "<A HREF='latest.php?hostid=$hostid'>$host</A> : <a href='trends.php?itemid=$itemid'>$description</a>"; + } + else + { + echo "<A HREF='latest.php?hostid=$hostid'>$host</A> : $description"; + } show_table_v_delimiter(); echo("<DIV ALIGN=CENTER>"); if($action =="showhistory") @@ -55,7 +63,11 @@ } else { - echo("<A HREF=\"history.php?action=showhistory&itemid=$itemid\">Last hour graph</A> "); + $item=get_item_by_itemid($itemid); + if($item["value_type"] == 0) + { + echo("<A HREF=\"history.php?action=showhistory&itemid=$itemid\">Last hour graph</A> "); + } } 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."{<A HREF=\"history.php?action=showhistory&itemid=".DBget_field($res1,0,4)."\">".DBget_field($res1,0,0).":".DBget_field($res1,0,1)."</A>.<B>".DBget_field($res1,0,2)."(</B>".DBget_field($res1,0,3)."<B>)</B>}"; + $item=get_item_by_itemid(DBget_field($res1,0,4)); + if($item["value_type"] ==0) + { + $exp=$exp."{<A HREF=\"history.php?action=showhistory&itemid=".DBget_field($res1,0,4)."\">".DBget_field($res1,0,0).":".DBget_field($res1,0,1)."</A>.<B>".DBget_field($res1,0,2)."(</B>".DBget_field($res1,0,3)."<B>)</B>}"; + } + else + { + $exp=$exp."{<A HREF=\"history.php?action=showvalues&period=3600&itemid=".DBget_field($res1,0,4)."\">".DBget_field($res1,0,0).":".DBget_field($res1,0,1)."</A>.<B>".DBget_field($res1,0,2)."(</B>".DBget_field($res1,0,3)."<B>)</B>}"; + } } continue; } @@ -1908,7 +1916,7 @@ show_table2_v_delimiter2(); echo "Press "; - echo "<input type=\"submit\" name=\"action\" value=\"showvalues\"> to see graph"; + echo "<input type=\"submit\" name=\"action\" value=\"showvalues\"> 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 "<td>"; printf("%.0f",$row["lastvalue"]); echo "</td>"; + if($row["value_type"] == 0 ) + { + echo "<td>"; printf("%.0f",$row["lastvalue"]); echo "</td>"; + } + else + { + echo "<td>"; echo substr($row["lastvalue"],0,20)," ..."; echo "</td>"; + } } else - { + { echo "<td>"; printf("%.2f",$row["lastvalue"]); echo "</td>"; } } @@ -151,7 +158,7 @@ } if( isset($row["lastvalue"]) && isset($row["prevvalue"]) && $row["lastvalue"]-$row["prevvalue"] != 0 ) { - echo "<td>".($row["lastvalue"]-$row["prevvalue"])."</td>"; + echo "<td>"; echo $row["lastvalue"]-$row["prevvalue"]; echo "</td>"; } 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 "<tr>OFF<tr>"; $audio="warning_off.wav"; } // Number of trigger increased if(isset($active_triggers)&&($count>$active_triggers)) { + echo "<tr>ON<tr>"; $audio="warning_on.wav"; } |