diff options
author | sasha <sasha@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2008-08-19 09:13:04 +0000 |
---|---|---|
committer | sasha <sasha@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2008-08-19 09:13:04 +0000 |
commit | aec5389566a99fec583deeef03614152ea505b6d (patch) | |
tree | 73bebdc7c63a4ca1c8ef3c8ef8d5793f9496faaa | |
parent | 12f5b1d4f4b4df72ae9db421d31023ed826ca1da (diff) | |
download | zabbix-aec5389566a99fec583deeef03614152ea505b6d.tar.gz zabbix-aec5389566a99fec583deeef03614152ea505b6d.tar.xz zabbix-aec5389566a99fec583deeef03614152ea505b6d.zip |
- [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
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | frontends/php/include/screens.inc.php | 29 |
2 files changed, 24 insertions, 8 deletions
@@ -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); |