diff options
| author | artem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2007-12-14 15:14:24 +0000 |
|---|---|---|
| committer | artem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2007-12-14 15:14:24 +0000 |
| commit | beb9fbcdd9d8d9b5b9c6e5d9c6c1af91caf3dfea (patch) | |
| tree | 131965548929548eac6d51236a437f8d0d65ba4f /frontends/php/include | |
| parent | 38591cdcd09a97021d0cf109fbd75978c8632f06 (diff) | |
| download | zabbix-beb9fbcdd9d8d9b5b9c6e5d9c6c1af91caf3dfea.tar.gz zabbix-beb9fbcdd9d8d9b5b9c6e5d9c6c1af91caf3dfea.tar.xz zabbix-beb9fbcdd9d8d9b5b9c6e5d9c6c1af91caf3dfea.zip | |
- [DEV-85] improvements to graph navigations (Artem)
git-svn-id: svn://svn.zabbix.com/trunk@5177 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include')
| -rw-r--r-- | frontends/php/include/config.inc.php | 23 | ||||
| -rw-r--r-- | frontends/php/include/graphs.inc.php | 41 | ||||
| -rw-r--r-- | frontends/php/include/locales/en_gb.inc.php | 6 |
3 files changed, 27 insertions, 43 deletions
diff --git a/frontends/php/include/config.inc.php b/frontends/php/include/config.inc.php index 202ec64c..b0e6bdb3 100644 --- a/frontends/php/include/config.inc.php +++ b/frontends/php/include/config.inc.php @@ -646,11 +646,11 @@ function TODO($msg) { echo "TODO: ".$msg.SBR; } // DEBUG INFO!!! break; case PAGE_TYPE_HTML: default: - echo "<p align=center>"; - echo "<font color='".((!$bool) ? "#AA0000" : "#223344")."'>"; - echo "<b>[".htmlspecialchars($msg)."]</b>"; - echo "</font>"; - echo "</p>"; + $p = new CTag('p','yes'); + $p->AddOption('align','center'); + $p->AddOption('style','color: '.((!$bool)?'#AA0000;':'#223344;')); + $p->AddItem(bold('['.$msg.']')); + $p->Show(); break; } } @@ -1028,7 +1028,7 @@ function TODO($msg) { echo "TODO: ".$msg.SBR; } // DEBUG INFO!!! function show_history($itemid,$from,$stime,$period) { $till=date(S_DATE_FORMAT_YMDHMS,time(NULL)-$from*3600); - show_table_header("TILL $till (".($period/3600)." HOURs)"); + show_table_header(S_TILL.SPACE.$till.' ('.($period/3600).' HOURs)'); $td = new CCol(get_js_sizeable_graph('graph','chart.php?itemid='.$itemid. url_param($from,false,'from'). @@ -1037,7 +1037,7 @@ function TODO($msg) { echo "TODO: ".$msg.SBR; } // DEBUG INFO!!! $td->AddOption('align','center'); $tr = new CRow($td); - $tr->AddOption('bgcolor','$dddddd'); + $tr->AddOption('bgcolor','#dddddd'); $table = new CTable(); $table->AddOption('width','100%'); @@ -1051,17 +1051,14 @@ function TODO($msg) { echo "TODO: ".$msg.SBR; } // DEBUG INFO!!! } - function get_status() - { + function get_status(){ global $DB_TYPE; $status = array(); // server - if( (exec("ps -ef|grep zabbix_server|grep -v grep|wc -l")>0) || (exec("ps -ax|grep zabbix_server|grep -v grep|wc -l")>0) ) - { + if( (exec('ps -ef|grep zabbix_server|grep -v grep|wc -l')>0) || (exec('ps -ax|grep zabbix_server|grep -v grep|wc -l')>0) ){ $status["zabbix_server"] = S_YES; } - else - { + else{ $status["zabbix_server"] = S_NO; } diff --git a/frontends/php/include/graphs.inc.php b/frontends/php/include/graphs.inc.php index b4d1bde0..77d8a3e9 100644 --- a/frontends/php/include/graphs.inc.php +++ b/frontends/php/include/graphs.inc.php @@ -805,42 +805,23 @@ return $result; } - function navigation_bar_calc() - { -// $workingperiod = 3600; + function navigation_bar_calc(){ if(!isset($_REQUEST["period"])) $_REQUEST["period"]=ZBX_PERIOD_DEFAULT; if(!isset($_REQUEST["from"])) $_REQUEST["from"]=0; if(!isset($_REQUEST["stime"])) $_REQUEST["stime"]=null; - -// if(isset($_REQUEST["inc"])) $workingperiod= $_REQUEST["period"]+$_REQUEST["inc"]; -// if(isset($_REQUEST["dec"])) $workingperiod= $workingperiod-$_REQUEST["dec"]; - if(isset($_REQUEST["inc"])) $_REQUEST["period"] += $_REQUEST["inc"]; - if(isset($_REQUEST["dec"])) $_REQUEST["period"] -= $_REQUEST["dec"]; - - if(isset($_REQUEST["left"])) $_REQUEST["from"] += $_REQUEST["left"]; - if(isset($_REQUEST["right"])) $_REQUEST["from"] -= $_REQUEST["right"]; - - //unset($_REQUEST["inc"]); - //unset($_REQUEST["dec"]); - unset($_REQUEST["left"]); - unset($_REQUEST["right"]); - - if($_REQUEST["from"] <= 0) $_REQUEST["from"] = 0; - if($_REQUEST["period"] <= ZBX_MIN_PERIOD) $_REQUEST["period"] = ZBX_MIN_PERIOD; - - if(isset($_REQUEST["reset"])) - { - $_REQUEST["period"] = ZBX_PERIOD_DEFAULT; - $_REQUEST["from"] = 0; -// $workingperiod = 3600; + + if($_REQUEST['period']<ZBX_MIN_PERIOD){ + show_message(S_WARNING.'. '.S_TIME_PERIOD.SPACE.S_MIN_VALUE_SMALL.': '.ZBX_MIN_PERIOD.' ('.(int)(ZBX_MIN_PERIOD/3600).'h)'); + $_REQUEST['period'] = ZBX_MIN_PERIOD; } - - return $_REQUEST["period"]; -// return $workingperiod; + else if($_REQUEST['period'] > ZBX_MAX_PERIOD){ + show_message(S_WARNING.'. '.S_TIME_PERIOD.SPACE.S_MAX_VALUE_SMALL.': '.ZBX_MAX_PERIOD.' ('.(int)(ZBX_MAX_PERIOD/86400).'d)'); + $_REQUEST['period'] = ZBX_MAX_PERIOD; + } + return $_REQUEST["period"]; } - function navigation_bar($url,$ext_saved_request=NULL) - { + function navigation_bar($url,$ext_saved_request=NULL){ $saved_request = array("screenid","itemid","action","from","fullscreen"); if(is_array($ext_saved_request)) diff --git a/frontends/php/include/locales/en_gb.inc.php b/frontends/php/include/locales/en_gb.inc.php index 4cfeca29..80fa4bff 100644 --- a/frontends/php/include/locales/en_gb.inc.php +++ b/frontends/php/include/locales/en_gb.inc.php @@ -218,6 +218,8 @@ 'S_TRIGGER_SEVERITY'=> 'Trigger severity', 'S_TRIGGER_VALUE'=> 'Trigger value', 'S_TIME_PERIOD'=> 'Time period', + 'S_MAX_VALUE_SMALL'=> 'max value', + 'S_MIN_VALUE_SMALL'=> 'min value', 'S_TRIGGER_DESCRIPTION'=> 'Trigger description', 'S_CONDITIONS'=> 'Conditions', 'S_CONDITION'=> 'Condition', @@ -554,6 +556,10 @@ 'S_REQUIRED_ITEMS_FOR_GRAPH'=> 'Required items for graph', // history.php + 'S_SECONDS_SMALL'=> 'seconds', + 'S_TILL_SMALL'=> 'till', + 'S_SELECT_ROWS_WITH_VALUE_LIKE'=>'Select rows with value like', + 'S_SHOWING_HISTORY_OF'=> 'Showing history of', 'S_LAST_HOUR_GRAPH'=> 'Last hour graph', 'S_LAST_WEEK_GRAPH'=> 'Last week graph', 'S_LAST_MONTH_GRAPH'=> 'Last month graph', |
