From 181b172ba8dc1e82cf8071534b95eba4da515bbd Mon Sep 17 00:00:00 2001 From: Jonathan Date: Wed, 1 Feb 2023 16:57:48 +0100 Subject: [PATCH 001/169] #9529 timezone visual for new users --- .../godmode/setup/setup_general.php | 2 +- pandora_console/include/auth/mysql.php | 4 ++ pandora_console/include/functions_config.php | 4 ++ pandora_console/include/functions_events.php | 52 ++++++++++++++++++- pandora_console/operation/events/events.php | 29 +++++++++-- 5 files changed, 84 insertions(+), 7 deletions(-) diff --git a/pandora_console/godmode/setup/setup_general.php b/pandora_console/godmode/setup/setup_general.php index fa889f3071..4060fe8847 100644 --- a/pandora_console/godmode/setup/setup_general.php +++ b/pandora_console/godmode/setup/setup_general.php @@ -276,7 +276,7 @@ foreach ($timezones as $timezone) { } } -$table->data[$i][0] = __('Timezone setup'); +$table->data[$i][0] = __('Server Timezone setup'); $table->data[$i][1] = html_print_input_text_extended( 'timezone_text', $config['timezone'], diff --git a/pandora_console/include/auth/mysql.php b/pandora_console/include/auth/mysql.php index be845f3fc0..1df8fae13c 100644 --- a/pandora_console/include/auth/mysql.php +++ b/pandora_console/include/auth/mysql.php @@ -393,6 +393,10 @@ function process_user_login_remote($login, $pass, $api=false) $user_info['metaconsole_access_node'] = $config['ldap_adv_user_node']; } + if (isset($config['timezonevisual']) === true) { + $user_info['timezone'] = $config['timezonevisual']; + } + $permissions = fill_permissions_ldap($sr); if (empty($permissions) === true) { $config['auth_error'] = __('User not found in database or incorrect password'); diff --git a/pandora_console/include/functions_config.php b/pandora_console/include/functions_config.php index b0d15d5cef..382e4354a4 100644 --- a/pandora_console/include/functions_config.php +++ b/pandora_console/include/functions_config.php @@ -561,6 +561,10 @@ function config_update_config() $error_update[] = __('Automatically assigned no hierarchy'); } + if (config_update_value('timezonevisual', (string) get_parameter('timezonevisual'), true) === false) { + $error_update[] = __('Automatically timezone visual'); + } + if (config_update_value('autocreate_blacklist', get_parameter('autocreate_blacklist'), true) === false) { $error_update[] = __('Autocreate blacklist'); } diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index 3740257717..2e6e836286 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -4235,12 +4235,53 @@ function events_page_details($event, $server_id=0) $data = []; $data[0] = '
'.__('Last contact').'
'; - $data[1] = ($agent['ultimo_contacto'] == '1970-01-01 00:00:00') ? ''.__('N/A').'' : ui_print_timestamp($agent['ultimo_contacto'], true); + + $user_timezone = users_get_user_by_id($_SESSION['id_usuario'])['timezone']; + if (!$user_timezone) { + $timezone = timezone_open(date_default_timezone_get()); + $datetime_eur = date_create('now', timezone_open($config['timezone'])); + $dif = timezone_offset_get($timezone, $datetime_eur); + date($config['date_format'], $dif); + if (!date('I')) { + // For summer -3600sec. + $dif -= 3600; + } + + $total_sec = strtotime($agent['ultimo_contacto']); + $total_sec += $dif; + $last_contact = date($config['date_format'], $total_sec); + $last_contact_value = ui_print_timestamp($last_contact, true); + } else { + $user_timezone = users_get_user_by_id($_SESSION['id_usuario'])['timezone']; + date_default_timezone_set($user_timezone); + + $last_contact_value = human_time_comparation(strtotime($agent['ultimo_contacto']), 'large'); + } + + $data[1] = ($agent['ultimo_contacto'] == '1970-01-01 00:00:00') ? ''.__('N/A').'' : $last_contact_value; $table_details->data[] = $data; + $user_timezone = users_get_user_by_id($_SESSION['id_usuario'])['timezone']; + if (!$user_timezone) { + $timezone = timezone_open(date_default_timezone_get()); + $datetime_eur = date_create('now', timezone_open($config['timezone'])); + $dif = timezone_offset_get($timezone, $datetime_eur); + date($config['date_format'], $dif); + if (!date('I')) { + // For summer -3600sec. + $dif -= 3600; + } + + $total_sec = strtotime($agent['ultimo_contacto_remoto']); + $total_sec += $dif; + $lr_contact = date($config['date_format'], $total_sec); + } else { + $lr_contact = date($config['date_format'], strtotime($agent['ultimo_contacto_remoto'])); + } + $data = []; $data[0] = '
'.__('Last remote contact').'
'; - $data[1] = ($agent['ultimo_contacto_remoto'] == '1970-01-01 00:00:00') ? ''.__('N/A').'' : date_w_fixed_tz($agent['ultimo_contacto_remoto']); + $data[1] = ($agent['ultimo_contacto_remoto'] == '1970-01-01 00:00:00') ? ''.__('N/A').'' : $lr_contact; $table_details->data[] = $data; $data = []; @@ -4729,6 +4770,13 @@ function events_page_general($event) $data[1] .= __('Last event').': '; $data[1] .= date($config['date_format'], $event['timestamp_last']); } else { + $user_timezone = users_get_user_by_id($_SESSION['id_usuario'])['timezone']; + if ($user_timezone) { + date_default_timezone_set($user_timezone); + } else { + date_default_timezone_set($config['timezone']); + } + $data[1] = date($config['date_format'], $event['utimestamp']); } diff --git a/pandora_console/operation/events/events.php b/pandora_console/operation/events/events.php index 6777ced4c3..23b8794b5c 100644 --- a/pandora_console/operation/events/events.php +++ b/pandora_console/operation/events/events.php @@ -527,10 +527,31 @@ if (is_ajax() === true) { (empty($tmp->ack_utimestamp) === true) ? 0 : $tmp->ack_utimestamp, true ); - $tmp->timestamp = ui_print_timestamp( - $tmp->timestamp, - true - ); + + $user_timezone = users_get_user_by_id($_SESSION['id_usuario'])['timezone']; + if (!$user_timezone) { + $timezone = timezone_open(date_default_timezone_get()); + $datetime_eur = date_create('now', timezone_open($config['timezone'])); + $dif = timezone_offset_get($timezone, $datetime_eur); + date($config['date_format'], $dif); + if (!date('I')) { + // For summer -3600sec. + $dif -= 3600; + } + + $total_sec = strtotime($tmp->timestamp); + $total_sec += $dif; + $last_contact = date($config['date_format'], $total_sec); + $last_contact_value = ui_print_timestamp($last_contact, true); + } else { + $user_timezone = users_get_user_by_id($_SESSION['id_usuario'])['timezone']; + date_default_timezone_set($user_timezone); + $title = date($config['date_format'], strtotime($tmp->timestamp)); + $value = human_time_comparation(strtotime($tmp->timestamp), 'large'); + $last_contact_value = ''.$value.''; + } + + $tmp->timestamp = $last_contact_value; if (is_numeric($tmp->data) === true) { $tmp->data = format_numeric( From fe507b2530de3f7a63b12b98d3ac7b16b6b3e4ac Mon Sep 17 00:00:00 2001 From: alejandro Date: Mon, 6 Feb 2023 13:32:19 +0100 Subject: [PATCH 002/169] Added log message in case of agent plugin failure --- pandora_agents/unix/pandora_agent | 1 + 1 file changed, 1 insertion(+) diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index f75da86403..806d961606 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -3741,6 +3741,7 @@ sub module_plugin ($) { # Do not save the output if there was an error if ($? != 0) { + log_message ('error', "plugin execution '". $command ."' exited with error code " . $?); return (); } From d447b621dec6055cd4cc1c670da37d3d1bc48875 Mon Sep 17 00:00:00 2001 From: Calvo Date: Thu, 16 Feb 2023 13:16:41 +0100 Subject: [PATCH 003/169] Fix events comment tags acl --- pandora_console/include/functions_events.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index 48ef7b2c30..9d6aa611d5 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -3476,7 +3476,7 @@ function events_page_responses($event) // Comments. $data = []; - $data[0] = __('Comment'); + $data[0] = __('Comsssment'); $data[1] = ''; $data[2] = html_print_button( __('Add comment'), @@ -5168,10 +5168,6 @@ function events_page_comments($event, $ajax=false, $groupedComments=[]) true ); $comments_form .= '
'; - } else { - $comments_form = ui_print_message( - __('If event replication is ongoing, it won\'t be possible to enter comments here. This option is only to allow local pandora users to see comments, but not to operate with them. The operation, when event replication is enabled, must be done only in the Metaconsole.') - ); } if ($ajax === true) { @@ -5196,9 +5192,10 @@ function events_clean_tags($tags) } $event_tags = tags_get_tags_formatted($tags, false); + $event_tags = str_replace(' ', '', $event_tags); $event_tags = io_safe_input($event_tags); - return explode(',', str_replace(' ', '', $event_tags)); + return explode(',', $event_tags); } From f70ab4c44d53b429ebbd2240167d5b2530a4f464 Mon Sep 17 00:00:00 2001 From: Calvo Date: Thu, 16 Feb 2023 16:57:11 +0100 Subject: [PATCH 004/169] Fix misspell --- pandora_console/include/functions_events.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index 9d6aa611d5..8c6c6fb8e3 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -3476,7 +3476,7 @@ function events_page_responses($event) // Comments. $data = []; - $data[0] = __('Comsssment'); + $data[0] = __('Comment'); $data[1] = ''; $data[2] = html_print_button( __('Add comment'), From 6efaa2bbc605747c02e1922ebb326e130addee97 Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Tue, 21 Feb 2023 15:06:15 +0100 Subject: [PATCH 005/169] #8642 Added heatmap widget --- pandora_console/include/class/Heatmap.class.php | 4 +++- pandora_console/include/lib/Dashboard/Widget.php | 4 ++++ pandora_console/operation/heatmap.php | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/pandora_console/include/class/Heatmap.class.php b/pandora_console/include/class/Heatmap.class.php index 8572d6cad1..bab7f8fd85 100644 --- a/pandora_console/include/class/Heatmap.class.php +++ b/pandora_console/include/class/Heatmap.class.php @@ -25,6 +25,8 @@ * GNU General Public License for more details. * ============================================================================ */ + +namespace PandoraFMS; class Heatmap { @@ -159,7 +161,7 @@ class Heatmap ], ]; - echo '
'; + echo '
'; ?> \ No newline at end of file From e6d2cc3cfa496b218faa8acd2a4d426f8ae116b2 Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Thu, 23 Feb 2023 13:22:38 +0100 Subject: [PATCH 008/169] #9893 changed HA view and connect --- .../general/first_task/HA_cluster_builder.php | 64 ------------------- pandora_console/include/config_process.php | 13 ++++ pandora_console/include/constants.php | 2 + 3 files changed, 15 insertions(+), 64 deletions(-) delete mode 100644 pandora_console/general/first_task/HA_cluster_builder.php diff --git a/pandora_console/general/first_task/HA_cluster_builder.php b/pandora_console/general/first_task/HA_cluster_builder.php deleted file mode 100644 index e475dfdf1a..0000000000 --- a/pandora_console/general/first_task/HA_cluster_builder.php +++ /dev/null @@ -1,64 +0,0 @@ - true, 'message' => __('There are no HA clusters defined yet.') ]); -?> - -
-
- __('Clusters')]); ?> -
-
-

-

-
'; - - echo __('Click on "add new node" to start transforming your Pandora FMS DB Cluster into a Pandora FMS DB Cluster.').'

'; - ?> -

- -
"; - echo ""; - ?> - - -
-
diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index d1edec1366..2d03687881 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -153,6 +153,19 @@ if (! defined('ENTERPRISE_DIR')) { } db_select_engine(); + +if (empty($config['remote_config']) === false + && file_exists($config['remote_config'].'/'.PANDORA_HA_FILE) + && filesize($config['remote_config'].'/'.PANDORA_HA_FILE) > 0 +) { + $data = file_get_contents($config['remote_config'].'/'.PANDORA_HA_FILE); + if (empty($data) === false) { + $ip_list = explode(',', $data); + // Connects to the first pandora_ha_dbs.conf database. + $config['dbhost'] = trim($ip_list[0]); + } +} + $config['dbconnection'] = db_connect(); require_once $ownDir.'functions_config.php'; diff --git a/pandora_console/include/constants.php b/pandora_console/include/constants.php index 18b32b6de4..e1497b8c42 100644 --- a/pandora_console/include/constants.php +++ b/pandora_console/include/constants.php @@ -864,3 +864,5 @@ define( // Pandora FMS Enterprise license. define('LICENSE_FILE', 'customer_key'); +// Pandora HA database list. +define('PANDORA_HA_FILE', 'pandora_ha_dbs.conf'); From fceddb13653f49e6590317b828f2357ae85efa76 Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Sun, 26 Feb 2023 18:10:58 +0100 Subject: [PATCH 009/169] #8642 Added heatmap widget 3 --- .../include/class/Heatmap.class.php | 28 +++++++++++++------ 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/pandora_console/include/class/Heatmap.class.php b/pandora_console/include/class/Heatmap.class.php index bab7f8fd85..ff017b0c24 100644 --- a/pandora_console/include/class/Heatmap.class.php +++ b/pandora_console/include/class/Heatmap.class.php @@ -97,18 +97,26 @@ class Heatmap */ protected $group = null; + /** + * Heatmap group. + * + * @var boolean + */ + protected $dashboard = null; + /** * Constructor function * - * @param integer $type Heatmap type. - * @param array $filter Heatmap filter. - * @param string $randomId Heatmap random id. - * @param integer $refresh Heatmap refresh. - * @param integer $width Width. - * @param integer $height Height. - * @param string $search Heatmap search. - * @param integer $group Heatmap group. + * @param integer $type Heatmap type. + * @param array $filter Heatmap filter. + * @param string $randomId Heatmap random id. + * @param integer $refresh Heatmap refresh. + * @param integer $width Width. + * @param integer $height Height. + * @param string $search Heatmap search. + * @param integer $group Heatmap group. + * @param boolean $dashboard Dashboard widget. */ public function __construct( int $type=0, @@ -118,7 +126,8 @@ class Heatmap int $width=0, int $height=0, string $search=null, - int $group=1 + int $group=1, + bool $dashboard=false ) { $this->type = $type; $this->filter = $filter; @@ -128,6 +137,7 @@ class Heatmap $this->height = $height; $this->search = $search; $this->group = $group; + $this->dashboard = $dashboard; } From 8c5e59afee0f6fd494a7966f802d03bdcae01cc4 Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Mon, 27 Feb 2023 15:50:26 +0100 Subject: [PATCH 010/169] #9893 changed connect 2 --- pandora_console/include/config_process.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 2d03687881..844a2fdd3e 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -155,10 +155,10 @@ if (! defined('ENTERPRISE_DIR')) { db_select_engine(); if (empty($config['remote_config']) === false - && file_exists($config['remote_config'].'/'.PANDORA_HA_FILE) - && filesize($config['remote_config'].'/'.PANDORA_HA_FILE) > 0 + && file_exists($config['remote_config'].'/conf/'.PANDORA_HA_FILE) + && filesize($config['remote_config'].'/conf/'.PANDORA_HA_FILE) > 0 ) { - $data = file_get_contents($config['remote_config'].'/'.PANDORA_HA_FILE); + $data = file_get_contents($config['remote_config'].'/conf/'.PANDORA_HA_FILE); if (empty($data) === false) { $ip_list = explode(',', $data); // Connects to the first pandora_ha_dbs.conf database. From 7cb1595b628a6c00565710e02455ed6b7330c234 Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Thu, 2 Mar 2023 11:31:07 +0100 Subject: [PATCH 011/169] #9893 changed constant --- pandora_console/include/constants.php | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/pandora_console/include/constants.php b/pandora_console/include/constants.php index e1497b8c42..c1317e71dd 100644 --- a/pandora_console/include/constants.php +++ b/pandora_console/include/constants.php @@ -1,4 +1,5 @@ Date: Fri, 3 Mar 2023 10:15:02 +0100 Subject: [PATCH 012/169] #9893 Added mr --- pandora_console/extras/mr/62.sql | 75 ++++++++++++++++++++++++++++++++ pandora_console/pandoradb.sql | 10 ++++- 2 files changed, 84 insertions(+), 1 deletion(-) create mode 100644 pandora_console/extras/mr/62.sql diff --git a/pandora_console/extras/mr/62.sql b/pandora_console/extras/mr/62.sql new file mode 100644 index 0000000000..db6fddca0f --- /dev/null +++ b/pandora_console/extras/mr/62.sql @@ -0,0 +1,75 @@ +START TRANSACTION; + +ALTER TABLE `tdatabase` ADD COLUMN `ssh_status` TINYINT UNSIGNED DEFAULT 0; +ALTER TABLE `tdatabase` ADD COLUMN `db_status` TINYINT UNSIGNED DEFAULT 0; +ALTER TABLE `tdatabase` ADD COLUMN `replication_status` TINYINT UNSIGNED DEFAULT 0; +ALTER TABLE `tdatabase` ADD COLUMN `replication_delay` BIGINT DEFAULT 0; +ALTER TABLE `tdatabase` ADD COLUMN `master` TINYINT UNSIGNED DEFAULT 0; +ALTER TABLE `tdatabase` ADD COLUMN `utimestamp` BIGINT DEFAULT 0; +ALTER TABLE `tdatabase` ADD COLUMN `mysql_version` VARCHAR(10) DEFAULT ''; +ALTER TABLE `tdatabase` ADD COLUMN `pandora_version` VARCHAR(10) DEFAULT ''; + +UPDATE tconfig_os SET `icon_name` = 'linux@os.svg' WHERE `id_os` = 1; +UPDATE tconfig_os SET `icon_name` = 'solaris@os.svg' WHERE `id_os` = 2; +UPDATE tconfig_os SET `icon_name` = 'aix@os.svg' WHERE `id_os` = 3; +UPDATE tconfig_os SET `icon_name` = 'freebsd@os.svg' WHERE `id_os` = 4; +UPDATE tconfig_os SET `icon_name` = 'HP@os.svg' WHERE `id_os` = 5; +UPDATE tconfig_os SET `icon_name` = 'cisco@os.svg' WHERE `id_os` = 7; +UPDATE tconfig_os SET `icon_name` = 'apple@os.svg' WHERE `id_os` = 8; +UPDATE tconfig_os SET `icon_name` = 'windows@os.svg' WHERE `id_os` = 9; +UPDATE tconfig_os SET `icon_name` = 'other-OS@os.svg' WHERE `id_os` = 10; +UPDATE tconfig_os SET `icon_name` = 'network-server@os.svg' WHERE `id_os` = 11; +UPDATE tconfig_os SET `icon_name` = 'network-server@os.svg' WHERE `id_os` = 12; +UPDATE tconfig_os SET `icon_name` = 'network-server@os.svg' WHERE `id_os` = 13; +UPDATE tconfig_os SET `icon_name` = 'embedded@os.svg' WHERE `id_os` = 14; +UPDATE tconfig_os SET `icon_name` = 'android@os.svg' WHERE `id_os` = 15; +UPDATE tconfig_os SET `icon_name` = 'vmware@os.svg' WHERE `id_os` = 16; +UPDATE tconfig_os SET `icon_name` = 'routers@os.svg' WHERE `id_os` = 17; +UPDATE tconfig_os SET `icon_name` = 'switch@os.svg' WHERE `id_os` = 18; +UPDATE tconfig_os SET `icon_name` = 'satellite@os.svg' WHERE `id_os` = 19; +UPDATE tconfig_os SET `icon_name` = 'mainframe@os.svg' WHERE `id_os` = 20; +UPDATE tconfig_os SET `icon_name` = 'cluster@os.svg' WHERE `id_os` = 100; + +UPDATE tgrupo SET `icon` = 'servers@groups.svg' WHERE `id_grupo` = 2; +UPDATE tgrupo SET `icon` = 'firewall@groups.svg' WHERE `id_grupo` = 4; +UPDATE tgrupo SET `icon` = 'database@groups.svg' WHERE `id_grupo` = 8; +UPDATE tgrupo SET `icon` = 'network@groups.svg' WHERE `id_grupo` = 9; +UPDATE tgrupo SET `icon` = 'unknown@groups.svg' WHERE `id_grupo` = 10; +UPDATE tgrupo SET `icon` = 'workstation@groups.svg' WHERE `id_grupo` = 11; +UPDATE tgrupo SET `icon` = 'applications@groups.svg' WHERE `id_grupo` = 12; +UPDATE tgrupo SET `icon` = 'web@groups.svg' WHERE `id_grupo` = 13; + +UPDATE `ttipo_modulo` SET `icon` = 'data-server@svg.svg' WHERE `id_tipo` = 1; +UPDATE `ttipo_modulo` SET `icon` = 'generic-boolean@svg.svg' WHERE `id_tipo` = 2; +UPDATE `ttipo_modulo` SET `icon` = 'generic-string@svg.svg' WHERE `id_tipo` = 3; +UPDATE `ttipo_modulo` SET `icon` = 'data-server@svg.svg' WHERE `id_tipo` = 4; +UPDATE `ttipo_modulo` SET `icon` = 'data-server@svg.svg' WHERE `id_tipo` = 5; +UPDATE `ttipo_modulo` SET `icon` = 'ICMP-network-boolean-data@svg.svg' WHERE `id_tipo` = 6; +UPDATE `ttipo_modulo` SET `icon` = 'ICMP-network-latency@svg.svg' WHERE `id_tipo` = 7; +UPDATE `ttipo_modulo` SET `icon` = 'TCP-network-numeric-data@svg.svg' WHERE `id_tipo` = 8; +UPDATE `ttipo_modulo` SET `icon` = 'TCP-network-boolean-data@svg.svg' WHERE `id_tipo` = 9; +UPDATE `ttipo_modulo` SET `icon` = 'TCP-network-alphanumeric-data@svg.svg' WHERE `id_tipo` = 10; +UPDATE `ttipo_modulo` SET `icon` = 'TCP-network-incremental-data@svg.svg' WHERE `id_tipo` = 11; +UPDATE `ttipo_modulo` SET `icon` = 'SNMP-network-numeric-data@svg.svg' WHERE `id_tipo` = 15; +UPDATE `ttipo_modulo` SET `icon` = 'SNMP-network-incremental-data@svg.svg' WHERE `id_tipo` = 16; +UPDATE `ttipo_modulo` SET `icon` = 'SNMP-network-alphanumeric-data@svg.svg' WHERE `id_tipo` = 17; +UPDATE `ttipo_modulo` SET `icon` = 'SNMP-network-incremental-data@svg.svg' WHERE `id_tipo` = 18; +UPDATE `ttipo_modulo` SET `icon` = 'asynchronus-data@svg.svg' WHERE `id_tipo` = 21; +UPDATE `ttipo_modulo` SET `icon` = 'asynchronus-data@svg.svg' WHERE `id_tipo` = 22; +UPDATE `ttipo_modulo` SET `icon` = 'asynchronus-data@svg.svg' WHERE `id_tipo` = 23; +UPDATE `ttipo_modulo` SET `icon` = 'wux@svg.svg' WHERE `id_tipo` = 25; +UPDATE `ttipo_modulo` SET `icon` = 'server-web@svg.svg' WHERE `id_tipo` = 30; +UPDATE `ttipo_modulo` SET `icon` = 'web-analisys-data@svg.svg' WHERE `id_tipo` = 31; +UPDATE `ttipo_modulo` SET `icon` = 'server-web@svg.svg' WHERE `id_tipo` = 32; +UPDATE `ttipo_modulo` SET `icon` = 'server-web@svg.svg' WHERE `id_tipo` = 33; +UPDATE `ttipo_modulo` SET `icon` = 'remote-execution-numeric-data@svg.svg' WHERE `id_tipo` = 34; +UPDATE `ttipo_modulo` SET `icon` = 'remote-execution-boolean-data@svg.svg' WHERE `id_tipo` = 35; +UPDATE `ttipo_modulo` SET `icon` = 'remote-execution-alphanumeric-data@svg.svg' WHERE `id_tipo` = 36; +UPDATE `ttipo_modulo` SET `icon` = 'remote-execution-incremental-data@svg.svg' WHERE `id_tipo` = 37; +UPDATE `ttipo_modulo` SET `icon` = 'server-web@svg.svg' WHERE `id_tipo` = 38; +UPDATE `ttipo_modulo` SET `icon` = 'keepalive@svg.svg' WHERE `id_tipo` = 100; + +CREATE INDEX agente_modulo_estado ON tevento (estado, id_agentmodule); +CREATE INDEX idx_disabled ON talert_template_modules (disabled); + +COMMIT; diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index e43aaa7646..b54cbb2535 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -2631,9 +2631,17 @@ CREATE TABLE IF NOT EXISTS `tdatabase` ( `action` TINYINT UNSIGNED DEFAULT 0, `ssh_key` TEXT, `ssh_pubkey` TEXT, + `ssh_status` TINYINT UNSIGNED DEFAULT 0, `last_error` TEXT, + `db_status` TINYINT UNSIGNED DEFAULT 0, + `replication_status` TINYINT UNSIGNED DEFAULT 0, + `replication_delay` BIGINT DEFAULT 0, + `master` TINYINT UNSIGNED DEFAULT 0, + `utimestamp` BIGINT DEFAULT 0, + `mysql_version` VARCHAR(10) DEFAULT '', + `pandora_version` VARCHAR(10) DEFAULT '', PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4 ; +) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; -- ----------------------------------------------------- -- Table `twidget` From 62673d8292b59d4d1a29db358f78308f2a56397a Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Fri, 3 Mar 2023 10:26:21 +0100 Subject: [PATCH 013/169] #9893 changed mr --- pandora_console/extras/mr/62.sql | 87 -------------------------------- 1 file changed, 87 deletions(-) diff --git a/pandora_console/extras/mr/62.sql b/pandora_console/extras/mr/62.sql index 3cb8722659..87b74f3174 100644 --- a/pandora_console/extras/mr/62.sql +++ b/pandora_console/extras/mr/62.sql @@ -9,91 +9,4 @@ ALTER TABLE `tdatabase` ADD COLUMN `utimestamp` BIGINT DEFAULT 0; ALTER TABLE `tdatabase` ADD COLUMN `mysql_version` VARCHAR(10) DEFAULT ''; ALTER TABLE `tdatabase` ADD COLUMN `pandora_version` VARCHAR(10) DEFAULT ''; -UPDATE tconfig_os SET `icon_name` = 'linux@os.svg' WHERE `id_os` = 1; -UPDATE tconfig_os SET `icon_name` = 'solaris@os.svg' WHERE `id_os` = 2; -UPDATE tconfig_os SET `icon_name` = 'aix@os.svg' WHERE `id_os` = 3; -UPDATE tconfig_os SET `icon_name` = 'freebsd@os.svg' WHERE `id_os` = 4; -UPDATE tconfig_os SET `icon_name` = 'HP@os.svg' WHERE `id_os` = 5; -UPDATE tconfig_os SET `icon_name` = 'cisco@os.svg' WHERE `id_os` = 7; -UPDATE tconfig_os SET `icon_name` = 'apple@os.svg' WHERE `id_os` = 8; -UPDATE tconfig_os SET `icon_name` = 'windows@os.svg' WHERE `id_os` = 9; -UPDATE tconfig_os SET `icon_name` = 'other-OS@os.svg' WHERE `id_os` = 10; -UPDATE tconfig_os SET `icon_name` = 'network-server@os.svg' WHERE `id_os` = 11; -UPDATE tconfig_os SET `icon_name` = 'network-server@os.svg' WHERE `id_os` = 12; -UPDATE tconfig_os SET `icon_name` = 'network-server@os.svg' WHERE `id_os` = 13; -UPDATE tconfig_os SET `icon_name` = 'embedded@os.svg' WHERE `id_os` = 14; -UPDATE tconfig_os SET `icon_name` = 'android@os.svg' WHERE `id_os` = 15; -UPDATE tconfig_os SET `icon_name` = 'vmware@os.svg' WHERE `id_os` = 16; -UPDATE tconfig_os SET `icon_name` = 'routers@os.svg' WHERE `id_os` = 17; -UPDATE tconfig_os SET `icon_name` = 'switch@os.svg' WHERE `id_os` = 18; -UPDATE tconfig_os SET `icon_name` = 'satellite@os.svg' WHERE `id_os` = 19; -UPDATE tconfig_os SET `icon_name` = 'mainframe@os.svg' WHERE `id_os` = 20; -UPDATE tconfig_os SET `icon_name` = 'cluster@os.svg' WHERE `id_os` = 100; - -UPDATE tgrupo SET `icon` = 'servers@groups.svg' WHERE `id_grupo` = 2; -UPDATE tgrupo SET `icon` = 'firewall@groups.svg' WHERE `id_grupo` = 4; -UPDATE tgrupo SET `icon` = 'database@groups.svg' WHERE `id_grupo` = 8; -UPDATE tgrupo SET `icon` = 'network@groups.svg' WHERE `id_grupo` = 9; -UPDATE tgrupo SET `icon` = 'unknown@groups.svg' WHERE `id_grupo` = 10; -UPDATE tgrupo SET `icon` = 'workstation@groups.svg' WHERE `id_grupo` = 11; -UPDATE tgrupo SET `icon` = 'applications@groups.svg' WHERE `id_grupo` = 12; -UPDATE tgrupo SET `icon` = 'web@groups.svg' WHERE `id_grupo` = 13; - -UPDATE `ttipo_modulo` SET `icon` = 'data-server@svg.svg' WHERE `id_tipo` = 1; -UPDATE `ttipo_modulo` SET `icon` = 'generic-boolean@svg.svg' WHERE `id_tipo` = 2; -UPDATE `ttipo_modulo` SET `icon` = 'generic-string@svg.svg' WHERE `id_tipo` = 3; -UPDATE `ttipo_modulo` SET `icon` = 'data-server@svg.svg' WHERE `id_tipo` = 4; -UPDATE `ttipo_modulo` SET `icon` = 'data-server@svg.svg' WHERE `id_tipo` = 5; -UPDATE `ttipo_modulo` SET `icon` = 'ICMP-network-boolean-data@svg.svg' WHERE `id_tipo` = 6; -UPDATE `ttipo_modulo` SET `icon` = 'ICMP-network-latency@svg.svg' WHERE `id_tipo` = 7; -UPDATE `ttipo_modulo` SET `icon` = 'TCP-network-numeric-data@svg.svg' WHERE `id_tipo` = 8; -UPDATE `ttipo_modulo` SET `icon` = 'TCP-network-boolean-data@svg.svg' WHERE `id_tipo` = 9; -UPDATE `ttipo_modulo` SET `icon` = 'TCP-network-alphanumeric-data@svg.svg' WHERE `id_tipo` = 10; -UPDATE `ttipo_modulo` SET `icon` = 'TCP-network-incremental-data@svg.svg' WHERE `id_tipo` = 11; -UPDATE `ttipo_modulo` SET `icon` = 'SNMP-network-numeric-data@svg.svg' WHERE `id_tipo` = 15; -UPDATE `ttipo_modulo` SET `icon` = 'SNMP-network-incremental-data@svg.svg' WHERE `id_tipo` = 16; -UPDATE `ttipo_modulo` SET `icon` = 'SNMP-network-alphanumeric-data@svg.svg' WHERE `id_tipo` = 17; -UPDATE `ttipo_modulo` SET `icon` = 'SNMP-network-incremental-data@svg.svg' WHERE `id_tipo` = 18; -UPDATE `ttipo_modulo` SET `icon` = 'asynchronus-data@svg.svg' WHERE `id_tipo` = 21; -UPDATE `ttipo_modulo` SET `icon` = 'asynchronus-data@svg.svg' WHERE `id_tipo` = 22; -UPDATE `ttipo_modulo` SET `icon` = 'asynchronus-data@svg.svg' WHERE `id_tipo` = 23; -UPDATE `ttipo_modulo` SET `icon` = 'wux@svg.svg' WHERE `id_tipo` = 25; -UPDATE `ttipo_modulo` SET `icon` = 'server-web@svg.svg' WHERE `id_tipo` = 30; -UPDATE `ttipo_modulo` SET `icon` = 'web-analisys-data@svg.svg' WHERE `id_tipo` = 31; -UPDATE `ttipo_modulo` SET `icon` = 'server-web@svg.svg' WHERE `id_tipo` = 32; -UPDATE `ttipo_modulo` SET `icon` = 'server-web@svg.svg' WHERE `id_tipo` = 33; -UPDATE `ttipo_modulo` SET `icon` = 'remote-execution-numeric-data@svg.svg' WHERE `id_tipo` = 34; -UPDATE `ttipo_modulo` SET `icon` = 'remote-execution-boolean-data@svg.svg' WHERE `id_tipo` = 35; -UPDATE `ttipo_modulo` SET `icon` = 'remote-execution-alphanumeric-data@svg.svg' WHERE `id_tipo` = 36; -UPDATE `ttipo_modulo` SET `icon` = 'remote-execution-incremental-data@svg.svg' WHERE `id_tipo` = 37; -UPDATE `ttipo_modulo` SET `icon` = 'server-web@svg.svg' WHERE `id_tipo` = 38; -UPDATE `ttipo_modulo` SET `icon` = 'keepalive@svg.svg' WHERE `id_tipo` = 100; - -CREATE TABLE IF NOT EXISTS `tagent_filter` ( - `id_filter` INT UNSIGNED NOT NULL AUTO_INCREMENT, - `id_name` VARCHAR(600) NOT NULL, - `id_group_filter` INT NOT NULL DEFAULT 0, - `group_id` INT NOT NULL DEFAULT 0, - `recursion` TEXT, - `status` INT NOT NULL DEFAULT -1, - `search` TEXT, - `id_os` INT NOT NULL DEFAULT 0, - `policies` TEXT, - `search_custom` TEXT, - `ag_custom_fields` TEXT, - PRIMARY KEY (`id_filter`) -) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; - -CREATE TABLE `tevent_sound` ( - `id` INT NOT NULL AUTO_INCREMENT, - `name` TEXT NULL, - `sound` TEXT NULL, - `active` TINYINT NOT NULL DEFAULT '1', -PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE INDEX agente_modulo_estado ON tevento (estado, id_agentmodule); -CREATE INDEX idx_disabled ON talert_template_modules (disabled); - -INSERT INTO `treport_custom_sql` (`name`, `sql`) VALUES ('Agent safe mode not enable', 'select alias from tagente where safe_mode_module = 0'); - COMMIT; From 4b773671a972b8777d3f33912100d862314ad585 Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Fri, 3 Mar 2023 11:49:25 +0100 Subject: [PATCH 014/169] #9893 changed mr 2 --- pandora_console/extras/mr/62.sql | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/pandora_console/extras/mr/62.sql b/pandora_console/extras/mr/62.sql index 87b74f3174..f1cc60dac6 100644 --- a/pandora_console/extras/mr/62.sql +++ b/pandora_console/extras/mr/62.sql @@ -9,4 +9,31 @@ ALTER TABLE `tdatabase` ADD COLUMN `utimestamp` BIGINT DEFAULT 0; ALTER TABLE `tdatabase` ADD COLUMN `mysql_version` VARCHAR(10) DEFAULT ''; ALTER TABLE `tdatabase` ADD COLUMN `pandora_version` VARCHAR(10) DEFAULT ''; +CREATE TABLE IF NOT EXISTS `tagent_filter` ( + `id_filter` INT UNSIGNED NOT NULL AUTO_INCREMENT, + `id_name` VARCHAR(600) NOT NULL, + `id_group_filter` INT NOT NULL DEFAULT 0, + `group_id` INT NOT NULL DEFAULT 0, + `recursion` TEXT, + `status` INT NOT NULL DEFAULT -1, + `search` TEXT, + `id_os` INT NOT NULL DEFAULT 0, + `policies` TEXT, + `search_custom` TEXT, + `ag_custom_fields` TEXT, + PRIMARY KEY (`id_filter`) +) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; + +CREATE TABLE `tevent_sound` ( + `id` INT NOT NULL AUTO_INCREMENT, + `name` TEXT NULL, + `sound` TEXT NULL, + `active` TINYINT NOT NULL DEFAULT '1', +PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE INDEX agente_modulo_estado ON tevento (estado, id_agentmodule); +CREATE INDEX idx_disabled ON talert_template_modules (disabled); + +INSERT INTO `treport_custom_sql` (`name`, `sql`) VALUES ('Agent safe mode not enable', 'select alias from tagente where safe_mode_module = 0'); + COMMIT; From 2a118736385511773d3f9eab30ff270bed38b03c Mon Sep 17 00:00:00 2001 From: Jonathan Date: Mon, 6 Mar 2023 12:12:36 +0100 Subject: [PATCH 015/169] #9529 fix events last contact value --- pandora_console/operation/events/events.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pandora_console/operation/events/events.php b/pandora_console/operation/events/events.php index f6cbbf3288..ed8094cda8 100644 --- a/pandora_console/operation/events/events.php +++ b/pandora_console/operation/events/events.php @@ -558,10 +558,7 @@ if (is_ajax() === true) { $last_contact_value = ''.$value.''; } - $tmp->timestamp = ui_print_timestamp( - $tmp->utimestamp, - true - ); + $tmp->timestamp = $last_contact_value; if (is_numeric($tmp->data) === true) { $tmp->data = format_numeric( From 031c8a8db1a54ab0204140fd14488fd69490f169 Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Tue, 7 Mar 2023 09:10:18 +0100 Subject: [PATCH 016/169] #10311 ignore extraid in sql when is empty --- pandora_console/include/functions_events.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index c41c909c27..e6f5994a89 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -1494,7 +1494,8 @@ function events_get_all( break; case EVENT_GROUP_REP_EXTRAIDS: - // Group by events. + // Group by events and ignore null. + $sql_filters[] = 'AND te.id_extra IS NOT NULL AND te.id_extra <> ""'; $group_by .= 'te.id_extra'; break; } From 8f393cea12b8c502ef7eb89b07413cfd6a170789 Mon Sep 17 00:00:00 2001 From: Ramon Novoa Date: Thu, 9 Mar 2023 10:49:54 +0100 Subject: [PATCH 017/169] Manage the sflow daemon. --- pandora_server/bin/pandora_server | 62 +++++++++++++++++++++++ pandora_server/lib/PandoraFMS/Config.pm | 6 +++ pandora_server/pandora_server.redhat.spec | 2 + pandora_server/pandora_server.spec | 2 + pandora_server/pandora_server_installer | 2 + pandora_server/util/pandora_db.pl | 17 +++++++ 6 files changed, 91 insertions(+) diff --git a/pandora_server/bin/pandora_server b/pandora_server/bin/pandora_server index c6b1fc15bb..5d3bb55868 100755 --- a/pandora_server/bin/pandora_server +++ b/pandora_server/bin/pandora_server @@ -76,6 +76,9 @@ sub pandora_shutdown () { # Stop the netflow daemon pandora_stop_netflow_daemon (); + # Stop the sflow daemon + pandora_stop_sflow_daemon (); + # Stop server threads. stop_server_threads(); @@ -167,6 +170,9 @@ sub pandora_startup () { # Start the netflow daemon if necessary pandora_start_netflow_daemon (); + + # Start the sflow daemon if necessary + pandora_start_sflow_daemon (); # Remove disabled servers @Servers = grep { defined ($_) } @Servers; @@ -310,6 +316,62 @@ sub pandora_stop_netflow_daemon () { return 0; } +######################################################################################## +# Start the sflow daemon if necessary. +######################################################################################## +sub pandora_start_sflow_daemon () { + my $pid_file = '/var/run/pandora_sfcapd.pid'; + + # Check if sflow is enabled + if ($Config{'activate_sflow'} != 1) { + logger (\%Config, " [*] sflow daemon disabled.", 1); + print_message (\%Config, " [*] sflow daemon disabled.", 1); + return; + } + + # Stop sfcapd if it's already running + my $pid = pandora_stop_sflow_daemon (); + if (pandora_stop_sflow_daemon () != 0) { + logger (\%Config, "sfcapd (pid $pid) is already running, attempting to kill it...", 1); + print_message (\%Config, "sfcapd (pid $pid) is already running, attempting to kill it...", 1); + } + + # Start sfcapd + my $command = $Config{'sflow_daemon'} . ' -D -T all -w -t ' . $Config{'sflow_interval'} . ' -P ' . $pid_file . ' -l ' . $Config{'sflow_path'}; + if (system ("$command >/dev/null 2>&1") != 0) { + logger (\%Config, " [E] Could not start sfcapd: $command", 1); + print_message (\%Config, " [E] Could not start sfcapd: $command", 1); + return; + } + + logger (\%Config, "[*] sflow daemon started.", 1); + print_message (\%Config, "[*] sflow daemon started.", 1); +} + +######################################################################################## +# Stop the sflow daemon if it's running. +######################################################################################## +sub pandora_stop_sflow_daemon () { + + my $pid_file = '/var/run/pandora_sfcapd.pid'; + + # Open the pid file + if ( ! (-e $pid_file && open (PIDFILE, $pid_file))) { + return 0; + } + + my $pid = ; + close PIDFILE; + + # Check if sfcapd is running + if (kill (0, $pid) > 0) { + kill (9, $pid); + return $pid; + } + + return 0; +} + sub pandora_agent_autoconfiguration_scheduled($) { my $pa_config = shift; diff --git a/pandora_server/lib/PandoraFMS/Config.pm b/pandora_server/lib/PandoraFMS/Config.pm index 7bf9e9f9c6..dbd64da63f 100644 --- a/pandora_server/lib/PandoraFMS/Config.pm +++ b/pandora_server/lib/PandoraFMS/Config.pm @@ -144,6 +144,12 @@ sub pandora_get_sharedconfig ($$) { $pa_config->{"netflow_interval"} = pandora_get_tconfig_token ($dbh, 'netflow_interval', 300); $pa_config->{"netflow_daemon"} = pandora_get_tconfig_token ($dbh, 'netflow_daemon', '/usr/bin/nfcapd'); + # Sflow configuration options + $pa_config->{"activate_sflow"} = pandora_get_tconfig_token ($dbh, 'activate_sflow', 0); + $pa_config->{"sflow_path"} = pandora_get_tconfig_token ($dbh, 'sflow_path', '/var/spool/pandora/data_in/sflow'); + $pa_config->{"sflow_interval"} = pandora_get_tconfig_token ($dbh, 'sflow_interval', 300); + $pa_config->{"sflow_daemon"} = pandora_get_tconfig_token ($dbh, 'sflow_daemon', '/usr/bin/nfcapd'); + # Log module configuration $pa_config->{"log_dir"} = pandora_get_tconfig_token ($dbh, 'log_dir', '/var/spool/pandora/data_in/log'); $pa_config->{"log_interval"} = pandora_get_tconfig_token ($dbh, 'log_interval', 3600); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index a4738c6552..54f98ce6f0 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -55,6 +55,7 @@ mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/spool/pandora/data_in/conf mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/spool/pandora/data_in/md5 mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/spool/pandora/data_in/collections mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/spool/pandora/data_in/netflow +mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/spool/pandora/data_in/sflow mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/spool/pandora/data_in/trans mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/spool/pandora/data_in/commands mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/log/pandora/ @@ -237,5 +238,6 @@ exit 0 %{_localstatedir}/spool/pandora/data_in/collections %{_localstatedir}/spool/pandora/data_in/conf %{_localstatedir}/spool/pandora/data_in/netflow +%{_localstatedir}/spool/pandora/data_in/sflow %{_localstatedir}/spool/pandora/data_in/trans %{_localstatedir}/spool/pandora/data_in/commands diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index b108390a3d..e415360696 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -62,6 +62,7 @@ mkdir -p $RPM_BUILD_ROOT/var/spool/pandora/data_in/conf mkdir -p $RPM_BUILD_ROOT/var/spool/pandora/data_in/md5 mkdir -p $RPM_BUILD_ROOT/var/spool/pandora/data_in/collections mkdir -p $RPM_BUILD_ROOT/var/spool/pandora/data_in/netflow +mkdir -p $RPM_BUILD_ROOT/var/spool/pandora/data_in/sflow mkdir -p $RPM_BUILD_ROOT/var/spool/pandora/data_in/trans mkdir -p $RPM_BUILD_ROOT/var/spool/pandora/data_in/commands mkdir -p $RPM_BUILD_ROOT/var/log/pandora/ @@ -235,6 +236,7 @@ rm -Rf /usr/share/man/man1/tentacle_server.1.gz /var/spool/pandora/data_in/md5 /var/spool/pandora/data_in/collections /var/spool/pandora/data_in/netflow +/var/spool/pandora/data_in/sflow /var/spool/pandora/data_in/conf /var/spool/pandora/data_in/trans /var/spool/pandora/data_in/commands diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 2a76611dde..293c1bb145 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -308,6 +308,8 @@ install () { chmod 2770 $DESTDIR$PANDORA_SPOOL/data_in/collections mkdir $DESTDIR$PANDORA_SPOOL/data_in/netflow 2> /dev/null chmod 2770 $DESTDIR$PANDORA_SPOOL/data_in/netflow + mkdir $DESTDIR$PANDORA_SPOOL/data_in/sflow 2> /dev/null + chmod 2770 $DESTDIR$PANDORA_SPOOL/data_in/sflow mkdir $DESTDIR$PANDORA_SPOOL/data_in/trans 2> /dev/null chmod 2770 $DESTDIR$PANDORA_SPOOL/data_in/trans mkdir $DESTDIR$PANDORA_SPOOL/data_in/commands 2> /dev/null diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index ce08881710..15fcdff1ac 100755 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -353,6 +353,23 @@ sub pandora_purgedb ($$$) { else { log_message ('PURGE', 'netflow_max_lifetime is set to 0. Old netflow data will not be deleted.'); } + + # Delete old sflow data + if ($conf->{'_sflow_max_lifetime'} > 0) { + log_message ('PURGE', "Deleting old sflow data."); + if (! defined ($conf->{'_sflow_path'}) || ! -d $conf->{'_sflow_path'}) { + log_message ('!', "sflow data directory does not exist, skipping."); + } + elsif (! -x $conf->{'_sflow_nfexpire'}) { + log_message ('!', "Cannot execute " . $conf->{'_sflow_nfexpire'} . ", skipping."); + } + else { + `yes 2>/dev/null | $conf->{'_sflow_nfexpire'} -r "$conf->{'_sflow_path'}" -t $conf->{'_sflow_max_lifetime'}d`; + } + } + else { + log_message ('PURGE', 'sflow_max_lifetime is set to 0. Old sflow data will not be deleted.'); + } # Delete old log data log_message ('PURGE', "Deleting old log data."); From 41e255ff9cea71c2ed7ef8267afeebfe21e1d830 Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Thu, 9 Mar 2023 16:24:43 +0100 Subject: [PATCH 018/169] #9893 added token legacy_database_ha --- pandora_console/include/constants.php | 11 ++++++++++- pandora_console/include/functions_config.php | 8 ++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/pandora_console/include/constants.php b/pandora_console/include/constants.php index c1317e71dd..9095f6ca89 100644 --- a/pandora_console/include/constants.php +++ b/pandora_console/include/constants.php @@ -695,9 +695,18 @@ define('NODE_IMAGE_PADDING', 5); // Pandora Database HA constants. define('HA_ACTION_NONE', 0); -define('HA_ACTION_RESYNC', 1); +define('HA_ACTION_DEPLOY', 1); +define('HA_ACTION_RECOVER', 2); +define('HA_ACTION_PROMOTE', 3); +define('HA_ACTION_DEMOTE', 4); define('HA_ACTION_DISABLE', 5); define('HA_ACTION_ENABLE', 6); +define('HA_ACTION_CLEANUP', 7); +define('HA_ACTION_RESYNC', 8); + +define('HA_RESYNC', 1); +define('HA_DISABLE', 5); +define('HA_ENABLE', 6); define('HA_UNINITIALIZED', 0); diff --git a/pandora_console/include/functions_config.php b/pandora_console/include/functions_config.php index 7b6e133f22..f890f9c28f 100644 --- a/pandora_console/include/functions_config.php +++ b/pandora_console/include/functions_config.php @@ -456,6 +456,10 @@ function config_update_config() $error_update[] = __('Enable Update Manager'); } + if (config_update_value('legacy_database_ha', get_parameter('legacy_database_ha'), true) === false) { + $error_update[] = __('Legacy database HA'); + } + if (config_update_value('ipam_ocuppied_critical_treshold', get_parameter('ipam_ocuppied_critical_treshold'), true) === false) { $error_update[] = __('Ipam Ocuppied Manager Critical'); } @@ -2217,6 +2221,10 @@ function config_process_config() config_update_value('enable_update_manager', 1); } + if (!isset($config['legacy_database_ha'])) { + config_update_value('legacy_database_ha', 1); + } + if (!isset($config['disabled_newsletter'])) { config_update_value('disabled_newsletter', 0); } From fd3a068b682d09e7ef3cf806942d90f4c11adff7 Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Thu, 9 Mar 2023 16:25:21 +0100 Subject: [PATCH 019/169] #9893 Added cluster builder --- .../general/first_task/HA_cluster_builder.php | 64 +++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 pandora_console/general/first_task/HA_cluster_builder.php diff --git a/pandora_console/general/first_task/HA_cluster_builder.php b/pandora_console/general/first_task/HA_cluster_builder.php new file mode 100644 index 0000000000..e475dfdf1a --- /dev/null +++ b/pandora_console/general/first_task/HA_cluster_builder.php @@ -0,0 +1,64 @@ + true, 'message' => __('There are no HA clusters defined yet.') ]); +?> + +
+
+ __('Clusters')]); ?> +
+
+

+

+
'; + + echo __('Click on "add new node" to start transforming your Pandora FMS DB Cluster into a Pandora FMS DB Cluster.').'

'; + ?> +

+ +
"; + echo ""; + ?> + + +
+
From 5148dcdaefdaccc2c18652af5cbed679285e8db9 Mon Sep 17 00:00:00 2001 From: "alejandro.campos@artica.es" Date: Thu, 9 Mar 2023 17:17:54 +0100 Subject: [PATCH 020/169] fixes in event comments --- pandora_console/include/ajax/events.php | 7 +++---- pandora_console/include/functions_events.php | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/pandora_console/include/ajax/events.php b/pandora_console/include/ajax/events.php index ccdb086f9a..d7b0fe4c47 100644 --- a/pandora_console/include/ajax/events.php +++ b/pandora_console/include/ajax/events.php @@ -91,9 +91,8 @@ $node_id = (int) get_parameter('node_id', 0); if ($get_comments === true) { $event = get_parameter('event', false); - $event_rep = (int) get_parameter('event_rep', 0); - $event_rep = get_parameter_post('event')['event_rep']; - $group_rep = get_parameter_post('event')['group_rep']; + $event_rep = (int) get_parameter_post('event')['event_rep']; + $group_rep = (int) get_parameter_post('event')['group_rep']; if ($event === false) { return __('Failed to retrieve comments'); @@ -126,7 +125,7 @@ if ($get_comments === true) { } else if ($group_rep === EVENT_GROUP_REP_EXTRAIDS) { $whereGrouped = sprintf( '`id_extra` = "%s"', - $event['id_extra'] + io_safe_output($event['id_extra']) ); } else { $whereGrouped = sprintf('`id_evento` = %d', $event['id_evento']); diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index f779b7121e..7ef77e6e47 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -5172,7 +5172,7 @@ function events_page_comments($event, $ajax=false, $groupedComments=[]) __('Add comment'), 'comment_button', false, - 'event_comment(\''.base64_encode(json_encode($event)).'\');', + 'event_comment("'.base64_encode(json_encode($event)).'");', [ 'icon' => 'next', 'mode' => 'mini secondary', From cd85c6062002dd9c21560f8890fa9e651fa8f8ed Mon Sep 17 00:00:00 2001 From: "alejandro.campos@artica.es" Date: Fri, 10 Mar 2023 15:17:21 +0100 Subject: [PATCH 021/169] visual fix after pandora style refactorization --- pandora_console/views/consoles/list.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pandora_console/views/consoles/list.php b/pandora_console/views/consoles/list.php index f7a4d6bcc1..dd4a9a8995 100644 --- a/pandora_console/views/consoles/list.php +++ b/pandora_console/views/consoles/list.php @@ -85,7 +85,7 @@ try { [ 'id' => $tableId, 'class' => 'info_table', - 'style' => 'width: 100%', + 'style' => 'width: 99%', 'columns' => $columns, 'column_names' => $column_names, 'ajax_url' => 'include/ajax/consoles.ajax', @@ -145,8 +145,6 @@ try { }, datatype: "json", success: function (data) { - console.log("dataaaa"); - console.log(data); showMsg(data); }, error: function(e) { From ca78f069f6ba59c74b58090f4c8b102f1bf56740 Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Fri, 10 Mar 2023 17:12:38 +0100 Subject: [PATCH 022/169] #9624 added support sflow --- pandora_console/godmode/menu.php | 5 + pandora_console/godmode/setup/setup.php | 24 ++++ .../godmode/setup/setup_general.php | 24 ++++ .../godmode/setup/setup_netflow.php | 3 +- pandora_console/godmode/setup/setup_sflow.php | 84 +++++++++++ pandora_console/include/functions_config.php | 134 +++++++++++++++++- pandora_console/include/functions_netflow.php | 28 +++- pandora_console/operation/menu.php | 44 ++---- pandora_console/pandoradb_data.sql | 6 + 9 files changed, 316 insertions(+), 36 deletions(-) create mode 100644 pandora_console/godmode/setup/setup_sflow.php diff --git a/pandora_console/godmode/menu.php b/pandora_console/godmode/menu.php index af15b28f7a..8b2ef974e1 100644 --- a/pandora_console/godmode/menu.php +++ b/pandora_console/godmode/menu.php @@ -364,6 +364,11 @@ if ($access_console_node === true) { $sub2['godmode/setup/setup§ion=net']['text'] = __('Netflow'); $sub2['godmode/setup/setup§ion=net']['refr'] = 0; } + + if ((bool) $config['activate_sflow'] === true) { + $sub2['godmode/setup/setup§ion=sflow']['text'] = __('Sflow'); + $sub2['godmode/setup/setup§ion=sflow']['refr'] = 0; + } } $sub2['godmode/setup/setup§ion=ehorus']['text'] = __('eHorus'); diff --git a/pandora_console/godmode/setup/setup.php b/pandora_console/godmode/setup/setup.php index 8c8587b1ef..846ea7a57f 100644 --- a/pandora_console/godmode/setup/setup.php +++ b/pandora_console/godmode/setup/setup.php @@ -154,6 +154,20 @@ if (check_acl($config['id_user'], 0, 'AW')) { ).'', ]; } + + if ($config['activate_sflow']) { + $buttons['sflow'] = [ + 'active' => false, + 'text' => ''.html_print_image( + 'images/op_netflow.png', + true, + [ + 'title' => __('Sflow'), + 'class' => 'invert_filter', + ] + ).'', + ]; + } } $buttons['integria'] = [ @@ -272,6 +286,12 @@ switch ($section) { $help_header = 'setup_netflow_tab'; break; + case 'sflow': + $buttons['sflow']['active'] = true; + $subpage = ' » '.__('Sflow'); + $help_header = 'setup_flow_tab'; + break; + case 'ehorus': $buttons['ehorus']['active'] = true; $subpage = ' » '.__('eHorus'); @@ -381,6 +401,10 @@ switch ($section) { include_once $config['homedir'].'/godmode/setup/setup_netflow.php'; break; + case 'sflow': + include_once $config['homedir'].'/godmode/setup/setup_sflow.php'; + break; + case 'vis': include_once $config['homedir'].'/godmode/setup/setup_visuals.php'; break; diff --git a/pandora_console/godmode/setup/setup_general.php b/pandora_console/godmode/setup/setup_general.php index fc169f91a2..348746ea60 100644 --- a/pandora_console/godmode/setup/setup_general.php +++ b/pandora_console/godmode/setup/setup_general.php @@ -246,7 +246,31 @@ $table->data[$i++][1] = html_print_checkbox_switch_extended( true ); +$table->data[$i][0] = __('Enable Sflow'); +$rbt_disabled = false; +if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') { + $rbt_disabled = true; +} +$table->data[$i++][1] = html_print_checkbox_switch_extended( + 'activate_sflow', + 1, + $config['activate_sflow'], + $rbt_disabled, + '', + '', + true +); + +$table->data[$i][0] = __('General network path'); +$table->data[$i++][1] = html_print_input_text( + 'general_network_path', + $config['general_network_path'], + '', + 40, + 255, + true +); $zone_name = [ 'Africa' => __('Africa'), 'America' => __('America'), diff --git a/pandora_console/godmode/setup/setup_netflow.php b/pandora_console/godmode/setup/setup_netflow.php index 48a2947bb2..00f6ecbe05 100644 --- a/pandora_console/godmode/setup/setup_netflow.php +++ b/pandora_console/godmode/setup/setup_netflow.php @@ -45,7 +45,8 @@ $table->class = 'databox filters'; $table->data = []; $table->data[0][0] = ''.__('Data storage path').''; -$table->data[0][1] = html_print_input_text('netflow_path', $config['netflow_path'], false, 50, 200, true); +$table->data[0][1] = html_print_input_text('netflow_name_dir', $config['netflow_name_dir'], false, 50, 200, true); +$table->data[0][1] .= ''; $table->data[1][0] = ''.__('Daemon interval').''; $table->data[1][1] = html_print_input_text('netflow_interval', $config['netflow_interval'], false, 50, 200, true); diff --git a/pandora_console/godmode/setup/setup_sflow.php b/pandora_console/godmode/setup/setup_sflow.php new file mode 100644 index 0000000000..2610bc3361 --- /dev/null +++ b/pandora_console/godmode/setup/setup_sflow.php @@ -0,0 +1,84 @@ +width = '100%'; +$table->border = 0; +$table->cellspacing = 3; +$table->cellpadding = 5; +$table->class = 'databox filters'; + +$table->data = []; + +$table->data[0][0] = ''.__('Data storage path').''; +$table->data[0][1] = html_print_input_text('sflow_name_dir', $config['sflow_name_dir'], false, 50, 200, true); +$table->data[0][1] .= ''; + + +$table->data[1][0] = ''.__('Daemon interval').''; +$table->data[1][1] = html_print_input_text('sflow_interval', $config['sflow_interval'], false, 50, 200, true); + +$table->data[2][0] = ''.__('Daemon binary path').''; +$table->data[2][1] = html_print_input_text('sflow_daemon', $config['sflow_daemon'], false, 50, 200, true); + +$table->data[3][0] = ''.__('Nfdump binary path').''; +$table->data[3][1] = html_print_input_text('sflow_nfdump', $config['sflow_nfdump'], false, 50, 200, true); + +$table->data[4][0] = ''.__('Nfexpire binary path').''; +$table->data[4][1] = html_print_input_text('sflow_nfexpire', $config['sflow_nfexpire'], false, 50, 200, true); + +$table->data[5][0] = ''.__('Maximum chart resolution').''; +$table->data[5][1] = html_print_input_text('sflow_max_resolution', $config['sflow_max_resolution'], false, 50, 200, true); + +$table->data[6][0] = ''.__('Disable custom live view filters').''; +$table->data[6][1] = html_print_checkbox_switch('sflow_disable_custom_lvfilters', 1, $config['sflow_disable_custom_lvfilters'], true); +$table->data[7][0] = ''.__('Max. sflow lifetime').''; +$table->data[7][1] = html_print_input_text('sflow_max_lifetime', $config['sflow_max_lifetime'], false, 50, 200, true); + +$table->data[8][0] = ''.__('Name resolution for IP address').''; +$onclick = "if (!confirm('".__('Warning').'. '.__('IP address resolution can take a lot of time')."')) return false;"; +$table->data[8][1] = html_print_checkbox_switch_extended('sflow_get_ip_hostname', 1, $config['sflow_get_ip_hostname'], false, $onclick, '', true); + +echo '
'; + +html_print_table($table); + +// Update button. +echo '
'; + html_print_input_hidden('update_config', 1); + html_print_submit_button(__('Update'), 'upd_button', false, 'class="sub upd"'); +echo '
'; diff --git a/pandora_console/include/functions_config.php b/pandora_console/include/functions_config.php index 24d2de537d..66b978a0d2 100644 --- a/pandora_console/include/functions_config.php +++ b/pandora_console/include/functions_config.php @@ -260,6 +260,24 @@ function config_update_config() $error_update[] = __('Enable Netflow'); } + if (config_update_value('activate_sflow', (bool) get_parameter('activate_sflow'), true) === false) { + $error_update[] = __('Enable Sflow'); + } + + if (config_update_value('general_network_path', get_parameter('general_network_path'), true) === false) { + $error_update[] = __('General network path'); + } else { + if (empty($config['netflow_name_dir']) === false && $config['netflow_name_dir'] !== '') { + $path = get_parameter('general_network_path'); + config_update_value('netflow_path', $path.$config['netflow_name_dir']); + } + + if (empty($config['sflow_name_dir']) === false && $config['sflow_name_dir'] !== '') { + $path = get_parameter('general_network_path'); + config_update_value('sflow_path', $path.$config['sflow_name_dir']); + } + } + $timezone = (string) get_parameter('timezone'); if (empty($timezone) === true || config_update_value('timezone', $timezone, true) === false) { $error_update[] = __('Timezone setup'); @@ -1501,8 +1519,13 @@ function config_update_config() break; case 'net': - if (config_update_value('netflow_path', get_parameter('netflow_path'), true) === false) { - $error_update[] = __('Data storage path'); + if (config_update_value('netflow_name_dir', get_parameter('netflow_name_dir'), true) === false) { + $error_update[] = __('Name storage path'); + } else { + if (empty($config['general_network_path']) === false && $config['general_network_path'] !== '') { + $name = get_parameter('netflow_name_dir'); + config_update_value('netflow_path', $config['general_network_path'].$name); + } } if (config_update_value('netflow_interval', (int) get_parameter('netflow_interval'), true) === false) { @@ -1538,6 +1561,49 @@ function config_update_config() } break; + case 'sflow': + if (config_update_value('sflow_name_dir', get_parameter('sflow_name_dir'), true) === false) { + $error_update[] = __('Sflow name dir'); + } else { + if (empty($config['general_network_path']) === false && $config['general_network_path'] !== '') { + $name = get_parameter('sflow_name_dir'); + config_update_value('sflow_path', $config['general_network_path'].$name); + } + } + + if (config_update_value('sflow_interval', (int) get_parameter('sflow_interval'), true) === false) { + $error_update[] = __('Daemon interval'); + } + + if (config_update_value('sflow_daemon', get_parameter('sflow_daemon'), true) === false) { + $error_update[] = __('Daemon binary path'); + } + + if (config_update_value('sflow_nfdump', get_parameter('sflow_nfdump'), true) === false) { + $error_update[] = __('Nfdump binary path'); + } + + if (config_update_value('sflow_nfexpire', get_parameter('sflow_nfexpire'), true) === false) { + $error_update[] = __('Nfexpire binary path'); + } + + if (config_update_value('sflow_max_resolution', (int) get_parameter('sflow_max_resolution'), true) === false) { + $error_update[] = __('Maximum chart resolution'); + } + + if (config_update_value('sflow_disable_custom_lvfilters', get_parameter('sflow_disable_custom_lvfilters'), true) === false) { + $error_update[] = __('Disable custom live view filters'); + } + + if (config_update_value('sflow_max_lifetime', (int) get_parameter('sflow_max_lifetime'), true) === false) { + $error_update[] = __('Sflow max lifetime'); + } + + if (config_update_value('sflow_get_ip_hostname', (int) get_parameter('sflow_get_ip_hostname'), true) === false) { + $error_update[] = __('Name resolution for IP address'); + } + break; + case 'log': if (config_update_value('elasticsearch_ip', get_parameter('elasticsearch_ip'), true) === false) { $error_update[] = __('IP ElasticSearch server'); @@ -2768,6 +2834,28 @@ function config_process_config() config_update_value('activate_netflow', 0); } + if (!isset($config['activate_sflow'])) { + config_update_value('activate_sflow', 0); + } + + if (!isset($config['general_network_path'])) { + if ($is_windows) { + $default = 'C:\PandoraFMS\Pandora_Server\data_in\\'; + } else { + $default = '/var/spool/pandora/data_in/'; + } + + config_update_value('general_network_path', $default); + } + + if (!isset($config['netflow_name_dir'])) { + config_update_value('netflow_name_dir', 'netflow'); + } + + if (!isset($config['sflow_name_dir'])) { + config_update_value('sflow_name_dir', 'sflow'); + } + if (!isset($config['netflow_path'])) { if ($is_windows) { $default = 'C:\PandoraFMS\Pandora_Server\data_in\netflow'; @@ -2806,6 +2894,48 @@ function config_process_config() config_update_value('netflow_max_lifetime', '5'); } + if (!isset($config['sflow_interval'])) { + config_update_value('sflow_interval', SECONDS_10MINUTES); + } + + if (!isset($config['sflow_daemon'])) { + config_update_value('sflow_daemon', '/usr/bin/nfcapd'); + } + + if (!isset($config['sflow_nfdump'])) { + config_update_value('sflow_nfdump', '/usr/bin/nfdump'); + } + + if (!isset($config['sflow_nfexpire'])) { + config_update_value('sflow_nfexpire', '/usr/bin/nfexpire'); + } + + if (!isset($config['sflow_max_resolution'])) { + config_update_value('sflow_max_resolution', '50'); + } + + if (!isset($config['sflow_disable_custom_lvfilters'])) { + config_update_value('sflow_disable_custom_lvfilters', 0); + } + + if (!isset($config['sflow_max_lifetime'])) { + config_update_value('sflow_max_lifetime', '5'); + } + + if (!isset($config['sflow_name_dir'])) { + config_update_value('sflow_name_dir', 'sflow'); + } + + if (!isset($config['sflow_path'])) { + if ($is_windows) { + $default = 'C:\PandoraFMS\Pandora_Server\data_in\sflow'; + } else { + $default = '/var/spool/pandora/data_in/sflow'; + } + + config_update_value('sflow_path', $default); + } + if (!isset($config['auth'])) { config_update_value('auth', 'mysql'); } diff --git a/pandora_console/include/functions_netflow.php b/pandora_console/include/functions_netflow.php index e4ac71e690..be271ef974 100644 --- a/pandora_console/include/functions_netflow.php +++ b/pandora_console/include/functions_netflow.php @@ -1025,9 +1025,29 @@ function netflow_get_command($options, $filter) // Build command. $command = io_safe_output($config['netflow_nfdump']).' -N'; - // Netflow data path. - if (isset($config['netflow_path']) && $config['netflow_path'] != '') { - $command .= ' -R. -M '.$config['netflow_path']; + if ($config['activate_sflow'] && $config['activate_netflow']) { + if (isset($config['sflow_name_dir']) && $config['sflow_name_dir'] !== '' + && isset($config['netflow_name_dir']) && $config['netflow_name_dir'] !== '' + && isset($config['general_network_path']) && $config['general_network_path'] !== '' + ) { + $command .= ' -R. -M '.$config['general_network_path'].$config['netflow_name_dir'].':'.$config['sflow_name_dir']; + } + } else { + if ($config['activate_sflow']) { + if (isset($config['sflow_name_dir']) && $config['sflow_name_dir'] !== '' + && isset($config['general_network_path']) && $config['general_network_path'] !== '' + ) { + $command .= ' -R. -M '.$config['general_network_path'].$config['sflow_name_dir']; + } + } + + if ($config['activate_netflow']) { + if (isset($config['netflow_name_dir']) && $config['netflow_name_dir'] !== '' + && isset($config['general_network_path']) && $config['general_network_path'] !== '' + ) { + $command .= ' -R. -M '.$config['general_network_path'].$config['netflow_name_dir']; + } + } } // Add options. @@ -1035,7 +1055,7 @@ function netflow_get_command($options, $filter) // Filter options. $command .= ' '.netflow_get_filter_arguments($filter); - + hd($command, true); return $command; } diff --git a/pandora_console/operation/menu.php b/pandora_console/operation/menu.php index 62984b4078..7dd1126cd9 100644 --- a/pandora_console/operation/menu.php +++ b/pandora_console/operation/menu.php @@ -205,7 +205,7 @@ if ($access_console_node === true) { $sub['operation/inventory/inventory']['refr'] = 0; } - if ($config['activate_netflow']) { + if ($config['activate_netflow'] || $config['activate_sflow']) { $sub['network_traffic'] = [ 'text' => __('Network'), 'id' => 'Network', @@ -213,34 +213,20 @@ if ($access_console_node === true) { 'subtype' => 'nolink', 'refr' => 0, ]; - - // Initialize the submenu. - $netflow_sub = []; - - $netflow_sub = array_merge( - $netflow_sub, - [ - 'operation/netflow/netflow_explorer' => [ - 'text' => __('Netflow explorer'), - 'id' => 'Netflow explorer', - ], - 'operation/netflow/nf_live_view' => [ - 'text' => __('Netflow Live View'), - 'id' => 'Netflow Live View', - ], - ] - ); - - $netflow_sub = array_merge( - $netflow_sub, - [ - 'operation/network/network_usage_map' => [ - 'text' => __('Network usage map'), - 'id' => 'Network usage map', - ], - ] - ); - + $netflow_sub = [ + 'operation/netflow/netflow_explorer' => [ + 'text' => __('Netflow explorer'), + 'id' => 'Netflow explorer', + ], + 'operation/netflow/nf_live_view' => [ + 'text' => __('Netflow Live View'), + 'id' => 'Netflow Live View', + ], + 'operation/network/network_usage_map' => [ + 'text' => __('Network usage map'), + 'id' => 'Network usage map', + ], + ]; $sub['network_traffic']['sub2'] = $netflow_sub; } diff --git a/pandora_console/pandoradb_data.sql b/pandora_console/pandoradb_data.sql index acb6636dca..f79f17b8cd 100644 --- a/pandora_console/pandoradb_data.sql +++ b/pandora_console/pandoradb_data.sql @@ -72,6 +72,8 @@ INSERT INTO `tconfig` (`token`, `value`) VALUES ('stats_interval', '60'), ('activate_gis', '0'), ('activate_netflow', '0'), +('activate_sflow', '0'), +('general_network_path', '/var/spool/pandora/data_in/'), ('timezone', 'Europe/Berlin'), ('string_purge', 7), ('audit_purge', 15), @@ -87,6 +89,10 @@ INSERT INTO `tconfig` (`token`, `value`) VALUES ('netflow_daemon', '/usr/bin/nfcapd'), ('netflow_nfdump', '/usr/bin/nfdump'), ('netflow_max_resolution', '50'), +('sflow_interval', '3600'), +('sflow_daemon', '/usr/bin/nfcapd'), +('sflow_nfdump', '/usr/bin/nfdump'), +('sflow_max_resolution', '50'), ('event_fields', 'mini_severity,evento,estado,agent_name,timestamp'), ('status_monitor_fields', 'policy,agent,data_type,module_name,server_type,interval,status,last_status_change,graph,warn,data,timestamp'), ('list_ACL_IPs_for_API', '127.0.0.1'), From daae94f904f1d03e5dc6db2a2b33feb6b4f6027f Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Mon, 13 Mar 2023 09:49:44 +0100 Subject: [PATCH 023/169] #9624 deleted General network path from database --- pandora_console/pandoradb_data.sql | 1 - 1 file changed, 1 deletion(-) diff --git a/pandora_console/pandoradb_data.sql b/pandora_console/pandoradb_data.sql index f79f17b8cd..0e75acb879 100644 --- a/pandora_console/pandoradb_data.sql +++ b/pandora_console/pandoradb_data.sql @@ -73,7 +73,6 @@ INSERT INTO `tconfig` (`token`, `value`) VALUES ('activate_gis', '0'), ('activate_netflow', '0'), ('activate_sflow', '0'), -('general_network_path', '/var/spool/pandora/data_in/'), ('timezone', 'Europe/Berlin'), ('string_purge', 7), ('audit_purge', 15), From f79d22b7813af682fba1140f0ff4efae7a572fab Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Mon, 13 Mar 2023 09:57:57 +0100 Subject: [PATCH 024/169] #9624 clear log --- pandora_console/include/functions_netflow.php | 1 - 1 file changed, 1 deletion(-) diff --git a/pandora_console/include/functions_netflow.php b/pandora_console/include/functions_netflow.php index be271ef974..89a6110b2e 100644 --- a/pandora_console/include/functions_netflow.php +++ b/pandora_console/include/functions_netflow.php @@ -1055,7 +1055,6 @@ function netflow_get_command($options, $filter) // Filter options. $command .= ' '.netflow_get_filter_arguments($filter); - hd($command, true); return $command; } From 695f3fb282f7b81966300654db05295e0eb5c71a Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Mon, 13 Mar 2023 15:07:38 +0100 Subject: [PATCH 025/169] #9893 Added img disabled --- pandora_console/include/functions_html.php | 1 + 1 file changed, 1 insertion(+) diff --git a/pandora_console/include/functions_html.php b/pandora_console/include/functions_html.php index 5d6f413573..c42ba2bf9a 100644 --- a/pandora_console/include/functions_html.php +++ b/pandora_console/include/functions_html.php @@ -3250,6 +3250,7 @@ function html_print_input_image($name, $src, $value, $style='', $return=false, $ 'onkeyup', 'class', 'form', + 'disabled', ]; foreach ($attrs as $attribute) { From 721d7eaff91b8883fe3ce12613b6031f6a84d056 Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Mon, 13 Mar 2023 18:07:04 +0100 Subject: [PATCH 026/169] #10665 fixed error 500 in user edit view --- pandora_console/godmode/users/configure_user.php | 10 ++++++---- pandora_console/godmode/users/user_management.php | 7 ++++--- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/pandora_console/godmode/users/configure_user.php b/pandora_console/godmode/users/configure_user.php index bb1c5d1c73..eef7062a9d 100644 --- a/pandora_console/godmode/users/configure_user.php +++ b/pandora_console/godmode/users/configure_user.php @@ -1271,10 +1271,12 @@ if ($new_user) { if (is_metaconsole() === false) { // User only can change skins if has more than one group. - if (count($usr_groups) > 1) { - if ($isFunctionSkins !== ENTERPRISE_NOT_HOOK) { - $skin = '

'.__('Skin').'

'; - $skin .= skins_print_select($id_usr, 'skin', $user_info['id_skin'], '', __('None'), 0, true).'
'; + if (function_exists('skins_print_select')) { + if (count($usr_groups) > 1) { + if ($isFunctionSkins !== ENTERPRISE_NOT_HOOK) { + $skin = '

'.__('Skin').'

'; + $skin .= skins_print_select($id_usr, 'skin', $user_info['id_skin'], '', __('None'), 0, true).'
'; + } } } } diff --git a/pandora_console/godmode/users/user_management.php b/pandora_console/godmode/users/user_management.php index cff87aef6f..4e9d48f14e 100644 --- a/pandora_console/godmode/users/user_management.php +++ b/pandora_console/godmode/users/user_management.php @@ -563,9 +563,10 @@ $userManagementTable->data['fields_lang_colorscheme'][0] = html_print_select_fro 'default', true ); - -$userManagementTable->data['captions_lang_colorscheme'][1] = __('User color scheme'); -$userManagementTable->data['fields_lang_colorscheme'][1] = skins_print_select($id_usr, 'skin', $user_info['id_skin'], '', __('None'), 0, true); +if (function_exists('skins_print_select')) { + $userManagementTable->data['captions_lang_colorscheme'][1] = __('User color scheme'); + $userManagementTable->data['fields_lang_colorscheme'][1] = skins_print_select($id_usr, 'skin', $user_info['id_skin'], '', __('None'), 0, true); +} $userManagementTable->rowclass['captions_blocksize_eventfilter'] = 'field_half_width'; $userManagementTable->rowclass['fields_blocksize_eventfilter'] = 'field_half_width'; From ae0ccf93a4e416b9d7cf5690680e1934e55189ab Mon Sep 17 00:00:00 2001 From: Ramon Novoa Date: Mon, 13 Mar 2023 18:16:42 +0100 Subject: [PATCH 027/169] Fix small spelling errors. --- pandora_server/bin/pandora_server | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pandora_server/bin/pandora_server b/pandora_server/bin/pandora_server index 5d3bb55868..8530b998c4 100755 --- a/pandora_server/bin/pandora_server +++ b/pandora_server/bin/pandora_server @@ -268,8 +268,8 @@ sub pandora_start_netflow_daemon () { # Check if netflow is enabled if ($Config{'activate_netflow'} != 1) { - logger (\%Config, " [*] Netflow daemon disabled.", 1); - print_message (\%Config, " [*] Netflow daemon disabled.", 1); + logger (\%Config, " [*] NetFlow daemon disabled.", 1); + print_message (\%Config, " [*] NetFlow daemon disabled.", 1); return; } @@ -288,8 +288,8 @@ sub pandora_start_netflow_daemon () { return; } - logger (\%Config, "[*] Netflow daemon started.", 1); - print_message (\%Config, "[*] Netflow daemon started.", 1); + logger (\%Config, "[*] NetFlow daemon started.", 1); + print_message (\%Config, "[*] NetFlow daemon started.", 1); } ######################################################################################## @@ -324,8 +324,8 @@ sub pandora_start_sflow_daemon () { # Check if sflow is enabled if ($Config{'activate_sflow'} != 1) { - logger (\%Config, " [*] sflow daemon disabled.", 1); - print_message (\%Config, " [*] sflow daemon disabled.", 1); + logger (\%Config, " [*] sFlow daemon disabled.", 1); + print_message (\%Config, " [*] sFlow daemon disabled.", 1); return; } @@ -344,8 +344,8 @@ sub pandora_start_sflow_daemon () { return; } - logger (\%Config, "[*] sflow daemon started.", 1); - print_message (\%Config, "[*] sflow daemon started.", 1); + logger (\%Config, "[*] sFlow daemon started.", 1); + print_message (\%Config, "[*] sFlow daemon started.", 1); } ######################################################################################## From be6c15fc585d996d2486d3e168529d8ac84c0b32 Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Tue, 14 Mar 2023 10:46:50 +0100 Subject: [PATCH 028/169] #9624 change icon sflow --- pandora_console/godmode/setup/setup.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/godmode/setup/setup.php b/pandora_console/godmode/setup/setup.php index 846ea7a57f..9aa16a4a24 100644 --- a/pandora_console/godmode/setup/setup.php +++ b/pandora_console/godmode/setup/setup.php @@ -159,7 +159,7 @@ if (check_acl($config['id_user'], 0, 'AW')) { $buttons['sflow'] = [ 'active' => false, 'text' => ''.html_print_image( - 'images/op_netflow.png', + 'images/op_recon.png', true, [ 'title' => __('Sflow'), From 62d1249fe084dddede68e2ebc45422afca6767f5 Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Tue, 14 Mar 2023 12:47:10 +0100 Subject: [PATCH 029/169] #8642 Added heatmap widget 4 --- pandora_console/images/widgets/heatmap.png | Bin 0 -> 5155 bytes .../include/class/Heatmap.class.php | 110 ++++++++++-- .../include/javascript/pandora_dashboards.js | 33 ++++ .../include/lib/Dashboard/Widgets/heatmap.php | 170 +++++++++++++++++- pandora_console/operation/heatmap.php | 5 +- 5 files changed, 295 insertions(+), 23 deletions(-) create mode 100644 pandora_console/images/widgets/heatmap.png diff --git a/pandora_console/images/widgets/heatmap.png b/pandora_console/images/widgets/heatmap.png new file mode 100644 index 0000000000000000000000000000000000000000..413134613b5d68f89c89eeb2f661478f6e438298 GIT binary patch literal 5155 zcmV+;6x{2HP)X+)SF1}+Tghds}nGgVX=bXFI z*>(*qU2NT=z<^!w7>GD zYP}$28d!AeDD>U3bX31?5*j{jhn}?frd>3O9u`9x!F>ceBI{c8_Af6*OO`CreF(Fh zVO&-s4`x)ORaINYs*z|q4-w$^-BG+#5CqN0L?gdgRb8N{Ql_dYU)^_m@gX`5!g{8P zm#W7on%38vXpKW<)icpW4gk86(wRtw)oVG)gypTHk*Er5fJucl*$FBuxChGSqTiOU zMi2k=9;34MPZJO}uAXkHdjKJollU}D&w>A$I00pF^@l#!E9?68uj||ZwtDqy@N{S5 z^rPwX(Yz-s(D1y=^~(C(bI+lLOJ^8Wiexe>thFEr0_`&^?2~Uy&~e@>Z!;<`EfyhQ z(uq{i5yNtEh5Z8kPvsJVXYz$VR#&IB9o5E}pf(ZX6$UuO$Ts-Ms75TLm6d-Vs7Zlg ztTZPuLY&4mo(w0_(HWhFr9kF^(vpd1bw)H3yLVFgnztR%7eq~eXVJ(q&4f;1h0A76 zWr10+I#ST91D_K5x@o5z?Z-gSzXu%7xK%NZ3?Y2@w3+nrgJQ zw#EQG^2j4->C&aRAsH1HW*|@ju11AL#kir_r~h87-HWzw-;P+YZ+uHavtH<9`~Z*T zxEcZS@n#LRN6p#j*ONKLKE`GA`Bz&|)y}J^+>;Q%HhgG?)x2&rYn`|^QCX;Dy(K|tG2RT%|80LrZfqEzCTc@jKZMg-}Fs_G0;K{=`*rpri3SJaMZP?lO1Nopzm@swi(&(3Eu za`RfU5*L(6!+o>9e=-J60}^3C(}6HlfYLjPKP7Noql&7!{z{~&fB^mUO_hPx1eyse zqmFRf*kCAq4-IF*Af5EHXk1_x(@gOC$NBmBg$tJap3aY!J$6?N?AgV4)jj;=i!tqy z(WfC4?D{sW4j;)!`yYPzA-eN{XAEW{iZ*fIb#z7&X7!0k8tq#Jf>9E;nSjQP{GgEo zN8+U6yF6%djM43KUBfxfA8D4#VK9e{N0QDIx^BV$G)^_a^ zQ|4M=M}?6#di3bF2OnEyOn^bdrxT=GSVq2tK^6xZRLE8O)+t!*_~g|Cvgis~U#hf_b`wxE9tq=t0J07QNE+?q!GU8u z)_{Sg1z|E46Mw({AN`!nMOz8*;s*~NL@)sc0^2#Fv=cl{73!W{e79*9+e#aB0A1v0 zSjn>{`Vj}koVc=?&hhX-$XF|4(FR>)C87jbi9Fa7PdtGd8X9=X`l?W7W+w6*kIRrs z0A0Af9}3SDgq0~+f3P~z4_~mLR9_|V8_&v*7k8}?Ayk707|mikJev0W2(md-t7xqN~Rh&`G9nWo4xvKm3t`{&atfDUFW&{E^9YG;Y|nLO@YfJ7*wS z)N^ujbZ~on8!Op>oj!e94?FEq7#ZUPTq^`CYp@Z6=Qgg}h;F|5X5C*)=CB#CLq}KbV7kxq#F)6e1<(jKBRq2*)3@wz?upmn6eYY3APw)+8 zez&&z$|!z?l7yb(dI8G&+Iddk0pPz2r_zAXi89k;=aZ)I*EYsA~WI8fsWiV{m zF!bo7k0QVEtbBNJSIWS7FnZe^P4q~Uh8|yVj}G!1kLF_+_NAJgZq-nPKeKD__Z!b3 zd_LgHG9>fyQ)kep`wr_-e4Y?1BA_u>j3voTza^rfa}LfHIK^WzNysv=F501>xQeJ4 z@l;HQJysm2c(FMzB{G6=Q0Gs-=pmu!c6pu&Avt^tr;x`^o5rDh0%;d?F zZ5O4;`i|dtb_&pGN$bwgO#BMt9zZSYCf^3d6VPD zHHH8O;7S>%jUk*_rT4GXyx|#Iy7249)oxGwTje$AQT*rBd42)V44gKG4G!OGG;KFw zSC%1!y)>Gqa4!KGSeDDXbP~EI_v;=uo|i_i?RuDnY70xqGEN)K<_-#x5aIoYA%lwLf3B;A!V8#Zh}4?Xk{$;uVuJJ)6EI4 z-ez!7(NAX0;ED|Q!hmy%$0g)3K^8>ewB1So>@vc%b)|<48G<&w#c#2R3{LR~zEj`2 zjf~C*dWfvMmS`l{E=9+?E4*mYB5m@GH?QXL2R-x>hh;S0>KW|&!ly863knJXxWrvm zOCDpl@GV=msDp>)FTHKfLemC6LI>oB@P)TPOEkP-md=Sn7tE#xqR<7i-GnFv{splS zh*n5f3UARu{m$k4c@ojegB$m2ix!JPkKa7UQpyU04R(>VGnsvYfj;ecOC!Qt8)Yeo zw>3tX+Zr{ztx@alZH-nXyv8f)aMk?`^-<+;NDW6rD5{3=PR@`dNWt#dSp_?!6iw+6 z6d{acF)W7Uuow-6(FoL9I?f_*Xbh>{?jbsXn*smw<0ORQh zJHs?dJr@uIO&KWrY)Q#Dhf}sZifp(q#(93t-!dgFeIUL(u|J#5#RJ91)z2zI+sXMe ze`vcw#z~2IGEVv0+AKke4%HOR{vf0i2`+FPK@!56A|EN6QP}8KRY%5w9>9uM-W)8c z@?f_NdhyLApor09^QM3An3H1yw#I>xL2EEjpeo+hsLW#Z#^@3dB^2$`5jnuxNKf#X z#)0cQqHXF(MTs)gN#$5a)h9IMFTHzH}TtR61;)~t&T#FU&+($gw!NBx2TYk}lvnFsImy`1*@ni&hfL#Rm(u>j_9TG1CFFn~$j+HNY zlG6KR;Ok^;hiulT_@gkMtT=X#WiA@ac{tVSIoHJFi3m3g zXk6=)1NUQsgW<~X5%KSv?ZoE)cY3gaPr;nxH$5};__1zza^TblyvF=;sZP(Uo=G*1 zh;L>Lw|sq!_)C1!tJ%eBd!(ZsiGBJSx}`cjLr|XrNi|MIMTLG7$6x>ak|%K=#NRJ1 zDk?JaraC=CP@e)xH4ex~7p@;Nr#d}9bR;yAY8<}@jd0Yg?!BF8_8jAz*F+CnAI|eN zwrObn%P*p9CSI*CK|ltO@8wt4pn;=ovvU(q?nCJI=`)Q%G8fTfLQ;+6_n@)4xf$gb zj6~C>&v2|R-Q#+1dkq2_#DRQZ7`q#y2`LSgI# zV;(n7KYl(O8=kWi0msqb+`G)vRrYS=Ah=y>oURyzp244?Jkw6pbLabY0^J=~K6aNH z$NJ>>IS7R>I>Wa_5^=mI2kt%Ca&Q$oe$Mz{Z6a(O=j~GCkSE9QK_lI+IM$qjcu_q$ zeh(Vc($Y}<{sZWp?OXMtJ=vlmH#aMMdEy8fgg>W39LT3eyf1Y_UZ9aIm((Z6??L18 z<;xLlnIazp8RxQ8N;dojfq{u5@*O^Wn1EdQPyOdNd>_Zr0wmQqz$iC27s;|WHbaLF zrDfH_$B!RJM~=k37B?mz03wkH%FD|$rTIOmH4#rR;;qyiGA%1BL+|g~gr?l(ZJWZD z$HM5UQ8%LU@^YP{-}D@+(QRl+H4fC&V1|Y=vc0|6AurG%&To2zZmRmpYt2$s;~pee zuW?e?SRx!$O=0;iTG7BRBL3cw{u%U(wiHrSaj=Ulqz4=EcUJiy?n^-U?CfmR_@0P% ztn+67#(EKDkNNuZ0)Ep=K((Z21-r<{{` zZ#t5yXNrM6`}VA4{M2dkNb9m2Tz3FyKi_U6AMrJ-8Zo;%@F<8s35*ID$;vv zRJY$6Wi|~v2KTKs [ - 'page' => 'operation/heatmap', - 'method' => 'showHeatmap', - 'randomId' => $this->randomId, - 'type' => $this->type, - 'filter' => $this->filter, - 'refresh' => $this->refresh, - 'search' => $this->search, - 'group' => $this->group, + 'page' => 'operation/heatmap', + 'method' => 'showHeatmap', + 'randomId' => $this->randomId, + 'type' => $this->type, + 'filter' => $this->filter, + 'refresh' => $this->refresh, + 'search' => $this->search, + 'group' => $this->group, + 'dashboard' => (int) $this->dashboard, ], ]; - echo '
'; + $style_dashboard = ''; + if ($this->dashboard === true) { + $style_dashboard = 'min-height: 0px'; + } + + echo '
'; ?> 1 && $this->group === 1) { + if (count($groups) > 1 && $this->group === 1 && $this->dashboard === false) { $x_back = 0; $y_back = 0; @@ -1111,7 +1185,7 @@ class Heatmap echo ''; // Dialog. - echo ''; + echo '
'; } diff --git a/pandora_console/include/javascript/pandora_dashboards.js b/pandora_console/include/javascript/pandora_dashboards.js index 7ffafd974f..3347ff0323 100644 --- a/pandora_console/include/javascript/pandora_dashboards.js +++ b/pandora_console/include/javascript/pandora_dashboards.js @@ -1560,3 +1560,36 @@ function showManualThresholds(element) { $(".dashboard-input-threshold-critical").addClass("invisible_important"); } } + +/** + * @return {void} + */ +// eslint-disable-next-line no-unused-vars +function type_change() { + var type = document.getElementById("type").value; + + switch (type) { + case "3": + $("#li_tags").hide(); + $("#li_groups").hide(); + $("#li_module_groups").hide(); + break; + case "2": + $("#li_tags").hide(); + $("#li_groups").hide(); + $("#li_module_groups").show(); + break; + case "1": + $("#li_tags").show(); + $("#li_groups").hide(); + $("#li_module_groups").hide(); + break; + + default: + case "0": + $("#li_tags").hide(); + $("#li_groups").show(); + $("#li_module_groups").hide(); + break; + } +} diff --git a/pandora_console/include/lib/Dashboard/Widgets/heatmap.php b/pandora_console/include/lib/Dashboard/Widgets/heatmap.php index c10c7c1f27..2f9d9533cd 100644 --- a/pandora_console/include/lib/Dashboard/Widgets/heatmap.php +++ b/pandora_console/include/lib/Dashboard/Widgets/heatmap.php @@ -192,6 +192,26 @@ class HeatmapWidget extends Widget // Retrieve global - common inputs. $values = parent::decoders($decoder); + if (isset($decoder['search']) === true) { + $values['search'] = $decoder['search']; + } + + if (isset($decoder['type']) === true) { + $values['type'] = $decoder['type']; + } + + if (isset($decoder['groups']) === true) { + $values['groups'] = $decoder['groups']; + } + + if (isset($decoder['tags']) === true) { + $values['tags'] = $decoder['tags']; + } + + if (isset($decoder['module_groups']) === true) { + $values['module_groups'] = $decoder['module_groups']; + } + return $values; } @@ -205,9 +225,117 @@ class HeatmapWidget extends Widget */ public function getFormInputs(): array { + global $config; // Retrieve global - common inputs. $inputs = parent::getFormInputs(); + $values = $this->values; + + // Search. + $inputs[] = [ + 'label' => \__('Search'), + 'arguments' => [ + 'name' => 'search', + 'type' => 'text', + 'class' => 'event-widget-input', + 'value' => $values['search'], + 'return' => true, + 'size' => 30, + ], + ]; + + $inputs[] = [ + 'label' => __('Type'), + 'arguments' => [ + 'type' => 'select', + 'fields' => [ + 0 => __('Group agents'), + 1 => __('Group modules by tag'), + 2 => __('Group modules by module group'), + 3 => __('Group modules by agents'), + ], + 'name' => 'type', + 'selected' => $values['type'], + 'script' => 'type_change()', + 'return' => true, + ], + ]; + + // Filters. + $inputs[] = [ + 'label' => __('Groups'), + 'style' => ($values['type'] === '0') ? '' : 'display:none', + 'id' => 'li_groups', + 'arguments' => [ + 'type' => 'select_groups', + 'name' => 'groups[]', + 'returnAllGroup' => true, + 'privilege' => 'AR', + 'selected' => explode(',', $values['groups'][0]), + 'return' => true, + 'multiple' => true, + ], + ]; + + if (tags_has_user_acl_tags($config['id_user']) === false) { + $tags = db_get_all_rows_sql( + 'SELECT id_tag, name FROM ttag WHERE id_tag ORDER BY name' + ); + } else { + $user_tags = tags_get_user_tags($config['id_user'], 'AR'); + if (empty($user_tags) === false) { + $id_user_tags = array_keys($user_tags); + $tags = db_get_all_rows_sql( + 'SELECT id_tag, name FROM ttag + WHERE id_tag IN ('.implode(',', $id_user_tags).') + ORDER BY name' + ); + } else { + $tags = db_get_all_rows_sql( + 'SELECT id_tag, name FROM ttag WHERE id_tag ORDER BY name' + ); + } + } + + $inputs[] = [ + 'label' => __('Tag'), + 'style' => ($values['type'] === '1') ? '' : 'display:none', + 'id' => 'li_tags', + 'arguments' => [ + 'type' => 'select', + 'fields' => $tags, + 'name' => 'tags[]', + 'selected' => explode(',', $values['tags'][0]), + 'return' => true, + 'multiple' => true, + ], + ]; + + $module_groups_aux = db_get_all_rows_sql( + 'SELECT id_mg, name FROM tmodule_group ORDER BY name' + ); + + $module_groups = []; + foreach ($module_groups_aux as $key => $module_group) { + $module_groups[$module_group['id_mg']] = $module_group['name']; + } + + $inputs[] = [ + 'label' => __('Module group'), + 'style' => ($values['type'] === '2') ? '' : 'display:none', + 'id' => 'li_module_groups', + 'arguments' => [ + 'type' => 'select', + 'fields' => $module_groups, + 'name' => 'module_groups[]', + 'selected' => explode(',', $values['module_groups'][0]), + 'return' => true, + 'multiple' => true, + 'nothing' => __('Not assigned'), + 'nothing_value' => 0, + ], + ]; + return $inputs; } @@ -222,6 +350,27 @@ class HeatmapWidget extends Widget // Retrieve global - common inputs. $values = parent::getPost(); + $values['search'] = \get_parameter('search', ''); + $values['type'] = \get_parameter('type', 0); + + switch ((int) $values['type']) { + case 2: + $values['module_groups'] = \get_parameter('module_groups', 0); + break; + + case 1: + $values['tags'] = \get_parameter('tags', 0); + break; + + case 0: + $values['groups'] = \get_parameter('groups', 0); + break; + + default: + // Do nothing. + break; + } + return $values; } @@ -256,8 +405,8 @@ class HeatmapWidget extends Widget public function getSizeModalConfiguration(): array { $size = [ - 'width' => 400, - 'height' => 205, + 'width' => 500, + 'height' => 300, ]; return $size; @@ -276,10 +425,23 @@ class HeatmapWidget extends Widget \ui_require_css_file('heatmap', 'include/styles/', true); $values = $this->values; - hd($values, true); + $search = (empty($values['search']) === false) ? $values['search'] : ''; + $type = (empty($values['type']) === false) ? $values['type'] : 0; + $filter = []; + if (isset($values['groups'])) { + $filter = explode(',', $values['groups'][0]); + } + + if (isset($values['tags'])) { + $filter = explode(',', $values['tags'][0]); + } + + if (isset($values['module_groups'])) { + $filter = explode(',', $values['module_groups'][0]); + } // Control call flow. - $heatmap = new Heatmap(0, [], null, 300, 400, 200, 0, 1); + $heatmap = new Heatmap($type, $filter, null, 300, 400, 200, $search, 0, true); // AJAX controller. if (is_ajax() === true) { $method = get_parameter('method'); diff --git a/pandora_console/operation/heatmap.php b/pandora_console/operation/heatmap.php index a53eebd698..1e063d3c3d 100644 --- a/pandora_console/operation/heatmap.php +++ b/pandora_console/operation/heatmap.php @@ -62,6 +62,8 @@ if ($group_sent === true) { $group = (int) get_parameter('group', true); } +$dashboard = (bool) get_parameter('dashboard', false); + $is_ajax = is_ajax(); if ($is_ajax === false && $pure === false) { $viewtab['config'] = '
'.html_print_image( @@ -192,6 +194,7 @@ if ($is_ajax === false && $pure === true) { html_print_input_hidden('type', $type); html_print_input_hidden('search', $search); html_print_input_hidden('filter', implode(',', $filter)); + html_print_input_hidden('dashboard', $dashboard); echo ''; echo '
'; echo '
'; @@ -230,7 +233,7 @@ if ($is_ajax === false && $pure === true) { // Control call flow. try { // Heatmap construct. - $heatmap = new Heatmap($type, $filter, $randomId, $refresh, $width, $height, $search, $group); + $heatmap = new Heatmap($type, $filter, $randomId, $refresh, $width, $height, $search, $group, $dashboard); } catch (Exception $e) { if (is_ajax() === true) { echo json_encode(['error' => '[Heatmap]'.$e->getMessage() ]); From a7a283fe2275326b54848974d7c9f6aba9512cb0 Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Tue, 14 Mar 2023 12:52:44 +0100 Subject: [PATCH 030/169] #8642 Fixed heatmap widget --- pandora_console/include/class/Heatmap.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/include/class/Heatmap.class.php b/pandora_console/include/class/Heatmap.class.php index f7375c2a5e..c440fcfecc 100644 --- a/pandora_console/include/class/Heatmap.class.php +++ b/pandora_console/include/class/Heatmap.class.php @@ -381,7 +381,7 @@ class Heatmap } $id_grupo = ''; - if (empty($this->filter) === false && current($this->filter) != 0) { + if (empty($this->filter) === false && empty(current($this->filter)) === false) { $id_grupo = ' AND id_grupo IN ('.implode(',', $this->filter).')'; } From 4220ac6e4f63f8ecdae6c7e87088082b71dab633 Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Tue, 14 Mar 2023 16:27:22 +0100 Subject: [PATCH 031/169] #10010 Added full text --- .../reporting/reporting_builder.item_editor.php | 10 ++++++++++ .../godmode/reporting/reporting_builder.php | 4 ++++ 2 files changed, 14 insertions(+) diff --git a/pandora_console/godmode/reporting/reporting_builder.item_editor.php b/pandora_console/godmode/reporting/reporting_builder.item_editor.php index c28bfca6ee..d0c0ee9c88 100755 --- a/pandora_console/godmode/reporting/reporting_builder.item_editor.php +++ b/pandora_console/godmode/reporting/reporting_builder.item_editor.php @@ -115,6 +115,7 @@ $exception_condition_value = 10; $modulegroup = 0; $period = SECONDS_1DAY; $search = ''; +$full_text = 0; $log_number = 1000; // Added support for projection graphs. $period_pg = SECONDS_5DAY; @@ -316,6 +317,7 @@ switch ($action) { $source = $es['source']; $search = $es['search']; $log_number = empty($es['log_number']) ? $log_number : $es['log_number']; + $full_text = empty($es['full_text']) ? 0 : $es['full_text']; break; case 'simple_graph': @@ -1324,6 +1326,14 @@ $class = 'databox filters'; diff --git a/pandora_console/godmode/reporting/reporting_builder.php b/pandora_console/godmode/reporting/reporting_builder.php index a0e25d0e04..27b294a3f5 100755 --- a/pandora_console/godmode/reporting/reporting_builder.php +++ b/pandora_console/godmode/reporting/reporting_builder.php @@ -1656,11 +1656,13 @@ switch ($action) { $agents_to_report = get_parameter('id_agents3'); $source = get_parameter('source', ''); $search = get_parameter('search', ''); + $full_text = (integer) get_parameter('full_text', 0); $log_number = get_parameter('log_number', ''); $es['source'] = $source; $es['id_agents'] = $agents_to_report; $es['search'] = $search; + $es['full_text'] = $full_text; $es['log_number'] = $log_number; $values['external_source'] = json_encode($es); @@ -2601,11 +2603,13 @@ switch ($action) { $agents_to_report = get_parameter('id_agents3'); $source = get_parameter('source', ''); $search = get_parameter('search', ''); + $full_text = (integer) get_parameter('full_text', 0); $log_number = get_parameter('log_number', ''); $es['source'] = $source; $es['id_agents'] = $agents_to_report; $es['search'] = $search; + $es['full_text'] = $full_text; $es['log_number'] = $log_number; $values['external_source'] = json_encode($es); From feff8668be741eee62a94b031f90f0defaf3a538 Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Tue, 14 Mar 2023 16:49:12 +0100 Subject: [PATCH 032/169] #8642 added img --- pandora_console/images/widgets/heatmap.png | Bin 5155 -> 5436 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/pandora_console/images/widgets/heatmap.png b/pandora_console/images/widgets/heatmap.png index 413134613b5d68f89c89eeb2f661478f6e438298..f16f8eb9927d60fc3da4ae07f9584d4212cf0047 100644 GIT binary patch literal 5436 zcmaJ_by$;o`==QQ1L>4eiUQjJiP12+J4GC9l4Em>E*Yf=f*_&7knUELk`w_!lyD$Y zf^fkTmLATcf|kUkpWhO$5*kU_WlP|9Rvl)@fXc6d8uBSlvX z8jScY0}e!E&(LIK%4&gFgsT?{4{|}ddHARZZ8f(Efjp2ZLbkHTP-83{^a{t&@?sR;eoC_7^_ z5FCR;f#kqYNmnRT8YB+`OUYfmDhHJSNkgTf5U4CfN?KA%P7!)lQA!^4=Oc8c4Trp` zXrZO^r>?V;ijX@Vk5z;~0s;cS0Wx3=&J7|3gTWwBX^6D6q(o$e)keIE94-ymLd-)H5v9Y4Qk1rnKbZ_E7o+rpgp_+YE;dbe zZr(tG6NRYN&xNtD{__%d>E{3)brOP_3Rn8-2+0-L+og+sMcqO;N+R?CeSMcBo(_1J5E@myIl{Uz+(=BqrIE#3k+@k$x^;}k-9Wut@w#x+{c8z#FXq`USDjFY8_~GZ8tWX)mJwT(FJLkKZbD(o zM5>HosJY)@NniZ>XMRQn zU&_B!%x#>532c4lzDT;OVjn9{-!&x;Yiw-nwvM(`vbeBr!+ds?JvUR+ z@*uaGkXa?2!YJAJesjaQh^QF8e7yr1+AohUR zwv+uIjKGd2zc>lM0wH4z==3fQ6_xqMBz7Dvx3bTFbt)hx{XsR?Hx`j>CSKnvdJ&rRZl^b1>ba)0pp-_Uv zr6_$FggM(I``d+v873CBFTHm5f-Lu$3%1FypV7YQ<=aMv7Sa`Ope}NlX`>>eM-&=5 z2^ZJZ>VLh1-mrrj;Y;PyXnW$GWMQY7Ni4iwRue5jyLvbr?mcfnEO{3J(OL7M@Ke=J zB&S(?Z9(@cnnC7tpr@qFXtKJZB6@#~)b(N}ynG`gJ-zI}n}2=07Cs5Na)t2Ri`2O} z)vP3;!Ei2?u1hE5zSZ%K7Oei0Lp!Pj{F|!-;;uact`#Ti(ht+pBBy*vdf3Km19pUw zmFUh+&5gs96c%Qxj@B7(wo17~i?T4!$jPy-^?H^2hjiE2&&Bo~cYYCZDl`5XwcV+o zGMqPuTm--A>G`s{D$WfkAES?=VI=hS>Xnq2yI$ZeC@zi)W~gyZNlCHezmt>{=jErE z2Q{L9M|`pT#+q)aWP}@7nMpzh7!MIuc)9yWN39OC`wl`5H>dKH>a~w6I1U~*EPEIi z`CDDbI+~g{eRMyV_!iQo7P3)47l4^P@@;9`@K`%}pv11x{ciSmK2AN@luX(KqDodwT6OYvmn~gat#2|57Z9`F?c!o?3 zYLq`GCn!A)_>`Ex1dOBH@!z~XY?z@u6C|PZxmo@*Y_EzpFHlxJTBSLlV}d}D#7$S! z?H#MhC4Z2#K`?JlPK{Uq3=m~0g@Q+KcNj8Ame)GH^Q5S+bB=yfq`C=)Kp;^ormEy~ zFD3+Yn_n9~G@je7zLFc!kF`5Fz{zVQWG*cY#E!iF{?toAIE1A=pBB54KsFN*#=uei zgDL@m;Lpi=F%!(%JDIx0JP&n&&Eu6VI}0IW2tt2d5He&nvg02f-Czx=PT!j^~6t*l}7P*fr~N z1#*KUDkJqvmhgMTuHD#nIR{z0a7Ib-Q3&sd1p*x6bz>N;QfyhQP-A-nOm8I&uC6Rh zo33X8IM0QKZ?c24pO^Xs=7r>BmzRwn2Eb}u^Leke!Qa4A1wt4;E>_(hHR2wSy6*jm z^(ht-8(!K4sx-}^*)Q&l7>WSa@F@FluyN}3mzTrN_5DO4;CSnjDnp}v zL==2m_C5MG9Uw`WrdIS4)zKk`lEif>S%u!9FQvtTA3bBL<r7HZJ%Lyv6gxXT}B;JJMsDJr|*kgFGiI)1Q!-|=nAOOJ}}>haMt>-Qf*b*Gr`1d z)vr%;Cl?fjoEPL1@i&eoO%v&+f(xiK;>GVn26La1EW}qJ6yGf6U^@X%|We)hc+tqzL_;29S~>2rv|Kdy9p%aNQA})=(PY0G5VhFTmRa*S&EeS+wJfc(O=j9imp;Ix&?sWGB*8uqm)54)ojQY5lMP?AO ztjBRvD2XnNq7@0RoG;#3uy5Y>D3(-3?pB2P6SZ*`z=D#{0wamiflyj6T z1JxbN)TIyd67)dfH0@W`ek7aOD31Duj;xTsGw>?qE6X<_n+$k+v(VMWq^ zFDAOWBsV=)7M7pyt~k!Gwsw_d+F`AZO*oX~q!s066`mVrby4&~(nIN47YlBS_8T&< zTHV-6cd2yEmD)6h)^NNn4L{&VU*`D~enu>{G>q|N03eVo zU}@M1EiH^;`Eru!h+HdfEA#ua#J*!5S>U#Bled9`b7tH65dVyzyXob!{hUlk?N5^8 zgQF9#at<`LwPW763Z1n=VY8q^qoLT&l#I!U@pCbp@yhQm%?4fwE-27Ad^l}<8h$c< zUQ9W_A;d#_L?ugoX)@*M&}~8T{ew?wSp*rkXN~18cV(?wux24`FOgQ>Z`ptV6!X4z%sJ^tYq)jHcxH;#8iq25P;L29>@)LqVYI_hNE zYQuU=k3WoU{Al&!%e8i{WwpQ(n*-Nrwb{{$Uoo7juPmQ1t{St&bk1-rbTt^~bWkQ4 zof9+JaPhUXX?&|b!w>^Yrx5TWE!xW5D&tvh@1V4;8&-AaiK2t!V!7}0t1g3;{Ex`? zc-cu3QnpsSgh*GGXNnqg%uxQMpImlGriHh41&wbx*Th~@ku%(!L6ZqDpHy5GSPY?5 z5C)!KLe zI}ERo1%jRTrqpenSp?;(RFf0$B-p$SjVS;2)q=b;KQF3FFwp&r)=>~^WRr9O^<$!3 zE=NaS1hZZO|9i3Rz!}V?P9kHP8Ge9{V7&bj=805js^_3*0&)497B!!?wgmxzp|;d< z{tpSQI#jxq3%8WEEk)O_1zgySz~W|QsJtH~t5+XvuUAa8-%|FTth0V{ZTz8IPadd# zf+CEDA=U%ZN>-v_6TDm^Ri@Mmcr{(a(Qja=d_B&X3c2!x^y?~Tp6gl;%N^5o3J4@r z;A3?V(<}Q&TeqrYQ@g?X(A~Cl4TGHUNbAHa5I#qwt_|p^P86!pOEq2~ z6E}(ZJA`urTt1dRWv2wQdAzN&6oWb=Tpo(c=`250Syn3NGNeJ~@jr{*35ugZS)cJ71S;b*tx8vN^sthHll z7Q-}yGcOLE-M76W3f5KJr@J@v9ERo;pS~HGzMQ@LG4yf7w@aVPF+JtMHbfWY7Q7$A z_7M79KVEXQ`R3%yIHH1`wS5zIZLxZB<0nb&n2zc6!eL{pK=*4|VrIwsJy5y74h6GP za%E|m*ckD6VtX*d0(C69(y-Y&?UK0+ z{6frILlUSjF^P_sL1U zdPA$r_O*RibLslM;&^ZFzwh^@Ms=*5a&AOjwUDjyBs9b=51S2t-(ZB4NE;w#*%O#OKNfwLopGOP+L8di zOCC)rOo{sVt^7foK91d_ndj$sWa{2Ev41qA>;G&>!%1V6^48Wb&e~b=uX-&)21U$_ zB<@h6FGwGpy}i6l?`&mPo-)$wVb>;^!ez9rS75GzS!cJB6xLnIDxLRo_`K#&k0`g@ zT4J}{pX)j(wg!ufHZ%4)hC(z3HZct#1L<;Y=Y{kRz|yLq0Fju5vlz5vf`_`>WT z-S~{$qsJ`C6LSNqU%dxhRW4^)vfZmFX)R04aPo0_$oAj{G8KB0XfsuzpN|gS=rz_g zNxg#o6@G!fy#h-xKQAK8{8~@cQ{)a8g$m`q!xinKx^sPcWWaOdy>xcc^vMhd>j??| z+%H-$=ak=QFpMviwTSax=whUq)`pRv%`||#fppDO24berYG#SZR5JspE+8F6SF4pL z@|Iq+u9G}nn;kFGAK!5YnbCV0U>Kj5?)%T7hQo->v-BTrWRzrbp|jOmRO2bX=b8H2 LCR$aRHwga$X}--D literal 5155 zcmV+;6x{2HP)X+)SF1}+Tghds}nGgVX=bXFI z*>(*qU2NT=z<^!w7>GD zYP}$28d!AeDD>U3bX31?5*j{jhn}?frd>3O9u`9x!F>ceBI{c8_Af6*OO`CreF(Fh zVO&-s4`x)ORaINYs*z|q4-w$^-BG+#5CqN0L?gdgRb8N{Ql_dYU)^_m@gX`5!g{8P zm#W7on%38vXpKW<)icpW4gk86(wRtw)oVG)gypTHk*Er5fJucl*$FBuxChGSqTiOU zMi2k=9;34MPZJO}uAXkHdjKJollU}D&w>A$I00pF^@l#!E9?68uj||ZwtDqy@N{S5 z^rPwX(Yz-s(D1y=^~(C(bI+lLOJ^8Wiexe>thFEr0_`&^?2~Uy&~e@>Z!;<`EfyhQ z(uq{i5yNtEh5Z8kPvsJVXYz$VR#&IB9o5E}pf(ZX6$UuO$Ts-Ms75TLm6d-Vs7Zlg ztTZPuLY&4mo(w0_(HWhFr9kF^(vpd1bw)H3yLVFgnztR%7eq~eXVJ(q&4f;1h0A76 zWr10+I#ST91D_K5x@o5z?Z-gSzXu%7xK%NZ3?Y2@w3+nrgJQ zw#EQG^2j4->C&aRAsH1HW*|@ju11AL#kir_r~h87-HWzw-;P+YZ+uHavtH<9`~Z*T zxEcZS@n#LRN6p#j*ONKLKE`GA`Bz&|)y}J^+>;Q%HhgG?)x2&rYn`|^QCX;Dy(K|tG2RT%|80LrZfqEzCTc@jKZMg-}Fs_G0;K{=`*rpri3SJaMZP?lO1Nopzm@swi(&(3Eu za`RfU5*L(6!+o>9e=-J60}^3C(}6HlfYLjPKP7Noql&7!{z{~&fB^mUO_hPx1eyse zqmFRf*kCAq4-IF*Af5EHXk1_x(@gOC$NBmBg$tJap3aY!J$6?N?AgV4)jj;=i!tqy z(WfC4?D{sW4j;)!`yYPzA-eN{XAEW{iZ*fIb#z7&X7!0k8tq#Jf>9E;nSjQP{GgEo zN8+U6yF6%djM43KUBfxfA8D4#VK9e{N0QDIx^BV$G)^_a^ zQ|4M=M}?6#di3bF2OnEyOn^bdrxT=GSVq2tK^6xZRLE8O)+t!*_~g|Cvgis~U#hf_b`wxE9tq=t0J07QNE+?q!GU8u z)_{Sg1z|E46Mw({AN`!nMOz8*;s*~NL@)sc0^2#Fv=cl{73!W{e79*9+e#aB0A1v0 zSjn>{`Vj}koVc=?&hhX-$XF|4(FR>)C87jbi9Fa7PdtGd8X9=X`l?W7W+w6*kIRrs z0A0Af9}3SDgq0~+f3P~z4_~mLR9_|V8_&v*7k8}?Ayk707|mikJev0W2(md-t7xqN~Rh&`G9nWo4xvKm3t`{&atfDUFW&{E^9YG;Y|nLO@YfJ7*wS z)N^ujbZ~on8!Op>oj!e94?FEq7#ZUPTq^`CYp@Z6=Qgg}h;F|5X5C*)=CB#CLq}KbV7kxq#F)6e1<(jKBRq2*)3@wz?upmn6eYY3APw)+8 zez&&z$|!z?l7yb(dI8G&+Iddk0pPz2r_zAXi89k;=aZ)I*EYsA~WI8fsWiV{m zF!bo7k0QVEtbBNJSIWS7FnZe^P4q~Uh8|yVj}G!1kLF_+_NAJgZq-nPKeKD__Z!b3 zd_LgHG9>fyQ)kep`wr_-e4Y?1BA_u>j3voTza^rfa}LfHIK^WzNysv=F501>xQeJ4 z@l;HQJysm2c(FMzB{G6=Q0Gs-=pmu!c6pu&Avt^tr;x`^o5rDh0%;d?F zZ5O4;`i|dtb_&pGN$bwgO#BMt9zZSYCf^3d6VPD zHHH8O;7S>%jUk*_rT4GXyx|#Iy7249)oxGwTje$AQT*rBd42)V44gKG4G!OGG;KFw zSC%1!y)>Gqa4!KGSeDDXbP~EI_v;=uo|i_i?RuDnY70xqGEN)K<_-#x5aIoYA%lwLf3B;A!V8#Zh}4?Xk{$;uVuJJ)6EI4 z-ez!7(NAX0;ED|Q!hmy%$0g)3K^8>ewB1So>@vc%b)|<48G<&w#c#2R3{LR~zEj`2 zjf~C*dWfvMmS`l{E=9+?E4*mYB5m@GH?QXL2R-x>hh;S0>KW|&!ly863knJXxWrvm zOCDpl@GV=msDp>)FTHKfLemC6LI>oB@P)TPOEkP-md=Sn7tE#xqR<7i-GnFv{splS zh*n5f3UARu{m$k4c@ojegB$m2ix!JPkKa7UQpyU04R(>VGnsvYfj;ecOC!Qt8)Yeo zw>3tX+Zr{ztx@alZH-nXyv8f)aMk?`^-<+;NDW6rD5{3=PR@`dNWt#dSp_?!6iw+6 z6d{acF)W7Uuow-6(FoL9I?f_*Xbh>{?jbsXn*smw<0ORQh zJHs?dJr@uIO&KWrY)Q#Dhf}sZifp(q#(93t-!dgFeIUL(u|J#5#RJ91)z2zI+sXMe ze`vcw#z~2IGEVv0+AKke4%HOR{vf0i2`+FPK@!56A|EN6QP}8KRY%5w9>9uM-W)8c z@?f_NdhyLApor09^QM3An3H1yw#I>xL2EEjpeo+hsLW#Z#^@3dB^2$`5jnuxNKf#X z#)0cQqHXF(MTs)gN#$5a)h9IMFTHzH}TtR61;)~t&T#FU&+($gw!NBx2TYk}lvnFsImy`1*@ni&hfL#Rm(u>j_9TG1CFFn~$j+HNY zlG6KR;Ok^;hiulT_@gkMtT=X#WiA@ac{tVSIoHJFi3m3g zXk6=)1NUQsgW<~X5%KSv?ZoE)cY3gaPr;nxH$5};__1zza^TblyvF=;sZP(Uo=G*1 zh;L>Lw|sq!_)C1!tJ%eBd!(ZsiGBJSx}`cjLr|XrNi|MIMTLG7$6x>ak|%K=#NRJ1 zDk?JaraC=CP@e)xH4ex~7p@;Nr#d}9bR;yAY8<}@jd0Yg?!BF8_8jAz*F+CnAI|eN zwrObn%P*p9CSI*CK|ltO@8wt4pn;=ovvU(q?nCJI=`)Q%G8fTfLQ;+6_n@)4xf$gb zj6~C>&v2|R-Q#+1dkq2_#DRQZ7`q#y2`LSgI# zV;(n7KYl(O8=kWi0msqb+`G)vRrYS=Ah=y>oURyzp244?Jkw6pbLabY0^J=~K6aNH z$NJ>>IS7R>I>Wa_5^=mI2kt%Ca&Q$oe$Mz{Z6a(O=j~GCkSE9QK_lI+IM$qjcu_q$ zeh(Vc($Y}<{sZWp?OXMtJ=vlmH#aMMdEy8fgg>W39LT3eyf1Y_UZ9aIm((Z6??L18 z<;xLlnIazp8RxQ8N;dojfq{u5@*O^Wn1EdQPyOdNd>_Zr0wmQqz$iC27s;|WHbaLF zrDfH_$B!RJM~=k37B?mz03wkH%FD|$rTIOmH4#rR;;qyiGA%1BL+|g~gr?l(ZJWZD z$HM5UQ8%LU@^YP{-}D@+(QRl+H4fC&V1|Y=vc0|6AurG%&To2zZmRmpYt2$s;~pee zuW?e?SRx!$O=0;iTG7BRBL3cw{u%U(wiHrSaj=Ulqz4=EcUJiy?n^-U?CfmR_@0P% ztn+67#(EKDkNNuZ0)Ep=K((Z21-r<{{` zZ#t5yXNrM6`}VA4{M2dkNb9m2Tz3FyKi_U6AMrJ-8Zo;%@F<8s35*ID$;vv zRJY$6Wi|~v2KTKs Date: Tue, 14 Mar 2023 17:13:19 +0100 Subject: [PATCH 033/169] #10650 fixed bug when user access in view maintenance and show modules select --- .../models/VisualConsole/Items/DonutGraph.php | 5 ++--- .../operation/visual_console/public_view.php | 13 +++++++++++-- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/pandora_console/include/rest-api/models/VisualConsole/Items/DonutGraph.php b/pandora_console/include/rest-api/models/VisualConsole/Items/DonutGraph.php index 398a44b999..83a09866e0 100644 --- a/pandora_console/include/rest-api/models/VisualConsole/Items/DonutGraph.php +++ b/pandora_console/include/rest-api/models/VisualConsole/Items/DonutGraph.php @@ -226,7 +226,7 @@ final class DonutGraph extends Item 'module_input' => true, 'module_name' => 'moduleId', 'module_none' => false, - 'get_only_string_modules' => true, + 'get_only_string_modules' => false, ], ]; @@ -235,14 +235,13 @@ final class DonutGraph extends Item 'label' => __('Module'), 'arguments' => [ 'type' => 'autocomplete_module', - 'fields' => $fields, 'name' => 'moduleId', 'selected' => $values['moduleId'], 'return' => true, 'sort' => false, 'agent_id' => $values['agentId'], 'metaconsole_id' => $values['metaconsoleId'], - 'get_only_string_modules' => true, + 'get_only_string_modules' => false, ], ]; diff --git a/pandora_console/operation/visual_console/public_view.php b/pandora_console/operation/visual_console/public_view.php index 496a34f3a6..062c9419e2 100644 --- a/pandora_console/operation/visual_console/public_view.php +++ b/pandora_console/operation/visual_console/public_view.php @@ -62,7 +62,13 @@ require_once 'include/functions_visual_map.php'; $hash = (string) get_parameter('hash'); $visualConsoleId = (int) get_parameter('id_layout'); -$config['id_user'] = (string) get_parameter('id_user'); +$userAccessMaintenance = null; +if (empty($config['id_user']) === true) { + $config['id_user'] = (string) get_parameter('id_user'); +} else { + $userAccessMaintenance = $config['id_user']; +} + $refr = (int) get_parameter('refr', ($config['refr'] ?? null)); if (!isset($config['pure'])) { @@ -179,6 +185,7 @@ $visualConsoleItems = VisualConsole::getItemsFromDB( \ No newline at end of file From 84fe5695d8545f27e6f667a089e3eb7d402141b9 Mon Sep 17 00:00:00 2001 From: Jose Gonzalez Date: Wed, 15 Mar 2023 16:34:18 +0100 Subject: [PATCH 044/169] Visual styles Setup view --- .../godmode/setup/setup_visuals.php | 3470 +++++++++-------- pandora_console/include/styles/pandora.css | 36 +- pandora_console/include/styles/tables.css | 4 + 3 files changed, 1913 insertions(+), 1597 deletions(-) diff --git a/pandora_console/godmode/setup/setup_visuals.php b/pandora_console/godmode/setup/setup_visuals.php index 5fb042fe66..2b5c553ca1 100755 --- a/pandora_console/godmode/setup/setup_visuals.php +++ b/pandora_console/godmode/setup/setup_visuals.php @@ -1,16 +1,31 @@ width = '100%'; -$table_behaviour->class = 'databox filters'; -$table_behaviour->style[0] = 'font-weight: bold;'; -$table_behaviour->size[0] = '50%'; -$table_behaviour->data = []; - -$table_behaviour->data[$row][0] = __('Block size for pagination'); -$table_behaviour->data[$row][1] = html_print_input( - [ - 'type' => 'number', - 'size' => 5, - 'max' => $performance_variables_control['block_size']->max, - 'name' => 'block_size', - 'value' => $config['global_block_size'], - 'return' => true, - 'min' => $performance_variables_control['block_size']->min, - 'style' => 'width:50px', - ] -); -$row++; - $values = []; $values[5] = human_time_description_raw(5); $values[30] = human_time_description_raw(30); @@ -89,178 +82,87 @@ $values[SECONDS_5MINUTES] = human_time_description_raw(SECONDS_5MINUTES); $values[SECONDS_10MINUTES] = human_time_description_raw(SECONDS_10MINUTES); $values[SECONDS_30MINUTES] = human_time_description_raw(SECONDS_30MINUTES); -$table_behaviour->data[$row][0] = __('Paginated module view'); -$table_behaviour->data[$row][1] = html_print_checkbox_switch( - 'paginate_module', - 1, - $config['paginate_module'], - true +$table_behaviour = new stdClass(); +$table_behaviour->width = '100%'; +$table_behaviour->class = 'filter-table-adv'; +$table_behaviour->size[0] = '50%'; +$table_behaviour->data = []; + +$table_behaviour->data[$row][] = html_print_label_input_block( + __('Block size for pagination'), + html_print_input( + [ + 'type' => 'number', + 'size' => 5, + 'max' => $performance_variables_control['block_size']->max, + 'name' => 'block_size', + 'value' => $config['global_block_size'], + 'return' => true, + 'min' => $performance_variables_control['block_size']->min, + 'style' => 'width:50px', + ] + ) +); + +$table_behaviour->data[$row][] = html_print_label_input_block( + __('Click to display lateral menus'), + html_print_checkbox_switch( + 'click_display', + 1, + $config['click_display'], + true + ) +); + +$row++; + +$table_behaviour->data[$row][] = html_print_label_input_block( + __('Paginated module view'), + html_print_checkbox_switch( + 'paginate_module', + 1, + $config['paginate_module'], + true + ) +); +$table_behaviour->data[$row][] = html_print_label_input_block( + __('Display data of proc modules in other format'), + html_print_checkbox_switch( + 'render_proc', + 1, + $config['render_proc'], + true + ) ); $row++; -$table_behaviour->data[$row][0] = __('Display data of proc modules in other format'); -$table_behaviour->data[$row][1] = html_print_checkbox_switch( - 'render_proc', - 1, - $config['render_proc'], - true +$table_behaviour->data[$row][] = html_print_label_input_block( + __('Display text proc modules have state is ok'), + html_print_input_text('render_proc_ok', $config['render_proc_ok'], '', 25, 25, true) ); -$row++; - -$table_behaviour->data[$row][0] = __('Display text proc modules have state is ok'); -$table_behaviour->data[$row][1] = html_print_input_text('render_proc_ok', $config['render_proc_ok'], '', 25, 25, true); -$row++; - -$table_behaviour->data[$row][0] = __('Display text when proc modules have state critical'); -$table_behaviour->data[$row][1] = html_print_input_text('render_proc_fail', $config['render_proc_fail'], '', 25, 25, true); -$row++; - -$table_behaviour->data[$row][0] = __('Click to display lateral menus'); -$table_behaviour->data[$row][1] = html_print_checkbox_switch( - 'click_display', - 1, - $config['click_display'], - true +$table_behaviour->data[$row][] = html_print_label_input_block( + __('Display text when proc modules have state critical'), + html_print_input_text('render_proc_fail', $config['render_proc_fail'], '', 25, 25, true) ); $row++; if (enterprise_installed() === true) { - $table_behaviour->data[$row][0] = __('Service label font size'); - $table_behaviour->data[$row][1] = html_print_input_text('service_label_font_size', $config['service_label_font_size'], '', 5, 5, true); - $row++; - - $table_behaviour->data[$row][0] = __('Space between items in Service maps'); - $table_behaviour->data[$row][1] = html_print_input_text('service_item_padding_size', $config['service_item_padding_size'], '', 5, 5, true, false, false, 'onChange="change_servicetree_nodes_padding()"'); $row++; + $table_behaviour->data[$row][] = html_print_label_input_block( + __('Service label font size'), + html_print_input_text('service_label_font_size', $config['service_label_font_size'], '', 5, 5, true) + ); + $table_behaviour->data[$row][] = html_print_label_input_block( + __('Space between items in Service maps'), + html_print_input_text('service_item_padding_size', $config['service_item_padding_size'], '', 5, 5, true, false, false, 'onChange="change_servicetree_nodes_padding()"') + ); } + // ---------------------------------------------------------------------- // ---------------------------------------------------------------------- // STYLE CONFIGURATION // ---------------------------------------------------------------------- -$table_styles = new stdClass(); -$table_styles->width = '100%'; -$table_styles->class = 'databox filters'; -$table_styles->style[0] = 'font-weight: bold;'; -$table_styles->style[1] = 'display: flex; align-items: center;'; -$table_styles->size[0] = '50%'; -$table_styles->data = []; - - -$table_styles->data[$row][0] = __('Style template'); -$table_styles->data[$row][1] = html_print_select( - themes_get_css(), - 'style', - $config['style'].'.css', - '', - '', - '', - true -); -$row++; - -$table_styles->data[$row][0] = __('Status icon set'); -$iconsets['default'] = __('Colors'); -$iconsets['faces'] = __('Faces'); -$iconsets['color_text'] = __('Colors and text'); -$table_styles->data[$row][1] = html_print_select( - $iconsets, - 'status_images_set', - $config['status_images_set'], - '', - '', - '', - true -); -$table_styles->data[$row][1] .= html_print_button( - __('View'), - 'status_set_preview', - false, - '', - [ - 'icon' => 'camera', - 'mode' => 'link', - 'class' => 'logo_preview', - ], - true -); -$row++; - -// Divs to show icon status Colours (Default). -$icon_unknown_ball = ui_print_status_image(STATUS_AGENT_UNKNOWN_BALL, '', true); -$icon_unknown = ui_print_status_image(STATUS_AGENT_UNKNOWN, '', true); -$icon_ok_ball = ui_print_status_image(STATUS_AGENT_OK_BALL, '', true); -$icon_ok = ui_print_status_image(STATUS_AGENT_OK, '', true); -$icon_warning_ball = ui_print_status_image(STATUS_AGENT_WARNING_BALL, '', true); -$icon_warning = ui_print_status_image(STATUS_AGENT_WARNING, '', true); -$icon_bad_ball = ui_print_status_image(STATUS_AGENT_CRITICAL_BALL, '', true); -$icon_bad = ui_print_status_image(STATUS_AGENT_CRITICAL, '', true); -// End - Divs to show icon status Colours (Default). -$table_styles->data[$row][0] = __('Login background'); -$backgrounds_list_jpg = list_files('images/backgrounds', 'jpg', 1, 0); -$backgrounds_list_gif = list_files('images/backgrounds', 'gif', 1, 0); -$backgrounds_list_png = list_files('images/backgrounds', 'png', 1, 0); -$backgrounds_list = array_merge($backgrounds_list_jpg, $backgrounds_list_png); -$backgrounds_list = array_merge($backgrounds_list, $backgrounds_list_gif); -asort($backgrounds_list); - -$open = false; -if (enterprise_installed() === false) { - $open = true; -} - -// Custom favicon. -$files = list_files('images/custom_favicon', 'ico', 1, 0); -$table_styles->data[$row][0] = __('Custom favicon'); -$table_styles->data[$row][1] = html_print_select( - $files, - 'custom_favicon', - $config['custom_favicon'], - 'setup_visuals_change_favicon();', - __('Default'), - '', - true, - false, - true, - '', - false, - 'width:240px' -); -$table_styles->data[$row][1] .= '   '.html_print_image( - ui_get_favicon(), - true, - ['id' => 'favicon_preview'] -); -$row++; - -$table_styles->data[$row][0] = __('Custom background logo'); -$table_styles->data[$row][1] = html_print_select( - $backgrounds_list, - 'login_background', - $config['login_background'], - '', - __('Default'), - '', - true, - false, - true, - '', - false, - 'width:240px' -); -$table_styles->data[$row][1] .= html_print_button( - __('View'), - 'login_background_preview', - false, - '', - [ - 'icon' => 'camera', - 'mode' => 'link', - 'class' => 'logo_preview', - ], - true -); -$row++; /** @@ -311,1369 +213,7 @@ function logo_custom_enterprise($name, $logo) } -$table_styles->data[$row][0] = __('Custom logo (menu)'); -$table_styles->data[$row][1] = logo_custom_enterprise('custom_logo', $config['custom_logo']); -$table_styles->data[$row][1] .= ' '.html_print_button( - __('View'), - 'custom_logo_preview', - $open, - '', - [ - 'icon' => 'camera', - 'mode' => 'link', - 'class' => 'logo_preview', - ], - true, - false, - $open, - 'visualmodal' -); -$row++; - -$table_styles->data[$row][0] = __('Custom logo collapsed (menu)'); -$table_styles->data[$row][1] = logo_custom_enterprise('custom_logo_collapsed', $config['custom_logo_collapsed']); -$table_styles->data[$row][1] .= ' '.html_print_button( - __('View'), - 'custom_logo_collapsed_preview', - $open, - '', - [ - 'icon' => 'camera', - 'mode' => 'link', - 'class' => 'logo_preview', - ], - true, - false, - $open, - 'visualmodal' -); -$row++; - -$table_styles->data[$row][0] = __('Custom logo (header white background)'); -if (enterprise_installed() === true) { - $ent_files = list_files('enterprise/images/custom_logo', 'png', 1, 0); - $open_files = list_files('images/custom_logo', 'png', 1, 0); - - $table_styles->data[$row][1] = html_print_select( - array_merge($open_files, $ent_files), - 'custom_logo_white_bg', - $config['custom_logo_white_bg'], - '', - '', - '', - true, - false, - true, - '', - $open, - 'width:240px' - ); -} else { - $table_styles->data[$row][1] = html_print_select( - list_files('images/custom_logo', 'png', 1, 0), - 'custom_logo_white_bg', - $config['custom_logo_white_bg'], - '', - '', - '', - true, - false, - true, - '', - $open, - 'width:240px' - ); -} - -$table_styles->data[$row][1] .= ' '.html_print_button( - __('View'), - 'custom_logo_white_bg_preview', - $open, - '', - [ - 'icon' => 'camera', - 'mode' => 'link', - 'class' => 'logo_preview', - ], - true, - false, - $open, - 'visualmodal' -); -$row++; - -$table_styles->data[$row][0] = __('Custom logo (login)'); - -if (enterprise_installed()) { - $table_styles->data[$row][1] = html_print_select( - list_files('enterprise/images/custom_logo_login', 'png', 1, 0), - 'custom_logo_login', - $config['custom_logo_login'], - '', - '', - '', - true, - false, - true, - '', - $open, - 'width:240px' - ); -} else { - $table_styles->data[$row][1] = html_print_select( - '', - 'custom_logo_login', - $config['custom_logo_login'], - '', - '', - '', - true, - false, - true, - '', - $open, - 'width:240px' - ); -} - -$table_styles->data[$row][1] .= ' '.html_print_button( - __('View'), - 'custom_logo_login_preview', - $open, - '', - [ - 'icon' => 'camera', - 'mode' => 'link', - 'class' => 'logo_preview', - ], - true, - false, - $open, - 'visualmodal' -); -$row++; - -// Splash login. -if (enterprise_installed() === true) { - $table_styles->data[$row][0] = __('Custom Splash (login)'); - - $table_styles->data[$row][1] = html_print_select( - list_files('enterprise/images/custom_splash_login', 'png', 1, 0), - 'custom_splash_login', - $config['custom_splash_login'], - '', - __('Default'), - 'default', - true, - false, - true, - '', - $open, - 'width:240px' - ); - - $table_styles->data[$row][1] .= ' '.html_print_button( - __('View'), - 'custom_splash_login_preview', - $open, - '', - [ - 'icon' => 'camera', - 'mode' => 'link', - 'class' => 'logo_preview', - ], - true, - false, - $open, - 'visualmodal' - ); - $row++; -} - -if (enterprise_installed() === true) { - // Get all the custom logos. - $files = list_files('enterprise/images/custom_general_logos', 'png', 1, 0); - - // Custom docs icon. - $table_styles->data[$row][0] = __('Custom documentation logo'); - - $table_styles->data[$row][1] = html_print_select( - $files, - 'custom_docs_logo', - $config['custom_docs_logo'], - '', - __('None'), - '', - true, - false, - true, - '', - false, - 'width:240px' - ); - $table_styles->data[$row][1] .= ' '.html_print_button( - __('View'), - 'custom_docs_logo_preview', - $open, - '', - [ - 'icon' => 'camera', - 'mode' => 'link', - 'class' => 'logo_preview', - ], - true, - false, - $open, - 'visualmodal' - ); - $row++; - - // Custom support icon. - $table_styles->data[$row][0] = __('Custom support logo'); - $table_styles->data[$row][1] = html_print_select( - $files, - 'custom_support_logo', - $config['custom_support_logo'], - '', - __('None'), - '', - true, - false, - true, - '', - false, - 'width:240px' - ); - $table_styles->data[$row][1] .= ' '.html_print_button( - __('View'), - 'custom_support_logo_preview', - $open, - '', - [ - 'icon' => 'camera', - 'mode' => 'link', - 'class' => 'logo_preview', - ], - true, - false, - $open, - 'visualmodal' - ); - $row++; - - // Custom center networkmap icon. - $table_styles->data[$row][0] = __('Custom networkmap center logo'); - $table_styles->data[$row][1] = html_print_select( - $files, - 'custom_network_center_logo', - $config['custom_network_center_logo'], - '', - __('Default'), - '', - true, - false, - true, - '', - false, - 'width:240px' - ); - $table_styles->data[$row][1] .= ' '.html_print_button( - __('View'), - 'custom_network_center_logo_preview', - $open, - '', - [ - 'icon' => 'camera', - 'mode' => 'link', - 'class' => 'logo_preview', - ], - true, - false, - $open, - 'visualmodal' - ); - $row++; - - // Custom center mobile console icon. - $table_styles->data[$row][0] = __('Custom mobile console icon'); - $table_styles->data[$row][1] = html_print_select( - $files, - 'custom_mobile_console_logo', - $config['custom_mobile_console_logo'], - '', - __('Default'), - '', - true, - false, - true, - '', - false, - 'width:240px' - ); - $table_styles->data[$row][1] .= ' '.html_print_button( - __('View'), - 'custom_mobile_console_logo_preview', - $open, - '', - [ - 'icon' => 'camera', - 'mode' => 'link', - 'class' => 'logo_preview', - ], - true, - false, - $open, - 'visualmodal' - ); - $row++; -} - -// Title Header. -$table_styles->data[$row][0] = __('Title (header)'); -$table_styles->data[$row][1] = html_print_input_text('custom_title_header', $config['custom_title_header'], '', 50, 40, true); -$row++; - -// Subtitle Header. -$table_styles->data[$row][0] = __('Subtitle (header)'); -$table_styles->data[$row][1] = html_print_input_text('custom_subtitle_header', $config['custom_subtitle_header'], '', 50, 40, true); -$row++; - -// Login title1. -if (enterprise_installed() === true) { - $table_styles->data[$row][0] = __('Title 1 (login)'); - $table_styles->data[$row][1] = html_print_input_text('custom_title1_login', $config['custom_title1_login'], '', 50, 50, true); - $row++; -} - -// Login text2. -if (enterprise_installed() === true) { - $table_styles->data[$row][0] = __('Title 2 (login)'); - $table_styles->data[$row][1] = html_print_input_text('custom_title2_login', $config['custom_title2_login'], '', 50, 50, true); - $row++; -} - -if (enterprise_installed() === true) { - $table_styles->data[$row][0] = __('Docs URL (login)'); - $table_styles->data[$row][1] = html_print_input_text('custom_docs_url', $config['custom_docs_url'], '', 50, 50, true); - $row++; -} - -if (enterprise_installed() === true) { - $table_styles->data[$row][0] = __('Support URL (login)'); - $table_styles->data[$row][1] = html_print_input_text('custom_support_url', $config['custom_support_url'], '', 50, 50, true); - $row++; -} - -if (enterprise_installed() === true) { - $table_styles->data[$row][0] = __('Product name'); - $table_styles->data[$row][1] = html_print_input_text('rb_product_name', get_product_name(), '', 30, 255, true); - $row++; -} - -if (enterprise_installed() === true) { - $table_styles->data[$row][0] = __('Copyright notice'); - $table_styles->data[$row][1] = html_print_input_text('rb_copyright_notice', get_copyright_notice(), '', 30, 255, true); - $row++; -} - -if (enterprise_installed() === true) { - $table_styles->data[$row][0] = __('Background opacity % (login)'); - $table_styles->data[$row][1] = ""; - $row++; -} - -if (enterprise_installed() === true) { - $table_styles->data[$row][0] = __('Disable logo in graphs'); - $table_styles->data[$row][1] = html_print_checkbox_switch( - 'fixed_graph', - 1, - $config['fixed_graph'], - true - ); - $row++; -} - - /* - Hello there! :) - We added some of what seems to be "buggy" messages to the openSource version recently. This is not to force open-source users to move to the enterprise version, this is just to inform people using Pandora FMS open source that it requires skilled people to maintain and keep it running smoothly without professional support. This does not imply open-source version is limited in any way. If you check the recently added code, it contains only warnings and messages, no limitations except one: we removed the option to add custom logo in header. In the Update Manager section, it warns about the 'danger’ of applying automated updates without a proper backup, remembering in the process that the Enterprise version comes with a human-tested package. Maintaining an OpenSource version with more than 500 agents is not so easy, that's why someone using a Pandora with 8000 agents should consider asking for support. It's not a joke, we know of many setups with a huge number of agents, and we hate to hear that “its becoming unstable and slow” :( - You can of course remove the warnings, that's why we include the source and do not use any kind of trick. And that's why we added here this comment, to let you know this does not reflect any change in our opensource mentality of does the last 14 years. - */ - -$table_styles->data[$row][0] = __('Disable helps'); -$table_styles->data[$row][1] = html_print_checkbox_switch( - 'disable_help', - 1, - $config['disable_help'], - true -); -$row++; - -$table_styles->data[$row][0] = __('Fixed header'); -$table_styles->data[$row][1] = html_print_checkbox_switch( - 'fixed_header', - 1, - $config['fixed_header'], - true -); -$row++; - - -// For 5.1 Autohidden menu feature. -$table_styles->data['autohidden'][0] = __('Automatically hide submenu'); -$table_styles->data['autohidden'][1] = html_print_checkbox_switch( - 'autohidden_menu', - 1, - $config['autohidden_menu'], - true -); - -$table_styles->data[$row][0] = __('Visual effects and animation'); -$table_styles->data[$row][1] = html_print_checkbox_switch( - 'visual_animation', - 1, - $config['visual_animation'], - true -); -$row++; - -$table_styles->data[$row][0] = __('Random background (login)'); -$table_styles->data[$row][1] = html_print_checkbox_switch( - 'random_background', - 1, - $config['random_background'], - true -); -$row++; - - -// ---------------------------------------------------------------------- -// ---------------------------------------------------------------------- -// GIS CONFIGURATION -// ---------------------------------------------------------------------- -$table_gis = new stdClass(); -$table_gis->width = '100%'; -$table_gis->class = 'databox filters'; -$table_gis->style[0] = 'font-weight: bold;'; -$table_gis->style[1] = 'display: flex; align-items: center;'; -$table_gis->size[0] = '50%'; -$table_gis->data = []; - -$table_gis->data[$row][0] = __('GIS Labels'); -$table_gis->data[$row][1] = html_print_checkbox_switch( - 'gis_label', - 1, - $config['gis_label'], - true -); -$row++; - -$listIcons = gis_get_array_list_icons(); -$arraySelectIcon = []; -foreach ($listIcons as $index => $value) { - $arraySelectIcon[$index] = $index; -} - -$table_gis->data[$row][0] = __('Default icon in GIS'); -$table_gis->data[$row][1] = html_print_select( - $arraySelectIcon, - 'gis_default_icon', - $config['gis_default_icon'], - '', - __('Agent icon group'), - '', - true -); -$table_gis->data[$row][1] .= ' '.html_print_button( - __('View'), - 'gis_icon_preview', - false, - '', - [ - 'icon' => 'camera', - 'mode' => 'link', - 'class' => 'logo_preview', - ], - true -); -$row++; - -// ---------------------------------------------------------------------- -// ---------------------------------------------------------------------- -// FONT AND TEXT CONFIGURATION -// ---------------------------------------------------------------------- -$table_font = new stdClass(); -$table_font->width = '100%'; -$table_font->class = 'databox filters'; -$table_font->style[0] = 'font-weight: bold;'; -$table_font->size[0] = '50%'; -$table_font->data = []; - -$table_font->data[$row][0] = __('Graphs font size'); - -$font_size_array = [ - 1 => 1, - 2 => 2, - 3 => 3, - 4 => 4, - 5 => 5, - 6 => 6, - 7 => 7, - 8 => 8, - 9 => 9, - 10 => 10, - 11 => 11, - 12 => 12, - 13 => 13, - 14 => 14, - 15 => 15, -]; - -$table_font->data[$row][1] = html_print_select( - $font_size_array, - 'font_size', - $config['font_size'], - '', - '', - 0, - true -); -$row++; - -$table_font->data[$row][0] = __('Agent size text'); -$table_font->data[$row][1] = __('Small:').html_print_input_text('agent_size_text_small', $config['agent_size_text_small'], '', 3, 3, true); -$table_font->data[$row][1] .= ' '.__('Normal:').html_print_input_text('agent_size_text_medium', $config['agent_size_text_medium'], '', 3, 3, true); -$row++; - -$table_font->data[$row][0] = __('Module size text'); -$table_font->data[$row][1] = __('Small:').html_print_input_text('module_size_text_small', $config['module_size_text_small'], '', 3, 3, true); -$table_font->data[$row][1] .= ' '.__('Normal:').html_print_input_text('module_size_text_medium', $config['module_size_text_medium'], '', 3, 3, true); -$row++; - -$table_font->data[$row][0] = __('Description size text'); -$table_font->data[$row][1] = html_print_input_text('description_size_text', $config['description_size_text'], '', 3, 3, true); -$row++; - -$table_font->data[$row][0] = __('Item title size text'); -$table_font->data[$row][1] = html_print_input_text( - 'item_title_size_text', - $config['item_title_size_text'], - '', - 3, - 3, - true -); -$row++; - -$table_font->data[$row][0] = __('Show unit along with value in reports'); -$table_font->data[$row][1] = html_print_checkbox_switch( - 'simple_module_value', - 1, - $config['simple_module_value'], - true -); -$row++; - -// ---------------------------------------------------------------------- -// ---------------------------------------------------------------------- -// CHARS CONFIGURATION -// ---------------------------------------------------------------------- -$table_chars = new stdClass(); -$table_chars->width = '100%'; -$table_chars->class = 'databox filters'; -$table_chars->style[0] = 'font-weight: bold;'; -$table_chars->style[1] = 'display: flex;'; -$table_chars->size[0] = '50%'; -$table_chars->data = []; - -$graphColorAmount = 10; - -for ($i = 1; $i <= $graphColorAmount; $i++) { - $table_chars->data[$row][0] = __('Graph color #'.$i); - $table_chars->data[$row][1] = html_print_input_text( - 'graph_color'.$i, - $config['graph_color'.$i], - '', - 10, - 8, - true - ); - $row++; -} - -$table_chars->data[$row][0] = __('Value to interface graphics'); -$table_chars->data[$row][1] = html_print_input_text( - 'interface_unit', - $config['interface_unit'], - '', - 20, - 20, - true -); -$row++; - -$disabled_graph_precision = false; -if (enterprise_installed() === false) { - $disabled_graph_precision = true; -} - -$table_chars->data[$row][0] = __('Data precision'); -$table_chars->data[$row][1] = html_print_input( - [ - 'type' => 'number', - 'size' => 5, - 'max' => $performance_variables_control['graph_precision']->max, - 'name' => 'graph_precision', - 'value' => $config['graph_precision'], - 'return' => true, - 'min' => $performance_variables_control['graph_precision']->min, - 'style' => 'width:50px', - ($disabled_graph_precision) ? 'readonly' : '' => 'readonly', - 'onchange' => 'change_precision()', - ] -); -$row++; - -if (isset($config['short_module_graph_data']) === false) { - $config['short_module_graph_data'] = true; -} - -$table_chars->data[$row][0] = __('Data precision in graphs'); -$table_chars->data[$row][1] = html_print_input( - [ - 'type' => 'number', - 'size' => 5, - 'max' => $performance_variables_control['short_module_graph_data']->max, - 'name' => 'short_module_graph_data', - 'value' => $config['short_module_graph_data'], - 'return' => true, - 'min' => $performance_variables_control['short_module_graph_data']->min, - 'style' => 'width:50px', - ($disabled_graph_precision) ? 'readonly' : '' => 'readonly', - 'onchange' => 'change_precision()', - ] -); - -$row++; - -$table_chars->data[$row][0] = __( - 'Default line thickness for the Custom Graph.' -); -$table_chars->data[$row][1] = html_print_input_text( - 'custom_graph_width', - $config['custom_graph_width'], - '', - 5, - 5, - true -); -$row++; - -$table_chars->data[$row][0] = __('Number of elements in Custom Graph'); -$table_chars->data[$row][1] = html_print_input_text( - 'items_combined_charts', - $config['items_combined_charts'], - '', - 5, - 5, - true, - false, - false, - '' -); -$row++; - -$table_chars->data[$row][0] = __('Use round corners'); -$table_chars->data[$row][1] = html_print_checkbox_switch( - 'round_corner', - 1, - $config['round_corner'], - true -); -$row++; - -$table_chars->data[$row][0] = __('Chart fit to content'); -$table_chars->data[$row][1] = html_print_checkbox_switch( - 'maximum_y_axis', - 1, - $config['maximum_y_axis'], - true -); -$row++; - -$table_chars->data[$row][0] = __('Type of module charts'); -$table_chars->data[$row][1] = __('Area').' '.html_print_radio_button( - 'type_module_charts', - 'area', - '', - $config['type_module_charts'] == 'area', - true -).'  '; -$table_chars->data[$row][1] .= __('Line').' '.html_print_radio_button( - 'type_module_charts', - 'line', - '', - $config['type_module_charts'] != 'area', - true -); -$row++; - -$table_chars->data[$row][0] = __('Type of interface charts'); -$table_chars->data[$row][1] = __('Area').' '.html_print_radio_button( - 'type_interface_charts', - 'area', - '', - $config['type_interface_charts'] == 'area', - true -).'  '; -$table_chars->data[$row][1] .= __('Line').' '.html_print_radio_button( - 'type_interface_charts', - 'line', - '', - $config['type_interface_charts'] != 'area', - true -); -$row++; - -$table_chars->data[$row][0] = __('Percentile'); -$table_chars->data[$row][1] = html_print_input_text( - 'percentil', - $config['percentil'], - '', - 20, - 20, - true -); -$row++; - -$table_chars->data[$row][0] = __('Graph TIP view:'); - -$options_full_escale = []; -$options_full_escale[0] = __('None'); -$options_full_escale[1] = __('All'); -$options_full_escale[2] = __('On Boolean graphs'); - -$table_chars->data[$row][1] = html_print_select( - $options_full_escale, - 'full_scale_option', - (isset($config['full_scale_option']) === true) ? $config['full_scale_option'] : 0, - '', - '', - 0, - true, - false, - false -); -$row++; - - -$table_chars->data[$row][0] = __('Graph mode'); - -$options_soft_graphs = []; -$options_soft_graphs[0] = __('Show only average by default'); -$options_soft_graphs[1] = __('Show MAX/AVG/MIN by default'); - -$table_chars->data[$row][1] = html_print_select( - $options_soft_graphs, - 'type_mode_graph', - (isset($config['type_mode_graph']) === true) ? $config['type_mode_graph'] : 0, - '', - '', - 0, - true, - false, - false -); -$row++; - -$table_chars->data[$row][0] = __('Zoom graphs:'); - -$options_zoom_graphs = []; -$options_zoom_graphs[1] = 'x1'; -$options_zoom_graphs[2] = 'x2'; -$options_zoom_graphs[3] = 'x3'; -$options_zoom_graphs[4] = 'x4'; -$options_zoom_graphs[5] = 'x5'; - -$table_chars->data[$row][1] = html_print_select( - $options_zoom_graphs, - 'zoom_graph', - $config['zoom_graph'], - '', - '', - 0, - true, - false, - false -); -$row++; - -// ---------------------------------------------------------------------- -// ---------------------------------------------------------------------- -// Visual Consoles -// ---------------------------------------------------------------------- -$table_vc = new stdClass(); -$table_vc->width = '100%'; -$table_vc->class = 'databox filters'; -$table_vc->style[0] = 'font-weight: bold'; -$table_vc->size[0] = '50%'; -$table_vc->data = []; - -// Remove when the new view reaches rock solid stability. -$table_vc->data[$row][0] = __('Legacy Visual Console View'); -$table_vc->data[$row][1] = html_print_checkbox_switch( - 'legacy_vc', - 1, - (bool) $config['legacy_vc'], - true -); -$row++; - -$intervals = [ - 10 => '10 '.__('seconds'), - 30 => '30 '.__('seconds'), - 60 => '1 '.__('minutes'), - 300 => '5 '.__('minutes'), - 900 => '15 '.__('minutes'), - 1800 => '30 '.__('minutes'), - 3600 => '1 '.__('hour'), -]; -$table_vc->data[$row][0] = __('Default cache expiration'); -$table_vc->data[$row][1] = html_print_extended_select_for_time( - 'vc_default_cache_expiration', - $config['vc_default_cache_expiration'], - '', - __('No cache'), - 0, - false, - true, - false, - false, - '', - false, - $intervals -); -$row++; - -$table_vc->data[$row][0] = __('Default interval for refresh on Visual Console'); -$table_vc->data[$row][1] = html_print_select( - $values, - 'vc_refr', - (int) $config['vc_refr'], - '', - 'N/A', - 0, - true, - false, - false -); -$row++; - -$vc_favourite_view_array[0] = __('Classic view'); -$vc_favourite_view_array[1] = __('View of favorites'); -$table_vc->data[$row][0] = __('Type of view of visual consoles'); -$table_vc->data[$row][1] = html_print_select( - $vc_favourite_view_array, - 'vc_favourite_view', - $config['vc_favourite_view'], - '', - '', - 0, - true -); -$row++; - -$table_vc->data[$row][0] = __('Number of favorite visual consoles to show in the menu'); -$table_vc->data[$row][1] = ""; -$row++; - -$table_vc->data[$row][0] = __('Default line thickness for the Visual Console'); -$table_vc->data[$row][1] = html_print_input_text( - 'vc_line_thickness', - (int) $config['vc_line_thickness'], - '', - 5, - 5, - true -); - -$table_vc->data[$row][0] = __('Mobile view not allow visual console orientation'); -$table_vc->data[$row][1] = html_print_checkbox_switch( - 'mobile_view_orientation_vc', - 1, - (bool) $config['mobile_view_orientation_vc'], - true -); -$row++; - - -// ---------------------------------------------------------------------- -// Services -// ---------------------------------------------------------------------- -$table_ser = new stdClass(); -$table_ser->width = '100%'; -$table_ser->class = 'databox filters'; -$table_ser->style[0] = 'font-weight: bold'; -$table_ser->size[0] = '50%'; -$table_ser->data = []; - -$table_ser->data['number'][0] = __('Number of favorite services to show in the menu'); -$table_ser->data['number'][1] = ""; - -// ---------------------------------------------------------------------- -// Reports -// ---------------------------------------------------------------------- -$table_report = new stdClass(); -$table_report->width = '100%'; -$table_report->class = 'databox filters'; -$table_report->style[0] = 'font-weight: bold;'; -$table_report->size[0] = '20%'; - -$table_report->data = []; - -$table_report->data[$row][0] = __('Show report info with description'); -$table_report->data[$row][1] = html_print_checkbox_switch( - 'custom_report_info', - 1, - $config['custom_report_info'], - true -); -$row++; - -$table_report->data[$row][0] = __('Custom report front page'); -$table_report->data[$row][1] = html_print_checkbox_switch( - 'custom_report_front', - 1, - $config['custom_report_front'], - true -); - -$row++; - -$table_report->data[$row][0] = __('PDF font size (px)'); -$table_report->data[$row][1] = ""; - -$row++; - -$table_report->data[$row][0] = __('HTML font size for SLA (em)'); -$table_report->data[$row][1] = ""; - -$row++; - -$table_report->data[$row][0] = __('Graph image height for HTML reports'); -$table_report->data[$row][1] = html_print_input_text('graph_image_height', $config['graph_image_height'], '', 20, 20, true); - -$row++; - -$interval_description = [ - 'large' => 'Long', - 'tiny' => 'Short', -]; -$table_report->data[$row][0] = __('Interval description'); -$table_report->data[$row][1] = html_print_select( - $interval_description, - 'interval_description', - (isset($config['interval_description']) === true) ? $config['interval_description'] : 'large', - '', - '', - '', - true, - false, - false -); - -$row++; - -// ---------------------------------------------------------------------- -$dirItems = scandir($config['homedir'].'/images/custom_logo'); -foreach ($dirItems as $entryDir) { - if (strstr($entryDir, '.jpg') !== false || strstr($entryDir, '.png') !== false) { - $customLogos['images/custom_logo/'.$entryDir] = $entryDir; - } -} - -// Logo. -$table_report->data['custom_report_front-logo'][0] = __('Custom report front').' - '.__('Custom logo').ui_print_help_tip( - __("The dir of custom logos is in your www Console in 'images/custom_logo'. You can upload more files (ONLY JPEG AND PNG) in upload tool in console."), - true -); - -$table_report->data['custom_report_front-logo'][1] = html_print_select( - $customLogos, - 'custom_report_front_logo', - io_safe_output($config['custom_report_front_logo']), - 'showPreview()', - __('Default'), - '', - true -); -// Preview. -$table_report->data['custom_report_front-preview'][0] = __('Custom report front').' - '.'Preview'; -if (empty($config['custom_report_front_logo'])) { - $config['custom_report_front_logo'] = 'images/pandora_logo_white.jpg'; -} - -$table_report->data['custom_report_front-preview'][1] = ''.html_print_image($config['custom_report_front_logo'], true).''; - -// Header. -$table_report->data['custom_report_front-header'][0] = __('Custom report front').' - '.__('Header'); - -// Do not remove io_safe_output in textarea. TinyMCE avoids XSS injection. -$table_report->data['custom_report_front-header'][1] = html_print_textarea( - 'custom_report_front_header', - 5, - 15, - io_safe_output($config['custom_report_front_header']), - 'class="w90p height_300px"', - true -); - -// First page. -// Do not remove io_safe_output in textarea. TinyMCE avoids XSS injection. -if ($config['custom_report_front']) { - $firstpage_content = $config['custom_report_front_firstpage']; -} else { - $firstpage_content = io_safe_output($config['custom_report_front_firstpage']); -} - -$table_report->data['custom_report_front-first_page'][0] = __('Custom report front').' - '.__('First page'); -$custom_report_front_firstpage = str_replace( - '(_URLIMAGE_)', - ui_get_full_url(false, true, false, false), - io_safe_output($firstpage_content) -); -$table_report->data['custom_report_front-first_page'][1] = html_print_textarea( - 'custom_report_front_firstpage', - 15, - 15, - $custom_report_front_firstpage, - 'class="w90p height_300px"', - true -); - -// Footer. -$table_report->data['custom_report_front-footer'][0] = __('Custom report front').' - '.__('Footer'); - -// Do not remove io_safe_output in textarea. TinyMCE avoids XSS injection. -$table_report->data['custom_report_front-footer'][1] = html_print_textarea( - 'custom_report_front_footer', - 5, - 15, - io_safe_output($config['custom_report_front_footer']), - 'class="w90p height_300px""', - true -); - - -// ---------------------------------------------------------------------- -// OTHER CONFIGURATION -// ---------------------------------------------------------------------- -$table_other = new stdClass(); -$table_other->width = '100%'; -$table_other->class = 'databox filters'; -$table_other->style[0] = 'font-weight: bold;'; -$table_other->size[0] = '50%'; -$table_other->size[1] = '26%'; -$table_other->size[2] = '12%'; -$table_other->size[3] = '12%'; -$table_other->data = []; - -$row++; - -$table_other->data[$row][0] = __('Networkmap max width'); -$table_other->data[$row][1] = html_print_input_text( - 'networkmap_max_width', - $config['networkmap_max_width'], - '', - 10, - 20, - true -); -$row++; - -$table_other->data[$row][0] = __('Show only the group name'); -$table_other->data[$row][1] = html_print_checkbox_switch( - 'show_group_name', - 1, - $config['show_group_name'], - true -); -$row++; - -$table_other->data[$row][0] = __('Show empty groups in group view'); -$table_other->data[$row][1] = html_print_checkbox_switch( - 'show_empty_groups', - 1, - $config['show_empty_groups'], - true -); -$row++; - -$table_other->data[$row][0] = __('Date format string'); -$table_other->data[$row][1] = ''.__('Example').' '.date($config['date_format']); -$table_other->data[$row][1] .= html_print_input_text('date_format', $config['date_format'], '', 30, 100, true); -$row++; - -$decimal_separators = [ - ',' => ',', - '.' => '.', -]; - -$table_other->data[$row][0] = __('Decimal separator'); -$table_other->data[$row][1] = html_print_select( - $decimal_separators, - 'decimal_separator', - $config['decimal_separator'], - '', - '', - '', - true, - false, - false -); - -$row++; - -$table_other->data[$row][0] = __('Visible time of successful notifiations'); -$table_other->data[$row][1] .= html_print_input_text('notification_autoclose_time', $config['notification_autoclose_time'], '', 10, 10, true); -$row++; - -if ($config['prominent_time'] === 'comparation') { - $timestamp = false; - $comparation = true; - $compact = false; -} else if ($config['prominent_time'] === 'timestamp') { - $timestamp = true; - $comparation = false; - $compact = false; -} else if ($config['prominent_time'] === 'compact') { - $timestamp = false; - $comparation = false; - $compact = true; -} - -$table_other->data[$row][0] = __('Timestamp, time comparison, or compact mode'); -$table_other->data[$row][1] = '
'; -$table_other->data[$row][1] .= html_print_radio_button('prominent_time', 'comparation', __('Comparation in rollover'), $comparation, true); -$table_other->data[$row][1] .= html_print_radio_button('prominent_time', 'timestamp', __('Timestamp in rollover'), $timestamp, true); -$table_other->data[$row][1] .= html_print_radio_button('prominent_time', 'compact', __('Compact mode'), $compact, true); -$table_other->data[$row][1] .= '
'; - -$row++; - -// ---------------------------------------------------------------------- -// CUSTOM VALUES POST PROCESS -// ---------------------------------------------------------------------- -$table_other->data[$row][0] = __('Custom values post process'); -$table_other->data[$row][1] = __('Value').': '.html_print_input_text('custom_value', '', '', 25, 50, true); -$table_other->data[$row][2] = __('Text').': '.html_print_input_text('custom_text', '', '', 15, 50, true); -$table_other->data[$row][2] .= ' '; -$table_other->data[$row][2] .= html_print_input_hidden( - 'custom_value_add', - '', - true -); -$table_other->data[$row][3] = html_print_button( - __('Add'), - 'custom_value_add_btn', - false, - '', - [ - 'icon' => 'next', - 'mode' => 'link', - ], - true -); - -$row++; - -$table_other->data[$row][0] = ''; -$table_other->data[$row][1] = __('Delete custom values').': '; -$table_other->data[$row][2] = html_print_select( - post_process_get_custom_values(), - 'custom_values', - '', - '', - '', - '', - true -); -$count_custom_postprocess = post_process_get_custom_values(); -$table_other->data[$row][3] = html_print_button( - __('Delete'), - 'custom_values_del_btn', - empty($count_custom_postprocess), - '', - [ - 'icon' => 'delete', - 'mode' => 'link', - ], - true -); -// This hidden field will be filled from jQuery before submit. -$table_other->data[$row][1] .= html_print_input_hidden( - 'custom_value_to_delete', - '', - true -); -$table_other->data[$row][3] .= '

'; - -// ---------------------------------------------------------------------- -// ---------------------------------------------------------------------- -// CUSTOM INTERVAL VALUES -// ---------------------------------------------------------------------- -$row++; -$table_other->data[$row][0] = __('Interval values'); -$units = [ - 1 => __('seconds'), - SECONDS_1MINUTE => __('minutes'), - SECONDS_1HOUR => __('hours'), - SECONDS_1DAY => __('days'), - SECONDS_1MONTH => __('months'), - SECONDS_1YEAR => __('years'), -]; -$table_other->data[$row][1] = __('Value').': '; -$table_other->data[$row][1] .= html_print_input_text('interval_value', '', '', 5, 5, true); -$table_other->data[$row][2] = html_print_select($units, 'interval_unit', 1, '', '', '', true, false, false); -$table_other->data[$row][3] = html_print_button( - __('Add'), - 'interval_add_btn', - false, - '', - [ - 'icon' => 'next', - 'mode' => 'link', - ], - true -); - -$row++; - -$table_other->data[$row][0] = ''; -$table_other->data[$row][1] = __('Delete interval').': '; -$table_other->data[$row][2] = html_print_select(get_periods(false, false), 'intervals', '', '', '', '', true); -$table_other->data[$row][3] = html_print_button( - __('Delete'), - 'interval_del_btn', - empty($config['interval_values']), - '', - [ - 'icon' => 'delete', - 'mode' => 'link', - ], - true -); - -$table_other->data[$row][1] .= html_print_input_hidden('interval_values', $config['interval_values'], true); -// This hidden field will be filled from jQuery before submit. -$table_other->data[$row][1] .= html_print_input_hidden('interval_to_delete', '', true); -$table_other->data[$row][3] .= '

'; -// ---------------------------------------------------------------------- -$row++; - -$table_other->data[$row][0] = __('Module units'); -$table_other->data[$row][1] = __('Value').': '; -$table_other->data[$row][1] .= html_print_input_text('custom_module_unit', '', '', 15, 50, true); -$table_other->data[$row][2] = ''; -$table_other->data[$row][3] = html_print_button( - __('Add'), - 'module_unit_add_btn', - false, - '', - [ - 'icon' => 'next', - 'mode' => 'link', - ], - true -); - -$row++; -$table_other->data[$row][0] = ''; -$table_other->data[$row][1] = __('Delete custom values').': '; -$table_other->data[$row][2] = html_print_select(get_custom_module_units(), 'module_units', '', '', '', '', true, false, true, 'w100p'); -$table_other->data[$row][3] = html_print_button( - __('Delete'), - 'custom_module_unit_del_btn', - empty($count_custom_postprocess), - '', - [ - 'icon' => 'delete', - 'mode' => 'link', - ], - true -); - -$table_other->data[$row][3] .= html_print_input_hidden( - 'custom_module_unit_to_delete', - '', - true -); - -$row++; - -$common_dividers = [ - ';' => ';', - ',' => ',', - '|' => '|', -]; -$table_other->data[$row][0] = __('CSV divider'); -if ($config['csv_divider'] != ';' && $config['csv_divider'] != ',' && $config['csv_divider'] != '|') { - $table_other->data[$row][1] = html_print_input_text( - 'csv_divider', - $config['csv_divider'], - '', - 20, - 255, - true - ); - $table_other->data[$row][1] .= '
'.html_print_image( - 'images/logs@svg.svg', - true, - [ - 'id' => 'select', - 'class' => 'main_menu_icon invert_filter', - ] - ).''; -} else { - $table_other->data[$row][1] = html_print_select( - $common_dividers, - 'csv_divider', - $config['csv_divider'], - '', - '', - '', - true, - false, - false - ); - $table_other->data[$row][1] .= ''.html_print_image( - 'images/edit.svg', - true, - [ - 'id' => 'pencil', - 'class' => 'main_menu_icon invert_filter', - ] - ).''; -} - -$row++; - -$decimal_separator = [ - '.' => '.', - ',' => ',', -]; -$table_other->data[$row][0] = __('CSV decimal separator'); -$table_other->data[$row][1] = html_print_select($decimal_separator, 'csv_decimal_separator', $config['csv_decimal_separator'], '', '', '', true, false, false); - -$row++; - -$table_other->data[$row][0] = __('Data multiplier to use in graphs/data'); -$options_data_multiplier = []; -$options_data_multiplier[0] = __('Use 1024 when module unit are bytes'); -$options_data_multiplier[1] = __('Use always 1000'); -$options_data_multiplier[2] = __('Use always 1024'); - - -$table_other->data[$row][1] = html_print_select($options_data_multiplier, 'use_data_multiplier', $config['use_data_multiplier'], '', '', 1, true, false, false);function load_fonts() +function load_fonts() { global $config; @@ -1692,68 +232,1828 @@ $table_other->data[$row][1] = html_print_select($options_data_multiplier, 'use_d } +$iconsets['default'] = __('Colors'); +$iconsets['faces'] = __('Faces'); +$iconsets['color_text'] = __('Colors and text'); + +// Divs to show icon status Colours (Default). +$icon_unknown_ball = ui_print_status_image(STATUS_AGENT_UNKNOWN_BALL, '', true); +$icon_unknown = ui_print_status_image(STATUS_AGENT_UNKNOWN, '', true); +$icon_ok_ball = ui_print_status_image(STATUS_AGENT_OK_BALL, '', true); +$icon_ok = ui_print_status_image(STATUS_AGENT_OK, '', true); +$icon_warning_ball = ui_print_status_image(STATUS_AGENT_WARNING_BALL, '', true); +$icon_warning = ui_print_status_image(STATUS_AGENT_WARNING, '', true); +$icon_bad_ball = ui_print_status_image(STATUS_AGENT_CRITICAL_BALL, '', true); +$icon_bad = ui_print_status_image(STATUS_AGENT_CRITICAL, '', true); +// End - Divs to show icon status Colours (Default). +$backgrounds_list_jpg = list_files('images/backgrounds', 'jpg', 1, 0); +$backgrounds_list_gif = list_files('images/backgrounds', 'gif', 1, 0); +$backgrounds_list_png = list_files('images/backgrounds', 'png', 1, 0); +$backgrounds_list = array_merge($backgrounds_list_jpg, $backgrounds_list_png); +$backgrounds_list = array_merge($backgrounds_list, $backgrounds_list_gif); +asort($backgrounds_list); + +$open = false; +if (enterprise_installed() === false) { + $open = true; +} + +if (enterprise_installed() === true) { + // Get all the custom logos. + $filesCustomLogos = list_files('enterprise/images/custom_general_logos', 'png', 1, 0); + + $ent_files = list_files('enterprise/images/custom_logo', 'png', 1, 0); + $open_files = list_files('images/custom_logo', 'png', 1, 0); + + $entOpenFilesInput = html_print_select( + array_merge($open_files, $ent_files), + 'custom_logo_white_bg', + $config['custom_logo_white_bg'], + '', + '', + '', + true, + false, + true, + '', + $open, + 'width:240px' + ); + + $customLogoLoginInput = html_print_select( + list_files('enterprise/images/custom_logo_login', 'png', 1, 0), + 'custom_logo_login', + $config['custom_logo_login'], + '', + '', + '', + true, + false, + true, + '', + $open, + 'width:240px' + ); +} else { + $entOpenFilesInput = html_print_select( + list_files('images/custom_logo', 'png', 1, 0), + 'custom_logo_white_bg', + $config['custom_logo_white_bg'], + '', + '', + '', + true, + false, + true, + '', + $open, + 'width:240px' + ); + + $customLogoLoginInput = html_print_select( + '', + 'custom_logo_login', + $config['custom_logo_login'], + '', + '', + '', + true, + false, + true, + '', + $open, + 'width:240px' + ); +} + +// Custom favicon. +$filesFavicon = list_files('images/custom_favicon', 'ico', 1, 0); + +$table_styles = new stdClass(); +$table_styles->width = '100%'; +$table_styles->class = 'filter-table-adv'; +$table_styles->size[0] = '50%'; +$table_styles->data = []; + +$table_styles->data[$row][] = html_print_label_input_block( + __('Style template'), + html_print_select( + themes_get_css(), + 'style', + $config['style'].'.css', + '', + '', + '', + true, + false, + true, + '', + false, + 'width: 100%' + ) +); +$row++; +$table_styles->data[$row][] = html_print_label_input_block( + __('Custom favicon'), + html_print_div( + [ + 'class' => 'select-with-sibling', + 'content' => html_print_select( + $filesFavicon, + 'custom_favicon', + $config['custom_favicon'], + 'setup_visuals_change_favicon();', + __('Default'), + '', + true, + false, + true, + '', + false, + 'width:240px' + ).html_print_image( + ui_get_favicon(), + true, + ['id' => 'favicon_preview'] + ), + ], + true + ) +); + +$table_styles->data[$row][] = html_print_label_input_block( + __('Custom background logo'), + html_print_div( + [ + 'class' => 'select-with-sibling', + 'content' => html_print_select( + $backgrounds_list, + 'login_background', + $config['login_background'], + '', + __('Default'), + '', + true, + false, + true, + '', + false, + 'width:240px' + ).html_print_button( + __('View'), + 'login_background_preview', + false, + '', + [ + 'icon' => 'camera', + 'mode' => 'link', + 'class' => 'logo_preview', + ], + true + ), + ], + true + ) +); +$row++; + +$table_styles->data[$row][] = html_print_label_input_block( + __('Custom logo (menu)'), + html_print_div( + [ + 'class' => 'select-with-sibling', + 'content' => logo_custom_enterprise('custom_logo', $config['custom_logo']).html_print_button( + __('View'), + 'custom_logo_preview', + $open, + '', + [ + 'icon' => 'camera', + 'mode' => 'link', + 'class' => 'logo_preview', + ], + true, + false, + $open, + 'visualmodal' + ), + ], + true + ) +); + +$table_styles->data[$row][] = html_print_label_input_block( + __('Custom logo collapsed (menu)'), + html_print_div( + [ + 'class' => 'select-with-sibling', + 'content' => logo_custom_enterprise('custom_logo_collapsed', $config['custom_logo_collapsed']).html_print_button( + __('View'), + 'custom_logo_collapsed_preview', + $open, + '', + [ + 'icon' => 'camera', + 'mode' => 'link', + 'class' => 'logo_preview', + ], + true, + false, + $open, + 'visualmodal' + ), + ], + true + ) +); +$row++; + +$table_styles->data[$row][] = html_print_label_input_block( + __('Custom logo (header white background)'), + html_print_div( + [ + 'class' => 'select-with-sibling', + 'content' => $entOpenFilesInput.html_print_button( + __('View'), + 'custom_logo_white_bg_preview', + $open, + '', + [ + 'icon' => 'camera', + 'mode' => 'link', + 'class' => 'logo_preview', + ], + true, + false, + $open, + 'visualmodal' + ), + ], + true + ) +); + +$table_styles->data[$row][] = html_print_label_input_block( + __('Custom logo (login)'), + html_print_div( + [ + 'class' => 'select-with-sibling', + 'content' => $entOpenFilesInput.html_print_button( + __('View'), + 'custom_logo_login_preview', + $open, + '', + [ + 'icon' => 'camera', + 'mode' => 'link', + 'class' => 'logo_preview', + ], + true, + false, + $open, + 'visualmodal' + ), + ], + true + ) +); +$row++; + +// Splash login. +if (enterprise_installed() === true) { + $table_styles->data[$row][] = html_print_label_input_block( + __('Custom Splash (login)'), + html_print_div( + [ + 'class' => 'select-with-sibling', + 'content' => html_print_select( + list_files('enterprise/images/custom_splash_login', 'png', 1, 0), + 'custom_splash_login', + $config['custom_splash_login'], + '', + __('Default'), + 'default', + true, + false, + true, + '', + $open, + 'width:240px' + ).html_print_button( + __('View'), + 'custom_splash_login_preview', + $open, + '', + [ + 'icon' => 'camera', + 'mode' => 'link', + 'class' => 'logo_preview', + ], + true, + false, + $open, + 'visualmodal' + ), + ], + true + ) + ); + + $table_styles->data[$row][] = html_print_label_input_block( + __('Custom documentation logo'), + html_print_div( + [ + 'class' => 'select-with-sibling', + 'content' => html_print_select( + $filesCustomLogos, + 'custom_docs_logo', + $config['custom_docs_logo'], + '', + __('None'), + '', + true, + false, + true, + '', + false, + 'width:240px' + ).html_print_button( + __('View'), + 'custom_docs_logo_preview', + $open, + '', + [ + 'icon' => 'camera', + 'mode' => 'link', + 'class' => 'logo_preview', + ], + true, + false, + $open, + 'visualmodal' + ), + ], + true + ) + ); + $row++; + + // Custom support icon. + $table_styles->data[$row][] = html_print_label_input_block( + __('Custom support logo'), + html_print_div( + [ + 'class' => 'select-with-sibling', + 'content' => html_print_select( + $filesCustomLogos, + 'custom_support_logo', + $config['custom_support_logo'], + '', + __('None'), + '', + true, + false, + true, + '', + false, + 'width:240px' + ).html_print_button( + __('View'), + 'custom_support_logo_preview', + $open, + '', + [ + 'icon' => 'camera', + 'mode' => 'link', + 'class' => 'logo_preview', + ], + true, + false, + $open, + 'visualmodal' + ), + ], + true + ) + ); + + $table_styles->data[$row][] = html_print_label_input_block( + __('Custom networkmap center logo'), + html_print_div( + [ + 'class' => 'select-with-sibling', + 'content' => html_print_select( + $filesCustomLogos, + 'custom_network_center_logo', + $config['custom_network_center_logo'], + '', + __('Default'), + '', + true, + false, + true, + '', + false, + 'width:240px' + ).html_print_button( + __('View'), + 'custom_network_center_logo_preview', + $open, + '', + [ + 'icon' => 'camera', + 'mode' => 'link', + 'class' => 'logo_preview', + ], + true, + false, + $open, + 'visualmodal' + ), + ], + true + ) + ); + $row++; + + // Custom center mobile console icon. + $table_styles->data[$row][] = html_print_label_input_block( + __('Custom mobile console icon'), + html_print_div( + [ + 'class' => 'select-with-sibling', + 'content' => html_print_select( + $filesCustomLogos, + 'custom_mobile_console_logo', + $config['custom_mobile_console_logo'], + '', + __('Default'), + '', + true, + false, + true, + '', + false, + 'width:240px' + ).html_print_button( + __('View'), + 'custom_mobile_console_logo_preview', + $open, + '', + [ + 'icon' => 'camera', + 'mode' => 'link', + 'class' => 'logo_preview', + ], + true, + false, + $open, + 'visualmodal' + ), + ], + true + ) + ); +} + +$row++; + +// Title Header. +$table_styles->data[$row][] = html_print_label_input_block( + __('Title (header)'), + html_print_input_text('custom_title_header', $config['custom_title_header'], '', 50, 40, true) +); + +// Subtitle Header. +$table_styles->data[$row][] = html_print_label_input_block( + __('Subtitle (header)'), + html_print_input_text('custom_subtitle_header', $config['custom_subtitle_header'], '', 50, 40, true) +); +$row++; + +if (enterprise_installed() === true) { + // Login title1. + $table_styles->data[$row][] = html_print_label_input_block( + __('Title 1 (login)'), + html_print_input_text('custom_title1_login', $config['custom_title1_login'], '', 50, 50, true) + ); + // Login text2. + $table_styles->data[$row][] = html_print_label_input_block( + __('Title 2 (login)'), + html_print_input_text('custom_title2_login', $config['custom_title2_login'], '', 50, 50, true) + ); + $row++; + + $table_styles->data[$row][] = html_print_label_input_block( + __('Docs URL (login)'), + html_print_input_text('custom_docs_url', $config['custom_docs_url'], '', 50, 50, true) + ); + + $table_styles->data[$row][] = html_print_label_input_block( + __('Support URL (login)'), + html_print_input_text('custom_support_url', $config['custom_support_url'], '', 50, 50, true) + ); + $row++; + + $table_styles->data[$row][] = html_print_label_input_block( + __('Product name'), + html_print_input_text('rb_product_name', get_product_name(), '', 30, 255, true) + ); + + $table_styles->data[$row][] = html_print_label_input_block( + __('Copyright notice'), + html_print_input_text('rb_copyright_notice', get_copyright_notice(), '', 30, 255, true) + ); + $row++; + + $table_styles->data[$row][] = html_print_label_input_block( + __('Background opacity % (login)'), + "" + ); + + $table_styles->data[$row][] = html_print_label_input_block( + __('Disable logo in graphs'), + html_print_checkbox_switch( + 'fixed_graph', + 1, + $config['fixed_graph'], + true + ) + ); + $row++; +} + +/* + Hello there! :) + We added some of what seems to be "buggy" messages to the openSource version recently. This is not to force open-source users to move to the enterprise version, this is just to inform people using Pandora FMS open source that it requires skilled people to maintain and keep it running smoothly without professional support. This does not imply open-source version is limited in any way. If you check the recently added code, it contains only warnings and messages, no limitations except one: we removed the option to add custom logo in header. In the Update Manager section, it warns about the 'danger’ of applying automated updates without a proper backup, remembering in the process that the Enterprise version comes with a human-tested package. Maintaining an OpenSource version with more than 500 agents is not so easy, that's why someone using a Pandora with 8000 agents should consider asking for support. It's not a joke, we know of many setups with a huge number of agents, and we hate to hear that “its becoming unstable and slow” :( + You can of course remove the warnings, that's why we include the source and do not use any kind of trick. And that's why we added here this comment, to let you know this does not reflect any change in our opensource mentality of does the last 14 years. +*/ + +$table_styles->data[$row][] = html_print_label_input_block( + __('Disable helps'), + html_print_checkbox_switch( + 'disable_help', + 1, + $config['disable_help'], + true + ) +); + +$table_styles->data[$row][] = html_print_label_input_block( + __('Fixed header'), + html_print_checkbox_switch( + 'fixed_header', + 1, + $config['fixed_header'], + true + ) +); +$row++; + +// For 5.1 Autohidden menu feature. +$table_styles->data[$row][] = html_print_label_input_block( + __('Automatically hide submenu'), + html_print_checkbox_switch( + 'autohidden_menu', + 1, + $config['autohidden_menu'], + true + ) +); + +$table_styles->data[$row][] = html_print_label_input_block( + __('Visual effects and animation'), + html_print_checkbox_switch( + 'visual_animation', + 1, + $config['visual_animation'], + true + ) +); +$row++; + +$table_styles->data[$row][] = html_print_label_input_block( + __('Random background (login)'), + html_print_checkbox_switch( + 'random_background', + 1, + $config['random_background'], + true + ) +); + +// ---------------------------------------------------------------------- +// ---------------------------------------------------------------------- +// GIS CONFIGURATION +// ---------------------------------------------------------------------- +$listIcons = gis_get_array_list_icons(); +$arraySelectIcon = []; +foreach ($listIcons as $index => $value) { + $arraySelectIcon[$index] = $index; +} + +$table_gis = new stdClass(); +$table_gis->width = '100%'; +$table_gis->class = 'filter-table-adv'; +$table_gis->size[0] = '50%'; +$table_gis->data = []; + +$table_gis->data[$row][] = html_print_label_input_block( + __('GIS Labels'), + html_print_checkbox_switch( + 'gis_label', + 1, + $config['gis_label'], + true + ) +); + +$table_gis->data[$row][] = html_print_label_input_block( + __('Default icon in GIS'), + html_print_div( + [ + 'class' => 'select-with-sibling', + 'content' => html_print_select( + $arraySelectIcon, + 'gis_default_icon', + $config['gis_default_icon'], + '', + __('Agent icon group'), + '', + true + ).html_print_button( + __('View'), + 'gis_icon_preview', + false, + '', + [ + 'icon' => 'camera', + 'mode' => 'link', + 'class' => 'logo_preview', + ], + true + ), + ], + true + ) +); +$row++; + +// ---------------------------------------------------------------------- +// ---------------------------------------------------------------------- +// FONT AND TEXT CONFIGURATION +// ---------------------------------------------------------------------- +$font_size_array = [ + 1 => 1, + 2 => 2, + 3 => 3, + 4 => 4, + 5 => 5, + 6 => 6, + 7 => 7, + 8 => 8, + 9 => 9, + 10 => 10, + 11 => 11, + 12 => 12, + 13 => 13, + 14 => 14, + 15 => 15, +]; + +$table_font = new stdClass(); +$table_font->width = '100%'; +$table_font->class = 'filter-table-adv'; +$table_font->size[0] = '50%'; +$table_font->data = []; + +$table_font->data[$row][] = html_print_label_input_block( + __('Graphs font size'), + html_print_select( + $font_size_array, + 'font_size', + $config['font_size'], + '', + '', + 0, + true, + false, + true, + '', + false, + 'width: 100%' + ) +); + + +$table_font->data[$row][] = html_print_label_input_block( + __('Show unit along with value in reports'), + html_print_checkbox_switch( + 'simple_module_value', + 1, + $config['simple_module_value'], + true + ) +); +$row++; + +$table_font->data[$row][] = html_print_label_input_block( + __('Agent size text'), + html_print_div( + [ + 'class' => 'filter-table-adv-manual', + 'content' => html_print_div( + [ + 'class' => 'w50p', + 'content' => __('Small').html_print_input_text('agent_size_text_small', $config['agent_size_text_small'], '', 10, 3, true), + ], + true + ).html_print_div( + [ + 'class' => 'w50p', + 'content' => __('Normal').html_print_input_text('agent_size_text_medium', $config['agent_size_text_medium'], '', 10, 3, true), + ], + true + ), + ], + true + ) +); +$table_font->data[$row][] = html_print_label_input_block( + __('Module size text'), + html_print_div( + [ + 'class' => 'filter-table-adv-manual', + 'content' => html_print_div( + [ + 'class' => 'w50p', + 'content' => __('Small').html_print_input_text('module_size_text_small', $config['module_size_text_small'], '', 10, 3, true), + ], + true + ).html_print_div( + [ + 'class' => 'w50p', + 'content' => __('Normal').html_print_input_text('module_size_text_medium', $config['module_size_text_medium'], '', 10, 3, true), + ], + true + ), + ], + true + ) +); +$row++; + +$table_font->data[$row][] = html_print_label_input_block( + __('Description size text'), + html_print_input_text( + 'description_size_text', + $config['description_size_text'], + '', + 3, + 3, + true + ) +); +$table_font->data[$row][] = html_print_label_input_block( + __('Item title size text'), + html_print_input_text( + 'item_title_size_text', + $config['item_title_size_text'], + '', + 3, + 3, + true + ) +); +$row++; + + +// ---------------------------------------------------------------------- +// ---------------------------------------------------------------------- +// CHARS CONFIGURATION +// ---------------------------------------------------------------------- +$disabled_graph_precision = false; +if (enterprise_installed() === false) { + $disabled_graph_precision = true; +} + +if (isset($config['short_module_graph_data']) === false) { + $config['short_module_graph_data'] = true; +} + +$options_full_escale = []; +$options_full_escale[0] = __('None'); +$options_full_escale[1] = __('All'); +$options_full_escale[2] = __('On Boolean graphs'); + +$options_soft_graphs = []; +$options_soft_graphs[0] = __('Show only average by default'); +$options_soft_graphs[1] = __('Show MAX/AVG/MIN by default'); + +$options_zoom_graphs = []; +$options_zoom_graphs[1] = 'x1'; +$options_zoom_graphs[2] = 'x2'; +$options_zoom_graphs[3] = 'x3'; +$options_zoom_graphs[4] = 'x4'; +$options_zoom_graphs[5] = 'x5'; + +$graphColorAmount = 10; +$table_chars = new stdClass(); +$table_chars->width = '100%'; +$table_chars->class = 'filter-table-adv'; +$table_chars->size[0] = '50%'; +$table_chars->size[1] = '50%'; +$table_chars->data = []; + +for ($i = 1; $i <= $graphColorAmount; $i++) { + $table_chars->data[$row][] = html_print_label_input_block( + __('Graph color #'.$i), + html_print_input_color( + 'graph_color'.$i, + $config['graph_color'.$i], + 'graph_color'.$i, + 'w50p', + true + ) + ); + + $row = ($i % 2 === 0) ? ($row + 1) : $row; +} + +$table_chars->data[$row][] = html_print_label_input_block( + __('Data precision'), + html_print_input( + [ + 'type' => 'number', + 'size' => 5, + 'max' => $performance_variables_control['graph_precision']->max, + 'name' => 'graph_precision', + 'value' => $config['graph_precision'], + 'return' => true, + 'min' => $performance_variables_control['graph_precision']->min, + 'style' => 'width:50%', + ($disabled_graph_precision) ? 'readonly' : '' => 'readonly', + 'onchange' => 'change_precision()', + ] + ) +); + +$table_chars->data[$row][] = html_print_label_input_block( + __('Data precision in graphs'), + html_print_input( + [ + 'type' => 'number', + 'size' => 5, + 'max' => $performance_variables_control['short_module_graph_data']->max, + 'name' => 'short_module_graph_data', + 'value' => $config['short_module_graph_data'], + 'return' => true, + 'min' => $performance_variables_control['short_module_graph_data']->min, + 'style' => 'width:50%', + ($disabled_graph_precision) ? 'readonly' : '' => 'readonly', + 'onchange' => 'change_precision()', + ] + ) +); +$row++; + +$table_chars->data[$row][] = html_print_label_input_block( + __('Value to interface graphics'), + html_print_input_text( + 'interface_unit', + $config['interface_unit'], + '', + 20, + 20, + true + ) +); + +$table_chars->data[$row][] = html_print_label_input_block( + __('Default line thickness for the Custom Graph.'), + html_print_input_text( + 'custom_graph_width', + $config['custom_graph_width'], + '', + 5, + 5, + true + ) +); +$row++; + +$table_chars->data[$row][] = html_print_label_input_block( + __('Number of elements in Custom Graph'), + html_print_input_text( + 'items_combined_charts', + $config['items_combined_charts'], + '', + 5, + 5, + true, + false, + false, + '' + ) +); +$table_chars->data[$row][] = html_print_label_input_block( + __('Use round corners'), + html_print_checkbox_switch( + 'round_corner', + 1, + $config['round_corner'], + true + ) +); +$row++; + +$table_chars->data[$row][] = html_print_label_input_block( + __('Chart fit to content'), + html_print_checkbox_switch( + 'maximum_y_axis', + 1, + $config['maximum_y_axis'], + true + ) +); + +$table_chars->data[$row][] = html_print_label_input_block( + __('Type of module charts'), + html_print_div( + [ + 'class' => '', + 'content' => html_print_div( + [ + 'class' => '', + 'content' => __('Area').' '.html_print_radio_button( + 'type_module_charts', + 'area', + '', + $config['type_module_charts'] == 'area', + true + ), + ], + true + ).html_print_div( + [ + 'class' => '', + 'content' => __('Line').' '.html_print_radio_button( + 'type_module_charts', + 'line', + '', + $config['type_module_charts'] != 'area', + true + ), + ], + true + ), + ], + true + ) +); +$row++; + +$table_chars->data[$row][] = html_print_label_input_block( + __('Percentile'), + html_print_input_text( + 'percentil', + $config['percentil'], + '', + 20, + 20, + true + ) +); + +$table_chars->data[$row][] = html_print_label_input_block( + __('Graph TIP view'), + html_print_select( + $options_full_escale, + 'full_scale_option', + (isset($config['full_scale_option']) === true) ? $config['full_scale_option'] : 0, + '', + '', + 0, + true, + false, + false + ) +); +$row++; + +$table_chars->data[$row][] = html_print_label_input_block( + __('Graph mode'), + html_print_select( + $options_soft_graphs, + 'type_mode_graph', + (isset($config['type_mode_graph']) === true) ? $config['type_mode_graph'] : 0, + '', + '', + 0, + true, + false, + false + ) +); + +$table_chars->data[$row][] = html_print_label_input_block( + __('Zoom graphs'), + html_print_select( + $options_zoom_graphs, + 'zoom_graph', + $config['zoom_graph'], + '', + '', + 0, + true, + false, + false + ) +); +$row++; + +// ---------------------------------------------------------------------- +// ---------------------------------------------------------------------- +// Visual Consoles +// ---------------------------------------------------------------------- +$intervals = [ + 10 => '10 '.__('seconds'), + 30 => '30 '.__('seconds'), + 60 => '1 '.__('minutes'), + 300 => '5 '.__('minutes'), + 900 => '15 '.__('minutes'), + 1800 => '30 '.__('minutes'), + 3600 => '1 '.__('hour'), +]; + +$vc_favourite_view_array[0] = __('Classic view'); +$vc_favourite_view_array[1] = __('View of favorites'); + +$table_vc = new stdClass(); +$table_vc->width = '100%'; +$table_vc->class = 'filter-table-adv'; +$table_vc->style[0] = 'font-weight: bold'; +$table_vc->size[0] = '50%'; +$table_vc->data = []; + +// Remove when the new view reaches rock solid stability. +$table_vc->data[$row][] = html_print_label_input_block( + __('Legacy Visual Console View'), + html_print_checkbox_switch( + 'legacy_vc', + 1, + (bool) $config['legacy_vc'], + true + ) +); + +$table_vc->data[$row][] = html_print_label_input_block( + __('Default cache expiration'), + html_print_extended_select_for_time( + 'vc_default_cache_expiration', + $config['vc_default_cache_expiration'], + '', + __('No cache'), + 0, + false, + true, + false, + false, + '', + false, + $intervals + ) +); +$row++; + +$table_vc->data[$row][] = html_print_label_input_block( + __('Default interval for refresh on Visual Console'), + html_print_select( + $values, + 'vc_refr', + (int) $config['vc_refr'], + '', + 'N/A', + 0, + true, + false, + false + ) +); + +$table_vc->data[$row][] = html_print_label_input_block( + __('Type of view of visual consoles'), + html_print_select( + $vc_favourite_view_array, + 'vc_favourite_view', + $config['vc_favourite_view'], + '', + '', + 0, + true + ) +); +$row++; + +$table_vc->data[$row][] = html_print_label_input_block( + __('Number of favorite visual consoles to show in the menu'), + "" +); + +$table_vc->data[$row][] = html_print_label_input_block( + __('Default line thickness for the Visual Console'), + html_print_input_text( + 'vc_line_thickness', + (int) $config['vc_line_thickness'], + '', + 5, + 5, + true + ) +); +$row++; + +$table_vc->data[$row][] = html_print_label_input_block( + __('Mobile view not allow visual console orientation'), + html_print_checkbox_switch( + 'mobile_view_orientation_vc', + 1, + (bool) $config['mobile_view_orientation_vc'], + true + ) +); +$row++; + + +// ---------------------------------------------------------------------- +// Services +// ---------------------------------------------------------------------- +$table_ser = new stdClass(); +$table_ser->width = '100%'; +$table_ser->class = 'filter-table-adv'; +$table_ser->size[0] = '50%'; +$table_ser->data = []; + +$table_ser->data[0][] = html_print_label_input_block( + __('Number of favorite services to show in the menu'), + "" +); + +// ---------------------------------------------------------------------- +// Reports +// ---------------------------------------------------------------------- +$interval_description = [ + 'large' => 'Long', + 'tiny' => 'Short', +]; + +$dirItems = scandir($config['homedir'].'/images/custom_logo'); +$customLogos = []; +foreach ($dirItems as $entryDir) { + if (strstr($entryDir, '.jpg') !== false || strstr($entryDir, '.png') !== false) { + $customLogos['images/custom_logo/'.$entryDir] = $entryDir; + } +} + +if (empty($config['custom_report_front_logo'])) { + $config['custom_report_front_logo'] = 'images/pandora_logo_white.jpg'; +} + +// Do not remove io_safe_output in textarea. TinyMCE avoids XSS injection. +if ($config['custom_report_front']) { + $firstpage_content = $config['custom_report_front_firstpage']; +} else { + $firstpage_content = io_safe_output($config['custom_report_front_firstpage']); +} + +$custom_report_front_firstpage = str_replace( + '(_URLIMAGE_)', + ui_get_full_url(false, true, false, false), + io_safe_output($firstpage_content) +); + +$table_report = new stdClass(); +$table_report->width = '100%'; +$table_report->class = 'filter-table-adv'; +$table_report->size[0] = '50%'; + +$table_report->data = []; + +$table_report->data[$row][] = html_print_label_input_block( + __('Show report info with description'), + html_print_checkbox_switch( + 'custom_report_info', + 1, + $config['custom_report_info'], + true + ) +); + +$table_report->data[$row][] = html_print_label_input_block( + __('Custom report front page'), + html_print_checkbox_switch( + 'custom_report_front', + 1, + $config['custom_report_front'], + true + ) +); +$row++; + +$table_report->data[$row][] = html_print_label_input_block( + __('PDF font size (px)'), + "" +); +$table_report->data[$row][] = html_print_label_input_block( + __('HTML font size for SLA (em)'), + "" +); +$row++; + +$table_report->data[$row][] = html_print_label_input_block( + __('Graph image height for HTML reports'), + html_print_input_text('graph_image_height', $config['graph_image_height'], '', 20, 20, true) +); +$table_report->data[$row][] = html_print_label_input_block( + __('Interval description'), + html_print_select( + $interval_description, + 'interval_description', + (isset($config['interval_description']) === true) ? $config['interval_description'] : 'large', + '', + '', + '', + true, + false, + false + ) +); +$row++; + +// Logo. +$table_report->data['custom_report_front-logo'][] = html_print_label_input_block( + __('Custom report front').' - '.__('Custom logo').ui_print_help_tip( + __("The dir of custom logos is in your www Console in 'images/custom_logo'. You can upload more files (ONLY JPEG AND PNG) in upload tool in console."), + true + ), + html_print_select( + $customLogos, + 'custom_report_front_logo', + io_safe_output($config['custom_report_front_logo']), + 'showPreview()', + __('Default'), + '', + true + ) +); +$table_report->data['custom_report_front-preview'][] = html_print_label_input_block( + __('Custom report front').' - '.__('Preview'), + ''.html_print_image($config['custom_report_front_logo'], true).'' +); + +$table_report->colspan['custom_report_front-header'][] = 2; +$table_report->data['custom_report_front-header'][] = html_print_label_input_block( + __('Custom report front').' - '.__('Header'), + html_print_textarea( + 'custom_report_front_header', + 5, + 15, + io_safe_output($config['custom_report_front_header']), + 'class="w90p height_300px"', + true + ) +); + +$table_report->colspan['custom_report_front-first_page'][] = 2; +$table_report->data['custom_report_front-first_page'][] = html_print_label_input_block( + __('Custom report front').' - '.__('First page'), + html_print_textarea( + 'custom_report_front_firstpage', + 15, + 15, + $custom_report_front_firstpage, + 'class="w90p height_300px"', + true + ) +); + +// Do not remove io_safe_output in textarea. TinyMCE avoids XSS injection. +$table_report->colspan['custom_report_front-footer'][] = 2; +$table_report->data['custom_report_front-footer'][] = html_print_label_input_block( + __('Custom report front').' - '.__('Footer'), + html_print_textarea( + 'custom_report_front_footer', + 5, + 15, + io_safe_output($config['custom_report_front_footer']), + 'class="w90p height_300px""', + true + ) +); + + +// ---------------------------------------------------------------------- +// OTHER CONFIGURATION +// ---------------------------------------------------------------------- +$decimal_separators = [ + ',' => ',', + '.' => '.', +]; + +$common_dividers = [ + ';' => ';', + ',' => ',', + '|' => '|', +]; + +$switchProminentTime = html_print_radio_button( + 'prominent_time', + 'comparation', + __('Comparation in rollover'), + ($config['prominent_time'] === 'comparation'), + true +); +$switchProminentTime .= html_print_radio_button( + 'prominent_time', + 'timestamp', + __('Timestamp in rollover'), + ($config['prominent_time'] === 'timestamp'), + true +); +$switchProminentTime .= html_print_radio_button( + 'prominent_time', + 'compact', + __('Compact mode'), + ($config['prominent_time'] === 'compact'), + true +); + +if ($config['csv_divider'] !== ';' && $config['csv_divider'] !== ',' && $config['csv_divider'] !== '|') { + $csvDividerInputs = html_print_input_text( + 'csv_divider', + $config['csv_divider'], + '', + 20, + 255, + true + ); + $csvDividerInputs .= ''.html_print_image( + 'images/logs@svg.svg', + true, + [ + 'id' => 'select', + 'class' => 'main_menu_icon invert_filter', + ] + ).''; +} else { + $csvDividerInputs = html_print_select( + $common_dividers, + 'csv_divider', + $config['csv_divider'], + '', + '', + '', + true, + false, + false + ); + $csvDividerInputs .= ''.html_print_image( + 'images/edit.svg', + true, + [ + 'id' => 'pencil', + 'class' => 'main_menu_icon invert_filter', + ] + ).''; +} + +$options_data_multiplier = []; +$options_data_multiplier[0] = __('Use 1024 when module unit are bytes'); +$options_data_multiplier[1] = __('Use always 1000'); +$options_data_multiplier[2] = __('Use always 1024'); + +$table_other = new stdClass(); +$table_other->width = '100%'; +$table_other->class = 'filter-table-adv'; +$table_other->size[0] = '50%'; +$table_other->size[1] = '50%'; +$table_other->data = []; + +$row++; + +$table_other->data[$row][] = html_print_label_input_block( + __('Networkmap max width'), + html_print_input_text( + 'networkmap_max_width', + $config['networkmap_max_width'], + '', + 10, + 20, + true + ) +); + +$table_other->data[$row][] = html_print_label_input_block( + __('Show only the group name'), + html_print_checkbox_switch( + 'show_group_name', + 1, + $config['show_group_name'], + true + ) +); +$row++; + +$table_other->data[$row][] = html_print_label_input_block( + __('Show empty groups in group view'), + html_print_checkbox_switch( + 'show_empty_groups', + 1, + $config['show_empty_groups'], + true + ) +); + +$table_other->data[$row][] = html_print_label_input_block( + __('Date format string'), + html_print_input_text( + 'date_format', + $config['date_format'], + '', + 30, + 100, + true + ).ui_print_input_placeholder( + __('Example').': '.date($config['date_format']), + true + ) +); +$row++; + +$table_other->data[$row][] = html_print_label_input_block( + __('Decimal separator'), + html_print_select( + $decimal_separators, + 'decimal_separator', + $config['decimal_separator'], + '', + '', + '', + true, + false, + false + ) +); + +$table_other->data[$row][] = html_print_label_input_block( + __('Visible time of successful notifiations'), + html_print_input_text( + 'notification_autoclose_time', + $config['notification_autoclose_time'], + '', + 10, + 10, + true + ) +); +$row++; + +$table_other->data[$row][] = html_print_label_input_block( + __('Timestamp, time comparison, or compact mode'), + html_print_div( + [ + 'class' => 'switch_radio_button', + 'content' => $switchProminentTime, + ], + true + ) +); +$row++; +// ---------------------------------------------------------------------- +// CUSTOM VALUES POST PROCESS +// ---------------------------------------------------------------------- +$count_custom_postprocess = post_process_get_custom_values(); +$table_other->data[$row][] = html_print_label_input_block( + __('Custom values post process'), + html_print_div( + [ + 'class' => 'filter-table-adv-manual', + 'content' => html_print_div( + [ + 'class' => '', + 'content' => __('Value').': '.html_print_input_text('custom_value', '', '', 25, 50, true), + ], + true + ).html_print_div( + [ + 'class' => '', + 'content' => __('Text').': '.html_print_input_text('custom_text', '', '', 15, 50, true), + ], + true + ).html_print_button( + __('Add'), + 'custom_value_add_btn', + false, + '', + [ + 'icon' => 'next', + 'mode' => 'link', + 'style' => 'display: flex; justify-content: flex-end; width: 100%;', + ], + true + ).html_print_input_hidden( + 'custom_value_add', + '', + true + ), + ], + true + ).html_print_div( + [ + 'class' => '', + 'content' => html_print_div( + [ + 'class' => '', + 'content' => __('Delete custom values').html_print_select( + post_process_get_custom_values(), + 'custom_values', + '', + '', + '', + '', + true, + false, + true, + '', + false, + 'width: 100%' + ), + ], + true + ).html_print_button( + __('Delete'), + 'custom_values_del_btn', + empty($count_custom_postprocess), + '', + [ + 'icon' => 'delete', + 'mode' => 'link', + 'style' => 'display: flex; justify-content: flex-end; width: 100%;', + ], + true + ).html_print_input_hidden( + 'custom_value_to_delete', + '', + true + ), + ], + true + ) +); + +// ---------------------------------------------------------------------- +// ---------------------------------------------------------------------- +// CUSTOM INTERVAL VALUES +// ---------------------------------------------------------------------- +$units = [ + 1 => __('seconds'), + SECONDS_1MINUTE => __('minutes'), + SECONDS_1HOUR => __('hours'), + SECONDS_1DAY => __('days'), + SECONDS_1MONTH => __('months'), + SECONDS_1YEAR => __('years'), +]; +$table_other->data[$row][] = html_print_label_input_block( + __('Interval values'), + html_print_div( + [ + 'class' => 'filter-table-adv-manual', + 'content' => html_print_div( + [ + 'class' => '', + 'content' => __('Value').html_print_input_text('interval_value', '', '', 5, 5, true), + ], + true + ).html_print_div( + [ + 'class' => '', + 'content' => __('Interval').html_print_select($units, 'interval_unit', 1, '', '', '', true, false, false, '', false, 'width: 100%'), + ], + true + ).html_print_button( + __('Add'), + 'interval_add_btn', + false, + '', + [ + 'mode' => 'link', + 'style' => 'display: flex; justify-content: flex-end; width: 100%;', + ], + true + ).html_print_input_hidden( + 'interval_values', + $config['interval_values'], + true + ), + ], + true + ).html_print_div( + [ + 'class' => empty($config['interval_values']) === true ? 'invisible' : '', + 'content' => html_print_div( + [ + 'class' => '', + 'content' => __('Delete interval values').html_print_select( + get_periods( + false, + false + ), + 'intervals', + '', + '', + '', + '', + true, + false, + true, + '', + false, + 'width: 100%' + ), + ], + true + ).html_print_button( + __('Delete'), + 'interval_del_btn', + empty($config['interval_values']), + '', + [ + 'mode' => 'link', + 'style' => 'display: flex; justify-content: flex-end; width: 100%;', + ], + true + ).html_print_input_hidden( + 'interval_to_delete', + '', + true + ), + ], + true + ) +); +$row++; + + + +$table_other->data[$row][] = html_print_label_input_block( + __('Module units'), + html_print_div( + [ + 'class' => 'filter-table-adv-manual', + 'content' => html_print_div( + [ + 'class' => '', + 'content' => __('Value').html_print_input_text('custom_module_unit', '', '', 15, 50, true), + ], + true + ).html_print_div( + [ + 'class' => '', + 'content' => __('Interval').html_print_select($units, 'interval_unit', 1, '', '', '', true, false, false, '', false, 'width: 100%'), + ], + true + ).html_print_button( + __('Add'), + 'module_unit_add_btn', + false, + '', + [ + 'style' => 'display: flex; justify-content: flex-end; width: 100%;', + 'mode' => 'link', + ], + true + ), + ], + true + ).html_print_div( + [ + 'class' => (empty($count_custom_postprocess) === true ? 'invisible' : ''), + 'content' => html_print_div( + [ + 'class' => '', + 'content' => __('Delete custom values').html_print_select( + get_custom_module_units(), + 'module_units', + '', + '', + '', + '', + true, + false, + true, + '', + false, + 'width: 100%' + ), + ], + true + ).html_print_button( + __('Delete'), + 'custom_module_unit_del_btn', + empty($count_custom_postprocess), + '', + [ + 'style' => 'display: flex; justify-content: flex-end; width: 100%;', + 'mode' => 'link', + ], + true + ).html_print_input_hidden( + 'custom_module_unit_to_delete', + '', + true + ), + ], + true + ) +); +$row++; + +$table_other->data[$row][] = html_print_label_input_block( + __('CSV divider'), + $csvDividerInputs +); + +$table_other->data[$row][] = html_print_label_input_block( + __('CSV decimal separator'), + html_print_select($decimal_separators, 'csv_decimal_separator', $config['csv_decimal_separator'], '', '', '', true, false, false) +); +$row++; + +$table_other->data[$row][] = html_print_label_input_block( + __('Data multiplier to use in graphs/data'), + html_print_select($options_data_multiplier, 'use_data_multiplier', $config['use_data_multiplier'], '', '', 1, true, false, false) +); +$row++; + /* * * PAINT HTML. * */ -echo '
'; +echo '
'; echo ''.__('Behaviour configuration').' '.ui_print_help_icon('behavoir_conf_tab', true).''; html_print_table($table_behaviour); echo '
'; -echo '
'; +echo '
'; echo ''.__('GIS configuration').' '.ui_print_help_icon('gis_conf_tab', true).''; html_print_table($table_gis); echo '
'; -echo '
'; +echo '
'; echo ''.__('Style configuration').' '.ui_print_help_icon('style_conf_tab', true).''; html_print_table($table_styles); echo '
'; -echo '
'; +echo '
'; echo ''.__('Charts configuration').' '.ui_print_help_icon('charts_conf_tab', true).''; html_print_table($table_chars); echo '
'; -echo '
'; +echo '
'; echo ''.__('Font and Text configuration').' '.ui_print_help_icon('front_and_text_conf_tab', true).''; html_print_table($table_font); echo '
'; -echo '
'; +echo '
'; echo ''.__('Visual consoles configuration').' '.ui_print_help_icon('visual_consoles_conf_tab', true).''; html_print_table($table_vc); echo '
'; -echo '
'; +echo '
'; echo ''.__('Reports configuration ').ui_print_help_icon('reports_configuration_tab', true).''; html_print_table($table_report); echo '
'; -echo '
'; +echo '
'; echo ''.__('Services configuration').' '.ui_print_help_icon('services_conf_tab', true).''; html_print_table($table_ser); echo '
'; -echo '
'; +echo '
'; echo ''.__('Other configuration').' '.ui_print_help_icon('other_conf_tab', true).''; html_print_table($table_other); echo '
'; -html_print_div( - [ - 'class' => 'action-buttons w100p', - 'content' => html_print_submit_button( - __('Update'), - 'update_button', - false, - [ 'icon' => 'next' ], - true - ), - ] +html_print_action_buttons( + html_print_submit_button( + __('Update'), + 'update_button', + false, + [ 'icon' => 'next' ], + true + ) ); echo ''; @@ -1871,22 +2171,23 @@ $(document).ready (function () { $("select#vc_default_cache_expiration_select").closest("tr").show(); } }).change(); - + var comfort = 0; - +/* if(comfort == 0){ $(':input,:radio,:checkbox,:file').change(function(){ - $('#submit-update_button').css({'position':'fixed','right':'80px','bottom':'55px'}); + $('#button-update_button').css({'position':'fixed','right':'80px','bottom':'55px'}); var comfort = 1; }); $("*").keydown(function(){ - $('#submit-update_button').css({'position':'fixed','right':'80px','bottom':'55px'}); + $('#button-update_button').css({'position':'fixed','right':'80px','bottom':'55px'}); var comfort = 1; }); $('#form_setup').after('
'); - } + } + $("#form_setup #text-graph_color1").attachColorPicker(); $("#form_setup #text-graph_color2").attachColorPicker(); @@ -1897,8 +2198,10 @@ $(document).ready (function () { $("#form_setup #text-graph_color7").attachColorPicker(); $("#form_setup #text-graph_color8").attachColorPicker(); $("#form_setup #text-graph_color9").attachColorPicker(); + + */ $("#form_setup #text-graph_color10").attachColorPicker(); - + //------------------------------------------------------------------ // CUSTOM VALUES POST PROCESS @@ -1931,7 +2234,7 @@ $(document).ready (function () { }); $("#button-interval_add_btn").click( function() { - $('#submit-update_button').trigger('click'); + $('#button-update_button').trigger('click'); }); //------------------------------------------------------------------ @@ -1941,11 +2244,11 @@ $(document).ready (function () { $("#button-custom_module_unit_del_btn").click( function() { var unit_selected = $('#module_units option:selected').val(); $('#hidden-custom_module_unit_to_delete').val(unit_selected); - $('#submit-update_button').trigger('click'); + $('#button-update_button').trigger('click'); }); $("#button-module_unit_add_btn").click( function() { - $('#submit-update_button').trigger('click'); + $('#button-update_button').trigger('click'); }); //------------------------------------------------------------------ @@ -1982,7 +2285,7 @@ $(".logo_preview").click (function(e) { var homeUrl = ""; var homeUrlEnt = homeUrl + ""; - var elementToCheck = $('#'+e.target.id).parent().attr('id'); + var elementToCheck = e.target.id; // Fill it seing the target has been clicked switch (elementToCheck) { case 'button-custom_logo_preview': @@ -2040,6 +2343,7 @@ $(".logo_preview").click (function(e) { }); $("#button-gis_icon_preview").click (function (e) { + var homeUrl = ""; var icon_prefix = $("select#gis_default_icon option:selected").val(); var icon_path = homeUrl + "images/gis_map/icons/" + icon_prefix; diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index b504b76a44..fe4e0aa8f7 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -30,6 +30,7 @@ :root { --primary-color: #14524f; --secondary-color: #ffffff; + --input-border: #c0ccdc; } /* @@ -5822,7 +5823,7 @@ div.label_select_child_left > span { width: 100%; display: flex; overflow: hidden; - height: 42px; + height: 48px; } .switch_radio_button input { @@ -5834,26 +5835,25 @@ div.label_select_child_left > span { overflow: hidden; } -div.switch_radio_button label { - background-color: #fff; +div.switch_radio_button > label { + background-color: var(--secondary-color); color: rgba(0, 0, 0, 0.6); - line-height: 6px !important; - text-align: center; - padding: 14px 10px; - margin-right: -1px; - border: 1px solid #cbcbcb; + text-align: center !important; + padding: 8px 10px; + margin-right: -2px; + border: 2px solid var(--input-border); transition: all 0.1s ease-in-out; background: transparent; } div.switch_radio_button label:first-of-type { - border-top-left-radius: 4px !important; - border-bottom-left-radius: 4px !important; + border-top-left-radius: 6px !important; + border-bottom-left-radius: 6px !important; } div.switch_radio_button label:last-of-type { - border-top-right-radius: 4px !important; - border-bottom-right-radius: 4px !important; + border-top-right-radius: 6px !important; + border-bottom-right-radius: 6px !important; margin-right: 0px; } @@ -5863,9 +5863,9 @@ div.switch_radio_button label:last-of-type { .switch_radio_button input:checked + label, .switch_radio_button input:checked:has(.custom_checkbox) { - background-color: #1d7873; + background-color: var(--primary-color); box-shadow: none; - color: #fff !important; + color: var(--secondary-color) !important; } /* @@ -11668,3 +11668,11 @@ div.ui-dialog-buttonset > button.ui-button.ui-corner-all.ui-widget:active { div#menu_full > div#menu_tabs > ul.tabs_ul { margin-bottom: 0px; } + +.filter-adapted-table-adv { +} + +.filter-adapted-table-adv tr { + display: flex; + flex-direction: column; +} diff --git a/pandora_console/include/styles/tables.css b/pandora_console/include/styles/tables.css index 39b3368e69..90f9659028 100644 --- a/pandora_console/include/styles/tables.css +++ b/pandora_console/include/styles/tables.css @@ -575,6 +575,10 @@ table.filter-table-adv td input[type="radio"] { height: 20px; } +table.filter-table-adv div.select-with-sibling { + display: flex; + align-items: center; +} table.databox.filter-table-adv { padding: 10px; } From 9a21c40780347aed1302db6b86cd5c1172cd43d6 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Wed, 15 Mar 2023 16:35:49 +0100 Subject: [PATCH 045/169] Background white PDFS --- pandora_console/include/styles/pandoraPDF.css | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pandora_console/include/styles/pandoraPDF.css b/pandora_console/include/styles/pandoraPDF.css index 05bf20b846..05e6ec9bb9 100644 --- a/pandora_console/include/styles/pandoraPDF.css +++ b/pandora_console/include/styles/pandoraPDF.css @@ -28,6 +28,10 @@ * ============================================================================ */ +body { + background-color: white !important; +} + table.header_table { width: 100%; } @@ -211,3 +215,7 @@ table tbody td.cellBorder1 { table tbody td.cellBig { font-size: 18px; } + +table.info_table > tbody > tr:nth-child(even) { + background-color: #e5e9ed !important; +} From 4d6029ba3fab6b8e9dfcdeb1fb30107d0dd67339 Mon Sep 17 00:00:00 2001 From: Pablo Aragon Date: Wed, 15 Mar 2023 17:02:25 +0100 Subject: [PATCH 046/169] 10408-Manage agents, Agent view --- pandora_console/godmode/agentes/agent_manager.php | 8 ++++---- pandora_console/operation/agentes/alerts_status.php | 6 +++--- .../operation/agentes/estado_generalagente.php | 4 ++-- pandora_console/operation/agentes/status_events.php | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/pandora_console/godmode/agentes/agent_manager.php b/pandora_console/godmode/agentes/agent_manager.php index 9281c04e44..06ec4a5308 100644 --- a/pandora_console/godmode/agentes/agent_manager.php +++ b/pandora_console/godmode/agentes/agent_manager.php @@ -971,7 +971,7 @@ foreach ($fields as $field) { $data_field[1] .= html_print_textarea( 'customvalue_'.$field['id_field'].'[]', 2, - 65, + 1000, $link_text, 'class="min-height-30px w100p"', true @@ -982,7 +982,7 @@ foreach ($fields as $field) { $data_field[1] .= html_print_textarea( 'customvalue_'.$field['id_field'].'[]', 2, - 65, + 1000, $link_url, 'class="min-height-30px w100p"', true @@ -991,7 +991,7 @@ foreach ($fields as $field) { $customContent = html_print_textarea( 'customvalue_'.$field['id_field'], 2, - 65, + 1000, $custom_value, 'class="min-height-30px w100p"', true @@ -1036,7 +1036,7 @@ if (empty($fields) === false) { '', true, false, - 'white_box white_box_opened white_table_graph_fixed', + 'white_box white_box_opened white_table_graph_fixed no_border', 'no-border custom_fields_elements' ); } diff --git a/pandora_console/operation/agentes/alerts_status.php b/pandora_console/operation/agentes/alerts_status.php index 1378351614..3a6f692399 100755 --- a/pandora_console/operation/agentes/alerts_status.php +++ b/pandora_console/operation/agentes/alerts_status.php @@ -497,9 +497,9 @@ if ($agent_view_page === true) { !$alerts_defined, false, true, - 'box-flat agent_details_col', - 'white-box-content', - 'width_available' + '', + '', + 'box-flat white_table_graph w100p' ), ], ); diff --git a/pandora_console/operation/agentes/estado_generalagente.php b/pandora_console/operation/agentes/estado_generalagente.php index e0038ee6a3..c770017587 100755 --- a/pandora_console/operation/agentes/estado_generalagente.php +++ b/pandora_console/operation/agentes/estado_generalagente.php @@ -710,7 +710,7 @@ if ((bool) $config['agentaccess'] === true && $access_agent > 0) { $agentAccessRate = html_print_div( [ - 'class' => 'box-flat agent_details_col mrgn_lft_20px', + 'class' => 'box-flat agent_details_col mrgn_lft_20px w50p', 'id' => 'table_access_rate', 'content' => $agentAccessRateHeader.$agentAccessRateContent, ], @@ -1038,7 +1038,7 @@ $agentEventsGraph = html_print_div( $agentEvents = html_print_div( [ - 'class' => 'box-flat agent_details_col', + 'class' => 'box-flat agent_details_col w50p', 'content' => $agentEventsHeader.$agentEventsGraph, ], true diff --git a/pandora_console/operation/agentes/status_events.php b/pandora_console/operation/agentes/status_events.php index d4c63a8b2c..478b0771c2 100755 --- a/pandora_console/operation/agentes/status_events.php +++ b/pandora_console/operation/agentes/status_events.php @@ -32,9 +32,9 @@ html_print_div( 'latest_events_agent', false, true, - 'box-flat agent_details_col', - 'white-box-content', - 'width_available' + '', + 'box-flat white-box-content no_border', + 'box-flat white_table_graph w100p' ), ], ); From 931610e7744d787933cb03cdb6958066c4f9d8bb Mon Sep 17 00:00:00 2001 From: alejandro Date: Wed, 15 Mar 2023 17:23:59 +0100 Subject: [PATCH 047/169] fix to correctly take the path of the logs to be monitored. --- pandora_plugins/Advanced Log Parser/pandora_logparser.pl | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pandora_plugins/Advanced Log Parser/pandora_logparser.pl b/pandora_plugins/Advanced Log Parser/pandora_logparser.pl index b83ad3477f..3f4dc7ac2f 100644 --- a/pandora_plugins/Advanced Log Parser/pandora_logparser.pl +++ b/pandora_plugins/Advanced Log Parser/pandora_logparser.pl @@ -743,8 +743,12 @@ while (my ($key, $value) = each (@{$plugin_setup{"log"}})) { if (defined($value->{"log_location_multiple"})){ $log_filename_multiple = $value->{"log_location_multiple"}; $log_create_module_for_each_log = $value->{"module_for_each_log"}; - #my @buffer = `dir "$log_filename_multiple" /b /a-d`; - my @buffer = `ls -d "$log_filename_multiple"`; + my @buffer; + if($^O =~ /win/i){ + @buffer = `dir "$log_filename_multiple" /b /a-d`; + }else{ + @buffer = `ls -d "$log_filename_multiple"`; + } foreach (@buffer) { # This should solve problems with carriage return in Unix, Linux and Windooze chomp($_); @@ -757,6 +761,7 @@ while (my ($key, $value) = each (@{$plugin_setup{"log"}})) { $module_name_multiple =~ s/\//_/g; $module_name_multiple = $module_name . "_" . $module_name_multiple; } + $log_filename = $log_filename_multiple . $_; manage_logfile ($log_filename, $module_name_multiple, $readall, $type, $regexp, $description); } } From d2a807636efb497ef2d4b5bb7efe29f58e47f8d4 Mon Sep 17 00:00:00 2001 From: Jose Gonzalez Date: Wed, 15 Mar 2023 17:43:35 +0100 Subject: [PATCH 048/169] General Setup view --- .../godmode/setup/setup_general.php | 1086 +++++++++-------- pandora_console/include/functions_config.php | 4 +- pandora_console/include/styles/pandora.css | 4 + 3 files changed, 598 insertions(+), 496 deletions(-) diff --git a/pandora_console/godmode/setup/setup_general.php b/pandora_console/godmode/setup/setup_general.php index d19d3587c6..879eef9ab3 100644 --- a/pandora_console/godmode/setup/setup_general.php +++ b/pandora_console/godmode/setup/setup_general.php @@ -14,7 +14,7 @@ * |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______| * * ============================================================================ - * Copyright (c) 2005-2021 Artica Soluciones Tecnologicas + * Copyright (c) 2005-2023 Artica Soluciones Tecnologicas * Please see http://pandorafms.org for full contribution list * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -26,6 +26,8 @@ * ============================================================================ */ +use function PHPSTORM_META\map; + // File begin. global $config; @@ -47,153 +49,17 @@ if (is_ajax()) { exit(); } -$performance_variables_control = (array) json_decode(io_safe_output($config['performance_variables_control'])); - -$table = new StdClass(); -$table->class = 'databox filters'; -$table->id = 'setup_general'; -$table->width = '100%'; -$table->data = []; -$table->size = []; -$table->size[0] = '30%'; -$table->style[0] = 'font-weight:bold'; -$table->size[1] = '70%'; - -$table_mail_conf = new stdClass(); -$table_mail_conf->width = '100%'; -$table_mail_conf->class = 'databox filters'; -$table_mail_conf->data = []; -$table_mail_conf->style[0] = 'font-weight: bold'; - -// Current config["language"] could be set by user, not taken from global setup ! -$current_system_lang = db_get_sql( - 'SELECT `value` FROM tconfig WHERE `token` = "language"' -); - -if ($current_system_lang == '') { - $current_system_lang = 'en'; -} - -$i = 0; - -$table->data[$i][0] = __('Language code'); -$table->data[$i++][1] = html_print_select_from_sql( - 'SELECT id_language, name FROM tlanguage', - 'language', - $current_system_lang, - '', - '', - '', - true -); - -$table->data[$i][0] = __('Remote config directory'); -$table->data[$i++][1] = html_print_input_text( - 'remote_config', - io_safe_output($config['remote_config']), - '', - 30, - 100, - true -); - -$table->data[$i][0] = __('Chromium path'); -$table->data[$i++][1] = html_print_input_text( - 'chromium_path', - io_safe_output( - $config['chromium_path'] - ), - '', - 30, - 100, - true -); - -$table->data[$i][0] = __('Auto login (hash) password'); -$table->data[$i][1] = html_print_input_password( - 'loginhash_pwd', - io_output_password($config['loginhash_pwd']), - '', - 15, - 15, - true -); -$table->data[$i++][1] .= ui_print_reveal_password( - 'loginhash_pwd', - true -); - -$table->data[$i][0] = __('Time source'); -$sources['system'] = __('System'); -$sources['sql'] = __('Database'); -$table->data[$i++][1] = html_print_select( - $sources, - 'timesource', - $config['timesource'], - '', - '', - '', - true -); - -$table->data[$i][0] = __('Automatic check for updates'); -$table->data[$i++][1] = html_print_checkbox_switch( - 'autoupdate', - 1, - $config['autoupdate'], - true -); - echo "'; -$table->data[$i][0] = __('Enforce https'); -$table->data[$i++][1] = html_print_checkbox_switch_extended( - 'https', - 1, - $config['https'], - false, - '', - '', - true -); +$performance_variables_control = (array) json_decode(io_safe_output($config['performance_variables_control'])); +$sources = []; +$sources['system'] = __('System'); +$sources['sql'] = __('Database'); -$table->data[$i][0] = __('Use cert of SSL'); -$table->data[$i++][1] = html_print_checkbox_switch_extended( - 'use_cert', - 1, - $config['use_cert'], - false, - '', - '', - true -); - -$table->rowstyle[$i] = 'display: none;'; -$table->rowid[$i] = 'ssl-path-tr'; -$table->data[$i][0] = __('Path of SSL Cert.'); -$table->data[$i++][1] = html_print_input_text( - 'cert_path', - io_safe_output($config['cert_path']), - '', - 50, - 255, - true -); - -$table->data[$i][0] = __('Attachment store'); -$table->data[$i++][1] = html_print_input_text( - 'attachment_store', - io_safe_output($config['attachment_store']), - '', - 50, - 255, - true -); - -$table->data[$i][0] = __('IP list with API access'); -if (isset($_POST['list_ACL_IPs_for_API'])) { +// ACL Ips for API. +if (isset($_POST['list_ACL_IPs_for_API']) === true) { $list_ACL_IPs_for_API = get_parameter_post('list_ACL_IPs_for_API'); } else { $list_ACL_IPs_for_API = get_parameter_get( @@ -202,51 +68,14 @@ if (isset($_POST['list_ACL_IPs_for_API'])) { ); } -$table->data[$i++][1] = html_print_textarea( - 'list_ACL_IPs_for_API', - 2, - 25, - $list_ACL_IPs_for_API, - 'class="height_130px w300px"', - true -); - -$table->data[$i][0] = __('API password'); -$table->data[$i][1] = html_print_input_password( - 'api_password', - io_output_password($config['api_password']), - '', - 25, - 255, - true -); -$table->data[$i++][1] .= ui_print_reveal_password('api_password', true); - -$table->data[$i][0] = __('Enable GIS features'); -$table->data[$i++][1] = html_print_checkbox_switch( - 'activate_gis', - 1, - $config['activate_gis'], - true -); - -$table->data[$i][0] = __('Enable Netflow'); -$rbt_disabled = false; +// Enable Netflow. if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') { $rbt_disabled = true; +} else { + $rbt_disabled = false; } -$table->data[$i++][1] = html_print_checkbox_switch_extended( - 'activate_netflow', - 1, - $config['activate_netflow'], - $rbt_disabled, - '', - '', - true -); - - +// Zone names. $zone_name = [ 'Africa' => __('Africa'), 'America' => __('America'), @@ -278,83 +107,16 @@ foreach ($timezones as $timezone) { } } -$table->data[$i][0] = __('Timezone setup'); -$table->data[$i][1] = html_print_input_text_extended( - 'timezone_text', - $config['timezone'], - 'text-timezone_text', - '', - 25, - 25, - false, - '', - 'readonly', - true -); -$table->data[$i][1] .= ''.html_print_image( - 'images/edit.svg', - true, +// Force Public URL Dialog. +html_print_div( [ - 'title' => __('Change timezone'), - 'class' => 'main_menu_icon invert_filter', - ] -).''; -$table->data[$i][1] .= '  '.html_print_select( - $zone_name, - 'zone', - $zone_selected, - 'show_timezone();', - '', - '', - true -); -$table->data[$i++][1] .= '  '.html_print_select( - $timezone_n, - 'timezone', - $config['timezone'], - '', - '', - '', - true -); - -$table->data[$i][0] = __('Public URL'); -$table->data[$i++][1] = html_print_input_text( - 'public_url', - $config['public_url'], - '', - 40, - 255, - true -); - -$table->data[$i][0] = __('Force use Public URL'); -$table->data[$i++][1] = html_print_switch( - [ - 'name' => 'force_public_url', - 'value' => $config['force_public_url'], + 'id' => 'force_public_url_dialog', + 'class' => 'invisible', + 'content' => __('If public URL is not properly configured you will lose access to ').get_product_name().__(' Console'), ] ); -echo "'; - -$table->data[$i][0] = __('Public URL host exclusions'); -$table->data[$i++][1] = html_print_textarea( - 'public_url_exclusions', - 2, - 25, - $config['public_url_exclusions'], - 'class="height_50px w300px"', - true -); - -// Inventory changes blacklist. -$table->data[$i][0] = __('Inventory changes blacklist'); - +// Inventory blacklist. $inventory_changes_blacklist_id = get_parameter( 'inventory_changes_blacklist', $config['inventory_changes_blacklist'] @@ -431,171 +193,492 @@ $table_ichanges = '
'; -$table->data[$i++][1] = $table_ichanges; - -$table->data[$i][0] = __('Referer security'); -$table->data[$i++][1] = html_print_checkbox_switch( - 'referer_security', - 1, - $config['referer_security'], - true -); - -$table->data[$i][0] = __('Event storm protection'); -$table->data[$i++][1] = html_print_checkbox_switch( - 'event_storm_protection', - 1, - $config['event_storm_protection'], - true -); - - -$table->data[$i][0] = __('Command Snapshot'); -$table->data[$i++][1] = html_print_checkbox_switch( - 'command_snapshot', - 1, - $config['command_snapshot'], - true -); - -$table->data[$i][0] = __('Change remote config encoding'); -$table->data[$i++][1] = html_print_checkbox_switch( - 'use_custom_encoding', - 1, - $config['use_custom_encoding'], - true -); - -$table->data[$i][0] = __('Server logs directory'); -$table->data[$i++][1] = html_print_input_text( - 'server_log_dir', - $config['server_log_dir'], - '', - 50, - 255, - true -); - -$table->data[$i][0] = __('Log size limit in system logs viewer extension'); -$table->data[$i++][1] = html_print_input_text( - 'max_log_size', - $config['max_log_size'], - '', - 10, - 255, - true -).html_print_label(' x1000', 'max_log_size', true); - $modes_tutorial = [ 'full' => __('Full mode'), 'on_demand' => __('On demand'), 'expert' => __('Expert'), ]; -$table->data[$i][0] = __('Tutorial mode'); -$table->data[$i++][1] = html_print_select( - $modes_tutorial, - 'tutorial_mode', - $config['tutorial_mode'], - '', - '', - 0, - true -); $config['past_planned_downtimes'] = isset( $config['past_planned_downtimes'] ) ? $config['past_planned_downtimes'] : 1; -$table->data[$i][0] = __('Allow create scheduled downtimes in the past'); -$table->data[$i++][1] = html_print_checkbox_switch( - 'past_planned_downtimes', - 1, - $config['past_planned_downtimes'], - true + +$table = new stdClass(); +$table->class = 'filter-table-adv'; +$table->id = 'setup_general'; +$table->width = '100%'; +$table->data = []; +$table->size = []; +$table->size[0] = '50%'; +$table->size[1] = '50%'; + +// Current config["language"] could be set by user, not taken from global setup ! +$current_system_lang = db_get_sql( + 'SELECT `value` FROM tconfig WHERE `token` = "language"' ); -$table->data[$i][0] = __('Limit for bulk operations'); -$table->data[$i++][1] = html_print_input( +if ($current_system_lang === '') { + $current_system_lang = 'en'; +} + +$i = 0; + +$table->data[$i][] = html_print_label_input_block( + __('Language code'), + html_print_select_from_sql( + 'SELECT id_language, name FROM tlanguage', + 'language', + $current_system_lang, + '', + '', + '', + true, + false, + true, + false, + 'width:100%' + ) +); + +$table->data[$i++][] = html_print_label_input_block( + __('Remote config directory'), + html_print_input_text( + 'remote_config', + io_safe_output($config['remote_config']), + '', + 30, + 100, + true + ) +); + +$table->data[$i][] = html_print_label_input_block( + __('Chromium path'), + html_print_input_text( + 'chromium_path', + io_safe_output( + $config['chromium_path'] + ), + '', + 30, + 100, + true + ) +); + +$table->data[$i++][] = html_print_label_input_block( + __('Auto login (hash) password'), + html_print_input_password( + 'loginhash_pwd', + io_output_password($config['loginhash_pwd']), + '', + 15, + 15, + true + ) +); + +$table->data[$i][] = html_print_label_input_block( + __('Time source'), + html_print_select( + $sources, + 'timesource', + $config['timesource'], + '', + '', + '', + true + ) +); + +$table->data[$i++][] = html_print_label_input_block( + __('Attachment store'), + html_print_input_text( + 'attachment_store', + io_safe_output($config['attachment_store']), + '', + 50, + 255, + true + ) +); + +$table->data[$i][] = html_print_label_input_block( + __('Enforce https'), + html_print_checkbox_switch_extended( + 'https', + 1, + $config['https'], + false, + '', + '', + true + ) +); + +$table->data[$i++][] = html_print_label_input_block( + __('Automatic check for updates'), + html_print_checkbox_switch( + 'autoupdate', + 1, + $config['autoupdate'], + true + ) +); + +$table->data[$i][] = html_print_label_input_block( + __('Use cert of SSL'), + html_print_checkbox_switch_extended( + 'use_cert', + 1, + $config['use_cert'], + false, + '', + '', + true + ) +); + +$table->data[$i++][] = html_print_label_input_block( + __('Path of SSL Cert.'), + html_print_input_text( + 'cert_path', + io_safe_output($config['cert_path']), + '', + 50, + 255, + true + ), [ - 'type' => 'number', - 'size' => 5, - 'max' => $performance_variables_control['limit_parameters_massive']->max, - 'name' => 'limit_parameters_massive', - 'value' => $config['limit_parameters_massive'], - 'return' => true, - 'min' => $performance_variables_control['limit_parameters_massive']->min, - 'style' => 'width:50px', + 'div_id' => 'ssl-path-tr', + 'div_style' => 'display: none', ] ); -$table->data[$i][0] = __('Include agents manually disabled'); -$table->data[$i++][1] = html_print_checkbox_switch( - 'include_agents', - 1, - $config['include_agents'], - true +$table->data[$i][] = html_print_label_input_block( + __('API password'), + html_print_input_password( + 'api_password', + io_output_password($config['api_password']), + '', + 25, + 255, + true + ) ); -$table->data[$i][0] = __('Set alias as name by default in agent creation'); -$table->data[$i++][1] = html_print_checkbox_switch( - 'alias_as_name', - 1, - $config['alias_as_name'], - true +$table->data[$i++][] = html_print_label_input_block( + __('IP list with API access'), + html_print_textarea( + 'list_ACL_IPs_for_API', + 2, + 25, + $list_ACL_IPs_for_API, + 'class="height_130px"', + true + ) ); -$table->data[$i][0] = __('Unique IP'); -$table->data[$i++][1] = html_print_checkbox_switch( - 'unique_ip', - 1, - $config['unique_ip'], - true + +$table->data[$i][] = html_print_label_input_block( + __('Enable GIS features'), + html_print_checkbox_switch( + 'activate_gis', + 1, + $config['activate_gis'], + true + ) ); -$table->data[$i][0] = __('Enable console log').ui_print_help_tip( - __('Log location').': pandora_console/log/console.log', - true -); -$table->data[$i++][1] = html_print_checkbox_switch( - 'console_log_enabled', - 1, - $config['console_log_enabled'], - true +$table->data[$i++][] = html_print_label_input_block( + __('Enable Netflow'), + html_print_checkbox_switch_extended( + 'activate_netflow', + 1, + $config['activate_netflow'], + $rbt_disabled, + '', + '', + true + ) ); -$table->data[$i][0] = __('Enable audit log').ui_print_help_tip( - __('Log location').': pandora_console/log/audit.log', - true -); -$table->data[$i++][1] = html_print_checkbox_switch( - 'audit_log_enabled', - 1, - $config['audit_log_enabled'], - true +$table->colspan[$i][] = 2; +$table->data[$i++][] = html_print_label_input_block( + __('Timezone setup'), + html_print_div( + [ + 'class' => '', + 'content' => html_print_input_text_extended( + 'timezone_text', + $config['timezone'], + 'text-timezone_text', + '', + 25, + 25, + false, + '', + 'readonly', + true + ).html_print_image( + 'images/edit.svg', + true, + [ + 'id' => 'change_timezone', + 'title' => __('Change timezone'), + 'class' => 'main_menu_icon invert_filter', + ] + ).html_print_select( + $zone_name, + 'zone', + $zone_selected, + 'show_timezone();', + '', + '', + true + ).html_print_select( + $timezone_n, + 'timezone', + $config['timezone'], + '', + '', + '', + true + ), + ], + true + ) ); -$table->data[$i][0] = __('Module custom ID readonly').ui_print_help_tip( - __('Useful for integrations'), - true -); -$table->data[$i++][1] = html_print_checkbox_switch( - 'module_custom_id_ro', - 1, - $config['module_custom_id_ro'], - true +$table->data[$i][] = html_print_label_input_block( + __('Public URL'), + html_print_input_text( + 'public_url', + $config['public_url'], + '', + 40, + 255, + true + ) ); -$table->data[$i][0] = __('Enable console report').ui_print_help_tip( +$table->data[$i++][] = html_print_label_input_block( + __('Force use Public URL'), + html_print_switch( + [ + 'name' => 'force_public_url', + 'value' => $config['force_public_url'], + ] + ) +); + +$table->data[$i++][] = html_print_label_input_block( + __('Public URL host exclusions'), + html_print_textarea( + 'public_url_exclusions', + 2, + 25, + $config['public_url_exclusions'], + 'class="height_50px w300px"', + true + ) +); + +// Inventory changes blacklist. +$table->data[$i][] = html_print_label_input_block( + __('Inventory changes blacklist'), + $table_ichanges +); + +$table->data[$i++][] = html_print_label_input_block( + __('Server logs directory'), + html_print_input_text( + 'server_log_dir', + $config['server_log_dir'], + '', + 50, + 255, + true + ) +); + +$table->data[$i][] = html_print_label_input_block( + __('Event storm protection'), + html_print_checkbox_switch( + 'event_storm_protection', + 1, + $config['event_storm_protection'], + true + ) +); + +$table->data[$i++][] = html_print_label_input_block( + __('Command Snapshot'), + html_print_checkbox_switch( + 'command_snapshot', + 1, + $config['command_snapshot'], + true + ) +); + +$table->data[$i][] = html_print_label_input_block( + __('Change remote config encoding'), + html_print_checkbox_switch( + 'use_custom_encoding', + 1, + $config['use_custom_encoding'], + true + ) +); +$table->data[$i++][] = html_print_label_input_block( + __('Referer security'), + html_print_checkbox_switch( + 'referer_security', + 1, + $config['referer_security'], + true + ) +); + +$table->data[$i][] = html_print_label_input_block( + __('Log size limit in system logs viewer extension'), + html_print_div( + [ + 'class' => '', + 'content' => html_print_input_text( + 'max_log_size', + $config['max_log_size'], + '', + 20, + 255, + true + ).html_print_label( + ' x1000', + 'max_log_size', + true + ), + ], + true + ) +); +$table->data[$i++][] = html_print_label_input_block( + __('Tutorial mode'), + html_print_select( + $modes_tutorial, + 'tutorial_mode', + $config['tutorial_mode'], + '', + '', + 0, + true + ) +); + +$table->data[$i][] = html_print_label_input_block( + __('Allow create scheduled downtimes in the past'), + html_print_checkbox_switch( + 'past_planned_downtimes', + 1, + $config['past_planned_downtimes'], + true + ) +); +$table->data[$i++][] = html_print_label_input_block( + __('Limit for bulk operations'), + html_print_input( + [ + 'type' => 'number', + 'size' => 5, + 'max' => $performance_variables_control['limit_parameters_massive']->max, + 'name' => 'limit_parameters_massive', + 'value' => $config['limit_parameters_massive'], + 'return' => true, + 'min' => $performance_variables_control['limit_parameters_massive']->min, + 'style' => 'width:50%', + ] + ) +); + +$table->data[$i][] = html_print_label_input_block( + __('Include agents manually disabled'), + html_print_checkbox_switch( + 'include_agents', + 1, + $config['include_agents'], + true + ) +); +$table->data[$i++][] = html_print_label_input_block( + __('Set alias as name by default in agent creation'), + html_print_checkbox_switch( + 'alias_as_name', + 1, + $config['alias_as_name'], + true + ) +); + +$table->data[$i][] = html_print_label_input_block( + __('Unique IP'), + html_print_checkbox_switch( + 'unique_ip', + 1, + $config['unique_ip'], + true + ) +); + +$table->data[$i++][] = html_print_label_input_block( + __('Module custom ID readonly'), + html_print_checkbox_switch( + 'module_custom_id_ro', + 1, + $config['module_custom_id_ro'], + true + ).ui_print_input_placeholder( + __('Useful for integrations'), + true + ) +); + +$table->data[$i][] = html_print_label_input_block( + __('Enable console log'), + html_print_checkbox_switch( + 'console_log_enabled', + 1, + $config['console_log_enabled'], + true + ).ui_print_input_placeholder( + __('Log location').': pandora_console/log/console.log', + true + ) +); + +$table->data[$i++][] = html_print_label_input_block( + __('Enable audit log'), + html_print_checkbox_switch( + 'audit_log_enabled', + 1, + $config['audit_log_enabled'], + true + ).ui_print_input_placeholder( + __('Log location').': pandora_console/log/audit.log', + true + ) +); + +$table->data[$i][] = html_print_label_input_block( __('Enable console report'), - true -); -$table->data[$i++][1] = html_print_checkbox_switch( - 'reporting_console_enable', - 1, - $config['reporting_console_enable'], - true + html_print_checkbox_switch( + 'reporting_console_enable', + 1, + $config['reporting_console_enable'], + true + ) ); -echo '
'; +echo ''; echo '
'; echo ''.__('General options').''; @@ -615,7 +698,7 @@ echo '
'; echo '
'; echo ''.__('Mail configuration').''; - $table_mail_conf->data[0][0] = ui_print_warning_message( + ui_print_warning_message( __( 'Please notice that some providers like Gmail or Office365 need to setup/enable manually external connections using SMTP and you need to use STARTTLS on port 587. @@ -623,114 +706,128 @@ echo ''.__('Mail configuration').''; ) ); - $table_mail_conf->data[1][0] = __('From address'); - $table_mail_conf->data[1][1] = html_print_input_text( - 'email_from_dir', - $config['email_from_dir'], - '', - 30, - 100, - true + $table_mail_conf = new stdClass(); + $table_mail_conf->width = '100%'; + $table_mail_conf->class = 'databox filter-table-adv'; + $table_mail_conf->size = []; + $table_mail_conf->size[0] = '50%'; + $table_mail_conf->size[1] = '50%'; + $table_mail_conf->data = []; + + $table_mail_conf->data[0][] = html_print_label_input_block( + __('From address'), + html_print_input_text( + 'email_from_dir', + $config['email_from_dir'], + '', + 30, + 100, + true + ) ); - $table_mail_conf->data[2][0] = __('From name'); - $table_mail_conf->data[2][1] = html_print_input_text( - 'email_from_name', - $config['email_from_name'], - '', - 30, - 100, - true + $table_mail_conf->data[0][] = html_print_label_input_block( + __('From name'), + html_print_input_text( + 'email_from_name', + $config['email_from_name'], + '', + 30, + 100, + true + ) ); - $table_mail_conf->data[3][0] = __('SMTP Server'); - $table_mail_conf->data[3][1] = html_print_input_text( - 'email_smtpServer', - $config['email_smtpServer'], - '', - 30, - 100, - true + $table_mail_conf->data[1][] = html_print_label_input_block( + __('SMTP Server'), + html_print_input_text( + 'email_smtpServer', + $config['email_smtpServer'], + '', + 30, + 100, + true + ) ); - $table_mail_conf->data[4][0] = __('SMTP Port'); - $table_mail_conf->data[4][1] = html_print_input_text( - 'email_smtpPort', - $config['email_smtpPort'], - '', - 30, - 100, - true + $table_mail_conf->data[1][] = html_print_label_input_block( + __('SMTP Port'), + html_print_input_text( + 'email_smtpPort', + $config['email_smtpPort'], + '', + 30, + 100, + true + ) ); - $table_mail_conf->data[5][0] = __('Encryption'); - $table_mail_conf->data[5][1] = html_print_select( - $encryption, - 'email_encryption', - $config['email_encryption'], - '', - __('none'), - 0, - true + $table_mail_conf->data[2][] = html_print_label_input_block( + __('Email user'), + html_print_input_text( + 'email_username', + $config['email_username'], + '', + 30, + 100, + true + ) + ); + $table_mail_conf->data[2][] = html_print_label_input_block( + __('Email password'), + html_print_input_password( + 'email_password', + io_output_password( + $config['email_password'] + ), + '', + 30, + 100, + true + ) ); - $table_mail_conf->data[6][0] = __('Email user'); - $table_mail_conf->data[6][1] = html_print_input_text( - 'email_username', - $config['email_username'], - '', - 30, - 100, - true - ); - - $table_mail_conf->data[7][0] = __('Email password'); - $table_mail_conf->data[7][1] = html_print_input_password( - 'email_password', - io_output_password( - $config['email_password'] - ), - '', - 30, - 100, - true - ); - $table_mail_conf->data[7][1] .= ui_print_reveal_password( - 'email_password', - true + $table_mail_conf->data[3][] = html_print_label_input_block( + __('Encryption'), + html_print_select( + $encryption, + 'email_encryption', + $config['email_encryption'], + '', + __('none'), + 0, + true + ) ); $uniqid = uniqid(); - $table_mail_conf->data[8][0] = html_print_button( - __('Email test'), - 'email_test_dialog', - false, - "show_email_test('".$uniqid."');", - [ 'icon' => 'next' ], - true - ); - print_email_test_modal_window($uniqid); html_print_input_hidden('update_config', 1); html_print_table($table_mail_conf); - echo '
'; - html_print_div( - [ - 'class' => 'action-buttons w100p', - 'content' => html_print_submit_button( - __('Update'), - 'update_button', - false, - ['icon' => 'update'], - true - ), - ] + html_print_action_buttons( + html_print_submit_button( + __('Update'), + 'update_button', + false, + ['icon' => 'update'], + true + ).html_print_button( + __('Email test'), + 'email_test_dialog', + false, + 'show_email_test("'.$uniqid.'");', + [ + 'icon' => 'mail', + 'mode' => 'secondary', + ], + true + ) ); echo '
'; @@ -748,26 +845,27 @@ echo ''.__('Mail configuration').''; // Email config table. $table_mail_test = new stdClass(); $table_mail_test->width = '100%'; - $table_mail_test->class = 'databox filters'; + $table_mail_test->class = 'filter-table-adv'; $table_mail_test->data = []; - $table_mail_test->style[0] = 'font-weight: bold;'; - $table_mail_test->style[1] = 'font-weight: bold;display: flex;height: 54px;align-items: center;padding-left: 15px;'; - $table_mail_test->data[0][0] = __('Address'); - $table_mail_test->data[0][1] = html_print_input_text( - 'email_test_address', - '', - '', - 35, - 100, - true + $table_mail_test->data[0][] = html_print_label_input_block( + __('Address'), + html_print_input_text( + 'email_test_address', + '', + '', + 35, + 100, + true + ) ); - $table_mail_test->data[1][0] = '  Email could not be sent'; + $table_mail_test->data[1][] = '  Email could not be sent'; - $table_mail_test->data[1][1] = html_print_div( + // $table_mail_test->colspan[2][0] = 2; + $submitButton = html_print_div( [ - 'class' => 'action-buttons w100p', + 'class' => 'action-buttons-right-forced', 'content' => html_print_button( __('Send'), 'email_test', @@ -783,7 +881,7 @@ echo ''.__('Mail configuration').''; true ); - echo ''; + echo ''; } diff --git a/pandora_console/include/functions_config.php b/pandora_console/include/functions_config.php index 24d2de537d..057572a863 100644 --- a/pandora_console/include/functions_config.php +++ b/pandora_console/include/functions_config.php @@ -3218,7 +3218,7 @@ function config_process_config() // Try to update user table in order to refresh skin inmediatly. $is_user_updating = get_parameter('sec2', ''); - if ($is_user_updating == 'operation/users/user_edit') { + if ($is_user_updating === 'godmode/users/configure_user') { $id = get_parameter_get('id', $config['id_user']); // ID given as parameter. $user_info = get_user_info($id); @@ -3746,7 +3746,7 @@ function config_user_set_custom_config() } } - if (defined('METACONSOLE')) { + if (is_metaconsole() === true) { $config['metaconsole_access'] = $userinfo['metaconsole_access']; } } diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index ff5298844f..dadb98544e 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -10465,6 +10465,10 @@ button div.upd { -webkit-mask: url(../../images/validate.svg) no-repeat center / contain; } +button div.mail { + mask: url(../../images/mail@svg.svg) no-repeat center / contain; + -webkit-mask: url(../../images/mail@svg.svg) no-repeat center / contain; +} button div.sound { mask: url(../../images/sound_console@svg.svg) no-repeat center / contain; -webkit-mask: url(../../images/sound_console@svg.svg) no-repeat center / From 39f342a9826aa754bf3c360f794b50a92e4536d7 Mon Sep 17 00:00:00 2001 From: daniel Date: Wed, 15 Mar 2023 21:17:50 +0100 Subject: [PATCH 049/169] fixed styles --- pandora_console/include/styles/pandora.css | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index dadb98544e..56b03ebb1d 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -11260,6 +11260,15 @@ input.main_menu_icon[src$=".svg"] { .main_menu_icon.arrow_down { transform: rotate(270deg); } + +.main_menu_icon.arrow_left { + transform: rotate(0deg); +} + +.main_menu_icon.arrow_right { + transform: rotate(180deg); +} + .after_input_icon { width: 32px; margin-left: 10px; @@ -11521,6 +11530,12 @@ div[role="dialog"] { margin: 0 auto; } +.policy_background_state { + mask: url(../../images/policy@svg.svg) no-repeat center / contain; + -webkit-mask: url(../../images/policy@svg.svg) no-repeat center / contain; + margin: 0 auto; +} + .filter-list-adv .wizard li { display: grid; } From 2767d24f60b90e47d4542469ceda56a103e2a5a1 Mon Sep 17 00:00:00 2001 From: artica Date: Thu, 16 Mar 2023 01:00:18 +0100 Subject: [PATCH 050/169] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.rhel7.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 08a656c69f..092f0925c7 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.769-230315 +Version: 7.0NG.769-230316 Architecture: all Priority: optional Section: admin diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh index 5218fc92cc..d71a7b978b 100644 --- a/pandora_agents/unix/DEBIAN/make_deb_package.sh +++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.769-230315" +pandora_version="7.0NG.769-230316" echo "Test if you has the tools for to make the packages." whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index 07f62b6c54..539b2e24a6 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -1023,7 +1023,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.769'; -use constant AGENT_BUILD => '230315'; +use constant AGENT_BUILD => '230316'; # Agent log default file size maximum and instances use constant DEFAULT_MAX_LOG_SIZE => 600000; diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index e41ed8c290..468ec39656 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_agent_linux %define version 7.0NG.769 -%define release 230315 +%define release 230316 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index ca32dc789f..628a9064a0 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_agent_linux %define version 7.0NG.769 -%define release 230315 +%define release 230316 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer index 8107c738db..623e85f1cf 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.769" -PI_BUILD="230315" +PI_BUILD="230316" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 86c9cf1820..89d354f968 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{230315} +{230316} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 6120e75fe4..43ade1d81d 100644 --- a/pandora_agents/win32/pandora.cc +++ b/pandora_agents/win32/pandora.cc @@ -30,7 +30,7 @@ using namespace Pandora; using namespace Pandora_Strutils; #define PATH_SIZE _MAX_PATH+1 -#define PANDORA_VERSION ("7.0NG.769 Build 230315") +#define PANDORA_VERSION ("7.0NG.769 Build 230316") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index cc42f22709..dadfdba481 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.769(Build 230315))" + VALUE "ProductVersion", "(7.0NG.769(Build 230316))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index aa3dd4d6cc..f808e5048e 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.769-230315 +Version: 7.0NG.769-230316 Architecture: all Priority: optional Section: admin diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh index d51774a6b6..84d810cbb3 100644 --- a/pandora_console/DEBIAN/make_deb_package.sh +++ b/pandora_console/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.769-230315" +pandora_version="7.0NG.769-230316" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 3dc77d2a00..234144c53d 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -20,7 +20,7 @@ /** * Pandora build version and version */ -$build_version = 'PC230315'; +$build_version = 'PC230316'; $pandora_version = 'v7.0NG.769'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 35c0c798f3..41a4b57628 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -131,7 +131,7 @@
[ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index 36a3b52e2c..d6ea4c7bd0 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_server %define version 7.0NG.769 -%define release 230315 +%define release 230316 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 8b81d27a4f..684494bec3 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_server %define version 7.0NG.769 -%define release 230315 +%define release 230316 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 400c64cc20..fab6d8ed96 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.769" -PI_BUILD="230315" +PI_BUILD="230316" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 767b7ce8ea..7320c71764 100755 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -35,7 +35,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.769 Build 230315"; +my $version = "7.0NG.769 Build 230316"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index feae35ab6b..d2d9eb2a8f 100755 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -36,7 +36,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "7.0NG.769 Build 230315"; +my $version = "7.0NG.769 Build 230316"; # save program name for logging my $progname = basename($0); From 9ac04fba28edc2395fd010921b3fa68ab567f673 Mon Sep 17 00:00:00 2001 From: Jose Gonzalez Date: Thu, 16 Mar 2023 09:42:59 +0100 Subject: [PATCH 051/169] Netflow fix --- pandora_console/include/functions_netflow.php | 10 +++++----- pandora_console/operation/netflow/nf_live_view.php | 5 ++++- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/pandora_console/include/functions_netflow.php b/pandora_console/include/functions_netflow.php index e4ac71e690..3ee11508b0 100644 --- a/pandora_console/include/functions_netflow.php +++ b/pandora_console/include/functions_netflow.php @@ -202,7 +202,7 @@ function netflow_stat_table($data, $start_date, $end_date, $aggregate) $table = new stdClass(); $table->width = '100%'; $table->cellspacing = 0; - $table->class = 'databox'; + $table->class = 'info_table'; $table->data = []; $j = 0; $x = 0; @@ -270,7 +270,7 @@ function netflow_data_table($data, $start_date, $end_date, $aggregate, $pdf=fals $table->size = ['100%']; } - $table->class = 'databox w100p'; + $table->class = 'info_table w100p'; $table->cellspacing = 0; $table->data = []; @@ -339,7 +339,7 @@ function netflow_top_n_table(array $data, int $total_bytes) $values = []; $table = new stdClass(); - $table->class = 'w100p'; + $table->class = 'info_table w100p'; $table->cellspacing = 0; $table->data = []; @@ -405,7 +405,7 @@ function netflow_summary_table($data) $values = []; $table = new stdClass(); $table->cellspacing = 0; - $table->class = 'databox'; + $table->class = 'info_table'; $table->styleTable = 'width: 100%'; $table->data = []; @@ -1323,7 +1323,7 @@ function netflow_draw_item( } if ($output === 'HTML' || $output === 'PDF') { - $html = ''; + $html = '
'; $html .= ''; $html .= '
'; $html .= netflow_summary_table($data_summary); diff --git a/pandora_console/operation/netflow/nf_live_view.php b/pandora_console/operation/netflow/nf_live_view.php index f476c30bfe..e9c71e0570 100644 --- a/pandora_console/operation/netflow/nf_live_view.php +++ b/pandora_console/operation/netflow/nf_live_view.php @@ -622,10 +622,13 @@ if (empty($draw) === false) { 'selected_style_theme', $config['style'] ); + + $netflowContainerClass = ($chart_type === 'netflow_data' || $chart_type === 'netflow_summary' || $chart_type === 'netflow_top_N') ? '' : 'white_box'; + // Draw the netflow chart. html_print_div( [ - 'class' => 'white_box', + 'class' => $netflowContainerClass, 'content' => netflow_draw_item( $start_date, $end_date, From 3aba51d0ed57394a02578d7776738016b383e593 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Thu, 16 Mar 2023 10:42:39 +0100 Subject: [PATCH 052/169] Borders and colors PDFS --- pandora_console/include/functions_events.php | 140 ++++++++++++++++++ .../include/functions_reporting_html.php | 66 +++------ pandora_console/include/styles/pandoraPDF.css | 17 ++- 3 files changed, 172 insertions(+), 51 deletions(-) diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index fca78f233f..f8874476e3 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -2752,6 +2752,146 @@ function events_print_type_img( } +/** + * Prints the event type image. + * + * @param string $type Event type from SQL. + * @param boolean $return Whether to return or print. + * + * @return string HTML with img. + */ +function events_print_type_img_pdf( + $type, + $return=false +) { + $svg = ''; + + switch ($type) { + case 'alert_recovered': + $svg = ' + Dark / 20 / alert@svg + Created with Sketch. + + + + '; + break; + + case 'alert_manual_validation': + $svg = ' + Dark / 20 / validate@svg + Created with Sketch. + + + + + + + '; + break; + + case 'going_down_critical': + case 'going_up_critical': + $svg = ' + Dark / 20 / modules@svg + Created with Sketch. + + + + '; + break; + + case 'going_up_normal': + case 'going_down_normal': + $svg = ' + Dark / 20 / modules@svg + Created with Sketch. + + + + '; + break; + + case 'going_up_warning': + case 'going_down_warning': + $svg = ' + Dark / 20 / modules@svg + Created with Sketch. + + + + '; + break; + + case 'going_unknown': + $svg = ' + Dark / 20 / modules@svg + Created with Sketch. + + + + '; + break; + + case 'system': + $svg = ' + Dark / 20 / configuration@svg + Created with Sketch. + + + + '; + break; + + case 'new_agent': + $svg = ' + Dark / 20 / agents@svg + Created with Sketch. + + + + + + + '; + break; + + case 'configuration_change': + $svg = ' + + Dark / 20 / configuration@svg + Created with Sketch. + + + + '; + break; + + case 'unknown': + default: + $svg = ' + Dark / 20 / event@svg + Created with Sketch. + + + + + + + '; + break; + } + + $output = '
'.$svg.'
'; + + if ($return) { + return $output; + } + + echo $output; +} + + /** * Prints the event type description * diff --git a/pandora_console/include/functions_reporting_html.php b/pandora_console/include/functions_reporting_html.php index 013cb1c617..a43f852945 100644 --- a/pandora_console/include/functions_reporting_html.php +++ b/pandora_console/include/functions_reporting_html.php @@ -1075,24 +1075,6 @@ function reporting_html_event_report_group($table, $item, $pdf=0) } foreach ($item['data'] as $k => $event) { - // First pass along the class of this row. - if ($item['show_summary_group']) { - $table1->cellclass[$k][2] = get_priority_class($event['criticity']); - $table1->cellclass[$k][3] = get_priority_class($event['criticity']); - $table1->cellclass[$k][4] = get_priority_class($event['criticity']); - $table1->cellclass[$k][5] = get_priority_class($event['criticity']); - $table1->cellclass[$k][6] = get_priority_class($event['criticity']); - $table1->cellclass[$k][7] = get_priority_class($event['criticity']); - $table1->cellclass[$k][8] = get_priority_class($event['criticity']); - } else { - $table1->cellclass[$k][2] = get_priority_class($event['criticity']); - $table1->cellclass[$k][3] = get_priority_class($event['criticity']); - $table1->cellclass[$k][4] = get_priority_class($event['criticity']); - $table1->cellclass[$k][5] = get_priority_class($event['criticity']); - $table1->cellclass[$k][6] = get_priority_class($event['criticity']); - $table1->cellclass[$k][7] = get_priority_class($event['criticity']); - } - $data = []; // Colored box. @@ -1125,7 +1107,11 @@ function reporting_html_event_report_group($table, $item, $pdf=0) ] ); - $data[] = events_print_type_img($event['event_type'], true); + if ($pdf) { + $data[] = events_print_type_img_pdf($event['event_type'], true); + } else { + $data[] = events_print_type_img($event['event_type'], true); + } if ($item['show_summary_group']) { $data[] = $event['event_rep']; @@ -1343,19 +1329,6 @@ function reporting_html_event_report_module($table, $item, $pdf=0) if (is_array($item_data) || is_object($item_data)) { foreach ($item_data as $i => $event) { $data = []; - if ($show_summary_group) { - $table1->cellclass[$i][2] = get_priority_class($event['criticity']); - $table1->cellclass[$i][3] = get_priority_class($event['criticity']); - $table1->cellclass[$i][4] = get_priority_class($event['criticity']); - $table1->cellclass[$i][5] = get_priority_class($event['criticity']); - $table1->cellclass[$i][6] = get_priority_class($event['criticity']); - } else { - $table1->cellclass[$i][2] = get_priority_class($event['criticity']); - $table1->cellclass[$i][3] = get_priority_class($event['criticity']); - $table1->cellclass[$i][4] = get_priority_class($event['criticity']); - $table1->cellclass[$i][6] = get_priority_class($event['criticity']); - } - // Colored box. switch ($event['estado']) { case 0: @@ -1386,7 +1359,12 @@ function reporting_html_event_report_module($table, $item, $pdf=0) ] ); - $data[1] = events_print_type_img($event['event_type'], true); + if ($pdf) { + $data[1] = events_print_type_img_pdf($event['event_type'], true); + } else { + $data[1] = events_print_type_img($event['event_type'], true); + } + $data[2] = io_safe_output($event['evento']); $data[3] = get_priority_name($event['criticity']); if ($show_summary_group) { @@ -2671,21 +2649,6 @@ function reporting_html_event_report_agent($table, $item, $pdf=0) } foreach ($item['data'] as $i => $event) { - if ($item['show_summary_group']) { - $table1->cellclass[$i][2] = get_priority_class($event['criticity']); - $table1->cellclass[$i][3] = get_priority_class($event['criticity']); - $table1->cellclass[$i][4] = get_priority_class($event['criticity']); - $table1->cellclass[$i][5] = get_priority_class($event['criticity']); - $table1->cellclass[$i][6] = get_priority_class($event['criticity']); - $table1->cellclass[$i][7] = get_priority_class($event['criticity']); - } else { - $table1->cellclass[$i][2] = get_priority_class($event['criticity']); - $table1->cellclass[$i][3] = get_priority_class($event['criticity']); - $table1->cellclass[$i][4] = get_priority_class($event['criticity']); - $table1->cellclass[$i][5] = get_priority_class($event['criticity']); - $table1->cellclass[$i][6] = get_priority_class($event['criticity']); - } - $data = []; // Colored box. switch ($event['status']) { @@ -2716,7 +2679,11 @@ function reporting_html_event_report_agent($table, $item, $pdf=0) ] ); - $data[] = events_print_type_img($event['type'], true); + if ($pdf) { + $data[] = events_print_type_img_pdf($event['type'], true); + } else { + $data[] = events_print_type_img($event['type'], true); + } if ($item['show_summary_group']) { $data[] = $event['count']; @@ -3284,6 +3251,7 @@ function get_alert_table($data) { $table = new StdCLass(); $table->width = '99%'; + $table->class = 'info_table'; $table->data = []; $table->head = []; $table->headstyle = []; diff --git a/pandora_console/include/styles/pandoraPDF.css b/pandora_console/include/styles/pandoraPDF.css index 05e6ec9bb9..151ee4ea8f 100644 --- a/pandora_console/include/styles/pandoraPDF.css +++ b/pandora_console/include/styles/pandoraPDF.css @@ -216,6 +216,19 @@ table tbody td.cellBig { font-size: 18px; } -table.info_table > tbody > tr:nth-child(even) { - background-color: #e5e9ed !important; +table.info_table { + border-collapse: collapse; +} + +table.info_table thead tr th, +table.info_table thead tr td { + background-color: white !important; +} + +table.info_table thead tr th { + border-bottom: 1px solid #333333; +} + +table.info_table tbody tr td { + border-bottom: 1px solid #e5e5e5; } From 21c263c7c467ae016b5df7f5b3a69a9e0ceb5a05 Mon Sep 17 00:00:00 2001 From: Jose Gonzalez Date: Thu, 16 Mar 2023 11:58:35 +0100 Subject: [PATCH 053/169] Setup views --- .../godmode/setup/setup_general.php | 12 +- .../godmode/setup/setup_visuals.php | 190 +++++++++++------- 2 files changed, 118 insertions(+), 84 deletions(-) diff --git a/pandora_console/godmode/setup/setup_general.php b/pandora_console/godmode/setup/setup_general.php index 879eef9ab3..90c7403847 100644 --- a/pandora_console/godmode/setup/setup_general.php +++ b/pandora_console/godmode/setup/setup_general.php @@ -178,18 +178,18 @@ $select_in = html_print_select( $table_ichanges = ' - - - + + + - - + - +
'.__('Out of black list').''.__('In black list').''.__('Out of black list').''.__('In black list').'
'.$select_out.' + '.$select_out.' '.html_print_image('images/arrow@svg.svg', true, ['style' => 'rotate: 180deg;', 'id' => 'right_iblacklist', 'alt' => __('Push selected modules into blacklist'), 'title' => __('Push selected modules into blacklist'), 'class' => 'main_menu_icon invert_filter']).'

'.html_print_image('images/arrow@svg.svg', true, ['style' => 'rotate: 0', 'id' => 'left_iblacklist', 'alt' => __('Pop selected modules out of blacklist'), 'title' => __('Pop selected modules out of blacklist'), 'class' => 'main_menu_icon invert_filter']).'
'.$select_in.''.$select_in.'
'; diff --git a/pandora_console/godmode/setup/setup_visuals.php b/pandora_console/godmode/setup/setup_visuals.php index 2b5c553ca1..589593ba49 100755 --- a/pandora_console/godmode/setup/setup_visuals.php +++ b/pandora_console/godmode/setup/setup_visuals.php @@ -65,7 +65,7 @@ require_once 'include/functions_themes.php'; require_once 'include/functions_gis.php'; $row = 0; -echo '
'; +echo ''; html_print_input_hidden('update_config', 1); $performance_variables_control = (array) json_decode(io_safe_output($config['performance_variables_control'])); @@ -392,7 +392,7 @@ $table_styles->data[$row][] = html_print_label_input_block( $config['login_background'], '', __('Default'), - '', + 'background_pandora_console_keys.jpg', true, false, true, @@ -532,7 +532,7 @@ if (enterprise_installed() === true) { $config['custom_splash_login'], '', __('Default'), - 'default', + 'default.svg', true, false, true, @@ -648,7 +648,7 @@ if (enterprise_installed() === true) { $config['custom_network_center_logo'], '', __('Default'), - '', + 'bola_pandora_network_maps.png', true, false, true, @@ -1588,44 +1588,84 @@ $switchProminentTime .= html_print_radio_button( true ); -if ($config['csv_divider'] !== ';' && $config['csv_divider'] !== ',' && $config['csv_divider'] !== '|') { - $csvDividerInputs = html_print_input_text( - 'csv_divider', - $config['csv_divider'], - '', - 20, - 255, - true - ); - $csvDividerInputs .= ''.html_print_image( - 'images/logs@svg.svg', - true, - [ - 'id' => 'select', - 'class' => 'main_menu_icon invert_filter', - ] - ).''; -} else { - $csvDividerInputs = html_print_select( - $common_dividers, - 'csv_divider', - $config['csv_divider'], - '', - '', - '', - true, - false, - false - ); - $csvDividerInputs .= ''.html_print_image( - 'images/edit.svg', - true, - [ - 'id' => 'pencil', - 'class' => 'main_menu_icon invert_filter', - ] - ).''; -} +$csvDividerIconEdit = 'images/edit.svg'; +$csvDividerIconFile = 'images/logs@svg.svg'; + +$isCommonDivider = (in_array($config['csv_divider'], $common_dividers) === true); +$csvDividerIcon = ($isCommonDivider === false) ? $csvDividerIconEdit : $csvDividerIconFile; + +$csvDividerInputsSub = html_print_div( + [ + 'class' => ($isCommonDivider === false) ? 'invisible' : '', + 'id' => 'custom_divider_input', + 'content' => html_print_input_text( + 'csv_divider', + $config['csv_divider'], + '', + 20, + 255, + true, + false, + false, + '', + '', + '', + 'off', + false, + '', + '', + '', + ($isCommonDivider === false) + ), + ], + true +); + +$csvDividerInputsSub .= html_print_div( + [ + 'class' => ($isCommonDivider === true) ? 'invisible' : '', + 'id' => 'common_divider_input', + 'content' => html_print_select( + $common_dividers, + 'csv_divider', + $config['csv_divider'], + '', + '', + '', + true, + false, + false, + '', + ($isCommonDivider === true), + ), + ], + true +); + +$csvDividerInputs = html_print_div( + [ + 'class' => 'mrgn_right_10px', + 'content' => $csvDividerInputsSub, + ], + true +); + +$csvDividerInputs .= html_print_image( + $csvDividerIcon, + true, + [ + 'id' => 'select_csv_divider', + 'class' => 'invert_filter', + ] +); + +$csvDividerBlock = html_print_div( + [ + 'class' => 'flex-row-center', + 'content' => $csvDividerInputs, + ], + true +); $options_data_multiplier = []; $options_data_multiplier[0] = __('Use 1024 when module unit are bytes'); @@ -1980,7 +2020,7 @@ $row++; $table_other->data[$row][] = html_print_label_input_block( __('CSV divider'), - $csvDividerInputs + $csvDividerBlock ); $table_other->data[$row][] = html_print_label_input_block( @@ -2001,47 +2041,47 @@ $row++; * */ -echo '
'; +echo '
'; echo ''.__('Behaviour configuration').' '.ui_print_help_icon('behavoir_conf_tab', true).''; html_print_table($table_behaviour); echo '
'; -echo '
'; +echo '
'; echo ''.__('GIS configuration').' '.ui_print_help_icon('gis_conf_tab', true).''; html_print_table($table_gis); echo '
'; -echo '
'; +echo '
'; echo ''.__('Style configuration').' '.ui_print_help_icon('style_conf_tab', true).''; html_print_table($table_styles); echo '
'; -echo '
'; +echo '
'; echo ''.__('Charts configuration').' '.ui_print_help_icon('charts_conf_tab', true).''; html_print_table($table_chars); echo '
'; -echo '
'; +echo '
'; echo ''.__('Font and Text configuration').' '.ui_print_help_icon('front_and_text_conf_tab', true).''; html_print_table($table_font); echo '
'; -echo '
'; +echo '
'; echo ''.__('Visual consoles configuration').' '.ui_print_help_icon('visual_consoles_conf_tab', true).''; html_print_table($table_vc); echo '
'; -echo '
'; +echo '
'; echo ''.__('Reports configuration ').ui_print_help_icon('reports_configuration_tab', true).''; html_print_table($table_report); echo '
'; -echo '
'; +echo '
'; echo ''.__('Services configuration').' '.ui_print_help_icon('services_conf_tab', true).''; html_print_table($table_ser); echo '
'; -echo '
'; +echo '
'; echo ''.__('Other configuration').' '.ui_print_help_icon('other_conf_tab', true).''; html_print_table($table_other); echo '
'; @@ -2068,26 +2108,21 @@ ui_require_javascript_file('pandora'); ?> '; $table = new stdClass(); $table->width = '100%'; - $table->class = 'databox filters'; + $table->class = 'databox filter-table-adv'; - $table->style[0] = 'font-weight: bold'; + $table->style[0] = 'width: 50%'; $table->data = []; - $table->data[0][0] = __('Images'); - $table->data[0][1] .= html_print_div(['id' => 'inputs_images'], true); - $table->data[0][1] .= html_print_div( + $table->data[0][0] = html_print_label_input_block( + __('Language'), + html_print_select_from_sql( + 'SELECT id_language, name FROM tlanguage', + 'id_lang', + '', + '', + '', + '0', + true, + false, + true, + false, + 'width: 100%;' + ) + ); + $table->data[0][1] = html_print_label_input_block( + __('Profile'), + html_print_select($profiles, 'id_profile', '0', '', __('All'), 0, true) + ); + $table->data[1][0] = html_print_label_input_block( + __('Title'), + html_print_input_text('title', '', '', 35, 100, true) + ); + $table->data[1][1] = html_print_label_input_block( + __('Url'), + html_print_input_text('url', '', '', 35, 100, true) + ); + $table->data[2][0] = html_print_label_input_block( + __('Text'), + html_print_textarea('text', 5, 50, '', '', true), + ); + $table->data[2][1] = html_print_label_input_block( + __('Enable'), + html_print_checkbox_switch('enable', true, true, true) + ); + + $inputImages = html_print_div(['id' => 'inputs_images'], true); + $inputImages .= html_print_div( [ 'id' => 'notices_images', 'class' => 'invisible', @@ -696,41 +743,36 @@ class TipsWindow ], true ); - $table->data[0][1] .= html_print_button(__('Add image'), 'button_add_image', false, '', '', true); - $table->data[1][0] = __('Language'); - $table->data[1][1] = html_print_select_from_sql( - 'SELECT id_language, name FROM tlanguage', - 'id_lang', - '', - '', - '', - '0', + $inputImages .= html_print_div( + [ + 'id' => 'notices_images', + 'class' => 'invisible empty_input_images', + 'content' => '

'.__('Please select a image').'

', + ], true ); - $table->data[2][0] = __('Profile'); - $table->data[2][1] = html_print_select($profiles, 'id_profile', '0', '', __('All'), 0, true); - $table->data[3][0] = __('Title'); - $table->data[3][1] = html_print_input_text('title', '', '', 35, 100, true); - $table->data[4][0] = __('Text'); - $table->data[4][1] = html_print_textarea('text', 5, 50, '', '', true); - $table->data[5][0] = __('Url'); - $table->data[5][1] = html_print_input_text('url', '', '', 35, 100, true); - $table->data[6][0] = __('Enable'); - $table->data[6][1] = html_print_checkbox_switch('enable', true, true, true); + $inputImages .= html_print_button(__('Add image'), 'button_add_image', false, '', ['class' => 'button-add-image'], true); - echo ''; + $table->data[3][0] = html_print_label_input_block( + __('Images'), + $inputImages + ); + + echo ''; html_print_table($table); echo '
'; - html_print_submit_button( + + $actionButtons = html_print_submit_button( __('Send'), 'submit_button', false, [ 'class' => 'sub', 'icon' => 'update', - ] + ], + true ); - html_print_submit_button( + $actionButtons .= html_print_submit_button( __('Preview'), 'preview_button', false, @@ -738,8 +780,11 @@ class TipsWindow 'class' => 'sub preview', 'id' => 'prev_button', 'icon' => 'preview', - ] + ], + true ); + + html_print_action_buttons($actionButtons); echo '
'; echo ''; html_print_div(['id' => 'tips_window_modal_preview']); @@ -813,16 +858,52 @@ class TipsWindow '; $table = new stdClass(); $table->width = '100%'; - $table->class = 'databox filters'; + $table->class = 'databox filter-table-adv'; - $table->style[0] = 'font-weight: bold'; + $table->style[0] = 'width: 50%'; $table->data = []; - $table->data[0][0] = __('Images'); - $table->data[0][1] .= $outputImagesTip; - $table->data[0][1] .= html_print_div(['id' => 'inputs_images'], true); - $table->data[0][1] .= html_print_input_hidden('images_to_delete', '{}', true); - $table->data[0][1] .= html_print_div( + + $table->data[0][0] = html_print_label_input_block( + __('Language'), + html_print_select_from_sql( + 'SELECT id_language, name FROM tlanguage', + 'id_lang', + $tip['id_lang'], + '', + '', + '0', + true, + false, + true, + false, + 'width: 100%;' + ) + ); + $table->data[0][1] = html_print_label_input_block( + __('Profile'), + html_print_select($profiles, 'id_profile', $tip['id_profile'], '', __('All'), 0, true) + ); + $table->data[1][0] = html_print_label_input_block( + __('Title'), + html_print_input_text('title', $tip['title'], '', 35, 100, true) + ); + $table->data[1][1] = html_print_label_input_block( + __('Url'), + html_print_input_text('url', $tip['url'], '', 35, 100, true) + ); + $table->data[2][0] = html_print_label_input_block( + __('Text'), + html_print_textarea('text', 5, 50, $tip['text'], '', true), + ); + $table->data[2][1] = html_print_label_input_block( + __('Enable'), + html_print_checkbox_switch('enable', 1, ($tip['enable'] === '1') ? true : false, true) + ); + $inputImages = $outputImagesTip; + $inputImages .= html_print_div(['id' => 'inputs_images'], true); + $inputImages .= html_print_input_hidden('images_to_delete', '{}', true); + $inputImages .= html_print_div( [ 'id' => 'notices_images', 'class' => 'invisible', @@ -830,41 +911,35 @@ class TipsWindow ], true ); - $table->data[0][1] .= html_print_button(__('Add image'), 'button_add_image', false, '', '', true); - $table->data[1][0] = __('Language'); - $table->data[1][1] = html_print_select_from_sql( - 'SELECT id_language, name FROM tlanguage', - 'id_lang', - $tip['id_lang'], - '', - '', - '0', + $inputImages .= html_print_div( + [ + 'id' => 'notices_images', + 'class' => 'invisible empty_input_images', + 'content' => '

'.__('Please select a image').'

', + ], true ); - $table->data[2][0] = __('Profile'); - $table->data[2][1] = html_print_select($profiles, 'id_profile', $tip['id_profile'], '', __('All'), 0, true); - $table->data[3][0] = __('Title'); - $table->data[3][1] = html_print_input_text('title', $tip['title'], '', 35, 100, true); - $table->data[4][0] = __('Text'); - $table->data[4][1] = html_print_textarea('text', 5, 50, $tip['text'], '', true); - $table->data[5][0] = __('Url'); - $table->data[5][1] = html_print_input_text('url', $tip['url'], '', 35, 100, true); - $table->data[6][0] = __('Enable'); - $table->data[6][1] = html_print_checkbox_switch('enable', 1, ($tip['enable'] === '1') ? true : false, true); + $inputImages .= html_print_button(__('Add image'), 'button_add_image', false, '', ['class' => 'button-add-image'], true); + + $table->data[3][0] = html_print_label_input_block( + __('Images'), + $inputImages + ); echo '
'; html_print_table($table); echo '
'; - html_print_submit_button( + $actionButtons = html_print_submit_button( __('Send'), 'submit_button', false, [ 'class' => 'sub', 'icon' => 'update', - ] + ], + true ); - html_print_submit_button( + $actionButtons .= html_print_submit_button( __('Preview'), 'preview_button', false, @@ -872,9 +947,12 @@ class TipsWindow 'class' => 'sub preview', 'id' => 'prev_button', 'icon' => 'preview', - ] + ], + true ); + html_print_action_buttons($actionButtons); + echo '
'; echo '
'; html_print_div(['id' => 'tips_window_modal_preview']); diff --git a/pandora_console/include/javascript/tipsWindow.js b/pandora_console/include/javascript/tipsWindow.js index 1f63c2bbe2..e454488094 100644 --- a/pandora_console/include/javascript/tipsWindow.js +++ b/pandora_console/include/javascript/tipsWindow.js @@ -2,15 +2,16 @@ $(document).ready(function() { $("#button-button_add_image").on("click", function() { var numberImages = $("#inputs_images").children().length; + $(".input-file").each(function(index) { + $(this).attr("name", "file_" + index); + }); var div_image = document.createElement("div"); $(div_image).attr("class", "action_image"); $(div_image).append( - `` + `` ); $(div_image).append( - `` + `` ); $("#inputs_images").append(div_image); }); @@ -72,8 +73,8 @@ function activeCarousel() { $(".carousel .images").bxSlider({ controls: true }); } } -function removeInputImage(name) { - $(`input[name=${name}]`) +function removeInputImage(e) { + $(e) .parent() .remove(); if ($(".action_image").length === 0) { @@ -314,7 +315,7 @@ function previewTip() { //Images in client var totalInputsFiles = $("input[type=file]").length; - if (totalInputsFiles > 0) { + if (totalInputsFiles > 0 && validateImages()) { extradata["totalFiles64"] = totalInputsFiles; $("input[type=file]").each(function(index) { var reader = new FileReader(); @@ -352,3 +353,15 @@ function previewTip() { }); } } + +function validateImages() { + $(".empty_input_images").addClass("invisible"); + let validate = true; + $("input[type=file]").each(function() { + if (this.files.length == 0) { + $(".empty_input_images").removeClass("invisible"); + validate = false; + } + }); + return validate; +} diff --git a/pandora_console/include/styles/tips_window.css b/pandora_console/include/styles/tips_window.css index 6e8927aa4d..505799949b 100644 --- a/pandora_console/include/styles/tips_window.css +++ b/pandora_console/include/styles/tips_window.css @@ -172,17 +172,17 @@ span.count-round-tip.active { } span.enable { display: block; - width: 15px; - height: 15px; - border-radius: 15px; + width: 40px; + height: 20px; + border-radius: 4px; background-color: #82b92e; margin: 0 auto; } span.disable { display: block; - width: 15px; - height: 15px; - border-radius: 15px; + width: 40px; + height: 20px; + border-radius: 4px; background-color: #e63c52; margin: 0 auto; } @@ -212,3 +212,12 @@ span.disable { opacity: 0; pointer-events: none; } +#list_tips_windows .main_menu_icon { + padding: 0px; +} +#list_tips_windows .table_action_buttons { + text-align: center; +} +.button-add-image { + max-width: fit-content; +} diff --git a/pandora_console/views/dashboard/tipsWindow.php b/pandora_console/views/dashboard/tipsWindow.php index 859caf43a0..45b6680ff2 100644 --- a/pandora_console/views/dashboard/tipsWindow.php +++ b/pandora_console/views/dashboard/tipsWindow.php @@ -83,7 +83,7 @@ $output .= ''; -// TODO Delete this buttons and use html_print_button when merge new design + $output .= html_print_button( __('Maybe later'), '', From f8f65bf5a12c69681a6b585f8f0dfec98d0b60b2 Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Thu, 16 Mar 2023 17:26:48 +0100 Subject: [PATCH 070/169] fixed icon size --- pandora_console/include/javascript/tipsWindow.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/include/javascript/tipsWindow.js b/pandora_console/include/javascript/tipsWindow.js index e454488094..008991f313 100644 --- a/pandora_console/include/javascript/tipsWindow.js +++ b/pandora_console/include/javascript/tipsWindow.js @@ -11,7 +11,7 @@ $(document).ready(function() { `` ); $(div_image).append( - `` + `` ); $("#inputs_images").append(div_image); }); From bbb1855d8153b10c91b053be46399339565fdb3d Mon Sep 17 00:00:00 2001 From: Jose Gonzalez Date: Thu, 16 Mar 2023 17:38:51 +0100 Subject: [PATCH 071/169] External Tools --- .../godmode/setup/setup_external_tools.php | 2 +- .../include/class/ExternalTools.class.php | 293 ++++++++++-------- 2 files changed, 160 insertions(+), 135 deletions(-) diff --git a/pandora_console/godmode/setup/setup_external_tools.php b/pandora_console/godmode/setup/setup_external_tools.php index 30bdd6b188..1aa0fd7638 100644 --- a/pandora_console/godmode/setup/setup_external_tools.php +++ b/pandora_console/godmode/setup/setup_external_tools.php @@ -14,7 +14,7 @@ * |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______| * * ============================================================================ - * Copyright (c) 2005-2021 Artica Soluciones Tecnologicas + * Copyright (c) 2005-2023 Artica Soluciones Tecnologicas * Please see http://pandorafms.org for full contribution list * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/pandora_console/include/class/ExternalTools.class.php b/pandora_console/include/class/ExternalTools.class.php index 3bcdce51ab..eb751b2ff9 100644 --- a/pandora_console/include/class/ExternalTools.class.php +++ b/pandora_console/include/class/ExternalTools.class.php @@ -14,7 +14,7 @@ * |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______| * * ============================================================================ - * Copyright (c) 2005-2021 Artica Soluciones Tecnologicas + * Copyright (c) 2005-2023 Artica Soluciones Tecnologicas * Please see http://pandorafms.org for full contribution list * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -203,132 +203,161 @@ class ExternalTools extends HTML } } + html_print_div(['id' => 'layer_sound_alert']); + html_print_div(['id' => 'layer_sound_critical']); + html_print_div(['id' => 'layer_sound_warning']); // Make the table for show the form. $table = new stdClass(); $table->width = '100%'; + $table->class = 'filter-table-adv'; $table->id = 'commandsTable'; $table->data = []; - $table->data[$i][0] = __('Sound for Alert fired'); - $table->data[$i][1] = html_print_select( - $sounds, - 'sound_alert', - $config['sound_alert'], - 'replaySound(\'alert\');', - '', - '', - true - ); - $table->data[$i][1] .= html_print_anchor( - [ - 'href' => 'javascript:toggleButton(\'alert\')', - 'content' => html_print_image( - 'images/control_play_col.png', - true, - [ - 'id' => 'button_sound_warning', - 'style' => 'vertical-align: middle;', - 'width' => '16', - 'title' => __('Play sound'), - 'class' => 'invert_filter', - - ] - ), - ], - true - ); - $table->data[$i++][1] .= '
'; - - $table->data[$i][0] = __('Sound for Monitor critical'); - $table->data[$i][1] = html_print_select( - $sounds, - 'sound_critical', - $config['sound_critical'], - 'replaySound(\'critical\');', - '', - '', - true - ); - $table->data[$i][1] .= html_print_anchor( - [ - 'href' => 'javascript:toggleButton(\'critical\')', - 'content' => html_print_image( - 'images/control_play_col.png', - true, - [ - 'id' => 'button_sound_warning', - 'style' => 'vertical-align: middle;', - 'width' => '16', - 'title' => __('Play sound'), - 'class' => 'invert_filter', - - ] - ), - ], - true - ); - $table->data[$i++][1] .= '
'; - - $table->data[$i][0] = __('Sound for Monitor warning'); - $table->data[$i][1] = html_print_select( - $sounds, - 'sound_warning', - $config['sound_warning'], - 'replaySound(\'warning\');', - '', - '', - true - ); - $table->data[$i][1] .= html_print_anchor( - [ - 'href' => 'javascript:toggleButton(\'warning\')', - 'content' => html_print_image( - 'images/control_play_col.png', - true, - [ - 'id' => 'button_sound_warning', - 'style' => 'vertical-align: middle;', - 'width' => '16', - 'title' => __('Play sound'), - 'class' => 'invert_filter', - - ] - ), - ], - true - ); - $table->data[$i++][1] .= '
'; - - $table->data[$i][0] = __('Custom graphviz directory'); - $table->data[$i++][1] = html_print_input_text( - 'graphviz_bin_dir', - $config['graphviz_bin_dir'], - '', - 25, - 255, - true + $table->data[$i][] = html_print_label_input_block( + __('Sound for Alert fired'), + html_print_div( + [ + 'class' => '', + 'content' => html_print_select( + $sounds, + 'sound_alert', + $config['sound_alert'], + 'replaySound(\'alert\');', + '', + '', + true + ).html_print_anchor( + [ + 'href' => 'javascript:toggleButton(\'alert\')', + 'content' => html_print_image( + 'images/change-active.svg', + true, + [ + 'id' => 'button_sound_warning', + 'style' => 'vertical-align: middle; margin-left: 10px', + 'width' => '16', + 'title' => __('Play sound'), + 'class' => 'invert_filter', + ] + ), + ], + true + ), + ], + true + ), ); - $table->data[$i][0] = __('Traceroute path'); - $table->data[$i++][1] = html_print_input_text('traceroute_path', $this->pathTraceroute, '', 40, 255, true); + $table->data[$i++][] = html_print_label_input_block( + __('Sound for Monitor critical'), + html_print_div( + [ + 'class' => '', + 'content' => html_print_select( + $sounds, + 'sound_critical', + $config['sound_critical'], + 'replaySound(\'critical\');', + '', + '', + true + ).html_print_anchor( + [ + 'href' => 'javascript:toggleButton(\'critical\')', + 'content' => html_print_image( + 'images/change-active.svg', + true, + [ + 'id' => 'button_sound_warning', + 'style' => 'vertical-align: middle; margin-left: 10px', + 'width' => '16', + 'title' => __('Play sound'), + 'class' => 'invert_filter', + ] + ), + ], + true + ), + ], + true + ), + ); - $table->data[$i][0] = __('Ping path'); - $table->data[$i++][1] = html_print_input_text('ping_path', $this->pathPing, '', 40, 255, true); + $table->data[$i++][] = html_print_label_input_block( + __('Sound for Monitor warning'), + html_print_div( + [ + 'class' => '', + 'content' => html_print_select( + $sounds, + 'sound_warning', + $config['sound_warning'], + 'replaySound(\'warning\');', + '', + '', + true + ).html_print_anchor( + [ + 'href' => 'javascript:toggleButton(\'warning\')', + 'content' => html_print_image( + 'images/change-active.svg', + true, + [ + 'id' => 'button_sound_warning', + 'style' => 'vertical-align: middle; margin-left: 10px', + 'width' => '16', + 'title' => __('Play sound'), + 'class' => 'invert_filter', + ] + ), + ], + true + ), + ], + true + ), + ); - $table->data[$i][0] = __('Nmap path'); - $table->data[$i++][1] = html_print_input_text('nmap_path', $this->pathNmap, '', 40, 255, true); + $table->data[$i][] = html_print_label_input_block( + __('Custom graphviz directory'), + html_print_input_text( + 'graphviz_bin_dir', + $config['graphviz_bin_dir'], + '', + 25, + 255, + true + ) + ); - $table->data[$i][0] = __('Dig path'); - $table->data[$i++][1] = html_print_input_text('dig_path', $this->pathDig, '', 40, 255, true); + $table->data[$i++][] = html_print_label_input_block( + __('Snmpget path'), + html_print_input_text('snmpget_path', $this->pathSnmpget, '', 40, 255, true) + ); - $table->data[$i][0] = __('Snmpget path'); - $table->data[$i++][1] = html_print_input_text('snmpget_path', $this->pathSnmpget, '', 40, 255, true); + $table->data[$i][] = html_print_label_input_block( + __('Traceroute path'), + html_print_input_text('traceroute_path', $this->pathTraceroute, '', 40, 255, true) + ); + $table->data[$i++][] = html_print_label_input_block( + __('Ping path'), + html_print_input_text('ping_path', $this->pathPing, '', 40, 255, true) + ); + + $table->data[$i][] = html_print_label_input_block( + __('Nmap path'), + html_print_input_text('nmap_path', $this->pathNmap, '', 40, 255, true) + ); + $table->data[$i++][] = html_print_label_input_block( + __('Dig path'), + html_print_input_text('dig_path', $this->pathDig, '', 40, 255, true) + ); $table->data[$i][0] = html_print_div( [ 'class' => 'title_custom_commands bolder float-left', - 'content' => __('Custom commands'), + 'content' => '', ], true ); @@ -336,13 +365,13 @@ class ExternalTools extends HTML [ 'id' => 'add_button_custom_command', 'content' => html_print_image( - 'images/add.png', + 'images/plus@svg.svg', true, [ 'title' => __('Add new custom command'), 'onclick' => 'manageCommandLines(event)', 'id' => 'img_add_button_custom_command', - 'class' => 'invert_filter', + 'class' => 'main_menu_icon invert_filter', ] ), @@ -350,8 +379,8 @@ class ExternalTools extends HTML true ); - $table->data[$i][0] = __('Command'); - $table->data[$i++][1] = __('Parameters').ui_print_help_tip(__('Adding `_address_` macro will use agent\'s IP when perform the execution'), true); + $table->data[$i][0] = '
'; + $table->data[$i++][1] = '
'.ui_print_help_tip(__('Adding `_address_` macro will use agent\'s IP when perform the execution'), true, '', false, 'margin-top: 2px').'
'; $y = 1; $iRow = $i; @@ -378,30 +407,27 @@ class ExternalTools extends HTML } } - $form = '
'; + $form = ''; $form .= '
'; $form .= ''.__('Options').''; $form .= html_print_input_hidden('update_paths', 1, true); $form .= html_print_table($table, true); $form .= '
'; - $form .= html_print_div( - [ - 'id' => '', - 'class' => 'action-buttons', - 'style' => 'width: 100%', - 'content' => html_print_submit_button( - __('Update'), - 'update_button', - false, - [ 'icon' => 'update' ], - true - ), - ], - true - ); - $form .= '
'; + html_print_action_buttons( + html_print_submit_button( + __('Update'), + 'update_button', + false, + [ + 'icon' => 'update', + 'form' => 'form_setup', + ], + true + ) + ); + echo $form; } @@ -436,15 +462,14 @@ class ExternalTools extends HTML $output = html_print_div( [ 'id' => 'delete_button_custom_'.$index, - 'class' => '', 'content' => html_print_image( - 'images/delete.png', + 'images/delete.svg', true, [ 'title' => __('Delete this custom command'), 'onclick' => 'manageCommandLines(event)', 'id' => 'img_delete_button_custom_'.$index, - 'class' => 'invert_filter', + 'class' => 'main_menu_icon invert_filter', ] ), ], From 211f29c0f95391ce1f10c8c4007cf7aab50d5583 Mon Sep 17 00:00:00 2001 From: Jose Gonzalez Date: Thu, 16 Mar 2023 17:49:57 +0100 Subject: [PATCH 072/169] Websocket engine and quickshell --- pandora_console/extensions/quick_shell.php | 121 ++++++++++-------- .../godmode/setup/setup_websocket_engine.php | 84 ++++++------ 2 files changed, 109 insertions(+), 96 deletions(-) diff --git a/pandora_console/extensions/quick_shell.php b/pandora_console/extensions/quick_shell.php index 3f8170e3c2..21e41cb63a 100644 --- a/pandora_console/extensions/quick_shell.php +++ b/pandora_console/extensions/quick_shell.php @@ -441,84 +441,95 @@ function quickShellSettings() } // Form. Using old style. - echo '
'; + echo '
'; echo ''.__('Quickshell').''; $t = new StdClass(); $t->data = []; $t->width = '100%'; - $t->class = 'databox filters'; + $t->class = 'filter-table-adv'; $t->data = []; $t->style = []; - $t->style[0] = 'font-weight: bold; width: 40%;'; + $t->style[0] = 'width: 50%;'; - $t->data[0][0] = __('Gotty path'); - $t->data[0][1] = html_print_input_text( - 'gotty', - $config['gotty'], - '', - 30, - 100, - true + $t->data[0][] = html_print_label_input_block( + __('Gotty path'), + html_print_input_text( + 'gotty', + $config['gotty'], + '', + 30, + 100, + true + ) ); - $t->data[1][0] = __('Gotty host'); - $t->data[1][1] = html_print_input_text( - 'gotty_host', - $config['gotty_host'], - '', - 30, - 100, - true + $t->data[0][] = html_print_label_input_block( + __('Gotty host'), + html_print_input_text( + 'gotty_host', + $config['gotty_host'], + '', + 30, + 100, + true + ) ); - $t->data[2][0] = __('Gotty ssh port'); - $t->data[2][1] = html_print_input_text( - 'gotty_ssh_port', - $config['gotty_ssh_port'], - '', - 30, - 100, - true + $t->data[1][] = html_print_label_input_block( + __('Gotty ssh port'), + html_print_input_text( + 'gotty_ssh_port', + $config['gotty_ssh_port'], + '', + 30, + 100, + true + ) ); - $t->data[3][0] = __('Gotty telnet port'); - $t->data[3][1] = html_print_input_text( - 'gotty_telnet_port', - $config['gotty_telnet_port'], - '', - 30, - 100, - true + $t->data[1][] = html_print_label_input_block( + __('Gotty telnet port'), + html_print_input_text( + 'gotty_telnet_port', + $config['gotty_telnet_port'], + '', + 30, + 100, + true + ) ); - $hidden = new StdClass(); + $hidden = new stdClass(); $hidden->data = []; $hidden->width = '100%'; - $hidden->class = 'databox filters'; + $hidden->class = 'filter-table-adv'; $hidden->data = []; - $hidden->style[0] = 'font-weight: bold;width: 40%;'; + $hidden->style[0] = 'width: 50%;'; - $hidden->data[0][0] = __('Gotty user'); - $hidden->data[0][1] = html_print_input_text( - 'gotty_user', - $config['gotty_user'], - '', - 30, - 100, - true + $hidden->data[0][] = html_print_label_input_block( + __('Gotty user'), + html_print_input_text( + 'gotty_user', + $config['gotty_user'], + '', + 30, + 100, + true + ) ); - $hidden->data[1][0] = __('Gotty password'); - $hidden->data[1][1] = html_print_input_password( - 'gotty_pass', - io_output_password($config['gotty_pass']), - '', - 30, - 100, - true + $hidden->data[0][] = html_print_label_input_block( + __('Gotty password'), + html_print_input_password( + 'gotty_pass', + io_output_password($config['gotty_pass']), + '', + 30, + 100, + true + ) ); - $hidden->data[1][1] .= ui_print_reveal_password('gotty_pass', true); html_print_table($t); diff --git a/pandora_console/godmode/setup/setup_websocket_engine.php b/pandora_console/godmode/setup/setup_websocket_engine.php index f6e05c09de..e042ae7788 100644 --- a/pandora_console/godmode/setup/setup_websocket_engine.php +++ b/pandora_console/godmode/setup/setup_websocket_engine.php @@ -14,7 +14,7 @@ * |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______| * * ============================================================================ - * Copyright (c) 2005-2021 Artica Soluciones Tecnologicas + * Copyright (c) 2005-2023 Artica Soluciones Tecnologicas * Please see http://pandorafms.org for full contribution list * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -32,68 +32,70 @@ $url = ui_get_full_url( 'index.php?sec=gsetup&sec2=godmode/setup/setup&section=websocket_engine&pure='.$config['pure'] ); -echo '
'; +echo ''; -echo '
'; +echo '
'; echo ''.__('WebSocket settings').''; $t = new StdClass(); $t->data = []; $t->width = '100%'; -$t->class = 'databox filters'; +$t->class = 'databox filter-table-adv'; $t->data = []; -$t->style[0] = 'font-weight: bold'; -$t->data[0][0] = __('Bind address'); -$t->data[0][1] = html_print_input_text( - 'ws_bind_address', - $config['ws_bind_address'], - '', - 30, - 100, - true +$t->data[0][] = html_print_label_input_block( + __('Bind address'), + html_print_input_text( + 'ws_bind_address', + $config['ws_bind_address'], + '', + 30, + 100, + true + ) ); -$t->data[1][0] = __('Bind port'); -$t->data[1][2] = html_print_input_text( - 'ws_port', - $config['ws_port'], - '', - 30, - 100, - true +$t->data[0][] = html_print_label_input_block( + __('Bind port'), + html_print_input_text( + 'ws_port', + $config['ws_port'], + '', + 30, + 100, + true + ) ); -$t->data[2][0] = __('WebSocket proxy url'); -$t->data[2][2] = html_print_input_text( - 'ws_proxy_url', - $config['ws_proxy_url'], - '', - 30, - 100, - true +$t->data[1][] = html_print_label_input_block( + __('WebSocket proxy url'), + html_print_input_text( + 'ws_proxy_url', + $config['ws_proxy_url'], + '', + 30, + 100, + true + ) ); html_print_input_hidden('update_config', 1); html_print_table($t); - echo '
'; if (function_exists('quickShellSettings') === true) { quickShellSettings(); } -html_print_div( - [ - 'class' => 'action-buttons w100p', - 'content' => html_print_submit_button( - __('Update'), - 'update_button', - false, - [ 'icon' => 'update' ], - true - ), - ] +html_print_action_buttons( + html_print_submit_button( + __('Update'), + 'update_button', + false, + [ 'icon' => 'update' ], + true + ) ); + echo ''; From 3f09fd16a757e678756334ea92b480239b063a21 Mon Sep 17 00:00:00 2001 From: daniel Date: Thu, 16 Mar 2023 18:51:54 +0100 Subject: [PATCH 073/169] fixed styles --- pandora_console/godmode/setup/os.builder.php | 2 +- pandora_console/godmode/setup/os.list.php | 2 +- pandora_console/include/class/TipsWindow.class.php | 5 ++++- pandora_console/include/styles/pandora.css | 6 +++--- pandora_console/include/styles/tables.css | 9 ++++----- pandora_console/index.php | 2 -- pandora_console/operation/agentes/status_monitor.php | 2 +- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/pandora_console/godmode/setup/os.builder.php b/pandora_console/godmode/setup/os.builder.php index f54eea5834..4c79ae4c07 100644 --- a/pandora_console/godmode/setup/os.builder.php +++ b/pandora_console/godmode/setup/os.builder.php @@ -55,7 +55,7 @@ $iconData[] = html_print_select( $iconData[] = html_print_div( [ 'id' => 'icon_image', - 'class' => 'inverse_filter main_menu_icon', + 'class' => 'invert_filter main_menu_icon', 'style' => 'margin-left: 10px', 'content' => ui_print_os_icon($idOS, false, true), ], diff --git a/pandora_console/godmode/setup/os.list.php b/pandora_console/godmode/setup/os.list.php index 2ae5096893..96223e8d09 100644 --- a/pandora_console/godmode/setup/os.list.php +++ b/pandora_console/godmode/setup/os.list.php @@ -133,7 +133,7 @@ foreach ($osList as $os) { $data[] = html_print_anchor( [ 'href' => $hrefDelete, - 'class' => 'inverse_filter main_menu_icon', + 'class' => 'invert_filter main_menu_icon', 'content' => html_print_image('images/delete.svg', true), ], true diff --git a/pandora_console/include/class/TipsWindow.class.php b/pandora_console/include/class/TipsWindow.class.php index 34e9ce3e27..81b3c92017 100644 --- a/pandora_console/include/class/TipsWindow.class.php +++ b/pandora_console/include/class/TipsWindow.class.php @@ -121,7 +121,10 @@ class TipsWindow } ui_require_css_file('tips_window'); - ui_require_css_file('pandora_black'); + if ($config['style'] === 'pandora_black' && is_metaconsole() === false) { + ui_require_css_file('pandora_black'); + } + ui_require_css_file('jquery.bxslider'); ui_require_javascript_file('tipsWindow'); ui_require_javascript_file('jquery.bxslider.min'); diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index 862bc3d1ef..6516f34890 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -1423,7 +1423,7 @@ div#menu_container { div#menu { width: 45px; float: left; - z-index: 2; + z-index: 3; position: absolute; } @@ -1438,7 +1438,7 @@ div#head { min-width: 882px; background-color: #fff; color: #000; - z-index: 2; + z-index: 3; } .fixed_header { @@ -1795,7 +1795,7 @@ div.title_line { #menu_tab_frame_view_bc { position: sticky; top: 61px; - z-index: 1; + z-index: 2; display: flex; align-items: flex-end; justify-content: space-between; diff --git a/pandora_console/include/styles/tables.css b/pandora_console/include/styles/tables.css index b4b4719088..4b13a2cd60 100644 --- a/pandora_console/include/styles/tables.css +++ b/pandora_console/include/styles/tables.css @@ -236,7 +236,8 @@ .table_action_buttons > a, .table_action_buttons > img, .table_action_buttons > button, -.table_action_buttons > form { +.table_action_buttons > form, +.table_action_buttons > div { visibility: hidden; } .info_table > tbody > tr:hover { @@ -248,7 +249,8 @@ .info_table > tbody > tr:hover .table_action_buttons > a, .info_table > tbody > tr:hover .table_action_buttons > img, .info_table > tbody > tr:hover .table_action_buttons > button, -.info_table > tbody > tr:hover .table_action_buttons > form { +.info_table > tbody > tr:hover .table_action_buttons > form, +.info_table > tbody > tr:hover .table_action_buttons > div { visibility: visible; } @@ -460,9 +462,6 @@ a.pandora_pagination.current:hover { .table_action_buttons input[type="image"], .action_button_img { border-radius: 4px; - /*border: 1px solid #dcdcdc !important;*/ - padding: 1px !important; - /*box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.1);*/ } /* This class is for only one icon to be a button type. */ diff --git a/pandora_console/index.php b/pandora_console/index.php index 9ba2482a85..441bcc63fa 100755 --- a/pandora_console/index.php +++ b/pandora_console/index.php @@ -1522,8 +1522,6 @@ require 'include/php_to_js_values.php'; From ed7b46eb2284997f4cb0eeee27a968ca9324eba4 Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Tue, 21 Mar 2023 09:50:14 +0100 Subject: [PATCH 095/169] #9662 fixed url tactic in list groups --- pandora_console/operation/agentes/group_view.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pandora_console/operation/agentes/group_view.php b/pandora_console/operation/agentes/group_view.php index d14a3d3262..5e281e8b23 100644 --- a/pandora_console/operation/agentes/group_view.php +++ b/pandora_console/operation/agentes/group_view.php @@ -321,7 +321,11 @@ if (empty($result_groups) === false) { $link = "
"; } else { $deep = groups_get_group_deep($data['_id_']); - $link = ""; + if ($data['_id_'] === '0') { + $link = ""; + } else { + $link = ""; + } } $group_name = ''.ui_print_truncate_text($data['_name_'], 50).''; From 563e9e15c4ee58480ddc6333f345930fc59c9794 Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Tue, 21 Mar 2023 10:30:35 +0100 Subject: [PATCH 096/169] #9624 fixed conflics --- pandora_console/godmode/setup/setup.php | 2 +- .../godmode/setup/setup_netflow.php | 7 +- pandora_console/godmode/setup/setup_sflow.php | 88 ++++++++++++------- 3 files changed, 63 insertions(+), 34 deletions(-) diff --git a/pandora_console/godmode/setup/setup.php b/pandora_console/godmode/setup/setup.php index f9c238e725..7b157648cf 100644 --- a/pandora_console/godmode/setup/setup.php +++ b/pandora_console/godmode/setup/setup.php @@ -293,7 +293,7 @@ switch ($section) { case 'sflow': $buttons['sflow']['active'] = true; - $subpage = ' » '.__('Sflow'); + $subpage = __('Sflow'); $help_header = 'setup_flow_tab'; break; diff --git a/pandora_console/godmode/setup/setup_netflow.php b/pandora_console/godmode/setup/setup_netflow.php index 3711280fad..b9cd79492d 100644 --- a/pandora_console/godmode/setup/setup_netflow.php +++ b/pandora_console/godmode/setup/setup_netflow.php @@ -45,7 +45,6 @@ $table->data[0][] = html_print_label_input_block( __('Data storage path'), html_print_input_text('netflow_name_dir', $config['netflow_name_dir'], false, 50, 200, true) ); -$table->data[0][] = ''; $table->data[0][] = html_print_label_input_block( __('Daemon interval'), @@ -101,3 +100,9 @@ html_print_action_buttons( ) ); echo ''; +?> + \ No newline at end of file diff --git a/pandora_console/godmode/setup/setup_sflow.php b/pandora_console/godmode/setup/setup_sflow.php index 2610bc3361..454be16034 100644 --- a/pandora_console/godmode/setup/setup_sflow.php +++ b/pandora_console/godmode/setup/setup_sflow.php @@ -1,6 +1,6 @@ width = '100%'; -$table->border = 0; -$table->cellspacing = 3; -$table->cellpadding = 5; -$table->class = 'databox filters'; +$table->class = 'databox filter-table-adv'; $table->data = []; -$table->data[0][0] = ''.__('Data storage path').''; -$table->data[0][1] = html_print_input_text('sflow_name_dir', $config['sflow_name_dir'], false, 50, 200, true); -$table->data[0][1] .= ''; +$table->data[0][] = html_print_label_input_block( + __('Data storage path'), + html_print_input_text('sflow_name_dir', $config['sflow_name_dir'], false, 50, 200, true) +); +$table->data[0][] = html_print_label_input_block( + __('Daemon interval'), + html_print_input_text('sflow_interval', $config['sflow_interval'], false, 50, 200, true) +); -$table->data[1][0] = ''.__('Daemon interval').''; -$table->data[1][1] = html_print_input_text('sflow_interval', $config['sflow_interval'], false, 50, 200, true); +$table->data[1][] = html_print_label_input_block( + __('Daemon binary path'), + html_print_input_text('sflow_daemon', $config['sflow_daemon'], false, 50, 200, true) +); -$table->data[2][0] = ''.__('Daemon binary path').''; -$table->data[2][1] = html_print_input_text('sflow_daemon', $config['sflow_daemon'], false, 50, 200, true); +$table->data[1][] = html_print_label_input_block( + __('Nfdump binary path'), + html_print_input_text('sflow_nfdump', $config['sflow_nfdump'], false, 50, 200, true) +); -$table->data[3][0] = ''.__('Nfdump binary path').''; -$table->data[3][1] = html_print_input_text('sflow_nfdump', $config['sflow_nfdump'], false, 50, 200, true); +$table->data[2][] = html_print_label_input_block( + __('Nfexpire binary path'), + html_print_input_text('sflow_nfexpire', $config['sflow_nfexpire'], false, 50, 200, true) +); -$table->data[4][0] = ''.__('Nfexpire binary path').''; -$table->data[4][1] = html_print_input_text('sflow_nfexpire', $config['sflow_nfexpire'], false, 50, 200, true); +$table->data[2][] = html_print_label_input_block( + __('Maximum chart resolution'), + html_print_input_text('sflow_max_resolution', $config['sflow_max_resolution'], false, 50, 200, true) +); -$table->data[5][0] = ''.__('Maximum chart resolution').''; -$table->data[5][1] = html_print_input_text('sflow_max_resolution', $config['sflow_max_resolution'], false, 50, 200, true); +$table->data[3][] = html_print_label_input_block( + __('Disable custom live view filters'), + html_print_checkbox_switch('sflow_disable_custom_lvfilters', 1, $config['sflow_disable_custom_lvfilters'], true) +); -$table->data[6][0] = ''.__('Disable custom live view filters').''; -$table->data[6][1] = html_print_checkbox_switch('sflow_disable_custom_lvfilters', 1, $config['sflow_disable_custom_lvfilters'], true); -$table->data[7][0] = ''.__('Max. sflow lifetime').''; -$table->data[7][1] = html_print_input_text('sflow_max_lifetime', $config['sflow_max_lifetime'], false, 50, 200, true); +$table->data[3][] = html_print_label_input_block( + __('Sflow max lifetime'), + html_print_input_text('sflow_max_lifetime', $config['sflow_max_lifetime'], false, 50, 200, true) +); -$table->data[8][0] = ''.__('Name resolution for IP address').''; $onclick = "if (!confirm('".__('Warning').'. '.__('IP address resolution can take a lot of time')."')) return false;"; -$table->data[8][1] = html_print_checkbox_switch_extended('sflow_get_ip_hostname', 1, $config['sflow_get_ip_hostname'], false, $onclick, '', true); - -echo '
'; +$table->data[4][] = html_print_label_input_block( + __('Name resolution for IP address'), + html_print_checkbox_switch_extended('sflow_get_ip_hostname', 1, $config['sflow_get_ip_hostname'], false, $onclick, '', true) +); +echo ''; html_print_table($table); - -// Update button. -echo '
'; - html_print_input_hidden('update_config', 1); - html_print_submit_button(__('Update'), 'upd_button', false, 'class="sub upd"'); -echo '
'; +html_print_input_hidden('update_config', 1); +html_print_action_buttons( + html_print_submit_button( + __('Update'), + 'upd_button', + false, + ['icon' => 'update'], + true + ) +); +echo ''; +?> + \ No newline at end of file From 2db4ec6a2bf39580f1c19878f2239409f1887de9 Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Tue, 21 Mar 2023 10:53:23 +0100 Subject: [PATCH 097/169] fixed color in counter refresh --- pandora_console/include/styles/pandora.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index bf60df270e..ab14e334e7 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -2667,7 +2667,7 @@ div#header_autorefresh_counter { a.autorefresh_txt, #refrcounter { - color: #1c1c1c; + color: #ffffff; font-size: 8.5pt; } From 388c6c3a2fba21a469203c6aee56ef0b1c9909a9 Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Tue, 21 Mar 2023 11:07:44 +0100 Subject: [PATCH 098/169] fixed color in counter refresh in node --- pandora_console/include/styles/pandora.css | 2 +- pandora_console/include/styles/pandora_black.css | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index ab14e334e7..bf60df270e 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -2667,7 +2667,7 @@ div#header_autorefresh_counter { a.autorefresh_txt, #refrcounter { - color: #ffffff; + color: #1c1c1c; font-size: 8.5pt; } diff --git a/pandora_console/include/styles/pandora_black.css b/pandora_console/include/styles/pandora_black.css index bf44c58a4b..11583ceccc 100644 --- a/pandora_console/include/styles/pandora_black.css +++ b/pandora_console/include/styles/pandora_black.css @@ -1534,3 +1534,9 @@ pre code.hljs { background-color: #222222; color: #fff; } + +a.autorefresh_txt, +#refrcounter { + color: #ffffff; + font-size: 8.5pt; +} From 8e88e0a603c44787f0f31e77447e53f3675e4c59 Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Tue, 21 Mar 2023 11:45:38 +0100 Subject: [PATCH 099/169] #10747 fixed error 500 in agent --- pandora_console/operation/agentes/ver_agente.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/pandora_console/operation/agentes/ver_agente.php b/pandora_console/operation/agentes/ver_agente.php index b21cca1b32..cd821f3523 100644 --- a/pandora_console/operation/agentes/ver_agente.php +++ b/pandora_console/operation/agentes/ver_agente.php @@ -1481,12 +1481,13 @@ if ($policyTab === ENTERPRISE_NOT_HOOK) { // Omnishell. -$tasks = count_tasks_agent($id_agente); - -if ($tasks === true) { - $omnishellTab = enterprise_hook('omnishell_tab'); - if ($omnishellTab == -1) { - $omnishellTab = ''; +if (function_exists('count_tasks_agent')) { + $tasks = count_tasks_agent($id_agente); + if ($tasks === true) { + $omnishellTab = enterprise_hook('omnishell_tab'); + if ($omnishellTab == -1) { + $omnishellTab = ''; + } } } From 72778eb97c842bf030684c588ed5be0f2eeffaba Mon Sep 17 00:00:00 2001 From: Jonathan Date: Tue, 21 Mar 2023 12:07:10 +0100 Subject: [PATCH 100/169] Wizzard template fix --- pandora_console/include/functions_ui.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index f9d8cfdf99..ce111ea249 100755 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -283,6 +283,14 @@ function ui_print_message($message, $class='', $attributes='', $return=false, $t if (empty($message['force_class']) === false) { $force_class = $message['force_class']; } + + if (isset($message['autoclose']) === true) { + if ($message['autoclose'] === true) { + $autoclose = true; + } else { + $autoclose = false; + } + } } else { $text_message = $message; } From 9654ba4fa2c1281214db178025aa90ee17a91a9f Mon Sep 17 00:00:00 2001 From: Jonathan Date: Tue, 21 Mar 2023 12:35:25 +0100 Subject: [PATCH 101/169] Snmp browser select multiple post --- pandora_console/operation/snmpconsole/snmp_browser.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/operation/snmpconsole/snmp_browser.php b/pandora_console/operation/snmpconsole/snmp_browser.php index 28cb1ce4e4..12cba23676 100644 --- a/pandora_console/operation/snmpconsole/snmp_browser.php +++ b/pandora_console/operation/snmpconsole/snmp_browser.php @@ -203,7 +203,7 @@ function snmp_browser_show_add_module_massive(module_target = 'agent') { function modal_preaction() { // Select all in select box. - $("input[name='select_all_right']").click(); + $('#id_item2>option').prop('selected', true); // Load adding modules modal. waiting_modal(); From aec5e6b483f9876eea02ea68466702dedda53db5 Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Tue, 21 Mar 2023 12:52:24 +0100 Subject: [PATCH 102/169] #10737 fixed error 500 in service map --- pandora_console/operation/agentes/ver_agente.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/operation/agentes/ver_agente.php b/pandora_console/operation/agentes/ver_agente.php index b21cca1b32..0b2710111a 100644 --- a/pandora_console/operation/agentes/ver_agente.php +++ b/pandora_console/operation/agentes/ver_agente.php @@ -30,7 +30,7 @@ use PandoraFMS\Enterprise\Metaconsole\Node; global $config; -require_once 'include/functions_gis.php'; +require_once $config['homedir'].'/include/functions_gis.php'; require_once $config['homedir'].'/include/functions_agents.php'; require_once $config['homedir'].'/include/functions_groups.php'; require_once $config['homedir'].'/include/functions_modules.php'; From d2d8b43c87f5f2e9c43aed1f19f1099a827b714d Mon Sep 17 00:00:00 2001 From: Jonathan Date: Tue, 21 Mar 2023 13:09:32 +0100 Subject: [PATCH 103/169] Custom fields agent view change size svg --- pandora_console/operation/agentes/custom_fields.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandora_console/operation/agentes/custom_fields.php b/pandora_console/operation/agentes/custom_fields.php index f7a3487bbf..a47df306ef 100644 --- a/pandora_console/operation/agentes/custom_fields.php +++ b/pandora_console/operation/agentes/custom_fields.php @@ -76,9 +76,9 @@ if ($fields === false) { $data[0] = ''.$field['name'].''; if ($field['display_on_front']) { - $data[1] = html_print_image('images/validate.svg', true, ['class' => 'invert_filter']); + $data[1] = html_print_image('images/validate.svg', true, ['class' => 'invert_filter main_menu_icon']); } else { - $data[1] = html_print_image('images/delete.svg', true, ['class' => 'invert_filter']); + $data[1] = html_print_image('images/delete.svg', true, ['class' => 'invert_filter main_menu_icon']); } $custom_value = db_get_all_rows_sql( From e8744b5d1228bb6b89acf4a54089148c0f73fd2a Mon Sep 17 00:00:00 2001 From: Pablo Aragon Date: Tue, 21 Mar 2023 13:31:11 +0100 Subject: [PATCH 104/169] 10712-New login --- pandora_console/general/login_page.php | 69 +++++++---- .../godmode/setup/setup_visuals.php | 4 +- pandora_console/include/functions_config.php | 12 +- pandora_console/include/styles/login.css | 117 ++++++++++++++---- .../include/styles/pandora_black.css | 8 +- 5 files changed, 145 insertions(+), 65 deletions(-) diff --git a/pandora_console/general/login_page.php b/pandora_console/general/login_page.php index 4bcce4142b..37421f655d 100755 --- a/pandora_console/general/login_page.php +++ b/pandora_console/general/login_page.php @@ -27,6 +27,22 @@ require_once __DIR__.'/../include/functions_ui.php'; require_once __DIR__.'/../include/functions.php'; require_once __DIR__.'/../include/functions_html.php'; +echo ''; if ($config['visual_animation']) { // form#login_form, div.login_data { @@ -121,7 +137,13 @@ if (empty($config['background_opacity']) === false) { $opacity = 30; } -$login_body_style = 'style="'.$background_100.'background: linear-gradient(rgba(0,0,0,.'.$opacity.'), rgba(0,0,0,.'.$opacity.")), url('".$background_url."');\""; +if ($config['style'] === 'pandora') { + $opacity_color = '255, 255, 255, .'; +} else { + $opacity_color = '0, 0, 0, .'; +} + +$login_body_style = 'style="'.$background_100.'background: linear-gradient(rgba('.$opacity_color.$opacity.'), rgba('.$opacity_color.$opacity.")), url('".$background_url."');\""; // Get alternative custom in case of db fail. $custom_fields = [ @@ -148,7 +170,7 @@ foreach ($custom_fields as $field) { $docs_logo = ui_get_docs_logo(); $support_logo = ui_get_support_logo(); echo '
'; -echo '
'; +echo '
'; echo '
    '; @@ -298,7 +320,7 @@ switch ($login_screen) { ); echo '
'; } else { - echo ''; echo '
'; diff --git a/pandora_console/godmode/setup/setup_visuals.php b/pandora_console/godmode/setup/setup_visuals.php index 29df51b114..e6dd22eb2d 100755 --- a/pandora_console/godmode/setup/setup_visuals.php +++ b/pandora_console/godmode/setup/setup_visuals.php @@ -431,7 +431,7 @@ $table_styles->data[$row][] = html_print_label_input_block( $config['login_background'], '', __('Default'), - 'background_pandora_console_keys.jpg', + '', true, false, true, @@ -571,7 +571,7 @@ if (enterprise_installed() === true) { $config['custom_splash_login'], '', __('Default'), - 'default.svg', + 'default', true, false, true, diff --git a/pandora_console/include/functions_config.php b/pandora_console/include/functions_config.php index 057572a863..47a6cce1de 100644 --- a/pandora_console/include/functions_config.php +++ b/pandora_console/include/functions_config.php @@ -2561,7 +2561,7 @@ function config_process_config() } if (!isset($config['custom_splash_login'])) { - config_update_value('custom_splash_login', 'default'); + config_update_value('custom_splash_login', 'none.png'); } if (!isset($config['custom_docs_logo'])) { @@ -2597,11 +2597,11 @@ function config_process_config() } if (!isset($config['custom_title1_login'])) { - config_update_value('custom_title1_login', __('PANDORA FMS')); + config_update_value('custom_title1_login', __('ONE TOOL TO MONITOR THEM ALL')); } if (!isset($config['custom_title2_login'])) { - config_update_value('custom_title2_login', __('ONE TOOL TO MONITOR THEM ALL')); + config_update_value('custom_title2_login', ''); } if (!isset($config['custom_docs_url'])) { @@ -2649,11 +2649,11 @@ function config_process_config() } if (!isset($config['meta_custom_title1_login'])) { - config_update_value('meta_custom_title1_login', __('PANDORA FMS NEXT GENERATION')); + config_update_value('meta_custom_title1_login', __('ONE TOOL TO MONITOR THEM ALL')); } if (!isset($config['meta_custom_title2_login'])) { - config_update_value('meta_custom_title2_login', __('METACONSOLE')); + config_update_value('meta_custom_title2_login', __('COMMAND CENTER')); } if (!isset($config['vc_favourite_view'])) { @@ -3482,7 +3482,7 @@ function config_process_config() } if (!isset($config['random_background'])) { - config_update_value('random_background', ''); + config_update_value('random_background', 1); } if (!isset($config['meta_random_background'])) { diff --git a/pandora_console/include/styles/login.css b/pandora_console/include/styles/login.css index d0a47c53b4..fdba06937a 100644 --- a/pandora_console/include/styles/login.css +++ b/pandora_console/include/styles/login.css @@ -26,7 +26,7 @@ div#error_buttons a { /* Set rules to fill background */ /* background-color:#000 !important; */ min-height: 100%; - min-width: 1200px; + /* min-width: 1200px; */ width: 100%; position: absolute; background-repeat: repeat; @@ -68,7 +68,7 @@ div#login_f { #ver_num { width: 100%; - color: #878787; + color: #dddddd; text-align: center; font-weight: 350; font-size: 10px; @@ -105,7 +105,7 @@ div#list_icon_docs_support ul { div#list_icon_docs_support ul li { display: inline-block; - color: white; + color: #fff; vertical-align: middle; margin-right: 5px; font-size: 10pt; @@ -140,7 +140,9 @@ li#li_margin_support { } div.login_page { - background-color: rgba(0, 0, 0, 0.8); + /* background-color: rgba(0, 0, 0, 0.8); */ + /* background-color: rgba(255, 255, 255, 0.2); */ + background-color: var(--login-background-color); width: 40vw; min-width: 300px; height: 100vh; @@ -164,7 +166,8 @@ div.login_logo_icon { div.login_logo_icon img { margin: 0 auto; - width: 300px; + max-height: 185px; + max-width: 300px; } div.login_double_auth_code, @@ -174,7 +177,6 @@ div.login_pass { width: 300px; height: 40px; margin-bottom: 20px; - box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1); border-radius: 3px; } @@ -195,8 +197,8 @@ div.login_pass input { box-sizing: border-box; } -div.login_pass > input#pass { - background-image: url(../../images/enable.svg); +input { + background-color: transparent; } input:not([type="image"]):focus, @@ -335,23 +337,26 @@ div.login_data { div.text_banner_login { width: 100%; - color: white; + color: #fff; margin-top: 40px; + display: flex; + flex-direction: column; } span.span1 { - font-size: 38px; - letter-spacing: -0.38px; + display: block; + max-width: 700px; + font-size: 80pt; + line-height: 80pt; font-family: "lato-bolder"; - color: white; - line-height: 49pt; + color: #fff; } span.span2 { display: block; - width: 700px; - font-size: 80pt; - line-height: 80pt; + max-width: 700px; + font-size: 30pt; + line-height: 30pt; font-family: "lato-bolder"; color: #fff; } @@ -377,16 +382,18 @@ div.img_banner_login img { @media all and (max-width: 1266px) { span.span1 { - font-size: 38px; - letter-spacing: -0.38px; - font-weight: bold; - color: white; - line-height: 49pt; - } - span.span2 { - width: 550px; + display: block; + max-width: 500px; font-size: 60pt; line-height: 60pt; + font-weight: bold; + color: #fff; + } + span.span2 { + display: block; + max-width: 500px; + font-size: 20pt; + line-height: 20pt; font-family: "lato-bolder"; color: #fff; } @@ -682,7 +689,7 @@ div.button_message_alert_form input { bottom: 10px; /* background: transparent; */ background: #f1f1f1; - border: solid white 10px; + border: solid #fff 10px; border-radius: 50%; } @@ -715,6 +722,7 @@ div.login_pass input:-webkit-autofill:active { background-size: 27px; background-position: right 10px bottom 50%; box-sizing: border-box; + -webkit-box-shadow: 0 0 0 30px rgba(0, 0, 0, 0) inset !important; } div.login_pass input:-webkit-autofill, @@ -796,3 +804,62 @@ button.submitButton > span { font-size: 9pt; top: -10px; } + +div.login_nick.white-theme input, +div.login_pass.white-theme input { + background-color: #f6f7fb; + border: 0px; + color: #343434; + border-radius: 3px; + width: 100%; + height: 40px; + font-size: 10pt; + padding: 0px 0px 0px 8%; + background-repeat: no-repeat; + background-size: 27px; + background-position: right 10px bottom 50%; + box-sizing: border-box; +} + +div.white-theme > .placeholder { + color: #8b8b8b; + left: 24px; +} + +div.white-theme > .input:not(:placeholder-shown) ~ .placeholder { + top: 15px; + color: transparent; +} + +div.white-theme > .input:focus ~ .placeholder { + top: 15px; + color: transparent; +} + +div.white-theme input:-webkit-autofill, +div.white-theme input:-webkit-autofill:hover, +div.white-theme input:-webkit-autofill:focus, +div.white-theme input:-webkit-autofill:active { + -webkit-text-fill-color: #343434; + border: 0px; + border-bottom: 0px; + border-radius: 3px; + width: 100%; + height: 40px; + font-size: 12pt; + background-repeat: no-repeat; + background-size: 27px; + background-position: right 10px bottom 50%; + box-sizing: border-box; + -webkit-box-shadow: 0 0 0 30px rgba(0, 0, 0, 0) inset !important; +} + +div.white-theme input:not([type="image"]):focus, +textarea:focus, +select:focus { + border: 2px solid #8a96a6; +} + +div#header_login.white-theme { + background-color: rgba(0, 0, 0, 0.5); +} diff --git a/pandora_console/include/styles/pandora_black.css b/pandora_console/include/styles/pandora_black.css index bf44c58a4b..37166788a4 100644 --- a/pandora_console/include/styles/pandora_black.css +++ b/pandora_console/include/styles/pandora_black.css @@ -31,7 +31,7 @@ ul.subsubmenu li, input.search_input, .filters input, input#text-id_parent.ac_input, -input, +input:not(div.login_pass > input):not(div.login_nick > input), textarea, select, .edit_user_comments #textarea_comments, @@ -466,12 +466,6 @@ ul.tree-group filter: invert(100%); } -/* login.css */ -div.login_nick input, -div.login_pass input { - background-color: #111 !important; -} - /* user edit */ .edit_user_info_right input { border-bottom: 1px solid #5f5f5f; From 64fc4bcd4625a2c54baf3839aa15e08b5e45a735 Mon Sep 17 00:00:00 2001 From: daniel Date: Tue, 21 Mar 2023 14:06:28 +0100 Subject: [PATCH 105/169] fixed styles --- .../godmode/alerts/alert_list.list.php | 6 +- .../include/class/SatelliteAgent.class.php | 4 +- .../include/functions_reporting_html.php | 57 ++++--------------- pandora_console/include/functions_ui.php | 48 ++++++---------- pandora_console/include/styles/pandora.css | 13 +++++ .../update_manager_client/views/register.php | 4 +- 6 files changed, 47 insertions(+), 85 deletions(-) diff --git a/pandora_console/godmode/alerts/alert_list.list.php b/pandora_console/godmode/alerts/alert_list.list.php index a2b0f242da..c11e3631a7 100644 --- a/pandora_console/godmode/alerts/alert_list.list.php +++ b/pandora_console/godmode/alerts/alert_list.list.php @@ -679,7 +679,7 @@ foreach ($simple_alerts as $alert) { true, [ 'id' => 'template-details-'.$alert['id_alert_template'], - 'class' => 'img_help action_button_img invert_filter', + 'class' => 'img_help main_menu_icon invert_filter', ] ); $data[2] .= '
'; @@ -757,7 +757,7 @@ foreach ($simple_alerts as $alert) { true, [ 'title' => __('Delete action'), - 'class' => 'action_button_img invert_filter', + 'class' => 'main_menu_icon invert_filter', ] ); $data[3] .= html_print_input_hidden('delete_action', 1, true); @@ -772,7 +772,7 @@ foreach ($simple_alerts as $alert) { true, [ 'title' => __('Update action'), - 'class' => 'action_button_img invert_filter', + 'class' => 'main_menu_icon invert_filter', 'onclick' => 'show_display_update_action(\''.$action['id'].'\',\''.$alert['id'].'\',\''.$alert['id_agent_module'].'\',\''.$action_id.'\',\''.$alert['id_agent_module'].'\')', ] ); diff --git a/pandora_console/include/class/SatelliteAgent.class.php b/pandora_console/include/class/SatelliteAgent.class.php index 18a4806bb5..07acb23c6c 100644 --- a/pandora_console/include/class/SatelliteAgent.class.php +++ b/pandora_console/include/class/SatelliteAgent.class.php @@ -393,7 +393,7 @@ class SatelliteAgent extends HTML true, [ 'border' => '0', - 'class' => 'action_button_img mrgn_lft_05em invert_filter', + 'class' => 'main_menu_icon mrgn_lft_05em invert_filter', 'onclick' => 'disable_agent(\''.$tmp->address.'\',\''.strip_tags($tmp->name).'\',\''.(int) $disable.'\',\''.$id_agente.'\')', ] ); @@ -405,7 +405,7 @@ class SatelliteAgent extends HTML true, [ 'border' => '0', - 'class' => 'action_button_img mrgn_lft_05em invert_filter', + 'class' => 'main_menu_icon mrgn_lft_05em invert_filter', 'onclick' => 'delete_agent(\''.$tmp->address.'\',\''.strip_tags($tmp->name).'\',\''.(int) $delete.'\',\''.$id_agente.'\')', ] ); diff --git a/pandora_console/include/functions_reporting_html.php b/pandora_console/include/functions_reporting_html.php index a43f852945..8b5cb3d917 100644 --- a/pandora_console/include/functions_reporting_html.php +++ b/pandora_console/include/functions_reporting_html.php @@ -6002,6 +6002,7 @@ function reporting_get_last_activity() $table = new stdClass(); $table->width = '100%'; $table->data = []; + $table->class = 'info_table'; $table->size = []; $table->size[2] = '150px'; $table->size[3] = '130px'; @@ -6015,37 +6016,13 @@ function reporting_get_last_activity() $table->head[5] = __('Comments'); $table->title = ''.__('Last activity in %s console', get_product_name()).''; - switch ($config['dbtype']) { - case 'mysql': - $sql = sprintf( - 'SELECT id_usuario,accion,fecha,ip_origen,descripcion,utimestamp - FROM tsesion - WHERE (`utimestamp` > UNIX_TIMESTAMP(NOW()) - '.SECONDS_1WEEK.") - AND `id_usuario` = '%s' ORDER BY `utimestamp` DESC LIMIT 5", - $config['id_user'] - ); - break; - - case 'postgresql': - $sql = sprintf( - "SELECT \"id_usuario\", accion, fecha, \"ip_origen\", descripcion, utimestamp - FROM tsesion - WHERE (\"utimestamp\" > ceil(date_part('epoch', CURRENT_TIMESTAMP)) - ".SECONDS_1WEEK.") - AND \"id_usuario\" = '%s' ORDER BY \"utimestamp\" DESC LIMIT 5", - $config['id_user'] - ); - break; - - case 'oracle': - $sql = sprintf( - "SELECT id_usuario, accion, fecha, ip_origen, descripcion, utimestamp - FROM tsesion - WHERE ((utimestamp > ceil((sysdate - to_date('19700101000000','YYYYMMDDHH24MISS')) * (".SECONDS_1DAY.')) - '.SECONDS_1WEEK.") - AND id_usuario = '%s') AND rownum <= 10 ORDER BY utimestamp DESC", - $config['id_user'] - ); - break; - } + $sql = sprintf( + 'SELECT id_usuario,accion,fecha,ip_origen,descripcion,utimestamp + FROM tsesion + WHERE (`utimestamp` > UNIX_TIMESTAMP(NOW()) - '.SECONDS_1WEEK.") + AND `id_usuario` = '%s' ORDER BY `utimestamp` DESC LIMIT 5", + $config['id_user'] + ); $sessions = db_get_all_rows_sql($sql); @@ -6056,18 +6033,8 @@ function reporting_get_last_activity() foreach ($sessions as $session) { $data = []; - switch ($config['dbtype']) { - case 'mysql': - case 'oracle': - $session_id_usuario = $session['id_usuario']; - $session_ip_origen = $session['ip_origen']; - break; - - case 'postgresql': - $session_id_usuario = $session['id_usuario']; - $session_ip_origen = $session['ip_origen']; - break; - } + $session_id_usuario = $session['id_usuario']; + $session_ip_origen = $session['ip_origen']; $data[0] = ''.$session_id_usuario.''; $data[1] = ui_print_session_action_icon($session['accion'], true); @@ -6079,10 +6046,6 @@ function reporting_get_last_activity() array_push($table->data, $data); } - if (defined('METACONSOLE')) { - $table->class = 'databox_tactical'; - } - return html_print_table($table, true); } diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index ce111ea249..8f62bc4ce0 100755 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -5020,30 +5020,22 @@ function ui_print_standard_header( $applyBreadcrumbs, true ); - // Create the header. - // if (is_metaconsole() === true) { - // $output = ui_meta_print_header( - // $title, - // false, - // $options - // ); - // } else { - $output = ui_print_page_header( - $title, - $icon, - true, - $help, - $godmode, - $options, - false, - '', - GENERIC_SIZE_TEXT, - '', - $headerInformation->printHeader(true), - false, - $fav_menu_config - ); - // } + + $output = ui_print_page_header( + $title, + $icon, + true, + $help, + $godmode, + $options, + false, + '', + GENERIC_SIZE_TEXT, + '', + $headerInformation->printHeader(true), + false, + $fav_menu_config + ); if ($return !== true) { echo $output; } else { @@ -7327,9 +7319,6 @@ function ui_get_inventory_module_add_form( $table->rowstyle = []; $table->rowstyle['hidden-custom-field-row'] = 'display: none;'; $table->rowstyle['custom-fields-button'] = 'display: none;'; - // $table->colspan = []; - // $table->colspan['custom-fields-row'] = []; - // $table->colspan['custom-fields-row']['custom-fields-column'] = 2; $table->data = []; $row = []; @@ -7593,13 +7582,10 @@ function ui_get_inventory_module_add_form( ob_start(); - echo '
'; + echo ''; echo html_print_table($table); - echo '
'; echo $form_buttons; - echo '
'; echo '
'; - ?> "; } diff --git a/pandora_console/include/javascript/jquery.pandora.js b/pandora_console/include/javascript/jquery.pandora.js index 31e31c9183..5b39a98631 100644 --- a/pandora_console/include/javascript/jquery.pandora.js +++ b/pandora_console/include/javascript/jquery.pandora.js @@ -226,8 +226,8 @@ $(document).ready(function() { resizable: false, draggable: true, modal: true, - height: 450, - width: 620, + height: 410, + width: 390, overlay: { opacity: 0.5, background: "black" diff --git a/pandora_console/include/styles/login.css b/pandora_console/include/styles/login.css index fdba06937a..c08d4a0908 100644 --- a/pandora_console/include/styles/login.css +++ b/pandora_console/include/styles/login.css @@ -455,7 +455,7 @@ div.form_message_alert { width: 90%; clear: both; padding-top: 20px; - padding-left: 40px; + padding-left: 20px; } div.form_message_alert ul li { @@ -765,7 +765,7 @@ button.submitButton:hover { background-position: 0 !important; } -button.submitButton > span { +button.submitButton:not(.mini) > span { font-family: Arial, Helvetica, sans-serif; font-size: 15pt; } diff --git a/pandora_console/include/styles/tree.css b/pandora_console/include/styles/tree.css index 88f342dec3..4c552e5e6d 100644 --- a/pandora_console/include/styles/tree.css +++ b/pandora_console/include/styles/tree.css @@ -407,7 +407,3 @@ div#tree-controller-recipient { .tree-node .node-icon.node-status { border: 0; } - -.max-graph-tree-view { - width: calc(100% - 100px); -} From e82de5d6aa55b43b50ba433867537ea44e4b4a0d Mon Sep 17 00:00:00 2001 From: daniel Date: Wed, 22 Mar 2023 14:08:03 +0100 Subject: [PATCH 121/169] fixed styles --- pandora_console/extensions/files_repo.php | 23 +- .../agentes/module_manager_editor_common.php | 288 +++++++------- pandora_console/godmode/setup/os.list.php | 3 +- pandora_console/include/functions_html.php | 4 +- .../include/functions_integriaims.php | 2 +- pandora_console/include/styles/tables.css | 10 + .../operation/agentes/estado_agente.php | 1 - .../configure_integriaims_incident.php | 350 ++++++++++-------- .../dashboard_detail_integriaims_incident.php | 38 +- .../incidents/incident_statistics.php | 21 +- .../incidents/list_integriaims_incidents.php | 238 ++++++++---- 11 files changed, 585 insertions(+), 393 deletions(-) diff --git a/pandora_console/extensions/files_repo.php b/pandora_console/extensions/files_repo.php index 656c3377c7..26e21750bb 100644 --- a/pandora_console/extensions/files_repo.php +++ b/pandora_console/extensions/files_repo.php @@ -240,7 +240,28 @@ function pandora_files_repo_operation() } // Header. - ui_print_page_header(__('Files repository'), 'images/extensions.png', false, '', false, $onheader); + ui_print_standard_header( + __('Files repository'), + 'images/extensions.png', + false, + '', + false, + $onheader, + [ + [ + 'link' => '', + 'label' => __('Admin tools'), + ], + [ + 'link' => '', + 'label' => __('Extension manager'), + ], + [ + 'link' => '', + 'label' => __('Files repository'), + ], + ] + ); $full_extensions_dir = $config['homedir'].'/'.EXTENSIONS_DIR.'/'; include_once $full_extensions_dir.'files_repo/functions_files_repo.php'; diff --git a/pandora_console/godmode/agentes/module_manager_editor_common.php b/pandora_console/godmode/agentes/module_manager_editor_common.php index 0231245274..b30f3d4c2c 100644 --- a/pandora_console/godmode/agentes/module_manager_editor_common.php +++ b/pandora_console/godmode/agentes/module_manager_editor_common.php @@ -445,79 +445,75 @@ $tableBasicThresholds->rowclass['caption_warning_threshold'] = 'field_half_width $tableBasicThresholds->rowclass['warning_threshold'] = 'field_half_width'; $tableBasicThresholds->data['caption_warning_threshold'][0] .= __('Warning threshold').' '; -if ((isset($stringTypeModule) === false || $stringTypeModule === false)) { - $tableBasicThresholds->data['caption_warning_threshold'][0] .= '('.__('Min / Max').')'; - $tableBasicThresholds->data['warning_threshold'][0] .= html_print_input_text( - 'min_warning', - $min_warning, - '', - 10, - 255, - true, - $disabledBecauseInPolicy || $edit === true, - false, - '', - $classdisabledBecauseInPolicy - ); - $tableBasicThresholds->data['warning_threshold'][1] .= html_print_input_text( - 'max_warning', - $max_warning, - '', - 10, - 255, - true, - $disabledBecauseInPolicy || $edit === true, - false, - '', - $classdisabledBecauseInPolicy - ).''; +$tableBasicThresholds->data['caption_warning_threshold'][0] .= '('.__('Min / Max').')'; +$tableBasicThresholds->data['warning_threshold'][0] .= html_print_input_text( + 'min_warning', + $min_warning, + '', + 10, + 255, + true, + $disabledBecauseInPolicy || $edit === true, + false, + '', + $classdisabledBecauseInPolicy +); +$tableBasicThresholds->data['warning_threshold'][1] .= html_print_input_text( + 'max_warning', + $max_warning, + '', + 10, + 255, + true, + $disabledBecauseInPolicy || $edit === true, + false, + '', + $classdisabledBecauseInPolicy +).''; - $tableBasicThresholds->data['switch_warning_threshold'][0] .= html_print_switch_radio_button( - [ - html_print_radio_button_extended('warning_thresholds_checks', 'normal_warning', __('Normal'), ($percentage_warning && $warning_inverse) === false, false, '', '', true, false, '', 'radius-normal_warning'), - html_print_radio_button_extended('warning_thresholds_checks', 'warning_inverse', __('Inverse interval'), $warning_inverse, $disabledBecauseInPolicy, '', '', true, false, '', 'radius-warning_inverse'), - html_print_radio_button_extended('warning_thresholds_checks', 'percentage_warning', __('Percentage'), $percentage_warning, $disabledBecauseInPolicy, '', '', true, false, '', 'radius-percentage_warning'), - ], - [ 'class' => 'margin-top-10' ], - true - ); -} +$tableBasicThresholds->data['switch_warning_threshold'][0] .= html_print_switch_radio_button( + [ + html_print_radio_button_extended('warning_thresholds_checks', 'normal_warning', __('Normal'), ($percentage_warning && $warning_inverse) === false, false, '', '', true, false, '', 'radius-normal_warning'), + html_print_radio_button_extended('warning_thresholds_checks', 'warning_inverse', __('Inverse interval'), $warning_inverse, $disabledBecauseInPolicy, '', '', true, false, '', 'radius-warning_inverse'), + html_print_radio_button_extended('warning_thresholds_checks', 'percentage_warning', __('Percentage'), $percentage_warning, $disabledBecauseInPolicy, '', '', true, false, '', 'radius-percentage_warning'), + ], + [ 'class' => 'margin-top-10' ], + true +); -if (isset($stringTypeModule) === true && $stringTypeModule === true) { - $basicThresholdsIntervalWarning = []; - $basicThresholdsIntervalWarning[] = ''.__('Inverse interval').''; - $basicThresholdsIntervalWarning[] = html_print_checkbox_switch( - 'warning_inverse_string', - 1, - $warning_inverse, - true, - $disabledBecauseInPolicy - ); +$basicThresholdsIntervalWarning = []; +$basicThresholdsIntervalWarning[] = ''.__('Inverse interval').''; +$basicThresholdsIntervalWarning[] = html_print_checkbox_switch( + 'warning_inverse_string', + 1, + $warning_inverse, + true, + $disabledBecauseInPolicy +); - $tableBasicThresholds->rowclass['caption_switch_warning_inverse_string'] = 'field_half_width'; - $tableBasicThresholds->data['caption_switch_warning_inverse_string'][0] = html_print_div( - [ - 'class' => 'margin-top-10', - 'style' => 'display: flex; flex-direction: row-reverse; align-items: center;', - 'content' => implode('', $basicThresholdsIntervalWarning), - ], - true - ); +$tableBasicThresholds->rowclass['caption_switch_warning_inverse_string'] = 'field_half_width'; +$tableBasicThresholds->data['caption_switch_warning_inverse_string'][0] = html_print_div( + [ + 'class' => 'margin-top-10', + 'style' => 'display: flex; flex-direction: row-reverse; align-items: center;', + 'content' => implode('', $basicThresholdsIntervalWarning), + ], + true +); - $tableBasicThresholds->data['caption_warning_threshold'][0] .= '('.__('Str.').')'; - $tableBasicThresholds->data['warning_threshold'][0] .= html_print_input_text( - 'str_warning', - str_replace('"', '', $str_warning), - '', - 10, - 1024, - true, - $disabledBecauseInPolicy || $edit === false, - false, - '', - $classdisabledBecauseInPolicy - ).''; -} +$tableBasicThresholds->data['caption_warning_threshold'][0] .= '('.__('Str.').')'; +$tableBasicThresholds->data['warning_threshold'][0] .= html_print_input_text( + 'str_warning', + str_replace('"', '', $str_warning), + '', + 10, + 1024, + true, + $disabledBecauseInPolicy || $edit === false, + false, + '', + $classdisabledBecauseInPolicy +).''; $tableBasicThresholds->data['switch_warning_threshold'][0] .= html_print_div( @@ -532,87 +528,84 @@ $tableBasicThresholds->data['switch_warning_threshold'][0] .= html_print_div( $tableBasicThresholds->rowclass['caption_critical_threshold'] = 'field_half_width pdd_t_10px'; $tableBasicThresholds->rowclass['critical_threshold'] = 'field_half_width'; $tableBasicThresholds->data['caption_critical_threshold'][0] .= __('Critical threshold').' '; -if ((isset($stringTypeModule) === false || $stringTypeModule === false)) { - $tableBasicThresholds->data['caption_critical_threshold'][0] .= '('.__('Min / Max').')'; - $tableBasicThresholds->data['critical_threshold'][0] .= html_print_input_text( - 'min_critical', - $min_critical, - '', - 10, - 255, - true, - $disabledBecauseInPolicy || $edit === false, - false, - '', - $classdisabledBecauseInPolicy - ); - $tableBasicThresholds->data['critical_threshold'][1] .= html_print_input_text( - 'max_critical', - $max_critical, - '', - 10, - 255, - true, - $disabledBecauseInPolicy || $edit === false, - false, - '', - $classdisabledBecauseInPolicy - ).''; +$tableBasicThresholds->data['caption_critical_threshold'][0] .= '('.__('Min / Max').')'; +$tableBasicThresholds->data['critical_threshold'][0] .= html_print_input_text( + 'min_critical', + $min_critical, + '', + 10, + 255, + true, + $disabledBecauseInPolicy || $edit === false, + false, + '', + $classdisabledBecauseInPolicy +); +$tableBasicThresholds->data['critical_threshold'][1] .= html_print_input_text( + 'max_critical', + $max_critical, + '', + 10, + 255, + true, + $disabledBecauseInPolicy || $edit === false, + false, + '', + $classdisabledBecauseInPolicy +).''; - $tableBasicThresholds->data['switch_critical_threshold'][0] .= html_print_switch_radio_button( - [ - html_print_radio_button_extended('critical_thresholds_checks', 'normal_critical', __('Normal'), ($percentage_critical && $critical_inverse) === false, false, '', '', true, false, '', 'radius-normal_critical'), - html_print_radio_button_extended('critical_thresholds_checks', 'critical_inverse', __('Inverse interval'), $critical_inverse, $disabledBecauseInPolicy, '', '', true, false, '', 'radius-critical_inverse'), - html_print_radio_button_extended('critical_thresholds_checks', 'percentage_critical', __('Percentage'), $percentage_critical, $disabledBecauseInPolicy, '', '', true, false, '', 'radius-percentage_critical'), - ], - [ 'class' => 'margin-top-10' ], - true - ); -} +$tableBasicThresholds->data['switch_critical_threshold'][0] .= html_print_switch_radio_button( + [ + html_print_radio_button_extended('critical_thresholds_checks', 'normal_critical', __('Normal'), ($percentage_critical && $critical_inverse) === false, false, '', '', true, false, '', 'radius-normal_critical'), + html_print_radio_button_extended('critical_thresholds_checks', 'critical_inverse', __('Inverse interval'), $critical_inverse, $disabledBecauseInPolicy, '', '', true, false, '', 'radius-critical_inverse'), + html_print_radio_button_extended('critical_thresholds_checks', 'percentage_critical', __('Percentage'), $percentage_critical, $disabledBecauseInPolicy, '', '', true, false, '', 'radius-percentage_critical'), + ], + [ 'class' => 'margin-top-10' ], + true +); -if (isset($stringTypeModule) === true && $stringTypeModule === true) { - $basicThresholdsIntervalCritical = []; - $basicThresholdsIntervalCritical[] = ''.__('Inverse interval').''; - $basicThresholdsIntervalCritical[] = html_print_checkbox_switch( - 'critical_inverse_string', - 1, - $critical_inverse, - true, - $disabledBecauseInPolicy - ); - $tableBasicThresholds->rowclass['caption_switch_critical_inverse_string'] = 'field_half_width'; - $tableBasicThresholds->data['caption_switch_critical_inverse_string'][0] = html_print_div( - [ - 'class' => 'margin-top-10', - 'style' => 'display: flex; flex-direction: row-reverse; align-items: center;', - 'content' => implode('', $basicThresholdsIntervalCritical), - ], - true - ); +$basicThresholdsIntervalCritical = []; +$basicThresholdsIntervalCritical[] = ''.__('Inverse interval').''; +$basicThresholdsIntervalCritical[] = html_print_checkbox_switch( + 'critical_inverse_string', + 1, + $critical_inverse, + true, + $disabledBecauseInPolicy +); - $tableBasicThresholds->data['switch_critical_threshold'][0] .= html_print_div( - [ - 'id' => 'percentage_critical', - 'content' => $divPercentageContent, - ], - true - ); +$tableBasicThresholds->rowclass['caption_switch_critical_inverse_string'] = 'field_half_width'; +$tableBasicThresholds->data['caption_switch_critical_inverse_string'][0] = html_print_div( + [ + 'class' => 'margin-top-10', + 'style' => 'display: flex; flex-direction: row-reverse; align-items: center;', + 'content' => implode('', $basicThresholdsIntervalCritical), + ], + true +); - $tableBasicThresholds->data['caption_critical_threshold'][0] .= '('.__('Str.').')'; - $tableBasicThresholds->data['critical_threshold'][0] .= html_print_input_text( - 'str_critical', - str_replace('"', '', $str_critical), - '', - 10, - 1024, - true, - $disabledBecauseInPolicy, - false, - '', - $classdisabledBecauseInPolicy - ); -} +$tableBasicThresholds->data['switch_critical_threshold'][0] .= html_print_div( + [ + 'id' => 'percentage_critical', + 'content' => $divPercentageContent, + ], + true +); + +$tableBasicThresholds->data['caption_critical_threshold'][0] .= '('.__('Str.').')'; +$tableBasicThresholds->data['critical_threshold'][0] .= html_print_input_text( + 'str_critical', + str_replace('"', '', $str_critical), + '', + 10, + 1024, + true, + $disabledBecauseInPolicy, + false, + '', + $classdisabledBecauseInPolicy +); $table_simple->rowstyle['thresholds_table'] = 'margin-top: 15px;height: 340px;width: 100%'; $table_simple->cellclass['thresholds_table'][0] = 'table_section half_section_left'; @@ -1623,6 +1616,11 @@ ui_require_jquery_file('json'); /* ; + var idModuleType = ''; + if (idModuleType != '') { + setModuleType(idModuleType); + } + $("#right").click (function () { jQuery.each($("select[name='id_tag_available[]'] option:selected"), function (key, value) { tag_name = $(value).html(); diff --git a/pandora_console/godmode/setup/os.list.php b/pandora_console/godmode/setup/os.list.php index 96223e8d09..7ec091e04b 100644 --- a/pandora_console/godmode/setup/os.list.php +++ b/pandora_console/godmode/setup/os.list.php @@ -69,7 +69,6 @@ if ($is_management_allowed === true) { $table->head[4] = ''; } -$table->align[1] = 'center'; if ($is_management_allowed === true) { $table->align[4] = 'center'; } @@ -100,7 +99,7 @@ $table->data = []; foreach ($osList as $os) { $data = []; $data[] = $os['id_os']; - $data[] = html_print_div(['class' => 'invert_filter main_menu_icon', 'content' => ui_print_os_icon($os['id_os'], false, true)], true); + $data[] = ui_print_os_icon($os['id_os'], false, true); if ($is_management_allowed === true) { if (is_metaconsole() === true) { $osNameUrl = 'index.php?sec=advanced&sec2=advanced/component_management&tab=os_manage&action=edit&tab2=builder&id_os='.$os['id_os']; diff --git a/pandora_console/include/functions_html.php b/pandora_console/include/functions_html.php index 13fab04eab..c475a44207 100644 --- a/pandora_console/include/functions_html.php +++ b/pandora_console/include/functions_html.php @@ -6097,6 +6097,8 @@ function html_print_autocomplete_users_from_integria( $attrs['class'] = $class; } + ui_print_help_tip(__('Type at least two characters to search the user.'), false); + html_print_input_text_extended( $name, $default, @@ -6110,8 +6112,6 @@ function html_print_autocomplete_users_from_integria( ); html_print_input_hidden($name.'_hidden', $id_agent_module); - ui_print_help_tip(__('Type at least two characters to search the user.'), false); - $javascript_ajax_page = ui_get_full_url('ajax.php', false, false, false, false); ?> \ No newline at end of file diff --git a/pandora_console/operation/incidents/incident_statistics.php b/pandora_console/operation/incidents/incident_statistics.php index 333c0206db..c2e428f188 100755 --- a/pandora_console/operation/incidents/incident_statistics.php +++ b/pandora_console/operation/incidents/incident_statistics.php @@ -18,13 +18,31 @@ require_once $config['homedir'].'/include/functions_graph.php'; check_login(); -ui_print_page_header(__('Incidents').' » '.__('Statistics'), 'images/book_edit.png', false, '', false, ''); +ui_print_standard_header( + __('Statistics'), + 'images/book_edit.png', + false, + '', + false, + [], + [ + [ + 'link' => '', + 'label' => __('Issues'), + ], + [ + 'link' => '', + 'label' => __('Statistics'), + ], + ] +); if (!$config['integria_enabled']) { ui_print_error_message(__('In order to access ticket management system, integration with Integria IMS must be enabled and properly configured')); exit; } +echo '
'; echo '

'.__('Incidents by status').'

'; echo graph_incidents_status(); @@ -39,3 +57,4 @@ echo '

'.__('Incidents by user').'

'; echo graphic_incident_user(); echo '
'; +echo '
'; diff --git a/pandora_console/operation/incidents/list_integriaims_incidents.php b/pandora_console/operation/incidents/list_integriaims_incidents.php index ce68e941fb..f28c7a271d 100644 --- a/pandora_console/operation/incidents/list_integriaims_incidents.php +++ b/pandora_console/operation/incidents/list_integriaims_incidents.php @@ -20,13 +20,23 @@ check_login(); // Header tabs. $onheader = integriaims_tabs('list_tab'); -ui_print_page_header( +ui_print_standard_header( __('Integria IMS Tickets'), '', false, 'integria_tab', false, - $onheader + $onheader, + [ + [ + 'link' => '', + 'label' => __('Issues'), + ], + [ + 'link' => '', + 'label' => __('Integria IMS Tickets'), + ], + ] ); // Check if Integria integration enabled. @@ -308,68 +318,100 @@ $resolution_incident = integriaims_get_details('resolution'); // TABLE FILTERS. $table = new StdClass(); $table->width = '100%'; -$table->class = 'databox filters'; -$table->styleTable = 'margin-bottom:0px'; -$table->cellpadding = '0'; -$table->cellspacing = '0'; +$table->size = []; +$table->size[0] = '33%'; +$table->size[1] = '33%'; +$table->size[2] = '33%'; +$table->class = 'filter-table-adv'; + $table->data = []; - -$table->data[0][0] = __('Text filter'); -$table->data[0][1] = html_print_input_text('incident_text', $incident_text, '', 30, 100, true); - -$table->data[0][2] = __('Status'); -$table->data[0][3] = html_print_select( - $status_incident, - 'incident_status', - $incident_status, - '', - __('All'), - 0, - true +$table->data[0][0] = html_print_label_input_block( + __('Text filter'), + html_print_input_text('incident_text', $incident_text, '', 30, 100, true) ); -$table->data[0][4] = __('Group'); -$table->data[0][5] = html_print_select( - $group_incident, - 'incident_group', - $incident_group, - '', - __('All'), - 1, - true +$table->data[0][1] = html_print_label_input_block( + __('Status'), + html_print_select( + $status_incident, + 'incident_status', + $incident_status, + '', + __('All'), + 0, + true + ) ); -$table->data[1][0] = __('Owner'); -$table->data[1][1] = html_print_autocomplete_users_from_integria('incident_owner', $incident_owner, true); - -$table->data[1][2] = __('Creator'); -$table->data[1][3] = html_print_autocomplete_users_from_integria('incident_creator', $incident_creator, true); - -$table->data[1][4] = __('Priority'); -$table->data[1][5] = html_print_select( - $priority_incident, - 'incident_priority', - $incident_priority, - '', - __('All'), - -1, - true +$table->data[0][2] = html_print_label_input_block( + __('Group'), + html_print_select( + $group_incident, + 'incident_group', + $incident_group, + '', + __('All'), + 1, + true + ) ); -$table->data[2][0] = __('Resolution'); -$table->data[2][1] = html_print_select( - $resolution_incident, - 'incident_resolution', - $incident_resolution, - '', - __('All'), - '', - true +$table->data[1][0] = html_print_label_input_block( + __('Owner'), + html_print_autocomplete_users_from_integria( + 'incident_owner', + $incident_owner, + true, + '30', + false, + false, + 'w100p' + ), + ['div_class' => 'inline'] ); -// TODO: field type date. -$table->data[2][2] = __('Date'); -$table->data[2][3] = html_print_input_text_extended( +$table->data[1][1] = html_print_label_input_block( + __('Creator'), + html_print_autocomplete_users_from_integria( + 'incident_creator', + $incident_creator, + true, + '30', + false, + false, + 'w100p' + ), + ['div_class' => 'inline'] +); + +$table->data[1][2] = html_print_label_input_block( + __('Priority'), + html_print_select( + $priority_incident, + 'incident_priority', + $incident_priority, + '', + __('All'), + -1, + true + ) +); + +$table->data[2][0] = html_print_label_input_block( + __('Resolution'), + html_print_select( + $resolution_incident, + 'incident_resolution', + $incident_resolution, + '', + __('All'), + '', + true + ) +); + +$input_date = '
'; +$input_date .= html_print_input_text_extended( 'created_from', $created_from, 'created_from', @@ -381,7 +423,7 @@ $table->data[2][3] = html_print_input_text_extended( 'placeholder="'.__('Created from').'"', true ); -$table->data[2][3] .= html_print_input_text_extended( +$input_date .= html_print_input_text_extended( 'created_to', $created_to, 'created_to', @@ -393,11 +435,12 @@ $table->data[2][3] .= html_print_input_text_extended( 'class="mrgn_lft_5px" placeholder="'.__('Created to').'"', true ); +$input_date .= '
'; -// TODO: image of Integria IMS. -$table->data[2][4] = ''; -$table->data[2][5] = ''; - +$table->data[2][2] = html_print_label_input_block( + __('Date'), + $input_date +); // Send filters to get_tickets_integriaims(). $tickets_filters = [ @@ -423,20 +466,48 @@ $url = ui_get_full_url( // ---- PRINT TABLE FILTERS ---- $integria_incidents_form = '
'; $integria_incidents_form .= html_print_table($table, true); -$integria_incidents_form .= '
'; -$integria_incidents_form .= '
'.html_print_button( +$buttons = html_print_submit_button( + __('Filter'), + 'filter_button', + false, + [ + 'icon' => 'search', + 'mode' => 'mini secondary', + ], + true +); +$buttons .= html_print_button( __('Export to CSV'), 'csv_export', false, "blockResubmit($(this)); location.href='operation/incidents/integriaims_export_csv.php?tickets_filters=$decode_csv'", - 'class="sub next"', + [ + 'icon' => 'cog', + 'mode' => 'mini secondary', + ], true -).'
'; -$integria_incidents_form .= '
'.html_print_submit_button(__('Filter'), 'filter_button', false, 'class="sub filter"', true).'
'; -$integria_incidents_form .= '
'; +); + +$integria_incidents_form .= html_print_div( + [ + 'class' => 'action-buttons', + 'content' => $buttons, + ], + true +); $integria_incidents_form .= '
'; -ui_toggle($integria_incidents_form, __('Filter'), '', '', false); +ui_toggle( + $integria_incidents_form, + ''.__('Filters').'', + 'filter_form', + '', + true, + false, + '', + 'white-box-content', + 'box-flat white_table_graph fixed_filter_bar' +); /* * Order api call 'get_incidents'. @@ -552,33 +623,52 @@ foreach ($incidents_paginated as $key => $value) { $table->data[$i][8] .= ''; - $table->data[$i][8] .= html_print_image('images/delete.svg', true, ['title' => __('Delete'), 'class' => 'invert_filter']); + $table->data[$i][8] .= html_print_image('images/delete.svg', true, ['title' => __('Delete'), 'class' => 'invert_filter main_menu_icon']); $table->data[$i][8] .= ''; $i++; } +$tablePagination = ''; // Show table incidents. -ui_pagination(count($array_get_incidents), $url, $offset); if (empty($table->data) === true) { ui_print_info_message(['no_close' => true, 'message' => __('No tickets to show').'.' ]); } else { html_print_table($table); - ui_pagination(count($array_get_incidents), $url, $offset, 0, false, 'offset', true, 'pagination-bottom'); + $tablePagination = ui_pagination( + count($array_get_incidents), + $url, + $offset, + 0, + true, + 'offset', + false, + 'pagination-bottom' + ); } // Show button to create incident. echo '
'; - echo '
'; - html_print_submit_button(__('Create'), 'create_new_incident', false, 'class="sub next"'); - echo '
'; +html_print_action_buttons( + html_print_submit_button( + __('Create'), + 'create_new_incident', + false, + [ 'icon' => 'next' ], + true + ), + [ + 'type' => 'data_table', + 'class' => 'fixed_action_buttons', + 'right_content' => $tablePagination, + ] +); echo '
'; // Datapicker library for show calendar. ui_require_jquery_file('ui.datepicker-'.get_user_language(), 'include/javascript/i18n/'); ?> - diff --git a/pandora_console/views/cluster/edit.php b/pandora_console/views/cluster/edit.php index eb144c5e72..b3c062977e 100644 --- a/pandora_console/views/cluster/edit.php +++ b/pandora_console/views/cluster/edit.php @@ -143,7 +143,9 @@ html_print_action_buttons( var buttonback = $('#button-submit').parent().html(); $('#button-submit').hide(); var buttonback = buttonback.replace('button-submit','button-submit_copy'); - $('.action_buttons_right_content').parent().html(buttonnext+buttonback); + var buttonalert = $('#button-add').parent().html(); + var buttonalert = buttonalert.replace('button-add','button-add_copy'); + $('.action_buttons_right_content').parent().html(buttonnext+buttonback+buttonalert); var style = $('#principal_action_buttons').attr('style'); $('#principal_action_buttons').attr('style',style+' justify-content: unset;'); diff --git a/pandora_console/views/cluster/list.php b/pandora_console/views/cluster/list.php index 44af135532..bcfc0743b6 100644 --- a/pandora_console/views/cluster/list.php +++ b/pandora_console/views/cluster/list.php @@ -27,12 +27,23 @@ */ // Header. -\ui_print_page_header( - __('Monitoring').' » '.__('Clusters'), +ui_print_standard_header( + __('Cluster view'), 'images/chart.png', false, '', - false + true, + [], + [ + [ + 'link' => '', + 'label' => __('Monitoring'), + ], + [ + 'link' => '', + 'label' => __('Clusters'), + ], + ] ); if (empty($message) === false) { From b0b2778c4aadbee388e12b41fbfdf4a3c48fc790 Mon Sep 17 00:00:00 2001 From: Pablo Aragon Date: Wed, 22 Mar 2023 16:42:03 +0100 Subject: [PATCH 123/169] 10760-Setup --- pandora_console/general/register.php | 2 +- pandora_console/godmode/setup/setup_auth.php | 95 +++++++---- .../godmode/setup/setup_ehorus.php | 127 +++++++------- .../godmode/setup/setup_integria.php | 157 +++++++++++------- .../include/ajax/double_auth.ajax.php | 11 +- .../include/class/ExternalTools.class.php | 4 +- pandora_console/include/styles/pandora.css | 8 + pandora_console/include/styles/setup.css | 4 +- 8 files changed, 248 insertions(+), 160 deletions(-) diff --git a/pandora_console/general/register.php b/pandora_console/general/register.php index 8714d1ec12..ed646f52f3 100644 --- a/pandora_console/general/register.php +++ b/pandora_console/general/register.php @@ -184,7 +184,7 @@ if (!$double_auth_enabled background: "black" }, width: 500, - height: 400, + height: 'auto', close: function (event, ui) { // Abort the ajax request if (typeof request != 'undefined'){ diff --git a/pandora_console/godmode/setup/setup_auth.php b/pandora_console/godmode/setup/setup_auth.php index 6686a26c7b..c0548b32e8 100644 --- a/pandora_console/godmode/setup/setup_auth.php +++ b/pandora_console/godmode/setup/setup_auth.php @@ -43,7 +43,7 @@ if (is_ajax() === true) { $table = new StdClass(); $table->data = []; $table->width = '100%'; - $table->class = 'databox filters table_result_auth'; + $table->class = 'databox filters table_result_auth filter-table-adv'; $table->size['name'] = '30%'; $table->style['name'] = 'font-weight: bold'; @@ -94,7 +94,11 @@ if (is_ajax() === true) { '', 30, 100, - true + true, + false, + false, + '', + 'w400px' ); $table->data['ldap_server'] = $row; @@ -107,7 +111,11 @@ if (is_ajax() === true) { '', 10, 100, - true + true, + false, + false, + '', + 'w400px' ); $table->data['ldap_port'] = $row; @@ -126,7 +134,10 @@ if (is_ajax() === true) { '', '', 0, - true + true, + false, + true, + 'w400px' ); $table->data['ldap_version'] = $row; @@ -189,12 +200,12 @@ if (is_ajax() === true) { $alt = '', 60, 100, - true - ); - $row['control'] .= ui_print_reveal_password( - 'ldap_admin_pass', - true + true, + false, + false, + 'w400px-important' ); + $table->data['ldap_admin_pass'] = $row; // Ldapsearch timeout. @@ -208,7 +219,11 @@ if (is_ajax() === true) { '', 10, 10, - true + true, + false, + false, + '', + 'w400px' ); $table->data['ldap_search_timeout'] = $row; @@ -239,7 +254,11 @@ if (is_ajax() === true) { '', 30, 100, - true + true, + false, + false, + '', + 'w400px' ); $table->data['ldap_server_secondary'] = $row; @@ -252,7 +271,11 @@ if (is_ajax() === true) { '', 10, 100, - true + true, + false, + false, + '', + 'w400px' ); $table->data['ldap_port_secondary'] = $row; @@ -271,7 +294,10 @@ if (is_ajax() === true) { '', '', 0, - true + true, + false, + true, + 'w400px' ); $table->data['ldap_version_secondary'] = $row; @@ -334,11 +360,10 @@ if (is_ajax() === true) { $alt = '', 60, 100, - true - ); - $row['control'] .= ui_print_reveal_password( - 'ldap_admin_pass_secondary', - true + true, + false, + false, + 'w400px-important' ); $table->data['ldap_admin_pass_secondary'] = $row; break; @@ -407,7 +432,11 @@ if (is_ajax() === true) { '', 10, 10, - true + true, + false, + false, + '', + 'w400px' ); $table->data['session_timeout'] = $row; @@ -421,7 +450,7 @@ require_once $config['homedir'].'/include/functions_profile.php'; $table = new StdClass(); $table->data = []; $table->width = '100%'; -$table->class = 'databox filters'; +$table->class = 'databox filters filter-table-adv'; $table->size['name'] = '30%'; $table->style['name'] = 'font-weight: bold'; @@ -459,12 +488,15 @@ $row['control'] = html_print_select( '', '', 0, - true + true, + false, + true, + 'w400px' ); $table->data['auth'] = $row; // Form. -echo '
'; +echo ''; if (is_metaconsole() === false) { html_print_input_hidden('update_config', 1); @@ -478,17 +510,14 @@ html_print_csrf_hidden(); html_print_table($table); html_print_div([ 'id' => 'table_auth_result' ]); -html_print_div( - [ - 'class' => 'action-buttons w100p', - 'content' => html_print_submit_button( - __('Update'), - 'update_button', - false, - [ 'icon' => 'update' ], - true - ), - ] +html_print_action_buttons( + html_print_submit_button( + __('Update'), + 'update_button', + false, + [ 'icon' => 'update' ], + true + ) ); echo '
'; diff --git a/pandora_console/godmode/setup/setup_ehorus.php b/pandora_console/godmode/setup/setup_ehorus.php index 308f3b8189..e69b9668f3 100644 --- a/pandora_console/godmode/setup/setup_ehorus.php +++ b/pandora_console/godmode/setup/setup_ehorus.php @@ -74,82 +74,98 @@ $table_remote->data = []; $table_remote->width = '100%'; $table_remote->styleTable = 'margin-bottom: 10px;'; $table_remote->id = 'ehorus-remote-setup'; -$table_remote->class = 'databox filters'; -$table_remote->size['name'] = '30%'; -$table_remote->style['name'] = 'font-weight: bold'; -$table_remote->style['control'] = 'display: flex;align-items: center;'; +$table_remote->class = 'databox filters filter-table-adv'; +$table_remote->size['ehorus_hostname'] = '50%'; +$table_remote->size['ehorus_port'] = '50%'; // Enable eHorus user configuration. $row = []; -$row['name'] = ('eHorus configuration at user level'); -$row['control'] = html_print_checkbox_switch('ehorus_user_level_conf', 1, $config['ehorus_user_level_conf'], true); +$row['ehorus_user_level_conf'] = html_print_label_input_block( + __('eHorus configuration at user level'), + html_print_checkbox_switch( + 'ehorus_user_level_conf', + 1, + $config['ehorus_user_level_conf'], + true + ) +); $table_remote->data['ehorus_user_level_conf'] = $row; // User. $row = []; -$row['name'] = __('User'); -$row['control'] = html_print_input_text('ehorus_user', $config['ehorus_user'], '', 30, 100, true); -$table_remote->data['ehorus_user'] = $row; +$row['ehorus_user'] = html_print_label_input_block( + __('User'), + html_print_input_text('ehorus_user', $config['ehorus_user'], '', 30, 100, true), + ['div_class' => 'ehorus-remote-setup-ehorus_user'] +); // Pass. -$row = []; -$row['name'] = __('Password'); -$row['control'] = html_print_input_password('ehorus_pass', io_output_password($config['ehorus_pass']), '', 30, 100, true); -$row['control'] .= ui_print_reveal_password('ehorus_pass', true); +$row['ehorus_pass'] = html_print_label_input_block( + __('Password'), + html_print_input_password('ehorus_pass', io_output_password($config['ehorus_pass']), '', 30, 100, true), + ['div_class' => 'ehorus-remote-setup-ehorus_user'] +); $table_remote->data['ehorus_pass'] = $row; // Directory hostname. $row = []; -$row['name'] = __('API Hostname'); -$row['control'] = html_print_input_text('ehorus_hostname', $config['ehorus_hostname'], '', 30, 100, true); -$table_remote->data['ehorus_hostname'] = $row; +$row['ehorus_hostname'] = html_print_label_input_block( + __('API Hostname'), + html_print_input_text('ehorus_hostname', $config['ehorus_hostname'], '', 30, 100, true) +); // Directory port. -$row = []; -$row['name'] = __('API Port'); -$row['control'] = html_print_input_text('ehorus_port', $config['ehorus_port'], '', 6, 100, true); +$row['ehorus_port'] = html_print_label_input_block( + __('API Port'), + html_print_input_text('ehorus_port', $config['ehorus_port'], '', 6, 100, true) +); $table_remote->data['ehorus_port'] = $row; // Request timeout. $row = []; -$row['name'] = __('Request timeout'); -$row['control'] = html_print_input_text('ehorus_req_timeout', $config['ehorus_req_timeout'], '', 3, 10, true); +$row['ehorus_req_timeout'] = html_print_label_input_block( + __('Request timeout'), + html_print_input_text('ehorus_req_timeout', $config['ehorus_req_timeout'], '', 3, 10, true) +); $table_remote->data['ehorus_req_timeout'] = $row; // Test. $row = []; -$row['name'] = __('Test'); -$row['control'] = html_print_button( - __('Start'), - 'test-ehorus', - false, - '', - [ - 'icon' => 'cog', - 'mode' => 'secondary mini', - ], - true +$test_start = ''; +$test_start .= ''; +$test_start .= ''; +$test_start .= ' '; +$row['ehorus_test'] = html_print_label_input_block( + __('Test'), + html_print_button( + __('Start'), + 'test-ehorus', + false, + '', + [ + 'icon' => 'cog', + 'mode' => 'secondary mini', + 'style' => 'width: 115px;', + ], + true + ).$test_start ); -$row['control'] .= ''; -$row['control'] .= ''; -$row['control'] .= ''; -$row['control'] .= ' '; $table_remote->data['ehorus_test'] = $row; // Print. -echo '
'; echo ''; - html_print_div( - [ - 'class' => 'action-buttons w100p', - 'content' => html_print_submit_button( - __('Update'), - 'update_button', - false, - ['icon' => 'update'], - true - ), - ] + html_print_action_buttons( + html_print_submit_button( + __('Update'), + 'update_button', + false, + ['icon' => 'update'], + true + ) ); echo ''; @@ -220,8 +233,8 @@ if(!$('input:checkbox[name="ehorus_enabled"]').is(':checked')) if($('input:checkbox[name="ehorus_user_level_conf"]').is(':checked')) { - $('#ehorus-remote-setup-ehorus_user').hide(); - $('#ehorus-remote-setup-ehorus_pass').hide() + $('.ehorus-remote-setup-ehorus_user').hide(); + $('.ehorus-remote-setup-ehorus_pass').hide() } @@ -234,13 +247,13 @@ if($('input:checkbox[name="ehorus_user_level_conf"]').is(':checked')) } var hideUserPass = function () { - $('#ehorus-remote-setup-ehorus_user').hide(); - $('#ehorus-remote-setup-ehorus_pass').hide(); + $('.ehorus-remote-setup-ehorus_user').hide(); + $('.ehorus-remote-setup-ehorus_pass').hide(); } var showUserPass = function () { - $('#ehorus-remote-setup-ehorus_user').show(); - $('#ehorus-remote-setup-ehorus_pass').show(); + $('.ehorus-remote-setup-ehorus_user').show(); + $('.ehorus-remote-setup-ehorus_pass').show(); } var handleEnable = function (event) { diff --git a/pandora_console/godmode/setup/setup_integria.php b/pandora_console/godmode/setup/setup_integria.php index fae8178498..9b4770471c 100644 --- a/pandora_console/godmode/setup/setup_integria.php +++ b/pandora_console/godmode/setup/setup_integria.php @@ -269,52 +269,102 @@ $table_remote->data = []; $table_remote->width = '100%'; $table_remote->styleTable = 'margin-bottom: 10px;'; $table_remote->id = 'integria-remote-setup'; -$table_remote->class = 'databox filters'; -$table_remote->size['name'] = '30%'; -$table_remote->style['name'] = 'font-weight: bold'; -$table_remote->style['control'] = 'display: flex;align-items: center;'; +$table_remote->class = 'databox filters filter-table-adv'; +$table_remote->size['hostname'] = '50%'; +$table_remote->size['api_pass'] = '50%'; -// Enable eHorus user configuration. +// Enable Integria user configuration. $row = []; -$row['name'] = ('Integria configuration at user level'); -$row['control'] = html_print_checkbox_switch('integria_user_level_conf', 1, $config['integria_user_level_conf'], true); +$row['user_level'] = html_print_label_input_block( + __('Integria configuration at user level'), + html_print_checkbox_switch( + 'integria_user_level_conf', + 1, + $config['integria_user_level_conf'], + true + ) +); $table_remote->data['integria_user_level_conf'] = $row; // Integria user. $row = []; -$row['name'] = __('User'); -$row['control'] = html_print_input_text('integria_user', $config['integria_user'], '', 30, 100, true); -$table_remote->data['integria_user'] = $row; +$row['user'] = html_print_label_input_block( + __('User'), + html_print_input_text( + 'integria_user', + $config['integria_user'], + '', + 30, + 100, + true + ), + ['div_class' => 'integria-remote-setup-integria_user'] +); // Integria password. -$row = []; -$row['name'] = __('Password'); -$row['control'] = html_print_input_password('integria_pass', io_output_password($config['integria_pass']), '', 30, 100, true); -$row['control'] .= ui_print_reveal_password('integria_pass', true); +$row['password'] = html_print_label_input_block( + __('Password'), + html_print_input_password( + 'integria_pass', + io_output_password($config['integria_pass']), + '', + 30, + 100, + true + ), + ['div_class' => 'integria-remote-setup-integria_pass'] +); $table_remote->data['integria_pass'] = $row; // Integria hostname. $row = []; -$row['name'] = __('URL to Integria IMS setup').ui_print_help_tip(__('Full URL to your Integria IMS setup (e.g., http://192.168.1.20/integria, https://support.mycompany.com).'), true); -$row['control'] = html_print_input_text('integria_hostname', $config['integria_hostname'], '', 30, 100, true); -$table_remote->data['integria_hostname'] = $row; +$row['hostname'] = html_print_label_input_block( + __('URL to Integria IMS setup').ui_print_help_tip(__('Full URL to your Integria IMS setup (e.g., http://192.168.1.20/integria, https://support.mycompany.com).'), true), + html_print_input_text( + 'integria_hostname', + $config['integria_hostname'], + '', + 30, + 100, + true + ), + ['div_class' => 'integria-remote-setup-integria_hostname'] +); // API password. -$row = []; -$row['name'] = __('API Password'); -$row['control'] = html_print_input_password('integria_api_pass', io_output_password($config['integria_api_pass']), '', 30, 100, true); -$row['control'] .= ui_print_reveal_password('integria_api_pass', true); +$row['api_pass'] = html_print_label_input_block( + __('API Password'), + html_print_input_password( + 'integria_api_pass', + io_output_password($config['integria_api_pass']), + '', + 30, + 100, + true + ), + ['div_class' => 'integria-remote-setup-integria_api_pass'] +); $table_remote->data['integria_api_pass'] = $row; // Request timeout. $row = []; -$row['name'] = __('Request timeout'); -$row['control'] = html_print_input_text('integria_req_timeout', $config['integria_req_timeout'], '', 3, 10, true); +$row['req_timeout'] = html_print_label_input_block( + __('Request timeout'), + html_print_input_text( + 'integria_req_timeout', + $config['integria_req_timeout'], + '', + 3, + 10, + true + ), + ['div_class' => 'integria-remote-setup-integria_req_timeout'] +); $table_remote->data['integria_req_timeout'] = $row; $row = []; -$row['name'] = __('Inventory'); -$row['control'] = html_print_button( +$row['control'] = __('Inventory'); +$row['control'] .= html_print_button( __('Sync inventory'), 'sync-inventory', false, @@ -575,8 +625,8 @@ $table_cr_settings->data['custom_response_incident_status'] = $row; // Test. $row = []; -$row['name'] = __('Test'); -$row['control'] = html_print_button( +$row['control'] = __('Test'); +$row['control'] .= html_print_button( __('Start'), 'test-integria', false, @@ -594,12 +644,12 @@ $row['control'] .= ' 
'; +echo ''; -echo "
"; +echo ""; html_print_input_hidden('update_config', 1); // Form enable. @@ -650,33 +700,24 @@ if ($has_connection != false) { echo '
'; echo ''; - html_print_div( - [ - 'class' => 'action-buttons w100p', - 'content' => html_print_submit_button( - __('Update'), - 'update_button', - false, - ['icon' => 'update'], - true - ), - ] + $update_button = html_print_submit_button( + __('Update'), + 'update_button', + false, + ['icon' => 'update'], + true ); } else { - html_print_div( - [ - 'class' => 'action-buttons w100p', - 'content' => html_print_submit_button( - __('Update and continue'), - 'update_button', - false, - ['icon' => 'update'], - true - ), - ] + $update_button = html_print_submit_button( + __('Update and continue'), + 'update_button', + false, + ['icon' => 'update'], + true ); } +html_print_action_buttons($update_button); echo ''; @@ -686,8 +727,8 @@ echo ''; if($('input:checkbox[name="integria_user_level_conf"]').is(':checked')) { - $('#integria-remote-setup-integria_user').hide(); - $('#integria-remote-setup-integria_pass').hide() + $('.integria-remote-setup-integria_user').hide(); + $('.integria-remote-setup-integria_pass').hide() } var handleUserLevel = function(event) { @@ -726,13 +767,13 @@ echo ''; } var hideUserPass = function () { - $('#integria-remote-setup-integria_user').hide(); - $('#integria-remote-setup-integria_pass').hide(); + $('.integria-remote-setup-integria_user').hide(); + $('.integria-remote-setup-integria_pass').hide(); } var showUserPass = function () { - $('#integria-remote-setup-integria_user').show(); - $('#integria-remote-setup-integria_pass').show(); + $('.integria-remote-setup-integria_user').show(); + $('.integria-remote-setup-integria_pass').show(); } var handleEnable = function (event) { diff --git a/pandora_console/include/ajax/double_auth.ajax.php b/pandora_console/include/ajax/double_auth.ajax.php index 3a995ce43a..54856a26c3 100644 --- a/pandora_console/include/ajax/double_auth.ajax.php +++ b/pandora_console/include/ajax/double_auth.ajax.php @@ -216,11 +216,8 @@ if ($get_double_auth_info_page) { $html .= '

'; $html .= ''; $html .= '
'; - $html .= '
'; + $html .= '
'; $html .= html_print_button(__('Download the app'), 'google_authenticator_download', false, '', '', true); - $html .= '
'; - $html .= '
'; - $html .= '
'; $html .= html_print_button(__('Continue'), 'continue_to_generate', false, '', '', true); $html .= '
'; @@ -311,11 +308,11 @@ if ($get_double_auth_generation_page) { $html .= '
'; $html .= __('QR').':
'; $html .= '
'; - $html .= '
'; + $html .= '
'; $html .= html_print_button(__('Refresh code'), 'continue_to_generate', false, '', '', true); - $html .= ' '; $html .= html_print_button(__('Continue'), 'continue_to_validate', false, '', '', true); $html .= '
'; + $html .= '
'; ob_clean(); ?> @@ -453,7 +450,7 @@ if ($get_double_auth_validation_page) { $html .= html_print_input_text('code', '', '', 50, $secret_lenght, true); $html .= '
'; $html .= '

'; - $html .= '
'; + $html .= '
'; $html .= html_print_button(__('Validate code'), 'continue_to_validate', false, '', '', true); $html .= html_print_image('images/spinner.gif', true); $html .= '
'; diff --git a/pandora_console/include/class/ExternalTools.class.php b/pandora_console/include/class/ExternalTools.class.php index eb751b2ff9..b086dd0419 100644 --- a/pandora_console/include/class/ExternalTools.class.php +++ b/pandora_console/include/class/ExternalTools.class.php @@ -234,7 +234,7 @@ class ExternalTools extends HTML 'images/change-active.svg', true, [ - 'id' => 'button_sound_warning', + 'id' => 'button_sound_alert', 'style' => 'vertical-align: middle; margin-left: 10px', 'width' => '16', 'title' => __('Play sound'), @@ -269,7 +269,7 @@ class ExternalTools extends HTML 'images/change-active.svg', true, [ - 'id' => 'button_sound_warning', + 'id' => 'button_sound_critical', 'style' => 'vertical-align: middle; margin-left: 10px', 'width' => '16', 'title' => __('Play sound'), diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index 82b26c79fb..4e03772017 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -509,6 +509,10 @@ select:-internal-list-box { width: 400px; } +.w400px-important { + width: 400px !important; +} + .w450px { width: 450px; } @@ -11752,3 +11756,7 @@ div.relative > div > div#ui-datepicker-div { border-radius: 0px; margin-left: 10px; } + +.container-div-input-password:has(.w400px-important) { + width: 400px; +} diff --git a/pandora_console/include/styles/setup.css b/pandora_console/include/styles/setup.css index f4c1571167..59699aff82 100644 --- a/pandora_console/include/styles/setup.css +++ b/pandora_console/include/styles/setup.css @@ -12,8 +12,8 @@ span.subtitle-2 { border: 0 !important; } -input[type="text"], -input[type="number"] { +input[type="text"]:not(.w100p-important), +input[type="number"]:not(.w100p-important) { width: 220px; } From d6bf16f5363be96793995f6fd074ccbf439cc2f0 Mon Sep 17 00:00:00 2001 From: Pablo Aragon Date: Wed, 22 Mar 2023 18:57:36 +0100 Subject: [PATCH 124/169] 10712-Login --- pandora_console/general/login_page.php | 4 ++-- pandora_console/include/functions_config.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pandora_console/general/login_page.php b/pandora_console/general/login_page.php index 37421f655d..0c89430122 100755 --- a/pandora_console/general/login_page.php +++ b/pandora_console/general/login_page.php @@ -522,10 +522,10 @@ if (file_exists(ENTERPRISE_DIR.'/load_enterprise.php')) { if ($config['custom_title1_login']) { echo io_safe_output($config['custom_title1_login']); } else { - echo __('ONE TOOL TO MONITOR THEM ALL'); + echo __('ONE TOOL TO RULE THEM ALL'); } } else { - echo __('ONE TOOL TO MONITOR THEM ALL'); + echo __('ONE TOOL TO RULE THEM ALL'); } echo '
'; diff --git a/pandora_console/include/functions_config.php b/pandora_console/include/functions_config.php index 47a6cce1de..833f2f22a2 100644 --- a/pandora_console/include/functions_config.php +++ b/pandora_console/include/functions_config.php @@ -2597,7 +2597,7 @@ function config_process_config() } if (!isset($config['custom_title1_login'])) { - config_update_value('custom_title1_login', __('ONE TOOL TO MONITOR THEM ALL')); + config_update_value('custom_title1_login', __('ONE TOOL TO RULE THEM ALL')); } if (!isset($config['custom_title2_login'])) { @@ -2649,7 +2649,7 @@ function config_process_config() } if (!isset($config['meta_custom_title1_login'])) { - config_update_value('meta_custom_title1_login', __('ONE TOOL TO MONITOR THEM ALL')); + config_update_value('meta_custom_title1_login', __('ONE TOOL TO RULE THEM ALL')); } if (!isset($config['meta_custom_title2_login'])) { From bd48dba65f5218e72308fbe64fd994d20fe26388 Mon Sep 17 00:00:00 2001 From: Pablo Aragon Date: Wed, 22 Mar 2023 20:00:42 +0100 Subject: [PATCH 125/169] 10715-Fix width tree view graph --- pandora_console/include/functions_treeview.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/pandora_console/include/functions_treeview.php b/pandora_console/include/functions_treeview.php index f2323fd13c..0b212eb8aa 100755 --- a/pandora_console/include/functions_treeview.php +++ b/pandora_console/include/functions_treeview.php @@ -946,6 +946,20 @@ function treeview_printTable($id_agente, $server_data=[], $no_head=false) function widthGraph () { var parentWidth = $('.max-graph-tree-view').parent().width(); $('.max-graph-tree-view').children().width(parentWidth + 5); + + $('').attr({ + type: 'hidden', + id: 'graph-counter', + value: 1 + }).appendTo('#container'); + + + if ($('#graph-counter').val() == 1) { + $('.max-graph-tree-view div.flot-x-axis').css('inset', '-25px').css('margin-top', '10px').css('margin-left', '10px'); + $('.max-graph-tree-view canvas.flot-base').css('height', '85px'); + $('#graph-counter').val(2); + } + } "; From cbbddd1ac6d7de4f8c08da84c1c8ab2c6652de59 Mon Sep 17 00:00:00 2001 From: artica Date: Thu, 23 Mar 2023 01:00:18 +0100 Subject: [PATCH 126/169] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.rhel7.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 32ae346476..d2e886052d 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.769-230322 +Version: 7.0NG.769-230323 Architecture: all Priority: optional Section: admin diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh index eae3843db7..122b06ac79 100644 --- a/pandora_agents/unix/DEBIAN/make_deb_package.sh +++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.769-230322" +pandora_version="7.0NG.769-230323" echo "Test if you has the tools for to make the packages." whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index 6b8caef6e7..ef17f8a8f4 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -1023,7 +1023,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.769'; -use constant AGENT_BUILD => '230322'; +use constant AGENT_BUILD => '230323'; # Agent log default file size maximum and instances use constant DEFAULT_MAX_LOG_SIZE => 600000; diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index 00bebae366..af7e2e2596 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_agent_linux %define version 7.0NG.769 -%define release 230322 +%define release 230323 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index a61b2f56f8..7a3adae918 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_agent_linux %define version 7.0NG.769 -%define release 230322 +%define release 230323 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer index 2e2d4ec44a..97c4765dbd 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.769" -PI_BUILD="230322" +PI_BUILD="230323" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 8daa30ae18..9f9bbb30f2 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{230322} +{230323} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index a1b982a207..1a59e872aa 100644 --- a/pandora_agents/win32/pandora.cc +++ b/pandora_agents/win32/pandora.cc @@ -30,7 +30,7 @@ using namespace Pandora; using namespace Pandora_Strutils; #define PATH_SIZE _MAX_PATH+1 -#define PANDORA_VERSION ("7.0NG.769 Build 230322") +#define PANDORA_VERSION ("7.0NG.769 Build 230323") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 7e27b054d3..bb8562378a 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.769(Build 230322))" + VALUE "ProductVersion", "(7.0NG.769(Build 230323))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index b5db0c7fc3..b766df0562 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.769-230322 +Version: 7.0NG.769-230323 Architecture: all Priority: optional Section: admin diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh index e528acf30e..7425ed46b6 100644 --- a/pandora_console/DEBIAN/make_deb_package.sh +++ b/pandora_console/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.769-230322" +pandora_version="7.0NG.769-230323" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index a1f6040007..ec90b4d8c2 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -20,7 +20,7 @@ /** * Pandora build version and version */ -$build_version = 'PC230322'; +$build_version = 'PC230323'; $pandora_version = 'v7.0NG.769'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 42bc80a76c..0cd9bd0385 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -131,7 +131,7 @@
[ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index 27492125a8..05e0de628b 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_server %define version 7.0NG.769 -%define release 230322 +%define release 230323 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 308a016430..0303266d05 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_server %define version 7.0NG.769 -%define release 230322 +%define release 230323 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 9213cdd253..8800e2e408 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.769" -PI_BUILD="230322" +PI_BUILD="230323" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index b6e04d983b..60699c5dbe 100755 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -35,7 +35,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.769 Build 230322"; +my $version = "7.0NG.769 Build 230323"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 78c1965717..da84e3f0d8 100755 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -36,7 +36,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "7.0NG.769 Build 230322"; +my $version = "7.0NG.769 Build 230323"; # save program name for logging my $progname = basename($0); From e2820d1ad74a2acb381e9f5b8541c4c17973cc65 Mon Sep 17 00:00:00 2001 From: Pablo Aragon Date: Thu, 23 Mar 2023 09:18:39 +0100 Subject: [PATCH 127/169] 9680-Fix widget --- pandora_console/include/ajax/module.php | 12 ++++++++++++ .../lib/Dashboard/Widgets/ModulesByStatus.php | 13 ++++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/pandora_console/include/ajax/module.php b/pandora_console/include/ajax/module.php index 30b84be44f..42a1194451 100755 --- a/pandora_console/include/ajax/module.php +++ b/pandora_console/include/ajax/module.php @@ -1692,6 +1692,18 @@ if (check_login()) { $where = 'tagente_modulo.nombre LIKE "%%'.$search.'%%" AND '; } + if (str_contains($status, '6') === true) { + $expl = explode(',', $status); + $exist = array_search('6', $expl); + if (isset($exist) === true) { + unset($expl[$exist]); + } + + array_push($expl, '1', '2'); + + $status = implode(',', $expl); + } + $where .= sprintf( 'tagente_estado.estado IN (%s) AND tagente_modulo.delete_pending = 0', diff --git a/pandora_console/include/lib/Dashboard/Widgets/ModulesByStatus.php b/pandora_console/include/lib/Dashboard/Widgets/ModulesByStatus.php index 2944663135..53d996607c 100644 --- a/pandora_console/include/lib/Dashboard/Widgets/ModulesByStatus.php +++ b/pandora_console/include/lib/Dashboard/Widgets/ModulesByStatus.php @@ -269,7 +269,6 @@ class ModulesByStatus extends Widget 'selected' => $status_selected, 'return' => true, 'multiple' => true, - 'class' => 'overflow-hidden', 'size' => count($status_fields), 'select_all' => false, 'required' => true, @@ -488,6 +487,18 @@ class ModulesByStatus extends Widget $where = 'tagente_modulo.nombre LIKE "%%'.$search.'%%" AND '; } + if (str_contains($status, '6') === true) { + $expl = explode(',', $status); + $exist = array_search('6', $expl); + if (isset($exist) === true) { + unset($expl[$exist]); + } + + array_push($expl, '1', '2'); + + $status = implode(',', $expl); + } + $where .= sprintf( 'tagente_estado.estado IN (%s) AND tagente_modulo.delete_pending = 0', From a60f9be92053ff439097cbdd694e5580d768bc85 Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Thu, 23 Mar 2023 09:53:09 +0100 Subject: [PATCH 128/169] #9624 changed default binary path daemon for sflow --- pandora_console/include/functions_config.php | 2 +- pandora_console/pandoradb_data.sql | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pandora_console/include/functions_config.php b/pandora_console/include/functions_config.php index 1706646c13..e5f9c1aad4 100644 --- a/pandora_console/include/functions_config.php +++ b/pandora_console/include/functions_config.php @@ -2899,7 +2899,7 @@ function config_process_config() } if (!isset($config['sflow_daemon'])) { - config_update_value('sflow_daemon', '/usr/bin/nfcapd'); + config_update_value('sflow_daemon', '/usr/bin/sfcapd'); } if (!isset($config['sflow_nfdump'])) { diff --git a/pandora_console/pandoradb_data.sql b/pandora_console/pandoradb_data.sql index 45d5f3d33f..eabbb48d59 100644 --- a/pandora_console/pandoradb_data.sql +++ b/pandora_console/pandoradb_data.sql @@ -89,7 +89,7 @@ INSERT INTO `tconfig` (`token`, `value`) VALUES ('netflow_nfdump', '/usr/bin/nfdump'), ('netflow_max_resolution', '50'), ('sflow_interval', '3600'), -('sflow_daemon', '/usr/bin/nfcapd'), +('sflow_daemon', '/usr/bin/sfcapd'), ('sflow_nfdump', '/usr/bin/nfdump'), ('sflow_max_resolution', '50'), ('event_fields', 'mini_severity,evento,estado,agent_name,timestamp'), From 94c843dac29421bc0715da40dc9d0a87a72366f3 Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Thu, 23 Mar 2023 10:41:08 +0100 Subject: [PATCH 129/169] #9662 Fixed gis map menu --- pandora_console/include/functions_menu.php | 5 +++ .../operation/gis_maps/gis_map.php | 22 +++++++++--- .../operation/gis_maps/render_view.php | 35 ++++++++++++------- pandora_console/operation/menu.php | 2 +- 4 files changed, 46 insertions(+), 18 deletions(-) diff --git a/pandora_console/include/functions_menu.php b/pandora_console/include/functions_menu.php index 14c43a5c14..1e8dfca576 100644 --- a/pandora_console/include/functions_menu.php +++ b/pandora_console/include/functions_menu.php @@ -68,6 +68,11 @@ function menu_print_menu(&$menu) $sec2 = 'godmode/alerts/alert_commands'; } else if ($sec2 === 'enterprise/godmode/setup/edit_skin') { $sec2 = 'enterprise/godmode/setup/setup_skins'; + } else if ($sec2 === 'operation/gis_maps/render_view') { + $map_id = (int) get_parameter('map_id'); + if (empty($map_id) === false) { + $sec2 .= '&map_id='.$map_id; + } } else if ($sec2 === 'godmode/servers/discovery') { $wiz = (string) get_parameter('wiz'); $sec2 = 'godmode/servers/discovery&wiz='.$wiz; diff --git a/pandora_console/operation/gis_maps/gis_map.php b/pandora_console/operation/gis_maps/gis_map.php index 4a9f56dd7a..5c615bef61 100644 --- a/pandora_console/operation/gis_maps/gis_map.php +++ b/pandora_console/operation/gis_maps/gis_map.php @@ -21,23 +21,35 @@ global $config; require_once 'include/functions_gis.php'; -// ui_require_javascript_file('openlayers.pandora'); $buttons['gis_maps_list'] = [ 'active' => true, 'text' => ''.html_print_image( - 'images/list.png', + 'images/logs@svg.svg', true, - ['title' => __('GIS Maps list')] + [ + 'title' => __('GIS Maps list'), + 'class' => 'main_menu_icon invert_filter', + ] ).'', ]; -ui_print_page_header( +ui_print_standard_header( __('GIS Maps'), 'images/op_gis.png', false, '', false, - $buttons + $buttons, + [ + [ + 'link' => '', + 'label' => __('Topology maps'), + ], + [ + 'link' => '', + 'label' => __('GIS Maps'), + ], + ] ); $own_info = get_user_info($config['id_user']); diff --git a/pandora_console/operation/gis_maps/render_view.php b/pandora_console/operation/gis_maps/render_view.php index 6ecb1ed6a4..5db4c1ea41 100644 --- a/pandora_console/operation/gis_maps/render_view.php +++ b/pandora_console/operation/gis_maps/render_view.php @@ -116,33 +116,34 @@ $controls = [ $layers = gis_get_layers($idMap); -// Render map +// Render map. $has_management_acl = check_acl_restricted_all($config['id_user'], $map['group_id'], 'MW') || check_acl_restricted_all($config['id_user'], $map['group_id'], 'MM'); $buttons = []; $buttons['gis_maps_list'] = [ - 'text' => ''.html_print_image( - 'images/list.png', + 'active' => false, + 'text' => ''.html_print_image( + 'images/logs@svg.svg', true, [ 'title' => __('GIS Maps list'), - 'class' => 'invert_filter', + 'class' => 'main_menu_icon invert_filter', ] ).'', ]; if ($config['pure'] == 0) { - $buttons[]['text'] = ''.html_print_image('images/full_screen.png', true, ['title' => __('Full screen mode'), 'class' => 'invert_filter']).''; + $buttons[]['text'] = ''.html_print_image('images/fullscreen@svg.svg', true, ['title' => __('Full screen mode'), 'class' => 'main_menu_icon invert_filter']).''; } else { - $buttons[]['text'] = ''.html_print_image('images/normalscreen.png', true, ['title' => __('Back to normal mode'), 'class' => 'invert_filter']).''; + $buttons[]['text'] = ''.html_print_image('images/exit_fullscreen@svg.svg', true, ['title' => __('Back to normal mode'), 'class' => 'main_menu_icon invert_filter']).''; } -if ($has_management_acl) { +if ($has_management_acl === true) { $hash = md5($config['dbpass'].$idMap.$config['id_user']); $buttons['public_link']['text'] = ''.html_print_image('images/camera_mc.png', true, ['title' => __('Show link to public GIS map'), 'class' => 'invert_filter']).''; + ).'" target="_blank">'.html_print_image('images/item-icon.svg', true, ['title' => __('Show link to public GIS map'), 'class' => 'main_menu_icon invert_filter']).''; } $times = [ @@ -170,17 +171,27 @@ $status = [ $buttons[]['text'] = "
".__('Filter by status').': '.html_print_select($status, 'show_status', 'all', 'changeShowStatus(this.value);', '', 0, true, false, false).'
'; if ($has_management_acl) { - $buttons['setup']['text'] = ''.html_print_image('images/setup.png', true, ['title' => __('Setup'), 'class' => 'invert_filter']).''; + $buttons['setup']['text'] = ''.html_print_image('images/configuration@svg.svg', true, ['title' => __('Setup'), 'class' => 'main_menu_icon invert_filter']).''; $buttons['setup']['godmode'] = 1; } -ui_print_page_header( +ui_print_standard_header( __('Map').' » '.__('Map').' '.$map['map_name'], 'images/op_gis.png', false, - 'render_view_tab', + '', false, - $buttons + $buttons, + [ + [ + 'link' => '', + 'label' => __('Topology maps'), + ], + [ + 'link' => '', + 'label' => __('GIS Maps'), + ], + ] ); $map_inline_style = 'width: 100%; min-height:500px; height: calc(100vh - 80px);'; diff --git a/pandora_console/operation/menu.php b/pandora_console/operation/menu.php index b9e2d2d714..11472b54a1 100644 --- a/pandora_console/operation/menu.php +++ b/pandora_console/operation/menu.php @@ -411,7 +411,7 @@ if ($access_console_node === true) { // INI GIS Maps. if ($config['activate_gis']) { $sub['gismaps']['text'] = __('GIS Maps'); - $sub['gismaps']['id'] = 'GIS Maps'; + $sub['gismaps']['id'] = 'GIS_Maps'; $sub['gismaps']['type'] = 'direct'; $sub['gismaps']['subtype'] = 'nolink'; $sub2 = []; From 5b3c5850b06df3aad8e1a0cb725bac1a6c642c6f Mon Sep 17 00:00:00 2001 From: Ramon Novoa Date: Thu, 23 Mar 2023 11:17:00 +0100 Subject: [PATCH 130/169] Set a default value for ha_hosts_file in pandora_db. --- pandora_server/util/pandora_db.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 6bb162bf96..f888b98129 100755 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -630,7 +630,8 @@ sub pandora_load_config_pdb ($) { $conf->{'errorlogfile'} = "/var/log/pandora_server.error" unless defined ($conf->{'errorlogfile'}); # The DB host was overridden by pandora_ha. - if (defined($conf->{'ha_hosts_file'}) && -f $conf->{'ha_hosts_file'}) { + $conf->{'ha_hosts_file'} = '/var/spool/pandora/data_in/conf/pandora_ha_hosts.conf' unless defined($conf->{'ha_hosts_file'}); + if (-f $conf->{'ha_hosts_file'}) { eval { open(my $fh, '<', $conf->{'ha_hosts_file'}) or return; my $dbhost = <$fh>; From f32c8861673a4ce5d8ca80fe8f7748ba04a17100 Mon Sep 17 00:00:00 2001 From: Pablo Aragon Date: Thu, 23 Mar 2023 11:51:21 +0100 Subject: [PATCH 131/169] 10712-login --- pandora_console/general/login_page.php | 32 ++++++++++-------- .../custom_logo_login/Pandora-FMS-1.png | Bin 0 -> 108650 bytes pandora_console/include/functions_config.php | 6 ++-- pandora_console/include/styles/login.css | 2 +- 4 files changed, 21 insertions(+), 19 deletions(-) create mode 100644 pandora_console/images/custom_logo_login/Pandora-FMS-1.png diff --git a/pandora_console/general/login_page.php b/pandora_console/general/login_page.php index 0c89430122..e1e462a823 100755 --- a/pandora_console/general/login_page.php +++ b/pandora_console/general/login_page.php @@ -30,7 +30,7 @@ require_once __DIR__.'/../include/functions_html.php'; echo '