summaryrefslogtreecommitdiffstats
path: root/frontends/php/include
diff options
context:
space:
mode:
authorosmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-03-16 13:36:24 +0000
committerosmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-03-16 13:36:24 +0000
commit4990e4cbc635b6ff953481e7d1147a39664d6a2b (patch)
tree8626b69277c5b76bf8ead551a2a3e78562a9131f /frontends/php/include
parentdf2d967e519775ef67c7e004199fe52caea58f1d (diff)
- developed PopUp menu for itemoveviw screen (Eugene)
git-svn-id: svn://svn.zabbix.com/trunk@3893 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include')
-rw-r--r--frontends/php/include/items.inc.php50
-rw-r--r--frontends/php/include/locales/en_gb.inc.php2
-rw-r--r--frontends/php/include/triggers.inc.php26
3 files changed, 65 insertions, 13 deletions
diff --git a/frontends/php/include/items.inc.php b/frontends/php/include/items.inc.php
index c9cc76d2..ad150b20 100644
--- a/frontends/php/include/items.inc.php
+++ b/frontends/php/include/items.inc.php
@@ -742,19 +742,61 @@ COpt::profiling_start('prepare table');
$table_row = array(nbsp($descr));
foreach($hosts as $hostname)
{
- $style = NULL;
+ $css_class = NULL;
+ unset($it_ov_menu);
+
$value = '-';
if(isset($ithosts[$hostname]))
{
if($ithosts[$hostname]['tr_value'] == TRIGGER_VALUE_TRUE)
- $style = get_severity_style($ithosts[$hostname]['severity']);
+ $css_class = get_severity_style($ithosts[$hostname]['severity']);
$value = format_lastvalue($ithosts[$hostname]);
+
+ $it_ov_menu = array(
+ array(S_VALUES, null, null,
+ array('outer'=> array('pum_oheader'), 'inner'=>array('pum_iheader'))),
+ array(S_500_LATEST_VALUES, 'history.php?action=showlatest&itemid='.$ithosts[$hostname]['itemid'],
+ array('tw'=>'_blank'))
+ );
+
+ switch($ithosts[$hostname]['value_type'])
+ {
+ case ITEM_VALUE_TYPE_UINT64:
+ case ITEM_VALUE_TYPE_FLOAT:
+ $it_ov_menu = array_merge(array(
+ /* name, url, (target [tw], statusbar [sb]), css, submenu */
+ array(S_GRAPHS, null, null,
+ array('outer'=> array('pum_oheader'), 'inner'=>array('pum_iheader'))
+ ),
+ array(S_LAST_HOUR_GRAPH, 'history.php?period=3600&action=showgraph&itemid='.
+ $ithosts[$hostname]['itemid'], array('tw'=>'_blank')),
+ array(S_LAST_WEEK_GRAPH, 'history.php?period=604800&action=showgraph&itemid='.
+ $ithosts[$hostname]['itemid'], array('tw'=>'_blank')),
+ array(S_LAST_MONTH_GRAPH, 'history.php?period=2678400&action=showgraph&itemid='.
+ $ithosts[$hostname]['itemid'], array('tw'=>'_blank'))
+ ), $it_ov_menu);
+ break;
+ default:
+ break;
+ }
}
- if($value == '-') $style = 'center';
+ if($value == '-') $css_class = 'center';
+ $value_col = new CCol($value,$css_class);
+
+ if(isset($it_ov_menu))
+ {
+ $it_ov_menu = new CPUMenu($it_ov_menu,170);
+ $value_col->OnClick($it_ov_menu->GetOnActionJS());
+ $value_col->AddOption('style', 'cursor: pointer;');
+ $value_col->AddAction('onmouseover',
+ 'this.old_border=this.style.border; this.style.border=\'1px dotted #0C0CF0\'');
+ $value_col->AddAction('onmouseout', 'this.style.border=this.old_border;');
+ unset($it_ov_menu);
+ }
- array_push($table_row,new CCol($value,$style));
+ array_push($table_row,$value_col);
}
$table->AddRow($table_row);
}
diff --git a/frontends/php/include/locales/en_gb.inc.php b/frontends/php/include/locales/en_gb.inc.php
index eab54baa..1dd8d99b 100644
--- a/frontends/php/include/locales/en_gb.inc.php
+++ b/frontends/php/include/locales/en_gb.inc.php
@@ -458,6 +458,8 @@
// history.php
"S_LAST_HOUR_GRAPH"=> "Last hour graph",
+ "S_LAST_WEEK_GRAPH"=> "Last week graph",
+ "S_LAST_MONTH_GRAPH"=> "Last month graph",
"S_VALUES_OF_LAST_HOUR"=> "Values of last hour",
"S_500_LATEST_VALUES"=> "500 latest values",
"S_GRAPH_OF_SPECIFIED_PERIOD"=> "Graph of specified period",
diff --git a/frontends/php/include/triggers.inc.php b/frontends/php/include/triggers.inc.php
index a2956927..0aa17e53 100644
--- a/frontends/php/include/triggers.inc.php
+++ b/frontends/php/include/triggers.inc.php
@@ -1131,27 +1131,30 @@
$table_row = array(nbsp($descr));
foreach($hosts as $hostname)
{
- $style = NULL;
+ $css_class = NULL;
+
unset($tr_ov_menu);
if(isset($trhosts[$hostname]))
{
switch($trhosts[$hostname]['value'])
{
case TRIGGER_VALUE_TRUE:
- $style = get_severity_style($trhosts[$hostname]['priority']);
+ $css_class = get_severity_style($trhosts[$hostname]['priority']);
break;
case TRIGGER_VALUE_FALSE:
- $style = 'normal';
+ $css_class = 'normal';
default:
- $style = 'unknown_trigger';
+ $css_class = 'unknown_trigger';
}
+ $style = 'cursor: pointer; ';
+
if((time(NULL)-$trhosts[$hostname]['lastchange'])<300)
- $style_img = 'background-image: url(images/gradients/blink1.gif); '.
+ $style .= 'background-image: url(images/gradients/blink1.gif); '.
'background-position: top left; '.
'background-repeat: repeate;';
elseif((time(NULL)-$trhosts[$hostname]['lastchange'])<900)
- $style_img = 'background-image: url(images/gradients/blink2.gif); '.
+ $style .= 'background-image: url(images/gradients/blink2.gif); '.
'background-position: top left; '.
'background-repeat: repeate;';
@@ -1212,14 +1215,19 @@
unset($item_menu);
}
- $status_col = new CCol(SPACE,$style);
- if(isset($style_img))
- $status_col->AddOption('style', $style_img);
+ $status_col = new CCol(SPACE,$css_class);
+ if(isset($style))
+ {
+ $status_col->AddOption('style', $style);
+ }
if(isset($tr_ov_menu))
{
$tr_ov_menu = new CPUMenu($tr_ov_menu,170);
$status_col->OnClick($tr_ov_menu->GetOnActionJS());
+ $status_col->AddAction('onmouseover',
+ 'this.old_border=this.style.border; this.style.border=\'1px dotted #0C0CF0\'');
+ $status_col->AddAction('onmouseout', 'this.style.border=this.old_border;');
}
array_push($table_row,$status_col);
}