summaryrefslogtreecommitdiffstats
path: root/frontends/php/include/items.inc.php
diff options
context:
space:
mode:
authoralex <alex@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-10-03 09:54:10 +0000
committeralex <alex@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-10-03 09:54:10 +0000
commit28a15437e99943fe4f87a3992342cf89714fa090 (patch)
treeb28d14ab6eb84a1233646e5dbbaedbaaa2e32827 /frontends/php/include/items.inc.php
parent559fa40b0e8794372c4d6275b88f522082f9ead6 (diff)
downloadzabbix-28a15437e99943fe4f87a3992342cf89714fa090.tar.gz
zabbix-28a15437e99943fe4f87a3992342cf89714fa090.tar.xz
zabbix-28a15437e99943fe4f87a3992342cf89714fa090.zip
- [ZBX-90] fixed displaying of last line of a log file in the Latest Data and Overview (Alexei)
[svn merge -r4724:4725 svn://svn.zabbix.com/branches/1.4.j] git-svn-id: svn://svn.zabbix.com/trunk@4824 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include/items.inc.php')
-rw-r--r--frontends/php/include/items.inc.php25
1 files changed, 22 insertions, 3 deletions
diff --git a/frontends/php/include/items.inc.php b/frontends/php/include/items.inc.php
index 93f70b75..3f9863bd 100644
--- a/frontends/php/include/items.inc.php
+++ b/frontends/php/include/items.inc.php
@@ -1075,11 +1075,30 @@ COpt::profiling_stop('prepare table');
{
$lastvalue="...";
}
+ else if($db_item["value_type"] == ITEM_VALUE_TYPE_LOG)
+ {
+ $row=DBfetch(DBselect("select max(id) as max from history_log where itemid=".$db_item["itemid"]));
+ if($row)
+ {
+ $row2=DBfetch(DBselect("select value from history_log where id=".$row["max"]));
+ $lastvalue=nbsp(htmlspecialchars(substr($row2["value"],0,20)));
+ if(strlen($db_item["lastvalue"]) > 20)
+ $lastvalue .= " ...";
+ }
+ else
+ {
+ $lastvalue="-";
+ }
+ }
+ else if($db_item["value_type"] == ITEM_VALUE_TYPE_STR)
+ {
+ $lastvalue=nbsp(htmlspecialchars(substr($db_item["lastvalue"],0,20)));
+ if(strlen($db_item["lastvalue"]) > 20)
+ $lastvalue .= " ...";
+ }
else
{
- $lastvalue=nbsp(htmlspecialchars(substr($db_item["lastvalue"],0,20)));
- if(strlen($db_item["lastvalue"]) > 20)
- $lastvalue .= " ...";
+ $lastvalue="Unknown value type";
}
if($db_item["valuemapid"] > 0);
$lastvalue = replace_value_by_map($lastvalue, $db_item["valuemapid"]);