diff --git a/pandora_console/include/functions_alerts.php b/pandora_console/include/functions_alerts.php index 3f47d58352..305a0cb089 100644 --- a/pandora_console/include/functions_alerts.php +++ b/pandora_console/include/functions_alerts.php @@ -132,7 +132,7 @@ function alerts_get_alerts($id_group = 0, $free_search = "", $status = "all", $s * * @return mixed Return id if the group have any alert is fired or false is not. */ -function alerts_get_event_status_group($idGroup, $type = "alert_fired", $query = 'AND 1=1') { +function alerts_get_event_status_group($idGroup, $type = "alert_fired", $query = 'AND 1=1', $agents = null) { global $config; $return = false; @@ -151,9 +151,14 @@ function alerts_get_event_status_group($idGroup, $type = "alert_fired", $query = $typeWhere = ' AND event_type IN (' . implode(',', $temp) . ')'; } - $agents = agents_get_group_agents($idGroup, false, "lower", false); - - $idAgents = array_keys($agents); + if ($agents == null) { + $agents = agents_get_group_agents($idGroup, false, "lower", false); + + $idAgents = array_keys($agents); + } + else { + $idAgents = array_values($agents); + } $result = db_get_all_rows_sql('SELECT id_evento FROM tevento diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index 40ad4f71a1..55c8e6a54c 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -3509,6 +3509,17 @@ div.simple_value > a > span.text p font-size:13pt; top:8px; } +.modalheaderh1{ + text-align:center; + width:100%; + height:37px; + left:0px; + background-color:#82b92e; + color:white; + position:relative; + font-family:Nunito; + font-size:13pt; +} .modalclosex{ cursor:pointer; display:inline; diff --git a/pandora_console/operation/events/events.php b/pandora_console/operation/events/events.php index a9cc441aeb..71ecff986d 100644 --- a/pandora_console/operation/events/events.php +++ b/pandora_console/operation/events/events.php @@ -133,24 +133,30 @@ if (is_ajax ()) { $id = get_parameter('id_row'); $idGroup = get_parameter('id_group'); - + $agents = get_parameter('agents', null); + $query = ' AND id_evento > ' . $id; $type = array(); $alert = get_parameter('alert_fired'); if ($alert == 'true') { $resultAlert = alerts_get_event_status_group($idGroup, - 'alert_fired', $query); + 'alert_fired', $query, $agents); } $critical = get_parameter('critical'); if ($critical == 'true') { $resultCritical = alerts_get_event_status_group($idGroup, - 'going_up_critical', $query); + 'going_up_critical', $query, $agents); } $warning = get_parameter('warning'); if ($warning == 'true') { $resultWarning = alerts_get_event_status_group($idGroup, - 'going_up_warning', $query); + 'going_up_warning', $query, $agents); + } + $unknown = get_parameter('unknown'); + if ($unknown == 'true') { + $resultUnknown = alerts_get_event_status_group($idGroup, + 'going_unknown', $query, $agents); } if ($resultAlert) { @@ -165,6 +171,10 @@ if (is_ajax ()) { $return = array('fired' => $resultWarning, 'sound' => $config['sound_warning']); } + else if ($resultUnknown) { + $return = array('fired' => $resultWarning, + 'sound' => $config['sound_alert']); + } else { $return = array('fired' => 0); } @@ -427,7 +437,7 @@ if ($config["pure"] == 0 || $meta) { echo ui_get_full_url('operation/events/sound_events.php'); ?>'; - window.open(url, '','width=300, height=300, toolbar=no, location=no, directories=no, status=no, menubar=no, resizable=yes'); + window.open(url, '','width=400, height=380, toolbar=no, location=no, directories=no, status=no, menubar=no, resizable=no'); } "; echo ""; echo "" . __("Sound Events") . ""; @@ -62,32 +64,40 @@ echo "" . __("Sound Events") . ""; echo ''; echo ''; echo ""; -echo ""; -echo html_print_image('images/pandora_logo_head.png', true); -echo "

" . __("Sound console"). "

"; +echo ""; +echo "

" . __("Sound console"). "

"; $table = null; $table->width = '100%'; $table->size[0] = '10%'; -$table->size[1] = '90%'; $table->style[0] = 'font-weight: bold; vertical-align: top;'; +$table->style[1] = 'font-weight: bold; vertical-align: top;'; $table->data[0][0] = __('Group'); -$table->data[0][1] = html_print_select_groups(false, $access, true, 'group', '', 'changeGroup();', '', 0, true); -$table->data[1][0] = __('Type'); -$table->data[1][1] = html_print_checkbox('alert_fired', 'alert_fired', true, true, false, 'changeType();') . __('Alert fired') . '
' . +$table->data[0][0] .= html_print_select_groups(false, $access, true, 'group', '', 'changeGroup();', '', 0, true) . '
' . '
'; +$table->data[0][0] .= __('Agent'); +$table->data[0][0] .= html_print_select($agents, 'id_agents[]', true, false, '', '', true, true); +$table->data[0][1] = __('Type'); +$table->data[0][1] .= '
' . html_print_checkbox('alert_fired', 'alert_fired', true, true, false, 'changeType();') . __('Alert fired') . '
' . html_print_checkbox('critical', 'critical', true, true, false, 'changeType();') . __('Monitor critical') . '
' . - html_print_checkbox('warning', 'warning', true, true, false, 'changeType();') . __('Monitor warning') . '
' . -$table->data[2][0] = ''; -$table->data[2][1] = '' . - html_print_image("images/play.button.png", true, array("id" => "button")) . - ''; -$table->data[2][1] .= '' . - html_print_image("images/ok.button.png", true, - array("style" => "margin-left: 10px;")) . ''; + html_print_checkbox('unknown', 'unknown', true, true, false, 'changeType();') . __('Monitor unknown') . '
' . + html_print_checkbox('warning', 'warning', true, true, false, 'changeType();') . __('Monitor warning') . '
'; html_print_table($table); + +echo '
'; + +echo '' . + html_print_image("images/icono_play.png", true, array("id" => "button")) . + ''; +echo '' . + html_print_image("images/icono_ok.png", true, array("style" => "margin-left: 15px;")) . + ''; +echo '' . + html_print_image("images/icono_altavoz.png", true, array("id" => "button_try", "style" => "margin-left: 15px;")) . + ''; + ?>