diff options
author | artem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2008-07-04 12:32:47 +0000 |
---|---|---|
committer | artem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2008-07-04 12:32:47 +0000 |
commit | 0218e165825ef10e034b1784777c1d53cf789104 (patch) | |
tree | 6e03d4a3ca1d6f644e7ae4ec9c14ecb239ae80ec /frontends | |
parent | e9e80b1adb24d4c1cfffdc3e5837797a26c877cc (diff) | |
download | zabbix-0218e165825ef10e034b1784777c1d53cf789104.tar.gz zabbix-0218e165825ef10e034b1784777c1d53cf789104.tar.xz zabbix-0218e165825ef10e034b1784777c1d53cf789104.zip |
- [DEV-188] implemented sound on/off button in status of triggers screens (Artem)
- [ZBX-333] fixed export/import time issue (Artem)
- [ZBX-270] minor fix in code performance (Artem)
git-svn-id: svn://svn.zabbix.com/trunk@5817 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends')
-rw-r--r-- | frontends/php/charts.php | 2 | ||||
-rw-r--r-- | frontends/php/dashboard.php | 6 | ||||
-rw-r--r-- | frontends/php/exp_imp.php | 10 | ||||
-rw-r--r-- | frontends/php/images/general/bttn/mute.png | bin | 0 -> 3150 bytes | |||
-rw-r--r-- | frontends/php/images/general/bttn/mute_bb.png | bin | 0 -> 3518 bytes | |||
-rw-r--r-- | frontends/php/images/general/bttn/sound.png | bin | 0 -> 3415 bytes | |||
-rw-r--r-- | frontends/php/images/general/bttn/sound_bb.png | bin | 0 -> 3651 bytes | |||
-rw-r--r-- | frontends/php/include/export.inc.php | 2 | ||||
-rw-r--r-- | frontends/php/include/locales/en_gb.inc.php | 2 | ||||
-rw-r--r-- | frontends/php/js/common.js | 87 | ||||
-rw-r--r-- | frontends/php/styles/css_bb.css | 8 | ||||
-rw-r--r-- | frontends/php/styles/div.css | 23 | ||||
-rw-r--r-- | frontends/php/tr_status.php | 32 |
13 files changed, 105 insertions, 67 deletions
diff --git a/frontends/php/charts.php b/frontends/php/charts.php index f5979932..e729deb1 100644 --- a/frontends/php/charts.php +++ b/frontends/php/charts.php @@ -59,7 +59,7 @@ include_once 'include/page_header.php'; <?php if(isset($_REQUEST['favobj'])){ - if(in_array($_REQUEST['favobj'],array('itemid','graphid'))){ + if(str_in_array($_REQUEST['favobj'],array('itemid','graphid'))){ $result = false; if('add' == $_REQUEST['action']){ $result = add2favorites('web.favorite.graphids',$_REQUEST['favid'],$_REQUEST['favobj']); diff --git a/frontends/php/dashboard.php b/frontends/php/dashboard.php index e6a72041..4cb276c0 100644 --- a/frontends/php/dashboard.php +++ b/frontends/php/dashboard.php @@ -88,7 +88,7 @@ include_once "include/page_header.php"; } } if('set_rf_rate' == $_REQUEST['favobj']){ - if(in_array($_REQUEST['favid'],array('hat_syssum','hat_stszbx','hat_lastiss','hat_webovr','hat_dscvry'))){ + if(str_in_array($_REQUEST['favid'],array('hat_syssum','hat_stszbx','hat_lastiss','hat_webovr','hat_dscvry'))){ update_profile('web.dahsboard.rf_rate.'.$_REQUEST['favid'],$_REQUEST['favcnt'], PROFILE_TYPE_INT); $_REQUEST['favcnt'] = get_profile('web.dahsboard.rf_rate.'.$_REQUEST['favid'],60); @@ -108,7 +108,7 @@ include_once "include/page_header.php"; } } - if(in_array($_REQUEST['favobj'],array('itemid','graphid'))){ + if(str_in_array($_REQUEST['favobj'],array('itemid','graphid'))){ $result = false; if('add' == $_REQUEST['action']){ $result = add2favorites('web.favorite.graphids',$_REQUEST['favid'],$_REQUEST['favobj']); @@ -147,7 +147,7 @@ include_once "include/page_header.php"; echo 'dashboard_submenu["menu_sysmaps"] = '.zbx_jsvalue(make_sysmap_submenu()).';'; } } - if(in_array($_REQUEST['favobj'],array('screenid','slideshowid'))){ + if(str_in_array($_REQUEST['favobj'],array('screenid','slideshowid'))){ $result = false; if('add' == $_REQUEST['action']){ $result = add2favorites('web.favorite.screenids',$_REQUEST['favid'],$_REQUEST['favobj']); diff --git a/frontends/php/exp_imp.php b/frontends/php/exp_imp.php index a3950e85..91b691b1 100644 --- a/frontends/php/exp_imp.php +++ b/frontends/php/exp_imp.php @@ -419,11 +419,13 @@ include_once "include/page_header.php"; NULL,true), $screens)*/ )); - $table->SetFooter(new CCol(array( - new CButton('preview', S_PREVIEW), - new CButton('export', S_EXPORT) - ))); } + + $table->SetFooter(new CCol(array( + new CButton('preview', S_PREVIEW), + new CButton('export', S_EXPORT) + ))); + $form->AddItem($table); $form->Show(); } diff --git a/frontends/php/images/general/bttn/mute.png b/frontends/php/images/general/bttn/mute.png Binary files differnew file mode 100644 index 00000000..a189199c --- /dev/null +++ b/frontends/php/images/general/bttn/mute.png diff --git a/frontends/php/images/general/bttn/mute_bb.png b/frontends/php/images/general/bttn/mute_bb.png Binary files differnew file mode 100644 index 00000000..5397cf89 --- /dev/null +++ b/frontends/php/images/general/bttn/mute_bb.png diff --git a/frontends/php/images/general/bttn/sound.png b/frontends/php/images/general/bttn/sound.png Binary files differnew file mode 100644 index 00000000..ea021b6a --- /dev/null +++ b/frontends/php/images/general/bttn/sound.png diff --git a/frontends/php/images/general/bttn/sound_bb.png b/frontends/php/images/general/bttn/sound_bb.png Binary files differnew file mode 100644 index 00000000..cf28644f --- /dev/null +++ b/frontends/php/images/general/bttn/sound_bb.png diff --git a/frontends/php/include/export.inc.php b/frontends/php/include/export.inc.php index a4e3649c..c8f23a7a 100644 --- a/frontends/php/include/export.inc.php +++ b/frontends/php/include/export.inc.php @@ -461,7 +461,7 @@ zbx_xmlwriter_start_element ($memory,XML_TAG_ZABBIX_EXPORT); zbx_xmlwriter_write_attribute($memory, 'version', '1.0'); zbx_xmlwriter_write_attribute($memory, 'date', date('d.m.y')); - zbx_xmlwriter_write_attribute($memory, 'time', date('h.i')); + zbx_xmlwriter_write_attribute($memory, 'time', date('H.i')); zbx_xmlwriter_start_element ($memory,XML_TAG_HOSTS); foreach($hosts as $hostid => $val){ diff --git a/frontends/php/include/locales/en_gb.inc.php b/frontends/php/include/locales/en_gb.inc.php index 3b13e2c8..1b2feaf5 100644 --- a/frontends/php/include/locales/en_gb.inc.php +++ b/frontends/php/include/locales/en_gb.inc.php @@ -1367,6 +1367,8 @@ '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', diff --git a/frontends/php/js/common.js b/frontends/php/js/common.js index cdc6ce46..621bb4c2 100644 --- a/frontends/php/js/common.js +++ b/frontends/php/js/common.js @@ -122,16 +122,7 @@ function add2favorites(favobj,favid){ 'action': 'add' } - var uri = new url(location.href); - - new Ajax.Request(uri.getPath()+"?output=ajax", - { - 'method': 'post', - 'parameters':params, - 'onSuccess': function(resp){ },//alert(resp.responseText); - 'onFailure': function(){ document.location = uri.getPath()+'?'+Object.toQueryString(params); } - } - ); + send_params(params); // json.onetime('dashboard.php?output=json&'+Object.toQueryString(params)); } @@ -152,17 +143,7 @@ function rm4favorites(favobj,favid,menu_rowid){ 'action': 'remove' } - var uri = new url(location.href); - - new Ajax.Request(uri.getPath()+"?output=ajax", - { - 'method': 'post', - 'parameters':params, - 'onSuccess': function(resp){ },//alert(resp.responseText); - 'onFailure': function(){ document.location = uri.getPath()+'?'+Object.toQueryString(params); } - } - ); - + send_params(params); // json.onetime('dashboard.php?output=json&'+Object.toQueryString(params)); } @@ -421,17 +402,24 @@ function eventTarget(e){ return targ; } +function send_params(params){ + + var uri = new url(location.href); + new Ajax.Request(uri.getPath()+"?output=ajax", + { + 'method': 'post', + 'parameters':params, + 'onSuccess': function(resp){ },//alert(resp.responseText); + 'onFailure': function(){ document.location = uri.getPath()+'?'+Object.toQueryString(params); } + } + ); +} + + /************************************************************************************/ /* Pages stuff */ /************************************************************************************/ function change_hat_state(icon, divid){ - if((typeof(icon) == 'undefined') || (typeof(divid) == 'undefined')) throw "Function [change_hat_state()] awaits exactly 2 arguments."; - - if(typeof(Ajax) == 'undefined'){ - throw("Prototype.js lib is required!"); - return false; - } - deselectAll(); var hat_state = ShowHide(divid); switchElementsClass(icon,"arrowup","arrowdown"); @@ -444,26 +432,10 @@ function change_hat_state(icon, divid){ 'state': hat_state } - var uri = new url(location.href); - new Ajax.Request(uri.getPath()+"?output=ajax", - { - 'method': 'post', - 'parameters':params, - 'onSuccess': function(resp){ },//alert(resp.responseText); - 'onFailure': function(){ document.location = uri.getPath()+'?'+Object.toQueryString(params); } - } - ); - + send_params(params); } function change_filter_state(icon, divid){ - if((typeof(icon) == 'undefined') || (typeof(divid) == 'undefined')) throw "Function [change_filter_state()] awaits exactly 2 arguments."; - - if('undefined' == typeof(Ajax)){ - throw("Prototype.js lib is required!"); - return false; - } - deselectAll(); var filter_state = ShowHide(divid); switchElementsClass(icon,"filteropened","filterclosed"); @@ -476,15 +448,22 @@ function change_filter_state(icon, divid){ 'state': filter_state } - var uri = new url(location.href); - new Ajax.Request(uri.getPath()+"?output=ajax", - { - 'method': 'post', - 'parameters':params, - 'onSuccess': function(resp){ },//alert(resp.responseText); - 'onFailure': function(){ document.location = uri.getPath()+'?'+Object.toQueryString(params); } - } - ); + send_params(params); +} + +function switch_mute(icon){ + deselectAll(); + var sound_state = switchElementsClass(icon,"iconmute","iconsound"); + + if(false === sound_state) return false; + sound_state = (sound_state == "iconmute")?1:0; + + var params = { + 'favobj': 'sound', + 'state': sound_state + } + + send_params(params); } function GetSelectedText(obj){ diff --git a/frontends/php/styles/css_bb.css b/frontends/php/styles/css_bb.css index 2d8c8fb7..a308f4ee 100644 --- a/frontends/php/styles/css_bb.css +++ b/frontends/php/styles/css_bb.css @@ -298,6 +298,14 @@ div.iconhelp{ background-image: url('../images/general/bttn/help_bb.png'); } +div.iconsound{ + background-image: url('../images/general/bttn/sound_bb.png'); +} + +div.iconmute{ + background-image: url('../images/general/bttn/mute_bb.png'); +} + div#scrolltableft{ color: #0CF; } diff --git a/frontends/php/styles/div.css b/frontends/php/styles/div.css index 7d368885..7f83fd62 100644 --- a/frontends/php/styles/div.css +++ b/frontends/php/styles/div.css @@ -133,6 +133,29 @@ div.filteropened:hover{ cursor:pointer; } +div.iconsound{ + height: 18px; + width: 18px; + background-image: url('../images/general/bttn/sound.png'); + background-repeat:no-repeat; +} + +div.iconsound:hover{ + cursor:pointer; +} + +div.iconmute{ + height: 18px; + width: 18px; + background-image: url('../images/general/bttn/mute.png'); + background-repeat:no-repeat; +} + +div.iconmute:hover{ + cursor:pointer; +} + + span.footer_sign{ padding-right: 5px; padding-left: 5px; diff --git a/frontends/php/tr_status.php b/frontends/php/tr_status.php index a19ef1a8..cfea839a 100644 --- a/frontends/php/tr_status.php +++ b/frontends/php/tr_status.php @@ -30,6 +30,8 @@ $page["title"] = "S_STATUS_OF_TRIGGERS"; $page['scripts'] = array('blink.js'); $page['hist_arg'] = array('groupid','hostid','compact','onlytrue','noactions','select'); + + $page['type'] = detect_page_type(PAGE_TYPE_HTML); ?> <?php @@ -93,10 +95,26 @@ include_once "include/page_header.php"; 'select'=> array(T_ZBX_STR, O_OPT, null, IN('"true","false"'), null), 'txt_select'=> array(T_ZBX_STR, O_OPT, null, null, null), 'fullscreen'=> array(T_ZBX_INT, O_OPT, P_SYS, IN('0,1'), null), - 'btnSelect'=> array(T_ZBX_STR, O_OPT, null, null, null) + 'btnSelect'=> array(T_ZBX_STR, O_OPT, null, null, null), + +//ajax + 'favobj'=> array(T_ZBX_STR, O_OPT, P_ACT, NULL, NULL), + 'state'=> array(T_ZBX_INT, O_OPT, P_ACT, NOT_EMPTY, 'isset({favobj})'), + ); check_fields($fields); + + if(isset($_REQUEST['favobj'])){ + if(str_in_array($_REQUEST['favobj'],array('sound'))){ + update_profile('web.tr_status.mute',$_REQUEST['state'], PROFILE_TYPE_INT); + } + } + + if((PAGE_TYPE_JS == $page['type']) || (PAGE_TYPE_HTML_BLOCK == $page['type'])){ + exit(); + } + validate_sort_and_sortorder('t.lastchange',ZBX_SORT_DOWN); $_REQUEST['show_triggers'] = get_request('show_triggers', get_profile('web.tr_status.show_triggers', TRIGGERS_OPTION_ONLYTRUE)); @@ -127,8 +145,10 @@ include_once "include/page_header.php"; update_profile('web.tr_status.compact',$_REQUEST['compact'], PROFILE_TYPE_STR); $config=select_config(); - - if(isset($audio)){ + + $mute = get_profile('web.tr_status.mute',0); + + if(isset($audio) && !$mute){ play_sound($audio); } ?> @@ -241,9 +261,13 @@ include_once "include/page_header.php"; $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."';")); + + $mute_icon = new CDiv(SPACE,$mute?'iconmute':'iconsound'); + $mute_icon->AddOption('title',S_SOUND.' '.S_ON.'/'.S_OFF); + $mute_icon->AddAction('onclick',new CScript("javascript: switch_mute(this);")); $icon_tab = new CTable(); - $icon_tab->AddRow(array($fs_icon,SPACE,$text)); + $icon_tab->AddRow(array($fs_icon,$mute_icon,SPACE,$text)); $text = $icon_tab; |