From cfff9c065d006f029d8e5ad608fde20a1f07cf73 Mon Sep 17 00:00:00 2001 From: Tatiana Llorente Date: Wed, 17 Apr 2019 09:27:15 +0200 Subject: [PATCH 01/13] New View Create/Update Agent - #3611 Former-commit-id: 5a36e41a05341d5afa19917a99f34ac16cfc99e9 --- .../godmode/agentes/agent_manager.php | 188 +++++++++++------- pandora_console/include/functions_ui.php | 4 +- pandora_console/include/styles/pandora.css | 135 +++++++++++++ 3 files changed, 254 insertions(+), 73 deletions(-) diff --git a/pandora_console/godmode/agentes/agent_manager.php b/pandora_console/godmode/agentes/agent_manager.php index a7fc1f156a..37a65581fe 100644 --- a/pandora_console/godmode/agentes/agent_manager.php +++ b/pandora_console/godmode/agentes/agent_manager.php @@ -167,27 +167,18 @@ if ($disk_conf_delete) { echo '
'; -$table = new stdClass(); -$table->width = '100%'; -$table->class = 'databox filters'; - -$table->head = []; -$table->style = []; -$table->style[0] = 'font-weight: bold; width: 150px;'; -$table->data = []; - -$table->align[2] = 'center'; - if (!$new_agent && $alias != '') { - $table->data[0][0] = __('Agent name').ui_print_help_tip(__("The agent's name must be the same as the one defined at the console"), true); - $table->data[0][1] = html_print_input_text('agente', $nombre_agente, '', 50, 100, true); + $table_agent_name = '

'.__('Agent name').': '.ui_print_help_tip(__("The agent's name must be the same as the one defined at the console"), true).'

'; + $table_agent_name .= '
'; + $table_agent_name .= '
'.html_print_input_text('agente', $nombre_agente, '', 50, 100, true).'
'; + $table_agent_name .= '
'; - $table->data[0][2] = __('QR Code Agent view'); + $table_qr_code = '

'.__('QR Code Agent view').':

'; if ($id_agente) { - $table->data[0][1] .= ' '.__('ID')."  $id_agente  "; - $table->data[0][1] .= '  '; - $table->data[0][1] .= html_print_image( + $table_agent_name .= ''.__('ID').' '.$id_agente.''; + $table_agent_name .= ''; + $table_agent_name .= html_print_image( 'images/zoom.png', true, [ @@ -195,11 +186,19 @@ if (!$new_agent && $alias != '') { 'title' => __('Agent detail'), ] ); - $table->data[0][1] .= ''; + $table_agent_name .= ''; } +} else { + $agent_info_new = 'agent_info_new'; } -// Remote configuration available +// Delete link from here. +if (!$new_agent) { + $table_agent_name .= "".html_print_image('images/cross.png', true, ['title' => __('Delete agent')]).''; +} + + +// Remote configuration available. if (!$new_agent) { if (isset($filename)) { if (file_exists($filename['md5'])) { @@ -207,8 +206,8 @@ if (!$new_agent) { $agent_name = io_safe_output($agent_name); $agent_md5 = md5($agent_name, false); - $table->data[0][1] .= '  '.''; - $table->data[0][1] .= html_print_image( + $table_agent_name .= ''; + $table_agent_name .= html_print_image( 'images/application_edit.png', true, [ @@ -216,7 +215,7 @@ if (!$new_agent) { 'title' => __('This agent can be remotely configured'), ] ); - $table->data[0][1] .= ''.ui_print_help_tip( + $table_agent_name .= ''.ui_print_help_tip( __('You can remotely edit this agent configuration'), true ); @@ -224,27 +223,38 @@ if (!$new_agent) { } } -// Delete link from here if (!$new_agent) { - $table->data[0][1] .= "  ".html_print_image('images/cross.png', true, ['title' => __('Delete agent')]).''; + $table_agent_name .= '
'; } -$table->data[1][0] = __('Alias').ui_print_help_tip(__('Characters /,\,|,%,#,&,$ will be ignored'), true).''; -$table->data[1][1] = html_print_input_text('alias', $alias, '', 50, 100, true); if ($new_agent) { - $table->data[1][1] .= html_print_checkbox('alias_as_name', 1, $config['alias_as_name'], true).__('Use alias as name'); + $label_select_child_left = 'label_select_child_left'; + $label_select_parent = 'label_select_parent'; } -$table->data[2][0] = __('IP Address'); -$table->data[2][1] = html_print_input_text('direccion', $direccion_agente, '', 16, 100, true).html_print_checkbox('unique_ip', 1, $config['unique_ip'], true).__('Unique IP').ui_print_help_tip(__('Set the primary IP address as the unique IP, preventing the same primary IP address from being used in more than one agent'), true); +$table_alias = '

'.__('Alias').': '.ui_print_help_tip(__('Characters /,\,|,%,#,&,$ will be ignored'), true).'

'; +$table_alias .= '
'; +$table_alias .= '
'.html_print_input_text('alias', $alias, '', 50, 100, true).'
'; +if ($new_agent) { + $table_alias .= '
'.html_print_checkbox_switch('alias_as_name', 1, $config['alias_as_name'], true).__('Use alias as name').'
'; +} + +$table_alias .= '
'; + +$table_ip = '

'.__('IP Address').':

'; +$table_ip .= '
'; +$table_ip .= '
'.html_print_input_text('direccion', $direccion_agente, '', 16, 100, true).'
'; +$table_ip .= '
'.html_print_checkbox_switch('unique_ip', 1, $config['unique_ip'], true).__('Unique IP').ui_print_help_tip(__('Set the primary IP address as the unique IP, preventing the same primary IP address from being used in more than one agent'), true).'
'; +$table_ip .= '
'; if ($id_agente) { - $table->data[2][1] .= '    '; - $ip_all = agents_get_addresses($id_agente); - $table->data[2][1] .= html_print_select($ip_all, 'address_list', $direccion_agente, '', '', 0, true); - $table->data[2][1] .= ' '.html_print_checkbox('delete_ip', 1, false, true).__('Delete selected'); + $table_ip .= '
'; + $table_ip .= '
'; + $table_ip .= '
'.html_print_select($ip_all, 'address_list', $direccion_agente, '', '', 0, true).'
'; + $table_ip .= '
'.html_print_checkbox_switch('delete_ip', 1, false, true).__('Delete selected').'
'; + $table_ip .= '
'; } ?> @@ -255,12 +265,13 @@ if ($id_agente) { rowspan[2][2] = 3; if ($id_agente) { - $table->data[2][2] = ""; + $table_qr_code .= ""; } else { - $table->data[2][2] = __('Only it is show when
the agent is saved.'); + $table_qr_code .= __('Only it is show when
the agent is saved.'); } + + $table_qr_code .= '
'; } $groups = users_get_groups($config['id_user'], 'AR', false); @@ -277,28 +288,32 @@ if (is_array($modules)) { } } -$table->data[4][0] = __('Primary group'); -// Cannot change primary group if user have not permission for that group +$table_primary_group = '

'.__('Primary group').':

'; +$table_primary_group .= '
'; +// Cannot change primary group if user have not permission for that group. if (isset($groups[$grupo]) || $new_agent) { - $table->data[4][1] = html_print_select_groups(false, 'AR', false, 'grupo', $grupo, '', '', 0, true); + $table_primary_group .= html_print_select_groups(false, 'AR', false, 'grupo', $grupo, '', '', 0, true); } else { - $table->data[4][1] = groups_get_name($grupo); - $table->data[4][1] .= html_print_input_hidden('grupo', $grupo, true); + $table_primary_group .= groups_get_name($grupo); + $table_primary_group .= html_print_input_hidden('grupo', $grupo, true); } -$table->data[4][1] .= ' '; -$table->data[4][1] .= ui_print_group_icon($grupo, true); -$table->data[4][1] .= ''; +$table_primary_group .= '
'; +$table_primary_group .= ui_print_group_icon($grupo, true); +$table_primary_group .= '
'; -$table->data[5][0] = __('Interval'); - -$table->data[5][1] = html_print_extended_select_for_time('intervalo', $intervalo, '', '', '0', 10, true); +$table_interval = '

'.__('Interval').':

'; +$table_interval .= '
'; +$table_interval .= html_print_extended_select_for_time('intervalo', $intervalo, '', '', '0', 10, true); if ($intervalo < SECONDS_5MINUTES) { - $table->data[5][1] .= clippy_context_help('interval_agent_min'); + $table_interval .= clippy_context_help('interval_agent_min'); } -$table->data[6][0] = __('OS'); -$table->data[6][1] = html_print_select_from_sql( +$table_interval .= '
'; + +$table_os = '

'.__('OS').':

'; +$table_os .= '
'; +$table_os .= html_print_select_from_sql( 'SELECT id_os, name FROM tconfig_os', 'id_os', $id_os, @@ -307,18 +322,19 @@ $table->data[6][1] = html_print_select_from_sql( '0', true ); -$table->data[6][1] .= ' '; -$table->data[6][1] .= ui_print_os_icon($id_os, false, true); -$table->data[6][1] .= ''; +$table_os .= '
'; +$table_os .= ui_print_os_icon($id_os, false, true); +$table_os .= '
'; -// Network server +// Network server. $servers = servers_get_names(); if (!array_key_exists($server_name, $servers)) { $server_Name = 0; // Set the agent have not server. } -$table->data[7][0] = __('Server'); +$table_server = '

'.__('Server').':

'; +$table_server .= '
'; if ($new_agent) { // Set first server by default. $servers_get_names = servers_get_names(); @@ -326,7 +342,7 @@ if ($new_agent) { $server_name = reset($array_keys_servers_get_names); } -$table->data[7][1] = html_print_select( +$table_server .= html_print_select( servers_get_names(), 'server_name', $server_name, @@ -334,21 +350,30 @@ $table->data[7][1] = html_print_select( __('None'), 0, true -).' '.ui_print_help_icon('agent_server', true); +).'
'.ui_print_help_icon('agent_server', true).'
'; -// Description -$table->data[8][0] = __('Description'); -$table->data[8][1] = html_print_input_text( +// Description. +$table_description = '

'.__('Description').':

'; +$table_description .= html_print_input_text( 'comentarios', $comentarios, '', 45, 200, true -); +).'
'; -html_print_table($table); -unset($table); + +echo '
+
+
'.$table_agent_name.$table_alias.$table_ip.$table_primary_group.'
+
'.$table_interval.$table_os.$table_server.$table_description.'
+
'; +if (!$new_agent) { + echo $table_qr_code; +} + +echo '
'; $table = new stdClass(); $table->width = '100%'; @@ -689,11 +714,11 @@ unset($table); $table = new stdClass(); $table->width = '100%'; -$table->class = 'databox filters'; +$table->class = 'custom_fields_table'; $table->head = []; $table->style = []; -$table->style[0] = 'font-weight: bold; width: 100px;'; +$table->style[0] = 'font-weight: bold;'; $table->data = []; $fields = db_get_all_fields_in_table('tagent_custom_fields'); @@ -703,11 +728,15 @@ if ($fields === false) { } foreach ($fields as $field) { - $data[0] = ''.$field['name'].''; + $id_custom_field = $field['id_field']; + + $data[0] = '
'; + $data[0] .= ''.$field['name'].''; $data[0] .= ui_print_help_tip( __('This field allows url insertion using the BBCode\'s url tag').'.
'.__('The format is: [url=\'url to navigate\']\'text to show\'[/url]').'.

'.__('e.g.: [url=google.com]Google web search[/url]'), true ); + $data[0] .= '
'; $combo = []; $combo = $field['combo_values']; $combo = explode(',', $combo); @@ -730,7 +759,7 @@ foreach ($fields as $field) { } if ($field['is_password_type']) { - $data[1] = html_print_input_text_extended( + $data_field[1] = html_print_input_text_extended( 'customvalue_'.$field['id_field'], $custom_value, 'customvalue_'.$field['id_field'], @@ -744,18 +773,18 @@ foreach ($fields as $field) { true ); } else { - $data[1] = html_print_textarea( + $data_field[1] = html_print_textarea( 'customvalue_'.$field['id_field'], 2, 65, $custom_value, - 'style="min-height: 30px; width:96%;"', + 'style="min-height: 30px;"', true ); } if ($field['combo_values'] !== '') { - $data[1] = html_print_select( + $data_field[1] = html_print_select( $combo_values, 'customvalue_'.$field['id_field'], $custom_value, @@ -776,11 +805,15 @@ foreach ($fields as $field) { ); }; + $table->rowid[] = 'name_field-'.$id_custom_field; array_push($table->data, $data); + + $table->rowid[] = 'field-'.$id_custom_field; + array_push($table->data, $data_field); } if (!empty($fields)) { - ui_toggle(html_print_table($table, true), __('Custom fields')); + ui_toggle(html_print_table($table, true), __('Custom fields'), '', true, false, 'white_box'); } echo '
'; @@ -825,6 +858,19 @@ ui_require_jquery_file('bgiframe'); ?> '; - } } diff --git a/pandora_console/include/class/CustomNetScan.class.php b/pandora_console/include/class/CustomNetScan.class.php index 078d23fa6b..dc28a696e7 100644 --- a/pandora_console/include/class/CustomNetScan.class.php +++ b/pandora_console/include/class/CustomNetScan.class.php @@ -443,7 +443,7 @@ class CustomNetScan extends Wizard 'name' => 'taskname', 'value' => $this->task['name'], 'type' => 'text', - 'size' => 25, + 'size' => 50, ], ]; @@ -465,7 +465,7 @@ class CustomNetScan extends Wizard 'name' => 'comment', 'value' => $this->task['description'], 'type' => 'text', - 'size' => 25, + 'size' => 50, ], ]; @@ -652,7 +652,7 @@ class CustomNetScan extends Wizard 'value' => $explanation, 'return' => true, 'attributes' => 'style="width: 388px;"', - 'class' => 'discovery_textarea_input' + 'class' => 'discovery_textarea_input', ], ]; diff --git a/pandora_console/include/styles/discovery.css b/pandora_console/include/styles/discovery.css index 51b4e98c10..28d4456a55 100644 --- a/pandora_console/include/styles/discovery.css +++ b/pandora_console/include/styles/discovery.css @@ -162,7 +162,7 @@ span.breadcrumb_link { .edit_discovery_info { display: flex; - align-items: center; + align-items: flex-start; padding-top: 25px; } @@ -181,63 +181,41 @@ span.breadcrumb_link { label { color: #343434 !important; - font-size: 1.5em; - font-family: "lato-bolder", "Open Sans", sans-serif !important; font-weight: bold; - margin: 0px 0px 5px 0px; } .discovery_full_width_input { width: 100%; } -select { - font-family: "lato-bolder", "Open Sans", sans-serif !important; - font-size: 1.6em !important; - color: #686868; +li > input[type="text"], +li > input[type="password"], +.discovery_text_input > input[type="password"], +.discovery_text_input > input[type="text"], +#interval_manual > input[type="text"] { + background-color: transparent !important; + border: none; + border-radius: 0 !important; + border-bottom: 1px solid #343434; + padding: 0px 0px 2px 0px; + box-sizing: border-box; + margin-bottom: 4px; } -select > option { - font-family: "lato-bolder", "Open Sans", sans-serif !important; - font-size: 1em !important; -} - -li > input[type=text], li > input[type=password], .discovery_text_input > input[type=password], .discovery_text_input > input[type=text], #interval_manual > input[type=text] { - background-color: transparent !important; - border: none; - border-radius: 0 !important; - border-bottom: 1px solid #343434; - padding: 0px 0px 2px 0px; - box-sizing: border-box; - margin-bottom: 4px; - font-family: "lato-bolder", "Open Sans", sans-serif !important; - font-size: 1.6em; -} - -li > input[type=text]:focus, li > input[type=password]:focus, .discovery_text_input > input[type=password]:focus, .discovery_text_input > input[type=text]:focus, #interval_manual > input[type=text]:focus { - font-weight: bold; -} - -#interval_manual > input[type=text] { +#interval_manual > input[type="text"] { width: 50px; margin-left: 10px; margin-right: 10px; } .discovery_list_input { - font-family: "lato-bolder", "Open Sans", sans-serif !important; - font-size: 1.6em !important; - color: #686868; width: 100%; - height: 240px; - border: 1px solid #CBCBCB; + border: 1px solid #cbcbcb; overflow-y: auto; } .discovery_list_input option { - font-family: "lato-bolder", "Open Sans", sans-serif !important; - font-size: 1.1em !important; - padding-left: 30%; + text-align: center; } .discovery_list_input option:checked { @@ -253,11 +231,9 @@ li > input[type=text]:focus, li > input[type=password]:focus, .discovery_text_in max-height: 100px; max-width: 100%; -webkit-box-sizing: border-box; /* Safari/Chrome, other WebKit */ - -moz-box-sizing: border-box; /* Firefox, other Gecko */ + -moz-box-sizing: border-box; /* Firefox, other Gecko */ box-sizing: border-box; resize: none; - font-family: "lato-bolder", "Open Sans", sans-serif !important; - font-size: 1.4em !important; } a.tip { @@ -270,4 +246,4 @@ a.tip { .discovery_interval_select_width { width: 90%; -} \ No newline at end of file +} diff --git a/pandora_console/include/styles/wizard.css b/pandora_console/include/styles/wizard.css index d7ec2e4ee5..029addf5cb 100644 --- a/pandora_console/include/styles/wizard.css +++ b/pandora_console/include/styles/wizard.css @@ -6,7 +6,8 @@ ul.wizard { } ul.wizard li { - padding: 10px; + padding-bottom: 10px; + padding-top: 10px; } ul.wizard li > label:not(.p-switch) { From f48dd94c65d61325ee2a053df9adcbcc3dd65114 Mon Sep 17 00:00:00 2001 From: Ramon Novoa Date: Mon, 13 May 2019 13:44:08 +0200 Subject: [PATCH 10/13] Check not_normal alerts when evaluating unknown modules. Former-commit-id: 80f58d4ebfaf5179312a19eae8ea09a4a8d0bff5 --- pandora_server/lib/PandoraFMS/Core.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm index aee397f90a..0c4254f1d9 100644 --- a/pandora_server/lib/PandoraFMS/Core.pm +++ b/pandora_server/lib/PandoraFMS/Core.pm @@ -391,7 +391,11 @@ sub pandora_generate_alerts ($$$$$$$$;$$$) { } # Get enabled alerts associated with this module - my $alert_type_filter = defined ($alert_type) ? " AND type = '$alert_type'" : ''; + my $alert_type_filter = ''; + if (defined($alert_type)) { + # not_normal includes unknown! + $alert_type_filter = $alert_type eq 'unknown' ? " AND (type = 'unknown' OR type = 'not_normal')" : " AND type = '$alert_type'"; + } my @alerts = get_db_rows ($dbh, ' SELECT talert_template_modules.id as id_template_module, talert_template_modules.*, talert_templates.* From e9082c5d8af29fc2ae7174ad85c3c25f989b5b41 Mon Sep 17 00:00:00 2001 From: Tatiana Llorente Date: Mon, 13 May 2019 14:55:15 +0200 Subject: [PATCH 11/13] Fixed a minor bug in remote config - #3611 Former-commit-id: 905739bc36ce640de743f4d6cf62031263c698eb --- .../godmode/agentes/agent_manager.php | 37 +++++++++---------- 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/pandora_console/godmode/agentes/agent_manager.php b/pandora_console/godmode/agentes/agent_manager.php index 964fd00bb3..f599668893 100644 --- a/pandora_console/godmode/agentes/agent_manager.php +++ b/pandora_console/godmode/agentes/agent_manager.php @@ -488,26 +488,23 @@ if (enterprise_installed()) { // Remote configuration $table_adv_remote = '

'.__('Remote configuration').':

'; - if (!$new_agent) { - $table_adv_remote .= ''.__('Not available').''; - if (isset($filename)) { - if (file_exists($filename['md5'])) { - $table_adv_remote .= date('F d Y H:i:s', fileatime($filename['md5'])); - // Delete remote configuration - $table_adv_remote .= ''; - $table_adv_remote .= html_print_image( - 'images/cross.png', - true, - [ - 'title' => __('Delete remote configuration file'), - 'style' => 'vertical-align: middle;', - ] - ).''; - $table_adv_remote .= ''.ui_print_help_tip( - __('Delete this conf file implies that for restore you must reactive remote config in the local agent.'), - true - ); - } + if (!$new_agent && isset($filename)) { + if (file_exists($filename['md5'])) { + $table_adv_remote .= date('F d Y H:i:s', fileatime($filename['md5'])); + // Delete remote configuration + $table_adv_remote .= ''; + $table_adv_remote .= html_print_image( + 'images/cross.png', + true, + [ + 'title' => __('Delete remote configuration file'), + 'style' => 'vertical-align: middle;', + ] + ).''; + $table_adv_remote .= ''.ui_print_help_tip( + __('Delete this conf file implies that for restore you must reactive remote config in the local agent.'), + true + ); } } else { $table_adv_remote .= ''.__('Not available').''; From e6fa42ddca37e83a5df7402b4243a4b38c15201e Mon Sep 17 00:00:00 2001 From: Tatiana Llorente Date: Mon, 13 May 2019 15:02:13 +0200 Subject: [PATCH 12/13] Fixed a minor bug in remote config - #3611 Former-commit-id: 02a786832c8b02a7f5962cf9021cb5a2fe525bcc --- .../godmode/agentes/agent_manager.php | 27 +++++++++---------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/pandora_console/godmode/agentes/agent_manager.php b/pandora_console/godmode/agentes/agent_manager.php index f599668893..797dd55d17 100644 --- a/pandora_console/godmode/agentes/agent_manager.php +++ b/pandora_console/godmode/agentes/agent_manager.php @@ -488,8 +488,7 @@ if (enterprise_installed()) { // Remote configuration $table_adv_remote = '

'.__('Remote configuration').':

'; - if (!$new_agent && isset($filename)) { - if (file_exists($filename['md5'])) { + if (!$new_agent && isset($filename) && file_exists($filename['md5'])) { $table_adv_remote .= date('F d Y H:i:s', fileatime($filename['md5'])); // Delete remote configuration $table_adv_remote .= ''; @@ -505,25 +504,25 @@ if (enterprise_installed()) { __('Delete this conf file implies that for restore you must reactive remote config in the local agent.'), true ); - } - } else { - $table_adv_remote .= ''.__('Not available').''; } +} else { + $table_adv_remote .= ''.__('Not available').''; +} $table_adv_remote .= '
'; $cps_array[-1] = __('Disabled'); - if ($cps > 0) { - $cps_array[$cps] = __('Enabled'); - } else { - $cps_inc = 0; - if ($id_agente) { - $cps_inc = service_agents_cps($id_agente); - } - - $cps_array[$cps_inc] = __('Enabled'); +if ($cps > 0) { + $cps_array[$cps] = __('Enabled'); +} else { + $cps_inc = 0; + if ($id_agente) { + $cps_inc = service_agents_cps($id_agente); } + $cps_array[$cps_inc] = __('Enabled'); +} + $table_adv_cascade = '

'.__('Cascade protection services').': '; $table_adv_cascade .= ui_print_help_tip(__('Disable the alerts and events of the elements that belong to this service'), true).'

'; $table_adv_cascade .= html_print_select($cps_array, 'cps', $cps, '', '', 0, true).'
'; From b6e8578d1d5fb8b21bac0eef67a88d27973ca122 Mon Sep 17 00:00:00 2001 From: Tatiana Llorente Date: Mon, 13 May 2019 15:54:06 +0200 Subject: [PATCH 13/13] Fixed a minor sintax error - #3611 Former-commit-id: 75ba583e8d060887c80eb32fd648157d2c4428bd --- .../godmode/agentes/agent_manager.php | 53 +++++++++---------- 1 file changed, 26 insertions(+), 27 deletions(-) diff --git a/pandora_console/godmode/agentes/agent_manager.php b/pandora_console/godmode/agentes/agent_manager.php index 797dd55d17..cee4cb2684 100644 --- a/pandora_console/godmode/agentes/agent_manager.php +++ b/pandora_console/godmode/agentes/agent_manager.php @@ -489,39 +489,38 @@ if (enterprise_installed()) { $table_adv_remote = '

'.__('Remote configuration').':

'; if (!$new_agent && isset($filename) && file_exists($filename['md5'])) { - $table_adv_remote .= date('F d Y H:i:s', fileatime($filename['md5'])); - // Delete remote configuration - $table_adv_remote .= '
'; - $table_adv_remote .= html_print_image( - 'images/cross.png', - true, - [ - 'title' => __('Delete remote configuration file'), - 'style' => 'vertical-align: middle;', - ] - ).''; - $table_adv_remote .= ''.ui_print_help_tip( - __('Delete this conf file implies that for restore you must reactive remote config in the local agent.'), - true - ); + $table_adv_remote .= date('F d Y H:i:s', fileatime($filename['md5'])); + // Delete remote configuration + $table_adv_remote .= ''; + $table_adv_remote .= html_print_image( + 'images/cross.png', + true, + [ + 'title' => __('Delete remote configuration file'), + 'style' => 'vertical-align: middle;', + ] + ).''; + $table_adv_remote .= ''.ui_print_help_tip( + __('Delete this conf file implies that for restore you must reactive remote config in the local agent.'), + true + ); + } else { + $table_adv_remote .= ''.__('Not available').''; } -} else { - $table_adv_remote .= ''.__('Not available').''; -} $table_adv_remote .= '
'; $cps_array[-1] = __('Disabled'); -if ($cps > 0) { - $cps_array[$cps] = __('Enabled'); -} else { - $cps_inc = 0; - if ($id_agente) { - $cps_inc = service_agents_cps($id_agente); - } + if ($cps > 0) { + $cps_array[$cps] = __('Enabled'); + } else { + $cps_inc = 0; + if ($id_agente) { + $cps_inc = service_agents_cps($id_agente); + } - $cps_array[$cps_inc] = __('Enabled'); -} + $cps_array[$cps_inc] = __('Enabled'); + } $table_adv_cascade = '

'.__('Cascade protection services').': '; $table_adv_cascade .= ui_print_help_tip(__('Disable the alerts and events of the elements that belong to this service'), true).'

';