diff options
author | artem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2008-08-05 14:25:48 +0000 |
---|---|---|
committer | artem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2008-08-05 14:25:48 +0000 |
commit | d1eb7d75f8caecbc8ca72210e3c6f0bfb9dec6a6 (patch) | |
tree | f18f050c04221aa5814641e2cd8f455fb10786d5 /frontends | |
parent | e33e68fccdfdabd17ff8ce5f818dbed7f58e301e (diff) | |
download | zabbix-d1eb7d75f8caecbc8ca72210e3c6f0bfb9dec6a6.tar.gz zabbix-d1eb7d75f8caecbc8ca72210e3c6f0bfb9dec6a6.tar.xz zabbix-d1eb7d75f8caecbc8ca72210e3c6f0bfb9dec6a6.zip |
- [DEV-137] changed trigger values definitions (Artem)
- [DEV-191] latest data reverted to standart refresh (Artem)
- [DEV-191] added hats to graphs, screens pages (Artem)
git-svn-id: svn://svn.zabbix.com/trunk@5873 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends')
-rw-r--r-- | frontends/php/blocks/latest.page.php | 389 | ||||
-rw-r--r-- | frontends/php/charts.php | 81 | ||||
-rw-r--r-- | frontends/php/events.php | 14 | ||||
-rw-r--r-- | frontends/php/include/events.inc.php | 32 | ||||
-rw-r--r-- | frontends/php/include/forms.inc.php | 25 | ||||
-rw-r--r-- | frontends/php/include/locales/en_gb.inc.php | 64 | ||||
-rw-r--r-- | frontends/php/include/triggers.inc.php | 4 | ||||
-rw-r--r-- | frontends/php/latest.php | 400 | ||||
-rw-r--r-- | frontends/php/maps.php | 59 | ||||
-rw-r--r-- | frontends/php/screens.php | 188 | ||||
-rw-r--r-- | frontends/php/tr_status.php | 16 |
11 files changed, 630 insertions, 642 deletions
diff --git a/frontends/php/blocks/latest.page.php b/frontends/php/blocks/latest.page.php deleted file mode 100644 index 17350330..00000000 --- a/frontends/php/blocks/latest.page.php +++ /dev/null @@ -1,389 +0,0 @@ -<?php - validate_sort_and_sortorder('i.description',ZBX_SORT_UP); - - $options = array('allow_all_hosts','monitored_hosts','with_monitored_items'); - - $_REQUEST['hostid'] = get_request('hostid',get_profile('web.latest.last.hostid', null, PROFILE_TYPE_ID)); - if(is_null($_REQUEST['hostid'])){ - array_push($options,'always_select_first_host'); - - $_REQUEST['groupid'] = get_request('groupid',get_profile('web.latest.last.groupid', null, PROFILE_TYPE_ID)); - if(is_null($_REQUEST['groupid'])){ - validate_group(PERM_READ_ONLY,array('allow_all_hosts','monitored_hosts','with_monitored_items','always_select_first_group'),'web.latest.last.groupid'); - } - } - - if(!$ZBX_WITH_SUBNODES) array_push($options,'only_current_node'); - - validate_group_with_host(PERM_READ_ONLY,$options,'web.latest.last.groupid','web.latest.last.hostid'); - -?> -<?php - - $_REQUEST['select'] = get_request('select',''); - - $_REQUEST['groupbyapp'] = get_request('groupbyapp',get_profile('web.latest.groupbyapp',1)); - update_profile('web.latest.groupbyapp',$_REQUEST['groupbyapp'],PROFILE_TYPE_INT); - - $_REQUEST['applications'] = get_request('applications',get_profile('web.latest.applications',array(),PROFILE_TYPE_ARRAY_ID)); - - if(isset($_REQUEST['open'])){ - if(!isset($_REQUEST['applicationid'])){ - $_REQUEST['applications'] = array(); - $show_all_apps = 1; - } - else if(!uint_in_array($_REQUEST['applicationid'],$_REQUEST['applications'])){ - array_push($_REQUEST['applications'],$_REQUEST['applicationid']); - } - - } - else if(isset($_REQUEST['close'])){ - if(!isset($_REQUEST['applicationid'])){ - $_REQUEST['applications'] = array(); - } - else if(($i=array_search($_REQUEST['applicationid'], $_REQUEST['applications'])) !== FALSE){ - unset($_REQUEST['applications'][$i]); - } - } - - /* limit opened application count */ - while(count($_REQUEST['applications']) > 25){ - array_shift($_REQUEST['applications']); - } - - update_profile('web.latest.applications',$_REQUEST['applications'],PROFILE_TYPE_ARRAY_ID); -?> -<?php - -// Header - $r_form = new CForm(); - $r_form->SetMethod('get'); -// $r_form->AddOption('onsubmit',"return updater.onetime_update('".ZBX_PAGE_MAIN_HAT."',this.form);"); - - $r_form->AddVar("select",$_REQUEST["select"]); - - $cmbGroup = new CComboBox("groupid",$_REQUEST["groupid"],"javascript: return updater.onetime_update('".ZBX_PAGE_MAIN_HAT."',this.form);"); - $cmbHosts = new CComboBox("hostid",$_REQUEST["hostid"],"javascript: return updater.onetime_update('".ZBX_PAGE_MAIN_HAT."',this.form);"); - - - $cmbGroup->AddItem(0,S_ALL_SMALL); - $cmbHosts->AddItem(0,S_ALL_SMALL); - - $available_groups= get_accessible_groups_by_user($USER_DETAILS,PERM_READ_LIST); - $available_hosts = get_accessible_hosts_by_user($USER_DETAILS,PERM_READ_LIST,PERM_RES_IDS_ARRAY); - - $result=DBselect('SELECT DISTINCT g.groupid,g.name '. - ' FROM groups g, hosts_groups hg, hosts h, items i '. - ' WHERE g.groupid in ('.$available_groups.') '. - ' AND hg.groupid=g.groupid '. - ' AND h.status='.HOST_STATUS_MONITORED. - ' AND h.hostid=i.hostid '. - ' AND hg.hostid=h.hostid '. - ' AND i.status='.ITEM_STATUS_ACTIVE. - ' ORDER BY g.name'); - while($row=DBfetch($result)){ - $cmbGroup->AddItem( - $row['groupid'], - get_node_name_by_elid($row['groupid']).$row['name'] - ); - } - $r_form->AddItem(array(S_GROUP.SPACE,$cmbGroup)); - - if($_REQUEST['groupid'] > 0){ - $sql='SELECT DISTINCT h.hostid,h.host '. - ' FROM hosts h,items i,hosts_groups hg '. - ' WHERE h.status='.HOST_STATUS_MONITORED. - ' AND h.hostid=i.hostid '. - ' AND hg.groupid='.$_REQUEST['groupid']. - ' AND hg.hostid=h.hostid'. - ' AND i.status='.ITEM_STATUS_ACTIVE. - ' AND '.DBcondition('h.hostid',$available_hosts). - ' ORDER BY h.host'; - } - else{ - $sql='SELECT DISTINCT h.hostid,h.host '. - ' FROM hosts h,items i '. - ' WHERE h.status='.HOST_STATUS_MONITORED. - ' AND i.status='.ITEM_STATUS_ACTIVE. - ' AND h.hostid=i.hostid'. - ' AND '.DBcondition('h.hostid',$available_hosts). - ' ORDER BY h.host'; - } - - $result=DBselect($sql); - while($row=DBfetch($result)){ - $cmbHosts->AddItem( - $row['hostid'], - get_node_name_by_elid($row['hostid']).$row['host'] - ); - } - - $r_form->AddItem(array(SPACE.S_HOST.SPACE,$cmbHosts)); - - $l_form = new CForm(); - $l_form->SetMethod('get'); - - $l_form->AddVar("hostid",$_REQUEST["hostid"]); - $l_form->AddVar("groupid",$_REQUEST["groupid"]); - - $l_form->AddItem(array(S_SHOW_ITEMS_WITH_DESCRIPTION_LIKE, new CTextBox("select",$_REQUEST["select"],20))); - $l_form->AddItem(array(SPACE, new CButton("show",S_SHOW,"javascript: return updater.onetime_update('".ZBX_PAGE_MAIN_HAT."',this.form);"))); - - show_table_header($l_form,$r_form); -//------------- - -?> -<?php - if(isset($show_all_apps)){ - $url = '?close=1'. - url_param('groupid'). - url_param('hostid'). - url_param('applications'). - url_param('select'); - - $link = new CLink(new CImg("images/general/opened.gif"),$url,null,"javascript: return updater.onetime_update('".ZBX_PAGE_MAIN_HAT."','".$url."');"); - } - else{ - $url = '?open=1'. - url_param('groupid'). - url_param('hostid'). - url_param('applications'). - url_param('select'); - - $link = new CLink(new CImg("images/general/closed.gif"),$url,null,"javascript: return updater.onetime_update('".ZBX_PAGE_MAIN_HAT."','".$url."');"); - } - - $table=new CTableInfo(); - $table->SetHeader(array( - is_show_subnodes()?make_sorting_link(S_NODE,'h.hostid') : null, - ($_REQUEST["hostid"] ==0)?make_sorting_link(S_HOST,'h.host') : NULL, - array($link,SPACE,make_sorting_link(S_DESCRIPTION,'i.description')), - make_sorting_link(S_LAST_CHECK,'i.lastclock'), - S_LAST_VALUE, - S_CHANGE, - S_HISTORY)); - -// $table->ShowStart(); - - $compare_host = $_REQUEST['hostid']?' AND h.hostid='.$_REQUEST['hostid']:''; - $compare_host.= $_REQUEST['groupid']?' AND hg.hostid=h.hostid AND hg.groupid ='.$_REQUEST['groupid']:''; - - $db_applications = DBselect('SELECT DISTINCT h.host,h.hostid,a.* '. - ' FROM applications a, hosts h'.($_REQUEST['groupid']?', hosts_groups hg ':''). - ' WHERE a.hostid=h.hostid'. - $compare_host. - ' AND '.DBcondition('h.hostid',$available_hosts). - ' AND h.status='.HOST_STATUS_MONITORED. - order_by('h.host,h.hostid','a.name,a.applicationid')); - - while($db_app = DBfetch($db_applications)){ - $db_items = DBselect('SELECT DISTINCT i.* '. - ' FROM items i,items_applications ia'. - ' WHERE ia.applicationid='.$db_app['applicationid']. - ' AND i.itemid=ia.itemid'. - ' AND i.status='.ITEM_STATUS_ACTIVE. - order_by('i.description,i.itemid,i.lastclock')); - - $app_rows = array(); - $item_cnt = 0; - while($db_item = DBfetch($db_items)){ - $description = item_description($db_item["description"],$db_item["key_"]); - - if(!empty($_REQUEST["select"]) && !zbx_stristr($description, $_REQUEST["select"]) ) continue; - - ++$item_cnt; - if(!uint_in_array($db_app["applicationid"],$_REQUEST["applications"]) && !isset($show_all_apps)) continue; - - if(isset($db_item["lastclock"])) - $lastclock=date(S_DATE_FORMAT_YMDHMS,$db_item["lastclock"]); - else - $lastclock = new CCol('-', 'center'); - - $lastvalue=format_lastvalue($db_item); - - if( isset($db_item["lastvalue"]) && isset($db_item["prevvalue"]) && - ($db_item["value_type"] == 0) && ($db_item["lastvalue"]-$db_item["prevvalue"] != 0) ) - { - if($db_item["lastvalue"]-$db_item["prevvalue"]<0){ - $change=convert_units($db_item["lastvalue"]-$db_item["prevvalue"],$db_item["units"]); - } - else{ - $change="+".convert_units($db_item["lastvalue"]-$db_item["prevvalue"],$db_item["units"]); - } - $change=nbsp($change); - } - else{ - $change=new CCol("-","center"); - } - - if(($db_item["value_type"]==ITEM_VALUE_TYPE_FLOAT) || ($db_item["value_type"]==ITEM_VALUE_TYPE_UINT64)){ - $actions=new CLink(S_GRAPH,"history.php?action=showgraph&itemid=".$db_item["itemid"],"action"); - } - else{ - $actions=new CLink(S_HISTORY,"history.php?action=showvalues&period=3600&itemid=".$db_item["itemid"],"action"); - } - - array_push($app_rows, new CRow(array( - is_show_subnodes()?SPACE:null, - ($_REQUEST["hostid"]>0)?NULL:SPACE, - str_repeat(SPACE,6).$description, - $lastclock, - new CCol($lastvalue, $lastvalue=='-' ? 'center' : null), - $change, - $actions - ))); - } - - if($item_cnt > 0){ - if(uint_in_array($db_app["applicationid"],$_REQUEST["applications"]) || isset($show_all_apps)){ - $url = '?close=1&applicationid='.$db_app["applicationid"]. - url_param('groupid'). - url_param('hostid'). - url_param('applications'). - url_param('fullscreen'). - url_param('select'); - - $link = new CLink(new CImg("images/general/opened.gif"),$url,null,"javascript: return updater.onetime_update('".ZBX_PAGE_MAIN_HAT."','".$url."');"); - } - else{ - $url = '?open=1&applicationid='.$db_app["applicationid"]. - url_param('groupid'). - url_param('hostid'). - url_param('applications'). - url_param('fullscreen'). - url_param('select'); - - $link = new CLink(new CImg("images/general/closed.gif"),$url,null,"javascript: return updater.onetime_update('".ZBX_PAGE_MAIN_HAT."','".$url."');"); - } - - $col = new CCol(array($link,SPACE,bold($db_app["name"]),SPACE.'('.$item_cnt.SPACE.S_ITEMS.')')); - $col->SetColSpan(5); - - $table->AddRow(array( - get_node_name_by_elid($db_app['hostid']), - ($_REQUEST["hostid"]>0)?NULL:$db_app["host"], - $col - )); - - foreach($app_rows as $row) $table->AddRow($row); - } - } - - - $sql = 'SELECT DISTINCT h.host,h.hostid '. - ' FROM hosts h'.($_REQUEST['groupid']?', hosts_groups hg ':'').', items i '. - ' LEFT JOIN items_applications ia ON ia.itemid=i.itemid'. - ' WHERE ia.itemid is NULL '. - $compare_host. - ' AND h.hostid=i.hostid '. - ' AND h.status='.HOST_STATUS_MONITORED. - ' AND i.status='.ITEM_STATUS_ACTIVE. - ' AND '.DBcondition('h.hostid',$available_hosts). - ' ORDER BY h.host'; - - $db_appitems = DBselect($sql); - - while($db_appitem = DBfetch($db_appitems)){ - - $sql = 'SELECT h.host,h.hostid,i.* '. - ' FROM hosts h'.($_REQUEST['groupid']?', hosts_groups hg ':'').', items i '. - ' LEFT JOIN items_applications ia ON ia.itemid=i.itemid'. - ' WHERE ia.itemid is NULL '. - $compare_host. - ' AND h.hostid=i.hostid '. - ' AND h.status='.HOST_STATUS_MONITORED. - ' AND i.status='.ITEM_STATUS_ACTIVE. - ' AND h.hostid='.$db_appitem['hostid']. - ' ORDER BY i.description,i.itemid'; - - $db_items = DBselect($sql); - - $app_rows = array(); - $item_cnt = 0; - - while($db_item = DBfetch($db_items)){ - $description = item_description($db_item["description"],$db_item["key_"]); - - if(!empty($_REQUEST["select"]) && !zbx_stristr($description, $_REQUEST["select"]) ) continue; - - ++$item_cnt; - - if(!uint_in_array(0,$_REQUEST["applications"]) && !isset($show_all_apps)) continue; - - if(isset($db_item["lastclock"])) - $lastclock=zbx_date2str(S_DATE_FORMAT_YMDHMS,$db_item["lastclock"]); - else - $lastclock = new CCol('-', 'center'); - - $lastvalue=format_lastvalue($db_item); - - if( isset($db_item["lastvalue"]) && isset($db_item["prevvalue"]) && - ($db_item["value_type"] == ITEM_VALUE_TYPE_FLOAT || $db_item["value_type"] == ITEM_VALUE_TYPE_UINT64) && - ($db_item["lastvalue"]-$db_item["prevvalue"] != 0) ) - { - if($db_item["lastvalue"]-$db_item["prevvalue"]<0){ - $change=convert_units($db_item["lastvalue"]-$db_item["prevvalue"],$db_item["units"]); - $change=nbsp($change); - } - else{ - $change="+".convert_units($db_item["lastvalue"]-$db_item["prevvalue"],$db_item["units"]); - $change=nbsp($change); - } - } - else{ - $change=new CCol("-","center"); - } - - if(($db_item["value_type"]==ITEM_VALUE_TYPE_FLOAT) || ($db_item["value_type"]==ITEM_VALUE_TYPE_UINT64)){ - $actions=new CLink(S_GRAPH,"history.php?action=showgraph&itemid=".$db_item["itemid"],"action"); - } - else{ - $actions=new CLink(S_HISTORY,"history.php?action=showvalues&period=3600&itemid=".$db_item["itemid"],"action"); - } - - array_push($app_rows, new CRow(array( - is_show_subnodes()?($item_cnt?SPACE:get_node_name_by_elid($db_item['itemid'])):null, - $_REQUEST["hostid"]?NULL:($item_cnt?SPACE:$db_item["host"]), - str_repeat(SPACE, 6).$description, - $lastclock, - new CCol($lastvalue, $lastvalue == '-' ? 'center' : null), - $change, - $actions - ))); - } - - if($item_cnt > 0){ - - if(uint_in_array(0,$_REQUEST["applications"]) || isset($show_all_apps)){ - $url = '?close=1&applicationid=0'. - url_param('groupid'). - url_param('hostid'). - url_param('applications'). - url_param('select'); - - $link = new CLink(new CImg("images/general/opened.gif"),$url,null,"javascript: return updater.onetime_update('".ZBX_PAGE_MAIN_HAT."','".$url."');"); - } - else{ - $url = '?open=1&applicationid=0'. - url_param('groupid'). - url_param('hostid'). - url_param('applications'). - url_param('select'); - $link = new CLink(new CImg("images/general/closed.gif"),$url,null,"javascript: return updater.onetime_update('".ZBX_PAGE_MAIN_HAT."','".$url."');"); - } - - $col = new CCol(array($link,SPACE,bold(S_MINUS_OTHER_MINUS),SPACE.'('.$item_cnt.SPACE.S_ITEMS.')')); - $col->SetColSpan(5); - - $table->AddRow(array( - get_node_name_by_elid($db_appitem['hostid']), - $_REQUEST["hostid"] > 0 ? NULL : $db_appitem["host"], - $col - )); - - foreach($app_rows as $row) $table->AddRow($row); - } - } - - $table->Show(); -?>
\ No newline at end of file diff --git a/frontends/php/charts.php b/frontends/php/charts.php index 5b4a03a3..0243c331 100644 --- a/frontends/php/charts.php +++ b/frontends/php/charts.php @@ -50,16 +50,21 @@ include_once 'include/page_header.php'; //ajax 'favobj'=> array(T_ZBX_STR, O_OPT, P_ACT, NULL, NULL), - 'favid'=> array(T_ZBX_STR, O_OPT, P_ACT, NOT_EMPTY, 'isset({favobj})') - - ); + 'favid'=> array(T_ZBX_STR, O_OPT, P_ACT, NOT_EMPTY, 'isset({favobj})'), + 'state'=> array(T_ZBX_INT, O_OPT, P_ACT, NOT_EMPTY, 'isset({favobj})'), + 'action'=> array(T_ZBX_STR, O_OPT, P_ACT, IN("'add','remove'"),NULL) + ); + check_fields($fields); ?> <?php if(isset($_REQUEST['favobj'])){ - if(str_in_array($_REQUEST['favobj'],array('itemid','graphid'))){ + if('hat' == $_REQUEST['favobj']){ + update_profile('web.charts.hats.'.$_REQUEST['favid'].'.state',$_REQUEST['state'], PROFILE_TYPE_INT); + } + else if(str_in_array($_REQUEST['favobj'],array('itemid','graphid'))){ $result = false; if('add' == $_REQUEST['action']){ $result = add2favorites('web.favorite.graphids',$_REQUEST['favid'],$_REQUEST['favobj']); @@ -125,7 +130,7 @@ include_once 'include/page_header.php'; update_profile('web.charts.graphid',$_REQUEST['graphid']); - $h1 = array(S_GRAPHS_BIG.SPACE.'/'.SPACE); + $h1 = array(); $available_groups = get_accessible_groups_by_user($USER_DETAILS,PERM_READ_LIST); $available_hosts = get_accessible_hosts_by_user($USER_DETAILS,PERM_READ_LIST,PERM_RES_IDS_ARRAY); @@ -144,6 +149,8 @@ include_once 'include/page_header.php'; array_push($h1, S_SELECT_GRAPH_TO_DISPLAY); } + $p_elements = array(); + $r_form = new CForm(); $r_form->SetMethod('get'); @@ -287,32 +294,7 @@ include_once 'include/page_header.php'; $r_form->AddItem(array(SPACE.S_GRAPH.SPACE,$cmbGraph)); - if($_REQUEST['graphid'] > 0){ - if(infavorites('web.favorite.graphids',$_REQUEST['graphid'],'graphid')){ - $icon = new CDiv(SPACE,'iconminus'); - $icon->AddOption('title',S_REMOVE_FROM.' '.S_FAVORITES); - $icon->AddAction('onclick',new CScript("javascript: rm4favorites('graphid','".$_REQUEST['graphid']."',0);")); - } - else{ - $icon = new CDiv(SPACE,'iconplus'); - $icon->AddOption('title',S_ADD_TO.' '.S_FAVORITES); - $icon->AddAction('onclick',new CScript("javascript: add2favorites('graphid','".$_REQUEST['graphid']."');")); - } - $icon->AddOption('id','addrm_fav'); - - $url = '?graphid='.$_REQUEST['graphid'].($_REQUEST['fullscreen']?'':'&fullscreen=1'); - - $fs_icon = new CDiv(SPACE,'fullscreen'); - $fs_icon->AddOption('title',$_REQUEST['fullscreen']?S_NORMAL.' '.S_VIEW:S_FULLSCREEN); - $fs_icon->AddAction('onclick',new CScript("javascript: document.location = '".$url."';")); - - $icon_tab = new CTable(); - $icon_tab->AddRow(array($fs_icon,$icon,SPACE,$h1)); - - $h1 = $icon_tab; - } - - show_table_header($h1, $r_form); + $p_elements[] = get_table_header($h1, $r_form); ?> <?php $table = new CTableInfo('...','chart'); @@ -379,8 +361,41 @@ include_once 'include/page_header.php'; $table->AddRow(new CScript($row)); } - $table->Show(); - echo SBR; + + $p_elements[] = $table; + $p_elements[] = BR(); + + $icon = null; + $fs_icon = null; + if($_REQUEST['graphid'] > 0){ + if(infavorites('web.favorite.graphids',$_REQUEST['graphid'],'graphid')){ + $icon = new CDiv(SPACE,'iconminus'); + $icon->AddOption('title',S_REMOVE_FROM.' '.S_FAVORITES); + $icon->AddAction('onclick',new CScript("javascript: rm4favorites('graphid','".$_REQUEST['graphid']."',0);")); + } + else{ + $icon = new CDiv(SPACE,'iconplus'); + $icon->AddOption('title',S_ADD_TO.' '.S_FAVORITES); + $icon->AddAction('onclick',new CScript("javascript: add2favorites('graphid','".$_REQUEST['graphid']."');")); + } + $icon->AddOption('id','addrm_fav'); + + $url = '?graphid='.$_REQUEST['graphid'].($_REQUEST['fullscreen']?'':'&fullscreen=1'); + + $fs_icon = new CDiv(SPACE,'fullscreen'); + $fs_icon->AddOption('title',$_REQUEST['fullscreen']?S_NORMAL.' '.S_VIEW:S_FULLSCREEN); + $fs_icon->AddAction('onclick',new CScript("javascript: document.location = '".$url."';")); + } + + $charts_hat = create_hat( + S_GRAPHS_BIG, + $p_elements, + array($icon,$fs_icon), + 'hat_charts', + get_profile('web.charts.hats.hat_charts.state',1) + ); + + $charts_hat->Show(); if($_REQUEST['graphid'] > 0){ // NAV BAR diff --git a/frontends/php/events.php b/frontends/php/events.php index 2f05f971..bbf6a067 100644 --- a/frontends/php/events.php +++ b/frontends/php/events.php @@ -325,16 +325,8 @@ include_once "include/page_header.php"; continue; } - if($row["value"] == TRIGGER_VALUE_FALSE){ - $value=new CCol(S_FALSE_BIG,"off"); - } - elseif($row["value"] == TRIGGER_VALUE_TRUE){ - $value=new CCol(S_TRUE_BIG,"on"); - } - else{ - $value=new CCol(S_UNKNOWN_BIG,"unknown"); - } - + $value = new CCol(trigger_value2str($row['value']), get_trigger_value_style($row["value"])); + $row = array_merge($triggers[$row['triggerid']],$row); if((0 == $show_unknown) && (!event_initial_time($row,$show_unknown))) continue; @@ -365,7 +357,7 @@ include_once "include/page_header.php"; "action" ), $value, - new CCol(get_severity_description($row["priority"]), get_severity_style($row["priority"])), + new CCol(get_severity_description($row["priority"]), get_severity_style($row["priority"],$row['value'])), $duration, ($config['event_ack_enable'])?$ack:NULL, $actions diff --git a/frontends/php/include/events.inc.php b/frontends/php/include/events.inc.php index 45a952ff..d860f480 100644 --- a/frontends/php/include/events.inc.php +++ b/frontends/php/include/events.inc.php @@ -304,16 +304,7 @@ function make_small_eventlist($triggerid,&$trigger_data){ $duration = zbx_date2age($lclock,$clock); - if($row["value"] == TRIGGER_VALUE_FALSE){ - $value=new CCol(S_FALSE_BIG,"off"); - } - elseif($row["value"] == TRIGGER_VALUE_TRUE){ - $value=new CCol(S_TRUE_BIG,"on"); - } - else{ - $value=new CCol(S_UNKNOWN_BIG,"unknown"); - } - + $value = new CCol(trigger_value2str($row['value']), get_trigger_value_style($row["value"])); $ack = '-'; if(1 == $row['acknowledged']){ @@ -424,15 +415,7 @@ function get_history_of_triggers_events($start,$num, $groupid=0, $hostid=0){ continue; } - if($row["value"] == TRIGGER_VALUE_FALSE){ - $value=new CCol(S_OFF,"off"); - } - else if($row["value"] == TRIGGER_VALUE_TRUE){ - $value=new CCol(S_ON,"on"); - } - else{ - $value=new CCol(S_UNKNOWN_BIG,"unknown"); - } + $value = new CCol(trigger_value2str($row['value']), get_trigger_value_style($row['value'])); $row = array_merge($triggers[$row['triggerid']],$row); if((0 == $show_unknown) && (!event_initial_time($row,$show_unknown))) continue; @@ -471,16 +454,7 @@ function get_history_of_discovery_events($start,$num){ continue; } - if($event_data["value"] == 0){ - $value=new CCol(S_UP,"off"); - } - else if($event_data["value"] == 1){ - $value=new CCol(S_DOWN,"on"); - } - else{ - $value=new CCol(S_UNKNOWN_BIG,"unknown"); - } - + $value = new CCol(trigger_value2str($event_data['value']), get_trigger_value_style($event_data['value'])); switch($event_data['object']){ case EVENT_OBJECT_DHOST: diff --git a/frontends/php/include/forms.inc.php b/frontends/php/include/forms.inc.php index 7405b509..6098b482 100644 --- a/frontends/php/include/forms.inc.php +++ b/frontends/php/include/forms.inc.php @@ -2859,8 +2859,6 @@ $tblAct->AddRow(array(S_STATUS, $cmbStatus)); $tblAction = new CTableInfo(); - $tblAction->AddOption('style','background-color: #CCC;'); - $tblAction->AddRow($tblAct); $td = new CCol(array(new CButton('save',S_SAVE))); @@ -2991,8 +2989,6 @@ $tblCond->AddRow(array(S_CONDITIONS, $cond_el)); $tblConditions = new CTableInfo(); - $tblConditions->AddOption('style','background-color: #CCC;'); - $tblConditions->AddRow($tblCond); $td = new CCol($cond_buttons); @@ -3007,7 +3003,6 @@ function get_act_new_cond_form($action=null){ $tblCond = new CTable('','nowrap'); - $tblCond->AddOption('style','background-color: #CCC;'); if(isset($_REQUEST['actionid']) && empty($action)){ $action = get_action_by_actionid($_REQUEST['actionid']); @@ -3160,7 +3155,6 @@ $tblCond->AddRow($rowCondition); $tblConditions = new CTableInfo(); - $tblConditions->AddOption('style','background-color: #CCC;'); $tblConditions->AddRow($tblCond); @@ -3298,8 +3292,9 @@ } unset($operations); + $tblOperFooter = new CTableInfo(null); + $oper_buttons = array(); - if(!isset($_REQUEST['new_operation'])){ $oper_buttons[] = new CButton('new_operation',S_NEW); } @@ -3307,19 +3302,19 @@ if($tblOper->ItemsCount() > 0 ){ $oper_buttons[] = new CButton('del_operation',S_DELETE_SELECTED); } - + $td = new CCol($oper_buttons); $td->AddOption('colspan',isset($_REQUEST['escalation'])?6:3); $td->AddOption('style','text-align: right;'); - $tblOper->SetFooter($td); + + $tblOperFooter->SetFooter($td); // end of condition list preparation - return $tblOper; + return array($tblOper,$tblOperFooter); } function get_act_new_oper_form($action=null){ $tblOper = new CTableInfo(); - $tblOper->AddOption('style','background-color: #CCC;'); if(isset($_REQUEST['actionid']) && empty($action)){ $action = get_action_by_actionid($_REQUEST['actionid']); @@ -3640,6 +3635,7 @@ $tblOper->AddRow($tblNewOperation); + $td = new CCol(array( new CButton('add_operation', isset($update_mode)?S_SAVE:S_ADD), SPACE, @@ -3656,7 +3652,6 @@ function get_oper_new_cond_form($action=null){ $tblCond = new CTable('','nowrap'); - $tblCond->AddOption('style','background-color: #CCC;'); if(isset($_REQUEST['actionid']) && empty($action)){ $action = get_action_by_actionid($_REQUEST['actionid']); @@ -3713,8 +3708,7 @@ $tblCond->AddRow($rowCondition); $tblConditions = new CTableInfo(); - $tblConditions->AddOption('style','background-color: #CCC;'); - + $tblConditions->AddRow($tblCond); $td = new CCol(array(new CButton('add_opcondition',S_ADD),new CButton('cancel_new_opcondition',S_CANCEL))); @@ -3798,8 +3792,7 @@ $frmMeadia->Show(); } - function insert_image_form() - { + function insert_image_form(){ $frmImages = new CFormTable(S_IMAGE,"config.php","post","multipart/form-data"); diff --git a/frontends/php/include/locales/en_gb.inc.php b/frontends/php/include/locales/en_gb.inc.php index 395106b1..e190b6d3 100644 --- a/frontends/php/include/locales/en_gb.inc.php +++ b/frontends/php/include/locales/en_gb.inc.php @@ -937,8 +937,7 @@ 'S_TYPE_ON'=> 'Type (ON)', 'S_COLOR_OFF'=> 'Color (OFF)', 'S_COLOR_ON'=> 'Color (ON)', - - + // sysmaps.php 'S_MAPS_BIG'=> 'MAPS', @@ -951,7 +950,8 @@ // map.php 'S_OK_BIG'=> 'OK', - 'S_PROBLEMS_SMALL'=> 'problems', + 'S_PROBLEM_BIG'=> 'PROBLEM', + 'S_PROBLEMS_SMALL'=> 'problems', 'S_ZABBIX_URL'=> 'http://www.zabbix.com', 'S_PROBLEM_BIG'=> 'PROBLEM', @@ -1376,35 +1376,35 @@ 'S_ADD'=> 'Add', // tr_status.php - 'S_SOUND'=> 'Sound', - 'S_MUTE'=> 'Mute', - 'S_STATUS_OF_TRIGGERS'=> 'Status of triggers', - 'S_STATUS_OF_TRIGGERS_BIG'=> 'STATUS OF TRIGGERS', - 'S_SHOW_ONLY_TRUE'=> 'Show only true', - 'S_HIDE_ACTIONS'=> 'Hide actions', - 'S_SHOW_ACTIONS'=> 'Show actions', - 'S_SHOW_ALL'=> 'Show all', - 'S_HIDE_ALL'=> 'Hide all', - 'S_SHOW_ONLY_TRUE'=> 'Show only true', - 'S_SHOW_NOFALSEFORB'=> 'Show all(no FALSE for B)', - 'S_SHOW_UNACKNOWLEDGED'=> 'Show unacknowledged', - 'S_SHOW_TRUE_UNACKNOWLEDGED'=> 'Show true-unacknowledged', - 'S_NOT_ACKNOWLEDGED'=> 'Not acknowledged', - 'S_HIDE_DETAILS'=> 'Hide details', - 'S_SHOW_DETAILS'=> 'Show details', - 'S_SELECT'=> 'Select', - 'S_INVERSE_SELECT'=> 'Inverse Select', - 'S_HIDE_SELECT'=> 'Hide select', - 'S_TRIGGERS_BIG'=> 'TRIGGERS', - 'S_NAME_BIG'=> 'NAME', - 'S_SEVERITY_BIG'=> 'SEVERITY', - 'S_LAST_CHANGE_BIG'=> 'LAST CHANGE', - 'S_LAST_CHANGE'=> 'Last change', - 'S_COMMENTS'=> 'Comments', - 'S_ACKNOWLEDGED'=> 'Acknowledged', - 'S_ACK'=> 'Ack', - 'S_NOT_ACK'=> 'Not Ack', - 'S_NEVER'=> 'Never', + 'S_SOUND'=> 'Sound', + 'S_MUTE'=> 'Mute', + 'S_STATUS_OF_TRIGGERS'=> 'Status of triggers', + 'S_STATUS_OF_TRIGGERS_BIG'=> 'STATUS OF TRIGGERS', + 'S_SHOW_ONLY_TRUE'=> 'Show only true', + 'S_HIDE_ACTIONS'=> 'Hide actions', + 'S_SHOW_ACTIONS'=> 'Show actions', + 'S_SHOW_ALL'=> 'Show all', + 'S_HIDE_ALL'=> 'Hide all', + 'S_SHOW_ONLY_PROBLEMS'=> 'Show only problems', + 'S_SHOW_NOFALSEFORB'=> 'Show all(no FALSE for B)', + 'S_SHOW_UNACKNOWLEDGED'=> 'Show unacknowledged', + 'S_SHOW_PROBLEM_UNACKNOWLEDGED'=> 'Show problem-unacknowledged', + 'S_NOT_ACKNOWLEDGED'=> 'Not acknowledged', + 'S_HIDE_DETAILS'=> 'Hide details', + 'S_SHOW_DETAILS'=> 'Show details', + 'S_SELECT'=> 'Select', + 'S_INVERSE_SELECT'=> 'Inverse Select', + 'S_HIDE_SELECT'=> 'Hide select', + 'S_TRIGGERS_BIG'=> 'TRIGGERS', + 'S_NAME_BIG'=> 'NAME', + 'S_SEVERITY_BIG'=> 'SEVERITY', + 'S_LAST_CHANGE_BIG'=> 'LAST CHANGE', + 'S_LAST_CHANGE'=> 'Last change', + 'S_COMMENTS'=> 'Comments', + 'S_ACKNOWLEDGED'=> 'Acknowledged', + 'S_ACK'=> 'Ack', + 'S_NOT_ACK'=> 'Not Ack', + 'S_NEVER'=> 'Never', // users.php 'S_ZABBIX_USER'=> 'ZABBIX User', diff --git a/frontends/php/include/triggers.inc.php b/frontends/php/include/triggers.inc.php index 892b3143..3ef8e0cf 100644 --- a/frontends/php/include/triggers.inc.php +++ b/frontends/php/include/triggers.inc.php @@ -354,8 +354,8 @@ * */ function trigger_value2str($value){ - $str_val[TRIGGER_VALUE_FALSE] = S_FALSE_BIG; - $str_val[TRIGGER_VALUE_TRUE] = S_TRUE_BIG; + $str_val[TRIGGER_VALUE_FALSE] = S_OK_BIG; + $str_val[TRIGGER_VALUE_TRUE] = S_PROBLEM_BIG; $str_val[TRIGGER_VALUE_UNKNOWN] = S_UNKNOWN_BIG; if(isset($str_val[$value])) diff --git a/frontends/php/latest.php b/frontends/php/latest.php index fac1e68f..8c2e8dd7 100644 --- a/frontends/php/latest.php +++ b/frontends/php/latest.php @@ -26,12 +26,12 @@ $page["title"] = "S_LATEST_VALUES"; $page["file"] = "latest.php"; $page['hist_arg'] = array('groupid','hostid','show','select','open','applicationid'); - $page['scripts'] = array('updater.js'); +// $page['scripts'] = array('updater.js'); $page['type'] = detect_page_type(PAGE_TYPE_HTML); define('ZBX_PAGE_MAIN_HAT','hat_latest'); - define('ZBX_PAGE_DO_JS_REFRESH', 1); +// define('ZBX_PAGE_DO_JS_REFRESH', 1); include_once "include/page_header.php"; ?> @@ -58,27 +58,413 @@ include_once "include/page_header.php"; ); check_fields($fields); + +// HEADER REQUEST + $_REQUEST['select'] = get_request('select',get_profile('web.latest.filter.select', '')); + update_profile('web.latest.filter.select', $_REQUEST['select'], PROFILE_TYPE_STR); + + $options = array('allow_all_hosts','monitored_hosts','with_monitored_items'); + $_REQUEST['hostid'] = get_request('hostid',get_profile('web.latest.last.hostid', null)); + if(is_null($_REQUEST['hostid'])){ + array_push($options,'always_select_first_host'); + + $_REQUEST['groupid'] = get_request('groupid',get_profile('web.latest.last.groupid', null)); + if(is_null($_REQUEST['groupid'])){ + validate_group(PERM_READ_ONLY,array('allow_all_hosts','monitored_hosts','with_monitored_items','always_select_first_group'),'web.latest.last.groupid'); + } + } + + if(!$ZBX_WITH_SUBNODES) array_push($options,'only_current_node'); + + validate_group_with_host(PERM_READ_ONLY,$options,'web.latest.last.groupid','web.latest.last.hostid'); +//---------------- +?> +<?php /* AJAX */ if(isset($_REQUEST['favobj'])){ if('hat' == $_REQUEST['favobj']){ update_profile('web.latest.hats.'.$_REQUEST['favid'].'.state',$_REQUEST['state'], PROFILE_TYPE_INT); } - if('refresh' == $_REQUEST['favobj']){ +/* + else if('refresh' == $_REQUEST['favobj']){ switch($_REQUEST['favid']){ case ZBX_PAGE_MAIN_HAT: include_once('blocks/latest.page.php'); break; } } +//*/ } if((PAGE_TYPE_JS == $page['type']) || (PAGE_TYPE_HTML_BLOCK == $page['type'])){ exit(); } //-------- + $p_elements = array(); +// Header + $r_form = new CForm(); + $r_form->SetMethod('get'); + +// $cmbGroup = new CComboBox("groupid",$_REQUEST["groupid"],"javascript: return updater.onetime_update('".ZBX_PAGE_MAIN_HAT."',this.form);"); +// $cmbHosts = new CComboBox("hostid",$_REQUEST["hostid"],"javascript: return updater.onetime_update('".ZBX_PAGE_MAIN_HAT."',this.form);"); + + $cmbGroup = new CComboBox('groupid',$_REQUEST['groupid'],'javascript: submit();'); + $cmbHosts = new CComboBox('hostid',$_REQUEST['hostid'],'javascript: submit();'); + + $cmbGroup->AddItem(0,S_ALL_SMALL); + $cmbHosts->AddItem(0,S_ALL_SMALL); + + $available_groups= get_accessible_groups_by_user($USER_DETAILS,PERM_READ_LIST); + $available_hosts = get_accessible_hosts_by_user($USER_DETAILS,PERM_READ_LIST,PERM_RES_IDS_ARRAY); + + $result=DBselect('SELECT DISTINCT g.groupid,g.name '. + ' FROM groups g, hosts_groups hg, hosts h, items i '. + ' WHERE g.groupid IN ('.$available_groups.') '. + ' AND hg.groupid=g.groupid '. + ' AND h.status='.HOST_STATUS_MONITORED. + ' AND h.hostid=i.hostid '. + ' AND hg.hostid=h.hostid '. + ' AND i.status='.ITEM_STATUS_ACTIVE. + ' ORDER BY g.name'); + while($row=DBfetch($result)){ + $cmbGroup->AddItem( + $row['groupid'], + get_node_name_by_elid($row['groupid']).$row['name'] + ); + } + $r_form->AddItem(array(S_GROUP.SPACE,$cmbGroup)); + + if($_REQUEST['groupid'] > 0){ + $sql='SELECT DISTINCT h.hostid,h.host '. + ' FROM hosts h,items i,hosts_groups hg '. + ' WHERE h.status='.HOST_STATUS_MONITORED. + ' AND h.hostid=i.hostid '. + ' AND hg.groupid='.$_REQUEST['groupid']. + ' AND hg.hostid=h.hostid'. + ' AND i.status='.ITEM_STATUS_ACTIVE. + ' AND '.DBcondition('h.hostid',$available_hosts). + ' ORDER BY h.host'; + } + else{ + $sql='SELECT DISTINCT h.hostid,h.host '. + ' FROM hosts h,items i '. + ' WHERE h.status='.HOST_STATUS_MONITORED. + ' AND i.status='.ITEM_STATUS_ACTIVE. + ' AND h.hostid=i.hostid'. + ' AND '.DBcondition('h.hostid',$available_hosts). + ' ORDER BY h.host'; + } + + $result=DBselect($sql); + while($row=DBfetch($result)){ + $cmbHosts->AddItem( + $row['hostid'], + get_node_name_by_elid($row['hostid']).$row['host'] + ); + } + + $r_form->AddItem(array(SPACE.S_HOST.SPACE,$cmbHosts)); + + $l_form = new CForm(); + $l_form->SetMethod('get'); + + $l_form->AddItem(array(S_SHOW_ITEMS_WITH_DESCRIPTION_LIKE, new CTextBox("select",$_REQUEST["select"],20))); + $l_form->AddItem(array(SPACE, new CButton("show",S_SHOW,'javascript: submit();'))); +// $l_form->AddItem(array(SPACE, new CButton("show",S_SHOW,"javascript: return updater.onetime_update('".ZBX_PAGE_MAIN_HAT."',this.form);"))); + + $p_elements[] = get_table_header($l_form,$r_form); +//------------- + + validate_sort_and_sortorder('i.description',ZBX_SORT_UP); + + $_REQUEST['groupbyapp'] = get_request('groupbyapp',get_profile('web.latest.groupbyapp',1)); + update_profile('web.latest.groupbyapp',$_REQUEST['groupbyapp'],PROFILE_TYPE_INT); + + $_REQUEST['applications'] = get_request('applications',get_profile('web.latest.applications',array(),PROFILE_TYPE_ARRAY_ID)); + + if(isset($_REQUEST['open'])){ + if(!isset($_REQUEST['applicationid'])){ + $_REQUEST['applications'] = array(); + $show_all_apps = 1; + } + else if(!uint_in_array($_REQUEST['applicationid'],$_REQUEST['applications'])){ + array_push($_REQUEST['applications'],$_REQUEST['applicationid']); + } + + } + else if(isset($_REQUEST['close'])){ + if(!isset($_REQUEST['applicationid'])){ + $_REQUEST['applications'] = array(); + } + else if(($i=array_search($_REQUEST['applicationid'], $_REQUEST['applications'])) !== FALSE){ + unset($_REQUEST['applications'][$i]); + } + } + + /* limit opened application count */ + while(count($_REQUEST['applications']) > 25){ + array_shift($_REQUEST['applications']); + } + + update_profile('web.latest.applications',$_REQUEST['applications'],PROFILE_TYPE_ARRAY_ID); +?> +<?php + if(isset($show_all_apps)){ + $url = '?close=1'. + url_param('groupid'). + url_param('hostid'). + url_param('applications'). + url_param('select'); + $link = new CLink(new CImg('images/general/opened.gif'),$url); +// $link = new CLink(new CImg('images/general/opened.gif'),$url,null,"javascript: return updater.onetime_update('".ZBX_PAGE_MAIN_HAT."','".$url."');"); + } + else{ + $url = '?open=1'. + url_param('groupid'). + url_param('hostid'). + url_param('applications'). + url_param('select'); + $link = new CLink(new CImg('images/general/closed.gif'),$url); +// $link = new CLink(new CImg('images/general/closed.gif'),$url,null,"javascript: return updater.onetime_update('".ZBX_PAGE_MAIN_HAT."','".$url."');"); + } + + $table=new CTableInfo(); + $table->SetHeader(array( + is_show_subnodes()?make_sorting_link(S_NODE,'h.hostid') : null, + ($_REQUEST["hostid"] ==0)?make_sorting_link(S_HOST,'h.host') : NULL, + array($link,SPACE,make_sorting_link(S_DESCRIPTION,'i.description')), + make_sorting_link(S_LAST_CHECK,'i.lastclock'), + S_LAST_VALUE, + S_CHANGE, + S_HISTORY)); + +// $table->ShowStart(); + + $compare_host = $_REQUEST['hostid']?' AND h.hostid='.$_REQUEST['hostid']:''; + $compare_host.= $_REQUEST['groupid']?' AND hg.hostid=h.hostid AND hg.groupid ='.$_REQUEST['groupid']:''; + + $db_applications = DBselect('SELECT DISTINCT h.host,h.hostid,a.* '. + ' FROM applications a, hosts h'.($_REQUEST['groupid']?', hosts_groups hg ':''). + ' WHERE a.hostid=h.hostid'. + $compare_host. + ' AND '.DBcondition('h.hostid',$available_hosts). + ' AND h.status='.HOST_STATUS_MONITORED. + order_by('h.host,h.hostid','a.name,a.applicationid')); + + while($db_app = DBfetch($db_applications)){ + $db_items = DBselect('SELECT DISTINCT i.* '. + ' FROM items i,items_applications ia'. + ' WHERE ia.applicationid='.$db_app['applicationid']. + ' AND i.itemid=ia.itemid'. + ' AND i.status='.ITEM_STATUS_ACTIVE. + order_by('i.description,i.itemid,i.lastclock')); + $app_rows = array(); + $item_cnt = 0; + while($db_item = DBfetch($db_items)){ + $description = item_description($db_item["description"],$db_item["key_"]); + if(!empty($_REQUEST["select"]) && !zbx_stristr($description, $_REQUEST["select"]) ) continue; + + ++$item_cnt; + if(!uint_in_array($db_app["applicationid"],$_REQUEST["applications"]) && !isset($show_all_apps)) continue; + + if(isset($db_item["lastclock"])) + $lastclock=date(S_DATE_FORMAT_YMDHMS,$db_item["lastclock"]); + else + $lastclock = new CCol('-', 'center'); + + $lastvalue=format_lastvalue($db_item); + + if( isset($db_item["lastvalue"]) && isset($db_item["prevvalue"]) && + ($db_item["value_type"] == 0) && ($db_item["lastvalue"]-$db_item["prevvalue"] != 0) ) + { + if($db_item["lastvalue"]-$db_item["prevvalue"]<0){ + $change=convert_units($db_item["lastvalue"]-$db_item["prevvalue"],$db_item["units"]); + } + else{ + $change="+".convert_units($db_item["lastvalue"]-$db_item["prevvalue"],$db_item["units"]); + } + $change=nbsp($change); + } + else{ + $change=new CCol("-","center"); + } + + if(($db_item["value_type"]==ITEM_VALUE_TYPE_FLOAT) || ($db_item["value_type"]==ITEM_VALUE_TYPE_UINT64)){ + $actions=new CLink(S_GRAPH,"history.php?action=showgraph&itemid=".$db_item["itemid"],"action"); + } + else{ + $actions=new CLink(S_HISTORY,"history.php?action=showvalues&period=3600&itemid=".$db_item["itemid"],"action"); + } + + array_push($app_rows, new CRow(array( + is_show_subnodes()?SPACE:null, + ($_REQUEST["hostid"]>0)?NULL:SPACE, + str_repeat(SPACE,6).$description, + $lastclock, + new CCol($lastvalue, $lastvalue=='-' ? 'center' : null), + $change, + $actions + ))); + } + + if($item_cnt > 0){ + if(uint_in_array($db_app["applicationid"],$_REQUEST["applications"]) || isset($show_all_apps)){ + $url = '?close=1&applicationid='.$db_app["applicationid"]. + url_param('groupid'). + url_param('hostid'). + url_param('applications'). + url_param('fullscreen'). + url_param('select'); + $link = new CLink(new CImg('images/general/opened.gif'),$url); +// $link = new CLink(new CImg('images/general/opened.gif'),$url,null,"javascript: return updater.onetime_update('".ZBX_PAGE_MAIN_HAT."','".$url."');"); + } + else{ + $url = '?open=1&applicationid='.$db_app["applicationid"]. + url_param('groupid'). + url_param('hostid'). + url_param('applications'). + url_param('fullscreen'). + url_param('select'); + $link = new CLink(new CImg('images/general/closed.gif'),$url); +// $link = new CLink(new CImg('images/general/closed.gif'),$url,null,"javascript: return updater.onetime_update('".ZBX_PAGE_MAIN_HAT."','".$url."');"); + } + + $col = new CCol(array($link,SPACE,bold($db_app["name"]),SPACE.'('.$item_cnt.SPACE.S_ITEMS.')')); + $col->SetColSpan(5); + + $table->AddRow(array( + get_node_name_by_elid($db_app['hostid']), + ($_REQUEST["hostid"]>0)?NULL:$db_app["host"], + $col + )); + + foreach($app_rows as $row) $table->AddRow($row); + } + } + + + $sql = 'SELECT DISTINCT h.host,h.hostid '. + ' FROM hosts h'.($_REQUEST['groupid']?', hosts_groups hg ':'').', items i '. + ' LEFT JOIN items_applications ia ON ia.itemid=i.itemid'. + ' WHERE ia.itemid is NULL '. + $compare_host. + ' AND h.hostid=i.hostid '. + ' AND h.status='.HOST_STATUS_MONITORED. + ' AND i.status='.ITEM_STATUS_ACTIVE. + ' AND '.DBcondition('h.hostid',$available_hosts). + ' ORDER BY h.host'; + + $db_appitems = DBselect($sql); + + while($db_appitem = DBfetch($db_appitems)){ + + $sql = 'SELECT h.host,h.hostid,i.* '. + ' FROM hosts h'.($_REQUEST['groupid']?', hosts_groups hg ':'').', items i '. + ' LEFT JOIN items_applications ia ON ia.itemid=i.itemid'. + ' WHERE ia.itemid is NULL '. + $compare_host. + ' AND h.hostid=i.hostid '. + ' AND h.status='.HOST_STATUS_MONITORED. + ' AND i.status='.ITEM_STATUS_ACTIVE. + ' AND h.hostid='.$db_appitem['hostid']. + ' ORDER BY i.description,i.itemid'; + + $db_items = DBselect($sql); + + $app_rows = array(); + $item_cnt = 0; + + while($db_item = DBfetch($db_items)){ + $description = item_description($db_item["description"],$db_item["key_"]); + + if(!empty($_REQUEST["select"]) && !zbx_stristr($description, $_REQUEST["select"]) ) continue; + + ++$item_cnt; + + if(!uint_in_array(0,$_REQUEST["applications"]) && !isset($show_all_apps)) continue; + + if(isset($db_item["lastclock"])) + $lastclock=zbx_date2str(S_DATE_FORMAT_YMDHMS,$db_item["lastclock"]); + else + $lastclock = new CCol('-', 'center'); + + $lastvalue=format_lastvalue($db_item); + + if( isset($db_item["lastvalue"]) && isset($db_item["prevvalue"]) && + ($db_item["value_type"] == ITEM_VALUE_TYPE_FLOAT || $db_item["value_type"] == ITEM_VALUE_TYPE_UINT64) && + ($db_item["lastvalue"]-$db_item["prevvalue"] != 0) ) + { + if($db_item["lastvalue"]-$db_item["prevvalue"]<0){ + $change=convert_units($db_item["lastvalue"]-$db_item["prevvalue"],$db_item["units"]); + $change=nbsp($change); + } + else{ + $change="+".convert_units($db_item["lastvalue"]-$db_item["prevvalue"],$db_item["units"]); + $change=nbsp($change); + } + } + else{ + $change=new CCol("-","center"); + } + + if(($db_item["value_type"]==ITEM_VALUE_TYPE_FLOAT) || ($db_item["value_type"]==ITEM_VALUE_TYPE_UINT64)){ + $actions=new CLink(S_GRAPH,"history.php?action=showgraph&itemid=".$db_item["itemid"],"action"); + } + else{ + $actions=new CLink(S_HISTORY,"history.php?action=showvalues&period=3600&itemid=".$db_item["itemid"],"action"); + } + + array_push($app_rows, new CRow(array( + is_show_subnodes()?($item_cnt?SPACE:get_node_name_by_elid($db_item['itemid'])):null, + $_REQUEST["hostid"]?NULL:($item_cnt?SPACE:$db_item["host"]), + str_repeat(SPACE, 6).$description, + $lastclock, + new CCol($lastvalue, $lastvalue == '-' ? 'center' : null), + $change, + $actions + ))); + } + + if($item_cnt > 0){ + + if(uint_in_array(0,$_REQUEST["applications"]) || isset($show_all_apps)){ + $url = '?close=1&applicationid=0'. + url_param('groupid'). + url_param('hostid'). + url_param('applications'). + url_param('select'); + $link = new CLink(new CImg('images/general/opened.gif'),$url); +// $link = new CLink(new CImg('images/general/opened.gif'),$url,null,"javascript: return updater.onetime_update('".ZBX_PAGE_MAIN_HAT."','".$url."');"); + } + else{ + $url = '?open=1&applicationid=0'. + url_param('groupid'). + url_param('hostid'). + url_param('applications'). + url_param('select'); + $link = new CLink(new CImg('images/general/closed.gif'),$url); +// $link = new CLink(new CImg('images/general/closed.gif'),$url,null,"javascript: return updater.onetime_update('".ZBX_PAGE_MAIN_HAT."','".$url."');"); + } + + $col = new CCol(array($link,SPACE,bold(S_MINUS_OTHER_MINUS),SPACE.'('.$item_cnt.SPACE.S_ITEMS.')')); + $col->SetColSpan(5); + + $table->AddRow(array( + get_node_name_by_elid($db_appitem['hostid']), + $_REQUEST["hostid"] > 0 ? NULL : $db_appitem["host"], + $col + )); + + foreach($app_rows as $row) $table->AddRow($row); + } + } + + $p_elements[] = $table; + +/* // Refresh tab $refresh_tab = array( array('id' => ZBX_PAGE_MAIN_HAT, @@ -86,9 +472,9 @@ include_once "include/page_header.php"; 'url' => zbx_empty($_SERVER['QUERY_STRING'])?'':'?'.$_SERVER['QUERY_STRING'], ) ); - +//*/ - $url = '?fullscreen='.($_REQUEST['fullscreen']?'0':'1').url_param('select'); + $url = '?fullscreen='.($_REQUEST['fullscreen']?'0':'1'); $fs_icon = new CDiv(SPACE,'fullscreen'); $fs_icon->AddOption('title',$_REQUEST['fullscreen']?S_NORMAL.' '.S_VIEW:S_FULLSCREEN); @@ -97,7 +483,7 @@ include_once "include/page_header.php"; $latest_hat = create_hat( S_LATEST_DATA_BIG, - new CSpan(S_LOADING_P,'textcolorstyles'), + $p_elements,//new CSpan(S_LOADING_P,'textcolorstyles'), array($fs_icon), ZBX_PAGE_MAIN_HAT, get_profile('web.latest.hats.hat_latest.state',1) @@ -105,7 +491,7 @@ include_once "include/page_header.php"; $latest_hat->Show(); - add_refresh_objects($refresh_tab); +// add_refresh_objects($refresh_tab); ?> <?php include_once "include/page_footer.php"; diff --git a/frontends/php/maps.php b/frontends/php/maps.php index aa3699b6..3535d943 100644 --- a/frontends/php/maps.php +++ b/frontends/php/maps.php @@ -54,11 +54,9 @@ include_once('include/page_header.php'); ?> <?php if(isset($_REQUEST['favobj'])){ - if(isset($_REQUEST['favobj'])){ - if('hat' == $_REQUEST['favobj']){ - update_profile('web.maps.hats.'.$_REQUEST['favid'].'.state',$_REQUEST['state'], PROFILE_TYPE_INT); - } - } + if('hat' == $_REQUEST['favobj']){ + update_profile('web.maps.hats.'.$_REQUEST['favid'].'.state',$_REQUEST['state'], PROFILE_TYPE_INT); + } else if('sysmapid' == $_REQUEST['favobj']){ $result = false; if('add' == $_REQUEST['action']){ @@ -124,28 +122,10 @@ include_once('include/page_header.php'); <?php $p_elements = array(); + $text = null; if(isset($_REQUEST["sysmapid"])){ $sysmap = get_sysmap_by_sysmapid($_REQUEST["sysmapid"]); - - $text = $all_maps[$_REQUEST["sysmapid"]]; - - if(infavorites('web.favorite.sysmapids',$_REQUEST['sysmapid'],'sysmapid')){ - $icon = new CDiv(SPACE,'iconminus'); - $icon->AddOption('title',S_REMOVE_FROM.' '.S_FAVORITES); - $icon->AddAction('onclick',new CScript("javascript: rm4favorites('sysmapid','".$_REQUEST["sysmapid"]."',0);")); - } - else{ - $icon = new CDiv(SPACE,'iconplus'); - $icon->AddOption('title',S_ADD_TO.' '.S_FAVORITES); - $icon->AddAction('onclick',new CScript("javascript: add2favorites('sysmapid','".$_REQUEST["sysmapid"]."');")); - } - $icon->AddOption('id','addrm_fav'); - - $url = '?sysmapid='.$_REQUEST['sysmapid'].($_REQUEST['fullscreen']?'':'&fullscreen=1'); - - $fs_icon = new CDiv(SPACE,'fullscreen'); - $fs_icon->AddOption('title',$_REQUEST['fullscreen']?S_NORMAL.' '.S_VIEW:S_FULLSCREEN); - $fs_icon->AddAction('onclick',new CScript("javascript: document.location = '".$url."';")); + $text = $all_maps[$_REQUEST["sysmapid"]]; } $form = new CForm(); @@ -161,9 +141,8 @@ include_once('include/page_header.php'); if($cmbMaps->ItemsCount()>0){ $form->AddItem($cmbMaps); + $p_elements[] = get_table_header($text,$form); } - - $p_elements[] = get_table_header($text,$form); ?> <?php $table = new CTable(S_NO_MAPS_DEFINED,"map"); @@ -177,6 +156,32 @@ include_once('include/page_header.php'); } $p_elements[] = $table; + + $icon = null; + $fs_icon = null; + if(isset($_REQUEST["sysmapid"])){ + $sysmap = get_sysmap_by_sysmapid($_REQUEST["sysmapid"]); + + $text = $all_maps[$_REQUEST["sysmapid"]]; + + if(infavorites('web.favorite.sysmapids',$_REQUEST['sysmapid'],'sysmapid')){ + $icon = new CDiv(SPACE,'iconminus'); + $icon->AddOption('title',S_REMOVE_FROM.' '.S_FAVORITES); + $icon->AddAction('onclick',new CScript("javascript: rm4favorites('sysmapid','".$_REQUEST["sysmapid"]."',0);")); + } + else{ + $icon = new CDiv(SPACE,'iconplus'); + $icon->AddOption('title',S_ADD_TO.' '.S_FAVORITES); + $icon->AddAction('onclick',new CScript("javascript: add2favorites('sysmapid','".$_REQUEST["sysmapid"]."');")); + } + $icon->AddOption('id','addrm_fav'); + + $url = '?sysmapid='.$_REQUEST['sysmapid'].($_REQUEST['fullscreen']?'':'&fullscreen=1'); + + $fs_icon = new CDiv(SPACE,'fullscreen'); + $fs_icon->AddOption('title',$_REQUEST['fullscreen']?S_NORMAL.' '.S_VIEW:S_FULLSCREEN); + $fs_icon->AddAction('onclick',new CScript("javascript: document.location = '".$url."';")); + } $latest_hat = create_hat( S_NETWORK_MAPS_BIG, diff --git a/frontends/php/screens.php b/frontends/php/screens.php index bed79eb8..94a172c5 100644 --- a/frontends/php/screens.php +++ b/frontends/php/screens.php @@ -19,14 +19,14 @@ **/ ?> <?php - require_once "include/config.inc.php"; - require_once "include/graphs.inc.php"; - require_once "include/screens.inc.php"; + require_once 'include/config.inc.php'; + require_once 'include/graphs.inc.php'; + require_once 'include/screens.inc.php'; require_once 'include/nodes.inc.php'; - $page["title"] = "S_CUSTOM_SCREENS"; - $page["file"] = "screens.php"; + $page['title'] = "S_CUSTOM_SCREENS"; + $page['file'] = 'screens.php'; $page['hist_arg'] = array('config','elementid'); $page['scripts'] = array('gmenu.js','scrollbar.js','sbox.js','sbinit.js'); //do not change order!!! @@ -38,37 +38,40 @@ define('ZBX_PAGE_DO_REFRESH', 1); } -include_once "include/page_header.php"; +include_once 'include/page_header.php'; ?> <?php // VAR TYPE OPTIONAL FLAGS VALIDATION EXCEPTION $fields=array( - "config"=> array(T_ZBX_INT, O_OPT, P_SYS, IN("0,1"), null), // 0 - screens, 1 - slides + 'config'=> array(T_ZBX_INT, O_OPT, P_SYS, IN('0,1'), null), // 0 - screens, 1 - slides - "groupid"=> array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, null), - "hostid"=> array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, null), + 'groupid'=> array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, null), + 'hostid'=> array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, null), - "elementid"=> array(T_ZBX_INT, O_OPT, P_SYS|P_NZERO, DB_ID,NULL), - "step"=> array(T_ZBX_INT, O_OPT, P_SYS, BETWEEN(0,65535),NULL), - "from"=> array(T_ZBX_INT, O_OPT, P_SYS, BETWEEN(0,65535*65535),NULL), - "period"=> array(T_ZBX_INT, O_OPT, P_SYS, null,NULL), - "stime"=> array(T_ZBX_STR, O_OPT, P_SYS, NULL,NULL), + 'elementid'=> array(T_ZBX_INT, O_OPT, P_SYS|P_NZERO, DB_ID,NULL), + 'step'=> array(T_ZBX_INT, O_OPT, P_SYS, BETWEEN(0,65535),NULL), + 'from'=> array(T_ZBX_INT, O_OPT, P_SYS, BETWEEN(0,65535*65535),NULL), + 'period'=> array(T_ZBX_INT, O_OPT, P_SYS, null,NULL), + 'stime'=> array(T_ZBX_STR, O_OPT, P_SYS, NULL,NULL), - "reset"=> array(T_ZBX_STR, O_OPT, P_SYS, IN("'reset'"),NULL), - "fullscreen"=> array(T_ZBX_INT, O_OPT, P_SYS, IN("0,1,2"), NULL), + 'reset'=> array(T_ZBX_STR, O_OPT, P_SYS, IN("'reset'"),NULL), + 'fullscreen'=> array(T_ZBX_INT, O_OPT, P_SYS, IN('0,1,2'), NULL), //ajax 'favobj'=> array(T_ZBX_STR, O_OPT, P_ACT, NULL, NULL), 'favid'=> array(T_ZBX_STR, O_OPT, P_ACT, NOT_EMPTY, 'isset({favobj})'), - 'action'=> array(T_ZBX_STR, O_OPT, P_SYS, IN("'go','add','remove'"),NULL) - + 'state'=> array(T_ZBX_INT, O_OPT, P_ACT, NOT_EMPTY, 'isset({favobj})'), + 'action'=> array(T_ZBX_STR, O_OPT, P_ACT, IN("'add','remove'"),NULL) ); check_fields($fields); if(isset($_REQUEST['favobj'])){ + if('hat' == $_REQUEST['favobj']){ + update_profile('web.screens.hats.'.$_REQUEST['favid'].'.state',$_REQUEST['state'], PROFILE_TYPE_INT); + } if(in_array($_REQUEST['favobj'],array('screenid','slideshowid'))){ $result = false; if('add' == $_REQUEST['action']){ @@ -100,30 +103,32 @@ include_once "include/page_header.php"; <?php $config = $_REQUEST['config'] = get_request('config', 0); - if( 2 != $_REQUEST["fullscreen"] ) + if( 2 != $_REQUEST['fullscreen'] ) update_profile('web.screens.config', $_REQUEST['config'],PROFILE_TYPE_INT); - $_REQUEST["elementid"] = get_request("elementid",get_profile("web.screens.elementid", null)); + $_REQUEST['elementid'] = get_request('elementid',get_profile('web.screens.elementid', null)); - if( 2 != $_REQUEST["fullscreen"] ) - update_profile("web.screens.elementid",$_REQUEST["elementid"]); + if( 2 != $_REQUEST['fullscreen'] ) + update_profile('web.screens.elementid',$_REQUEST['elementid']); - $_REQUEST["period"] = get_request('period',get_profile('web.screens.period', ZBX_PERIOD_DEFAULT, null, $_REQUEST['elementid'])); - if($_REQUEST["period"] >= ZBX_MIN_PERIOD){ + $_REQUEST['period'] = get_request('period',get_profile('web.screens.period', ZBX_PERIOD_DEFAULT, null, $_REQUEST['elementid'])); + if($_REQUEST['period'] >= ZBX_MIN_PERIOD){ update_profile('web.screens.period',$_REQUEST['period'], PROFILE_TYPE_INT, $_REQUEST['elementid']); } ?> <?php - $text = array(S_SCREENS_BIG); - $elementid = get_request('elementid', null); if($elementid <= 0) $elementid = null; + $p_elements = array(); + + $text = null; + $form = new CForm(); $form->SetMethod('get'); - $form->AddVar("fullscreen",$_REQUEST["fullscreen"]); + $form->AddVar('fullscreen',$_REQUEST['fullscreen']); $cmbConfig = new CComboBox('config', $config, 'submit()'); $cmbConfig->AddItem(0, S_SCREENS); @@ -131,7 +136,7 @@ include_once "include/page_header.php"; $form->AddItem($cmbConfig); - $cmbElements = new CComboBox("elementid",$elementid,"submit()"); + $cmbElements = new CComboBox('elementid',$elementid,'submit()'); unset($screen_correct); unset($first_screen); @@ -142,15 +147,15 @@ include_once "include/page_header.php"; ' order by name' ); while($row=DBfetch($result)){ - if(!screen_accessible($row["elementid"], PERM_READ_ONLY)) + if(!screen_accessible($row['elementid'], PERM_READ_ONLY)) continue; $cmbElements->AddItem( $row['elementid'], - get_node_name_by_elid($row['elementid']).$row["name"] + get_node_name_by_elid($row['elementid']).$row['name'] ); - if((bccomp($elementid , $row["elementid"]) == 0)) $element_correct = 1; - if(!isset($first_element)) $first_element = $row["elementid"]; + if((bccomp($elementid , $row['elementid']) == 0)) $element_correct = 1; + if(!isset($first_element)) $first_element = $row['elementid']; } } else{ @@ -160,15 +165,15 @@ include_once "include/page_header.php"; ' order by name' ); while($row=DBfetch($result)){ - if(!slideshow_accessible($row["elementid"], PERM_READ_ONLY)) + if(!slideshow_accessible($row['elementid'], PERM_READ_ONLY)) continue; $cmbElements->AddItem( $row['elementid'], get_node_name_by_elid($row['elementid']).$row['name'] ); - if((bccomp($elementid , $row["elementid"]) == 0)) $element_correct = 1; - if(!isset($first_element)) $first_element = $row["elementid"]; + if((bccomp($elementid , $row['elementid']) == 0)) $element_correct = 1; + if(!isset($first_element)) $first_element = $row['elementid']; } } @@ -187,49 +192,22 @@ include_once "include/page_header.php"; access_deny(); $element = get_slideshow_by_slideshowid($elementid); } - - if( $element ){ - $text = array(nbsp(' / '),$element["name"]); - - if(infavorites('web.favorite.screenids',$elementid,(0 == $config)?'screenid':'slideshowid')){ - $icon = new CDiv(SPACE,'iconminus'); - $icon->AddOption('title',S_REMOVE_FROM.' '.S_FAVORITES); - $icon->AddAction('onclick',new CScript("javascript: rm4favorites('".((0 == $config)?'screenid':'slideshowid')."','".$elementid."',0);")); - } - else{ - $icon = new CDiv(SPACE,'iconplus'); - $icon->AddOption('title',S_ADD_TO.' '.S_FAVORITES); - $icon->AddAction('onclick',new CScript("javascript: add2favorites('".((0 == $config)?'screenid':'slideshowid')."','".$elementid."');")); - } - $icon->AddOption('id','addrm_fav'); - - $url = '?elementid='.$elementid.($_REQUEST['fullscreen']?'':'&fullscreen=1'); - - $fs_icon = new CDiv(SPACE,'fullscreen'); - $fs_icon->AddOption('title',$_REQUEST['fullscreen']?S_NORMAL.' '.S_VIEW:S_FULLSCREEN); - $fs_icon->AddAction('onclick',new CScript("javascript: document.location = '".$url."';")); - $icon_tab = new CTable(); - $icon_tab->AddRow(array($fs_icon,$icon,SPACE,$text)); - - $text = $icon_tab; - } - else{ - $elementid = null; - update_profile("web.screens.elementid",0); + if($element ){ + $text = $element['name']; } } if($cmbElements->ItemsCount() > 0) $form->AddItem($cmbElements); - - if((2 != $_REQUEST["fullscreen"]) && (0 == $config) && (!empty($elementid)) && (check_dynamic_items($elementid))){ - if(!isset($_REQUEST["hostid"])){ - $_REQUEST["groupid"] = $_REQUEST["hostid"] = 0; + + if((2 != $_REQUEST['fullscreen']) && (0 == $config) && !empty($elementid) && check_dynamic_items($elementid)){ + if(!isset($_REQUEST['hostid'])){ + $_REQUEST['groupid'] = $_REQUEST['hostid'] = 0; } - $options = array("allow_all_hosts","monitored_hosts","with_items");//, "always_select_first_host"); - if(!$ZBX_WITH_SUBNODES) array_push($options,"only_current_node"); + $options = array('allow_all_hosts','monitored_hosts','with_items');//, 'always_select_first_host'); + if(!$ZBX_WITH_SUBNODES) array_push($options,'only_current_node'); validate_group_with_host(PERM_READ_ONLY,$options); @@ -261,7 +239,7 @@ include_once "include/page_header.php"; while($row=DBfetch($result)){ $cmbGroup->AddItem( $row['groupid'], - get_node_name_by_elid($row['groupid']).$row["name"] + get_node_name_by_elid($row['groupid']).$row['name'] ); } @@ -296,16 +274,16 @@ include_once "include/page_header.php"; } $r_form->AddItem(array(SPACE.S_HOST.SPACE,$cmbHosts)); - show_table_header($text,$form); - show_table_header(null,$r_form); + $p_elements[] = get_table_header($text,array($form,$r_form)); } - else if(2 != $_REQUEST["fullscreen"]){ - show_table_header($text,$form); + else if(2 != $_REQUEST['fullscreen']){ + $p_elements[] = get_table_header($text,$form); } ?> <?php if(isset($elementid)){ $effectiveperiod = navigation_bar_calc(); + if( 0 == $config ){ $element = get_screen($elementid, 0, $effectiveperiod); } @@ -314,13 +292,14 @@ include_once "include/page_header.php"; zbx_add_post_js('if(typeof(parent) != "undefined") parent.resizeiframe("iframe"); else resizeiframe("iframe");'."\n"); } + if($element){ - $element->Show(); + $p_elements[] = $element; } $_REQUEST['elementid'] = $elementid; - if( 2 != $_REQUEST["fullscreen"] ){ + if( 2 != $_REQUEST['fullscreen'] ){ $stime = time() - (31536000); // ~1year $bstime = time()-$effectiveperiod; @@ -335,22 +314,55 @@ include_once "include/page_header.php"; zbx_add_post_js($script); $img = new CImg('images/general/tree/zero.gif','space','20','20'); - $img->Show(); - echo SBR; -// navigation_bar("screens.php",array('config','elementid')); + + $p_elements[] = $img; + $p_elements[] = BR(); +// navigation_bar('screens.php',array('config','elementid')); + } + } + else{ + $p_elements[] = new CTableInfo((0 == $config)?S_NO_SCREENS_DEFINED:S_NO_SLIDESHOWS_DEFINED); + } + + $icon = null; + $fs_icon = null; + if(isset($elementid) && $element ){ + if(infavorites('web.favorite.screenids',$elementid,(0 == $config)?'screenid':'slideshowid')){ + $icon = new CDiv(SPACE,'iconminus'); + $icon->AddOption('title',S_REMOVE_FROM.' '.S_FAVORITES); + $icon->AddAction('onclick',new CScript("javascript: rm4favorites('".((0 == $config)?'screenid':'slideshowid')."','".$elementid."',0);")); } + else{ + $icon = new CDiv(SPACE,'iconplus'); + $icon->AddOption('title',S_ADD_TO.' '.S_FAVORITES); + $icon->AddAction('onclick',new CScript("javascript: add2favorites('".((0 == $config)?'screenid':'slideshowid')."','".$elementid."');")); + } + $icon->AddOption('id','addrm_fav'); + + $url = '?elementid='.$elementid.($_REQUEST['fullscreen']?'':'&fullscreen=1'); + + $fs_icon = new CDiv(SPACE,'fullscreen'); + $fs_icon->AddOption('title',$_REQUEST['fullscreen']?S_NORMAL.' '.S_VIEW:S_FULLSCREEN); + $fs_icon->AddAction('onclick',new CScript("javascript: document.location = '".$url."';")); } - else - { - echo unpack_object(new CTableInfo( - 0 == $config ? - S_NO_SCREENS_DEFINED : - S_NO_SLIDESHOWS_DEFINED - )); + + if( 2 == $_REQUEST['fullscreen']){ + echo unpack_object($p_elements); + } + else{ + $screens_hat = create_hat( + (0 == $config)?S_SCREENS_BIG:S_SLIDESHOWS_BIG, + $p_elements, + array($icon,$fs_icon), + 'hat_screens', + get_profile('web.charts.hats.hat_screens.state',1) + ); + + $screens_hat->Show(); } ?> <?php -include_once "include/page_footer.php"; +include_once 'include/page_footer.php'; ?> diff --git a/frontends/php/tr_status.php b/frontends/php/tr_status.php index 7053ac6e..5c0a3c9d 100644 --- a/frontends/php/tr_status.php +++ b/frontends/php/tr_status.php @@ -312,7 +312,7 @@ include_once "include/page_header.php"; $tr_select = new CComboBox('show_triggers',$show_triggers,'javasctipt: submit();'); if(TRIGGERS_OPTION_ONLYTRUE){ - $tr_select->Additem(TRIGGERS_OPTION_ONLYTRUE,S_SHOW_ONLY_TRUE); + $tr_select->Additem(TRIGGERS_OPTION_ONLYTRUE,S_SHOW_ONLY_PROBLEMS); } if(TRIGGERS_OPTION_ALL){ @@ -337,7 +337,7 @@ include_once "include/page_header.php"; } if(EVENTS_OPTION_ONLYTRUE_NOTACK && $config['event_ack_enable']){ - $ev_select->AddItem(EVENTS_OPTION_ONLYTRUE_NOTACK,S_SHOW_TRUE_UNACKNOWLEDGED.SPACE.'('.$config['event_expire'].SPACE.(($config['event_expire']>1)?S_DAYS:S_DAY).')'); + $ev_select->AddItem(EVENTS_OPTION_ONLYTRUE_NOTACK,S_SHOW_PROBLEM_UNACKNOWLEDGED.SPACE.'('.$config['event_expire'].SPACE.(($config['event_expire']>1)?S_DAYS:S_DAY).')'); } //------- JP ------- @@ -563,11 +563,11 @@ include_once "include/page_header.php"; $table->AddRow(array( ($config['event_ack_enable'])?SPACE:NULL, new CCol( - get_severity_description($row["priority"]), - get_severity_style($row["priority"]) + get_severity_description($row['priority']), + get_severity_style($row['priority'],$row['value']) ), $value, - new CLink(zbx_date2str(S_DATE_FORMAT_YMDHMS,$row["lastchange"]),"events.php?triggerid=".$row["triggerid"],"action"), + new CLink(zbx_date2str(S_DATE_FORMAT_YMDHMS,$row['lastchange']),'events.php?triggerid='.$row['triggerid'],'action'), get_node_name_by_elid($row['triggerid']), $host, $description, @@ -616,11 +616,11 @@ include_once "include/page_header.php"; $table->AddRow(array( ($config['event_ack_enable'])?(($row_event['acknowledged'] == 1)?(SPACE):(new CCheckBox('events['.$row_event['eventid'].']', 'no',NULL,$row_event['eventid']))):NULL, new CCol( - get_severity_description($row["priority"]), - get_severity_style($row["priority"]) + get_severity_description($row['priority']), + get_severity_style($row['priority'],$row['value']) ), $value, - new CLink(zbx_date2str(S_DATE_FORMAT_YMDHMS,$row_event['clock']),"events.php?triggerid=".$row["triggerid"],"action"), + new CLink(zbx_date2str(S_DATE_FORMAT_YMDHMS,$row_event['clock']),'events.php?triggerid='.$row['triggerid'],'action'), get_node_name_by_elid($row['triggerid']), $host, $description, |