Improve code and fix update alerts

This commit is contained in:
José González 2022-06-29 11:05:50 +02:00
parent 237de0ee97
commit 7edcd3b0a6
2 changed files with 34 additions and 23 deletions

View File

@ -128,7 +128,7 @@ if (is_array($temp) === true) {
} }
$form_filter .= "<td class='bolder''>".__('Actions').'</td><td>'; $form_filter .= "<td class='bolder''>".__('Actions').'</td><td>';
$form_filter .= html_print_select($arrayActions, 'action_id', $actionID, '', __('All'), -1, true); $form_filter .= html_print_select($arrayActions, 'action_id', $actionID, '', __('All'), -1, true, false, true, '', false, 'width:95%');
$form_filter .= '</td>'; $form_filter .= '</td>';
$form_filter .= "<td class='bolder''>".__('Field content').'</td><td>'; $form_filter .= "<td class='bolder''>".__('Field content').'</td><td>';
$form_filter .= html_print_input_text('field_content', $fieldContent, '', 12, 255, true); $form_filter .= html_print_input_text('field_content', $fieldContent, '', 12, 255, true);
@ -1192,8 +1192,8 @@ function show_display_update_action(id_module_action, alert_id, alert_id_agent_m
dropdownParent: $(`#update_action-div-${alert_id}`) dropdownParent: $(`#update_action-div-${alert_id}`)
}); });
}, },
width: 455, width: 600,
height: 500 height: 350
}) })
.show (); .show ();
} }

View File

@ -1,18 +1,29 @@
<?php <?php
// Pandora FMS - http://pandorafms.com /**
// ================================================== * Ajax script for List view for Alerts.
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas *
// Please see http://pandorafms.org for full contribution list * @category Alerts
// This program is free software; you can redistribute it and/or * @package Community
// modify it under the terms of the GNU General Public License * @subpackage Software agents repository
// as published by the Free Software Foundation for version 2. * @version 1.0.0
// This program is distributed in the hope that it will be useful, * @license See below
// but WITHOUT ANY WARRANTY; without even the implied warranty of *
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * ______ ___ _______ _______ ________
// GNU General Public License for more details. * | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ==========================================================
* Copyright (c) 2005-2022 Artica Soluciones Tecnológicas S.L
* This code is NOT free software. This code is NOT licenced under GPL2 licence
* You cannot redistribute it without written permission of copyright holder.
* ============================================================================
*/
// Begin.
global $config; global $config;
// Login check // Login check.
check_login(); check_login();
require_once 'include/functions_agents.php'; require_once 'include/functions_agents.php';
@ -60,7 +71,7 @@ if ($get_agent_alerts_simple) {
$alerts = agents_get_alerts_simple($id_agent); $alerts = agents_get_alerts_simple($id_agent);
if (empty($alerts)) { if (empty($alerts) === true) {
echo json_encode(false); echo json_encode(false);
return; return;
} }
@ -424,7 +435,7 @@ if ($show_update_action_menu) {
); );
$data .= '<form id="update_action-'.$id_alert.'" method="post" style="height:85%;">'; $data .= '<form id="update_action-'.$id_alert.'" method="post" style="height:85%;">';
$data .= '<table class="databox_color w100p bg_color222" style="height:100%;">'; $data .= '<table class="w100p bg_color222" style="height:100%;">';
$data .= html_print_input_hidden( $data .= html_print_input_hidden(
'update_action', 'update_action',
1, 1,
@ -442,7 +453,7 @@ if ($show_update_action_menu) {
); );
if (! $id_agente) { if (! $id_agente) {
$data .= '<tr class="datos2">'; $data .= '<tr class="datos2">';
$data .= '<td class="datos2 bolder_6px">'; $data .= '<td class="datos2 bolder pdd_6px font_10pt">';
$data .= __('Agent').'&nbsp;'.ui_print_help_icon( $data .= __('Agent').'&nbsp;'.ui_print_help_icon(
'alert_scalate', 'alert_scalate',
true, true,
@ -463,7 +474,7 @@ if ($show_update_action_menu) {
} }
$data .= '<tr class="datos">'; $data .= '<tr class="datos">';
$data .= '<td class="datos bolder_6px">'; $data .= '<td class="datos bolder pdd_6px font_10pt">';
$data .= __('Module'); $data .= __('Module');
$data .= '</td>'; $data .= '</td>';
$data .= '<td class="datos">'; $data .= '<td class="datos">';
@ -478,7 +489,7 @@ if ($show_update_action_menu) {
$data .= '</td>'; $data .= '</td>';
$data .= '</tr>'; $data .= '</tr>';
$data .= '<tr class="datos2">'; $data .= '<tr class="datos2">';
$data .= '<td class="datos2 bolder_6px">'; $data .= '<td class="datos2 bolder pdd_6px font_10pt">';
$data .= __('Action'); $data .= __('Action');
$data .= '</td>'; $data .= '</td>';
$data .= '<td class="datos2">'; $data .= '<td class="datos2">';
@ -494,12 +505,12 @@ if ($show_update_action_menu) {
true, true,
'', '',
false, false,
'width:150px' 'width:95%'
); );
$data .= '</td>'; $data .= '</td>';
$data .= '</tr>'; $data .= '</tr>';
$data .= '<tr class="datos">'; $data .= '<tr class="datos">';
$data .= '<td class="datos bolder_6px">'; $data .= '<td class="datos bolder pdd_6px font_10pt">';
$data .= __('Number of alerts match from'); $data .= __('Number of alerts match from');
$data .= '</td>'; $data .= '</td>';
$data .= '<td class="datos">'; $data .= '<td class="datos">';
@ -523,7 +534,7 @@ if ($show_update_action_menu) {
$data .= '</td>'; $data .= '</td>';
$data .= '</tr>'; $data .= '</tr>';
$data .= '<tr class="datos2">'; $data .= '<tr class="datos2">';
$data .= '<td class="datos2 bolder_6px">'; $data .= '<td class="datos2 bolder pdd_6px font_10pt">';
$data .= __('Threshold'); $data .= __('Threshold');
$data .= '</td>'; $data .= '</td>';
$data .= '<td class="datos2">'; $data .= '<td class="datos2">';