diff options
| author | artem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2008-02-25 15:20:55 +0000 |
|---|---|---|
| committer | artem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2008-02-25 15:20:55 +0000 |
| commit | 8b818f2fa041df344af3cfde1fec132bf3ae2927 (patch) | |
| tree | 43c86a894fe6ceb8225adc933cc486de05ebdf6d /frontends/php/include | |
| parent | d215a0cc8d018303992833528c36455480cfb10b (diff) | |
| download | zabbix-8b818f2fa041df344af3cfde1fec132bf3ae2927.tar.gz zabbix-8b818f2fa041df344af3cfde1fec132bf3ae2927.tar.xz zabbix-8b818f2fa041df344af3cfde1fec132bf3ae2927.zip | |
- [DEV-118] added refresh options to dashboard screen {still beta} (Artem)
git-svn-id: svn://svn.zabbix.com/trunk@5394 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include')
| -rw-r--r-- | frontends/php/include/blocks.inc.php | 37 | ||||
| -rw-r--r-- | frontends/php/include/locales/en_gb.inc.php | 4 |
2 files changed, 39 insertions, 2 deletions
diff --git a/frontends/php/include/blocks.inc.php b/frontends/php/include/blocks.inc.php index 6272cc3b..0f97ea4a 100644 --- a/frontends/php/include/blocks.inc.php +++ b/frontends/php/include/blocks.inc.php @@ -92,6 +92,7 @@ function make_system_summary($available_hosts=false){ } $table->AddRow($group_row); } + $table->SetFooter(new CCol(S_REFRESHED.': '.date("[H:i:s]",time()))); return $table; } @@ -152,7 +153,7 @@ function make_status_of_zbx(){ } $table->AddRow(array(S_NUMBER_OF_USERS,$usr_cnt,new CSpan($online_cnt,'green'))); - + $table->SetFooter(new CCol(S_REFRESHED.': '.date("[H:i:s]",time()))); return $table; } @@ -295,7 +296,7 @@ function make_latest_issues($available_hosts=false){ ' AND h.hostid in ('.$available_hosts.') '. ' AND h.status='.HOST_STATUS_MONITORED. ' AND t.value='.TRIGGER_VALUE_TRUE. - 'ORDER BY t.lastchange DESC'; + ' ORDER BY t.lastchange DESC'; $result = DBselect($sql); while($row=DBfetch($result)){ @@ -354,6 +355,7 @@ function make_latest_issues($available_hosts=false){ } unset($row,$description, $actions); } + $table->SetFooter(new CCol(S_REFRESHED.': '.date("[H:i:s]",time()))); return $table; } @@ -430,6 +432,7 @@ function make_webmon_overview($available_hosts=false){ new CSpan($apps[HTTPTEST_STATE_UNKNOWN],'unknown') )); } + $table->SetFooter(new CCol(S_REFRESHED.': '.date("[H:i:s]",time()))); return $table; } @@ -716,4 +719,34 @@ function make_screen_submenu(){ return $screenids; } + +function add_refresh_objects($ref_tab){ + $min = PHP_INT_MAX; + foreach($ref_tab as $id => $interval){ + $min = ($min < $interval)?$min:$interval; + zbx_add_post_js(get_refresh_obj_script($id,$interval)); + } + zbx_add_post_js('updater.interval = 10; updater.check4Update();'); +} + +function get_refresh_obj_script($id,$interval){ + return 'updater.setObj4Update("'.$id.'","dashboard.php?output=html",{"favobj": "refresh", "favid": "'.$id.'"}, '.$interval.');'; +} + +function make_refresh_menu($id,$cur_interval,&$menu,&$submenu){ + + $menu['menu_'.$id][] = array(S_REFRESH, null, null, array('outer'=> array('pum_oheader'), 'inner'=>array('pum_iheader'))); + $intervals = array('10','30','60', '120','600','900'); + + foreach($intervals as $key => $value){ + $menu['menu_'.$id][] = array( + S_EVERY.SPACE.$value.SPACE.S_SECONDS_SMALL, + 'javascript: setRefreshRate("'.$id.'",'.$value.');'. + 'void(0);', + null, + array('outer' => ($value == $cur_interval)?'pum_b_submenu':'pum_o_submenu', 'inner'=>array('pum_i_submenu') + )); + } + $submenu['menu_'.$id][] = array(); +} ?>
\ No newline at end of file diff --git a/frontends/php/include/locales/en_gb.inc.php b/frontends/php/include/locales/en_gb.inc.php index b8614521..a2444c29 100644 --- a/frontends/php/include/locales/en_gb.inc.php +++ b/frontends/php/include/locales/en_gb.inc.php @@ -937,6 +937,8 @@ 'S_SYSTEM_STATUS'=> 'System status', 'S_LATEST_ISSUES'=> 'Latest issues', 'S_FAVORITE'=> 'Favorite', + 'S_EVERY'=> 'Every', + 'S_REFRESHED'=> 'Refreshed', // overview.php 'S_SELECT_GROUP_DOT_DOT_DOT'=> 'Select group ...', @@ -958,6 +960,8 @@ 'S_THE_QUEUE_IS_EMPTY'=> 'The queue is empty', 'S_TOTAL'=> 'Total', 'S_COUNT'=> 'Count', + 'S_SECONDS_SMALL'=> 'seconds', + 'S_MINUTES_SMALL'=> 'minutes', 'S_5_SECONDS'=> '5 seconds', 'S_10_SECONDS'=> '10 seconds', 'S_30_SECONDS'=> '30 seconds', |
