From aec5389566a99fec583deeef03614152ea505b6d Mon Sep 17 00:00:00 2001 From: sasha Date: Tue, 19 Aug 2008 09:13:04 +0000 Subject: - [ZBX-420] added order by id of log and text items in screens git-svn-id: svn://svn.zabbix.com/trunk@5922 97f52cf1-0a1b-0410-bd0e-c28be96e8082 --- ChangeLog | 3 ++- frontends/php/include/screens.inc.php | 29 ++++++++++++++++++++++------- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index d1534aab..808dcd54 100644 --- a/ChangeLog +++ b/ChangeLog @@ -131,7 +131,8 @@ Changes for 1.5: Changes for 1.4.7: - - [ZBX-418] fixed possible server crash while processing macros (Sasha) + - [ZBX-420] added support of log files in screens (Sasha) + - [ZBX-418] fixed possible server crash while processing macros (Sasha) - [ZBX-370] fixed cpu.c for system.cpu.load[] processing (Sasha) Changes for 1.4.6: diff --git a/frontends/php/include/screens.inc.php b/frontends/php/include/screens.inc.php index 18bacbf9..af018a4a 100644 --- a/frontends/php/include/screens.inc.php +++ b/frontends/php/include/screens.inc.php @@ -321,19 +321,34 @@ global $DB; $item=get_item_by_itemid($itemid); - switch($item["value_type"]){ - case ITEM_VALUE_TYPE_FLOAT: $history_table = "history"; break; - case ITEM_VALUE_TYPE_UINT64: $history_table = "history_uint"; break; - case ITEM_VALUE_TYPE_TEXT: $history_table = "history_text"; break; - case ITEM_VALUE_TYPE_LOG: $history_table = "history_log"; break; - default: $history_table = "history_str"; break; + switch($item['value_type']){ + case ITEM_VALUE_TYPE_FLOAT: + $history_table = 'history'; + $order_field = 'clock'; + break; + case ITEM_VALUE_TYPE_UINT64: + $history_table = 'history_uint'; + $order_field = 'clock'; + break; + case ITEM_VALUE_TYPE_TEXT: + $history_table = 'history_text'; + $order_field = 'id'; + break; + case ITEM_VALUE_TYPE_LOG: + $history_table = 'history_log'; + $order_field = 'id'; + break; + default: + $history_table = 'history_str'; + $order_field = 'clock'; + break; } $sql='SELECT h.clock,h.value,i.valuemapid '. ' FROM '.$history_table.' h, items i '. ' WHERE h.itemid=i.itemid '. ' AND i.itemid='.$itemid. - ' ORDER BY h.clock DESC'; + ' ORDER BY h.'.$order_field.' DESC'; $result=DBselect($sql,$elements); -- cgit