diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 092f0925c7..a39c7bab9d 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-230316 +Version: 7.0NG.769-230317 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 d71a7b978b..791388a3f6 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-230316" +pandora_version="7.0NG.769-230317" 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 539b2e24a6..d7a12f027a 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 => '230316'; +use constant AGENT_BUILD => '230317'; # 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 468ec39656..4799d2ffac 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 230316 +%define release 230317 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 628a9064a0..87ecf2a2a7 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 230316 +%define release 230317 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 623e85f1cf..b7bed4dc9a 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="230316" +PI_BUILD="230317" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 89d354f968..fc0fe42845 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{230316} +{230317} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 43ade1d81d..744f98fd9e 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 230316") +#define PANDORA_VERSION ("7.0NG.769 Build 230317") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index dadfdba481..b3910634fc 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 230316))" + VALUE "ProductVersion", "(7.0NG.769(Build 230317))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index f808e5048e..99062dbe92 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.769-230316 +Version: 7.0NG.769-230317 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 84d810cbb3..86fba40def 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-230316" +pandora_version="7.0NG.769-230317" package_pear=0 package_pandora=1 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/general/login_page.php b/pandora_console/general/login_page.php index 56664d0e7f..4bcce4142b 100755 --- a/pandora_console/general/login_page.php +++ b/pandora_console/general/login_page.php @@ -454,6 +454,7 @@ if (file_exists(ENTERPRISE_DIR.'/load_enterprise.php')) { 'enterprise/images/custom_splash_login/'.$config['custom_splash_login'], false, [ + 'class' => 'splash-logo', 'alt' => 'splash', 'border' => 0, ], diff --git a/pandora_console/godmode/agentes/configurar_agente.php b/pandora_console/godmode/agentes/configurar_agente.php index f559b4e3eb..04b90c1bb1 100644 --- a/pandora_console/godmode/agentes/configurar_agente.php +++ b/pandora_console/godmode/agentes/configurar_agente.php @@ -1907,62 +1907,64 @@ if ($create_module) { ); } - if (is_error($id_agent_module) === true) { - switch ($id_agent_module) { - case ERR_EXIST: - $msg = __('There was a problem adding module. Another module already exists with the same name.'); - break; + if ($update_module || $create_module) { + if (is_error($id_agent_module) === true) { + switch ($id_agent_module) { + case ERR_EXIST: + $msg = __('There was a problem adding module. Another module already exists with the same name.'); + break; - case ERR_INCOMPLETE: - $msg = __('There was a problem adding module. Some required fields are missed : (name)'); - break; + case ERR_INCOMPLETE: + $msg = __('There was a problem adding module. Some required fields are missed : (name)'); + break; - case ERR_DB: - case ERR_GENERIC: - default: - $msg = __('There was a problem adding module. Processing error'); - break; - } + case ERR_DB: + case ERR_GENERIC: + default: + $msg = __('There was a problem adding module. Processing error'); + break; + } - // I save the result of the action (insert or update). - $success_action = $id_agent_module; + // I save the result of the action (insert or update). + $success_action = $id_agent_module; - $id_agent_module = false; - ui_print_error_message($msg); - $edit_module = true; - $moduletype = $id_module; - db_pandora_audit( - AUDIT_LOG_AGENT_MANAGEMENT, - "Fail to try added module '".io_safe_output($name)."' for agent ".io_safe_output($agent['alias']) - ); - } else { - if ($prediction_module === MODULE_PREDICTION_SYNTHETIC) { - enterprise_hook( - 'modules_create_synthetic_operations', - [ - $id_agent_module, - $serialize_ops, - ] + $id_agent_module = false; + ui_print_error_message($msg); + $edit_module = true; + $moduletype = $id_module; + db_pandora_audit( + AUDIT_LOG_AGENT_MANAGEMENT, + "Fail to try added module '".io_safe_output($name)."' for agent ".io_safe_output($agent['alias']) + ); + } else { + if ($prediction_module === MODULE_PREDICTION_SYNTHETIC) { + enterprise_hook( + 'modules_create_synthetic_operations', + [ + $id_agent_module, + $serialize_ops, + ] + ); + } + + // Update the module interval. + cron_update_module_interval($id_agent_module, $cron_interval); + + ui_print_success_message(__('Module added successfully')); + $id_agent_module = false; + $edit_module = false; + + $info = ''; + + $agent = db_get_row('tagente', 'id_agente', $id_agente); + db_pandora_audit( + AUDIT_LOG_AGENT_MANAGEMENT, + "Added module '".db_escape_string_sql($name)."' for agent ".io_safe_output($agent['alias']), + false, + true, + io_json_mb_encode($values) ); } - - // Update the module interval. - cron_update_module_interval($id_agent_module, $cron_interval); - - ui_print_success_message(__('Module added successfully')); - $id_agent_module = false; - $edit_module = false; - - $info = ''; - - $agent = db_get_row('tagente', 'id_agente', $id_agente); - db_pandora_audit( - AUDIT_LOG_AGENT_MANAGEMENT, - "Added module '".db_escape_string_sql($name)."' for agent ".io_safe_output($agent['alias']), - false, - true, - io_json_mb_encode($values) - ); } } diff --git a/pandora_console/godmode/alerts/alert_list.builder.php b/pandora_console/godmode/alerts/alert_list.builder.php index 74120d36c8..4844e5c443 100644 --- a/pandora_console/godmode/alerts/alert_list.builder.php +++ b/pandora_console/godmode/alerts/alert_list.builder.php @@ -123,7 +123,7 @@ $table->data[1][0] = html_print_label_input_block( 'w100p', false, 'width: 100%;' - ).''.$create_action + ).'
'.$create_action.'
' ); $own_info = get_user_info($config['id_user']); @@ -162,7 +162,7 @@ $table->data[1][1] = html_print_label_input_block( 'w100p', false, 'width: 100%;' - ).' '.$create_template + ).'
'.$create_template.'
' ); $table->data[2][0] = html_print_label_input_block( diff --git a/pandora_console/godmode/events/custom_events.php b/pandora_console/godmode/events/custom_events.php index 627c81c27b..ea44daac5e 100644 --- a/pandora_console/godmode/events/custom_events.php +++ b/pandora_console/godmode/events/custom_events.php @@ -132,7 +132,8 @@ $table->data[1][1] = ''.html_print_image( [ 'id' => 'right', 'title' => __('Add fields to select'), - 'style' => 'rotate: 180deg; width: 40px', + 'style' => 'rotate: 180deg;', + 'class' => 'main_menu_icon invert_filter', ] ).''; $table->data[1][1] .= '



'.html_print_image( @@ -141,7 +142,7 @@ $table->data[1][1] .= '



'.html_print_image( [ 'id' => 'left', 'title' => __('Delete fields to select'), - 'style' => 'width: 40px', + 'style' => '', ] ).''; @@ -169,6 +170,7 @@ $table->data[1][2] .= ''.html_print_image( [ 'onclick' => 'sortUpDown(\'up\');', 'title' => __('Move up selected fields'), + 'class' => 'main_menu_icon invert_filter', ] ).''; $table->data[1][2] .= ''.html_print_image( @@ -177,6 +179,7 @@ $table->data[1][2] .= ''.html_print_image( [ 'onclick' => 'sortUpDown(\'down\');', 'title' => __('Move down selected fields'), + 'class' => 'main_menu_icon invert_filter', ] ).''; $table->data[1][2] .= ''; diff --git a/pandora_console/godmode/netflow/nf_edit.php b/pandora_console/godmode/netflow/nf_edit.php index 1d2bdd48ad..9859cb8022 100644 --- a/pandora_console/godmode/netflow/nf_edit.php +++ b/pandora_console/godmode/netflow/nf_edit.php @@ -211,7 +211,6 @@ $buttons = html_print_submit_button( true ); -// hd($filters); if (empty($filters) === false) { echo '
'; html_print_input_hidden('multiple_delete', 1); 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/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/godmode/setup/setup_general.php b/pandora_console/godmode/setup/setup_general.php index 90c7403847..b586cb0d72 100644 --- a/pandora_console/godmode/setup/setup_general.php +++ b/pandora_console/godmode/setup/setup_general.php @@ -680,7 +680,7 @@ $table->data[$i][] = html_print_label_input_block( echo ''; -echo '
'; +echo '
'; echo ''.__('General options').''; html_print_input_hidden('update_config', 1); @@ -695,7 +695,7 @@ $encryption = [ echo '
'; -echo '
'; +echo '
'; echo ''.__('Mail configuration').''; ui_print_warning_message( diff --git a/pandora_console/godmode/setup/setup_netflow.php b/pandora_console/godmode/setup/setup_netflow.php index 48a2947bb2..fbecfa766d 100644 --- a/pandora_console/godmode/setup/setup_netflow.php +++ b/pandora_console/godmode/setup/setup_netflow.php @@ -14,7 +14,7 @@ * |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______| * * ============================================================================ - * Copyright (c) 2005-2022 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 @@ -37,46 +37,66 @@ $update = (bool) get_parameter('update'); $table = new stdClass(); $table->width = '100%'; +$table->class = 'databox filter-table-adv'; $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('netflow_path', $config['netflow_path'], false, 50, 200, true); +$table->data[0][] = html_print_label_input_block( + __('Data storage path'), + html_print_input_text('netflow_path', $config['netflow_path'], false, 50, 200, true) +); -$table->data[1][0] = ''.__('Daemon interval').''; -$table->data[1][1] = html_print_input_text('netflow_interval', $config['netflow_interval'], false, 50, 200, true); +$table->data[0][] = html_print_label_input_block( + __('Daemon interval'), + html_print_input_text('netflow_interval', $config['netflow_interval'], false, 50, 200, true) +); -$table->data[2][0] = ''.__('Daemon binary path').''; -$table->data[2][1] = html_print_input_text('netflow_daemon', $config['netflow_daemon'], false, 50, 200, true); +$table->data[1][] = html_print_label_input_block( + __('Daemon binary path'), + html_print_input_text('netflow_daemon', $config['netflow_daemon'], false, 50, 200, true) +); -$table->data[3][0] = ''.__('Nfdump binary path').''; -$table->data[3][1] = html_print_input_text('netflow_nfdump', $config['netflow_nfdump'], false, 50, 200, true); +$table->data[1][] = html_print_label_input_block( + __('Nfdump binary path'), + html_print_input_text('netflow_nfdump', $config['netflow_nfdump'], false, 50, 200, true) +); -$table->data[4][0] = ''.__('Nfexpire binary path').''; -$table->data[4][1] = html_print_input_text('netflow_nfexpire', $config['netflow_nfexpire'], false, 50, 200, true); +$table->data[2][] = html_print_label_input_block( + __('Nfexpire binary path'), + html_print_input_text('netflow_nfexpire', $config['netflow_nfexpire'], false, 50, 200, true) +); -$table->data[5][0] = ''.__('Maximum chart resolution').''; -$table->data[5][1] = html_print_input_text('netflow_max_resolution', $config['netflow_max_resolution'], false, 50, 200, true); +$table->data[2][] = html_print_label_input_block( + __('Maximum chart resolution'), + html_print_input_text('netflow_max_resolution', $config['netflow_max_resolution'], false, 50, 200, true) +); -$table->data[6][0] = ''.__('Disable custom live view filters').''; -$table->data[6][1] = html_print_checkbox_switch('netflow_disable_custom_lvfilters', 1, $config['netflow_disable_custom_lvfilters'], true); -$table->data[7][0] = ''.__('Netflow max lifetime').''; -$table->data[7][1] = html_print_input_text('netflow_max_lifetime', $config['netflow_max_lifetime'], false, 50, 200, true); +$table->data[3][] = html_print_label_input_block( + __('Disable custom live view filters'), + html_print_checkbox_switch('netflow_disable_custom_lvfilters', 1, $config['netflow_disable_custom_lvfilters'], true) +); + +$table->data[3][] = html_print_label_input_block( + __('Netflow max lifetime'), + html_print_input_text('netflow_max_lifetime', $config['netflow_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('netflow_get_ip_hostname', 1, $config['netflow_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('netflow_get_ip_hostname', 1, $config['netflow_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 ''; diff --git a/pandora_console/godmode/setup/setup_visuals.php b/pandora_console/godmode/setup/setup_visuals.php index 589593ba49..7efaa24e6c 100755 --- a/pandora_console/godmode/setup/setup_visuals.php +++ b/pandora_console/godmode/setup/setup_visuals.php @@ -352,6 +352,42 @@ $table_styles->data[$row][] = html_print_label_input_block( 'width: 100%' ) ); + +$table_styles->data[$row][] = html_print_label_input_block( + __('Status icon set'), + html_print_div( + [ + 'class' => 'select-with-sibling', + 'content' => html_print_select( + $iconsets, + 'status_images_set', + $config['status_images_set'], + '', + '', + '', + true, + false, + true, + '', + false, + 'width: 240px' + ).html_print_button( + __('View'), + 'status_set_preview', + false, + '', + [ + 'icon' => 'camera', + 'mode' => 'link', + 'class' => 'logo_preview', + ], + true + ), + ], + true + ) +); + $row++; $table_styles->data[$row][] = html_print_label_input_block( __('Custom favicon'), @@ -374,7 +410,10 @@ $table_styles->data[$row][] = html_print_label_input_block( ).html_print_image( ui_get_favicon(), true, - ['id' => 'favicon_preview'] + [ + 'id' => 'favicon_preview', + 'style' => 'margin-left: 10px', + ] ), ], true @@ -498,7 +537,7 @@ $table_styles->data[$row][] = html_print_label_input_block( html_print_div( [ 'class' => 'select-with-sibling', - 'content' => $entOpenFilesInput.html_print_button( + 'content' => $customLogoLoginInput.html_print_button( __('View'), 'custom_logo_login_preview', $open, @@ -2041,47 +2080,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 '
'; 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 ''; diff --git a/pandora_console/godmode/users/configure_user.php b/pandora_console/godmode/users/configure_user.php index 06d06c9823..5fcf6a616c 100644 --- a/pandora_console/godmode/users/configure_user.php +++ b/pandora_console/godmode/users/configure_user.php @@ -1645,9 +1645,13 @@ if ($new_user === true) { html_print_input_hidden('json_profile', $json_profile); } -echo ''; - echo ''; + +// User Profile definition table. (Only where user is not creating). +if ($new_user === false && ((bool) check_acl($config['id_user'], 0, 'UM') === true)) { + profile_print_profile_table($id, io_safe_output($json_profile), false, ($is_err === true)); +} + echo ''; $actionButtons = []; diff --git a/pandora_console/godmode/users/user_list.php b/pandora_console/godmode/users/user_list.php index 57ddd56d50..a9f28ef4c6 100644 --- a/pandora_console/godmode/users/user_list.php +++ b/pandora_console/godmode/users/user_list.php @@ -451,9 +451,9 @@ if ($delete_user === true) { } } - $filter_group = (int) get_parameter('filter_group', 0); - $filter_search = get_parameter('filter_search', ''); - $search = (bool) get_parameter('search', false); +$filter_group = (int) get_parameter('filter_group', 0); +$filter_search = get_parameter('filter_search', ''); +$search = (bool) get_parameter('search', false); if (($filter_group == 0) && ($filter_search == '')) { $search = false; @@ -803,7 +803,6 @@ foreach ($info as $user_id => $user_info) { ); } - $data[4] .= '
'; $data[4] .= '
'; $total_profile++; diff --git a/pandora_console/godmode/users/user_management.php b/pandora_console/godmode/users/user_management.php index 9bd2d6a858..2a78ea0302 100644 --- a/pandora_console/godmode/users/user_management.php +++ b/pandora_console/godmode/users/user_management.php @@ -763,23 +763,3 @@ html_print_div( ); html_print_table($userManagementTable); -// User Profile definition table. (Only where user is not creating). -if ($new_user === false && ((bool) check_acl($config['id_user'], 0, 'UM') === true)) { - profile_print_profile_table($id, io_safe_output($json_profile), false, ($is_err === true)); -} - -?> - \ No newline at end of file diff --git a/pandora_console/godmode/wizards/DiscoveryTaskList.class.php b/pandora_console/godmode/wizards/DiscoveryTaskList.class.php index 1c3642b075..913e08e104 100644 --- a/pandora_console/godmode/wizards/DiscoveryTaskList.class.php +++ b/pandora_console/godmode/wizards/DiscoveryTaskList.class.php @@ -835,7 +835,10 @@ class DiscoveryTaskList extends HTML $data[6] = html_print_image( 'images/cluster@os.svg', true, - ['title' => __('Discovery Applications Microsoft SQL Server')] + [ + 'title' => __('Discovery Applications Microsoft SQL Server'), + 'class' => 'main_menu_icon invert_filter', + ] ).'  '; $data[6] .= __('Discovery.App.Microsoft SQL Server'); break; diff --git a/pandora_console/images/status_dot.svg b/pandora_console/images/status_dot.svg new file mode 100644 index 0000000000..3e9c8b2ead --- /dev/null +++ b/pandora_console/images/status_dot.svg @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file 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', ] ), ], diff --git a/pandora_console/include/class/ManageNetScanScripts.class.php b/pandora_console/include/class/ManageNetScanScripts.class.php index a65f728ef1..adfedf3e26 100644 --- a/pandora_console/include/class/ManageNetScanScripts.class.php +++ b/pandora_console/include/class/ManageNetScanScripts.class.php @@ -453,7 +453,7 @@ class ManageNetScanScripts extends Wizard 'delete', 'images/delete.svg', 1, - 'width:40px;', + '', true, [ 'title' => __('Delete Script'), diff --git a/pandora_console/include/class/ModuleTemplates.class.php b/pandora_console/include/class/ModuleTemplates.class.php index 2e777bdf4c..bfb02c7ae8 100644 --- a/pandora_console/include/class/ModuleTemplates.class.php +++ b/pandora_console/include/class/ModuleTemplates.class.php @@ -868,7 +868,7 @@ class ModuleTemplates extends HTML 'delete_profile', 'images/delete.svg', $row['id_np'], - 'width:40px', + '', true, [ 'onclick' => 'if (!confirm(\''.__('Are you sure?').'\')) return false;', @@ -1156,7 +1156,7 @@ class ModuleTemplates extends HTML 'del_block_'.$id_group.'_', 'images/delete.svg', 1, - 'width: 40px', + '', true, [ 'title' => __('Delete this block'), @@ -1253,7 +1253,7 @@ class ModuleTemplates extends HTML 'del_module_'.$module['component_id'].'_', 'images/delete.svg', 1, - 'width:40px;', + '', true, [ 'title' => __('Delete this module'), diff --git a/pandora_console/include/class/TipsWindow.class.php b/pandora_console/include/class/TipsWindow.class.php index 2ed452cc98..0dffdb7994 100644 --- a/pandora_console/include/class/TipsWindow.class.php +++ b/pandora_console/include/class/TipsWindow.class.php @@ -121,6 +121,10 @@ class TipsWindow } ui_require_css_file('tips_window'); + 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'); @@ -435,7 +439,14 @@ class TipsWindow 'title', 'text', 'enable', - 'actions', + [ + 'text' => 'edit', + 'class' => 'table_action_buttons', + ], + [ + 'text' => 'delete', + 'class' => 'table_action_buttons', + ], ]; $columnNames = [ @@ -443,7 +454,8 @@ class TipsWindow __('Title'), __('Text'), __('Enable'), - __('Actions'), + __('Edit'), + __('Delete'), ]; // Load datatables user interface. @@ -451,7 +463,9 @@ class TipsWindow [ 'id' => 'list_tips_windows', 'class' => 'info_table', - 'style' => 'width: 100%', + 'style' => 'width: 99%', + 'dom_elements' => 'lpfti', + 'filter_main_class' => 'box-flat white_table_graph fixed_filter_bar', 'columns' => $columns, 'column_names' => $columnNames, 'ajax_url' => $this->ajaxController, @@ -474,18 +488,19 @@ class TipsWindow ], ] ); - echo '
'; - echo ''; - html_print_submit_button( + echo ''; } catch (Exception $e) { echo $e->getMessage(); @@ -585,16 +600,15 @@ class TipsWindow $data[$key]['title'] = io_safe_output($row['title']); $data[$key]['text'] = io_safe_output($row['text']); $data[$key]['url'] = io_safe_output($row['url']); - $data[$key]['actions'] = '
'; - $data[$key]['actions'] .= ''; - $data[$key]['actions'] .= html_print_image( + $data[$key]['edit'] = ''; + $data[$key]['edit'] .= html_print_image( 'images/edit.svg', true, ['class' => 'main_menu_icon'] ); - $data[$key]['actions'] .= ''; - $data[$key]['actions'] .= '
'; - $data[$key]['actions'] .= html_print_input_image( + $data[$key]['edit'] .= ''; + $data[$key]['delete'] .= ''; + $data[$key]['delete'] .= html_print_input_image( 'button_delete_tip', 'images/delete.svg', '', @@ -602,12 +616,11 @@ class TipsWindow true, [ 'onclick' => 'if (!confirm(\''.__('Are you sure?').'\')) return false;', - 'class' => 'main_menu_icon', + 'class' => 'main_menu_icon invert_filter', ] ); - $data[$key]['actions'] .= html_print_input_hidden('idTip', $row['id'], true); - $data[$key]['actions'] .= '
'; - $data[$key]['actions'] .= '
'; + $data[$key]['delete'] .= html_print_input_hidden('idTip', $row['id'], true); + $data[$key]['delete'] .= ''; } if (empty($data) === true) { @@ -680,14 +693,50 @@ 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] .= 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', @@ -695,41 +744,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, @@ -737,8 +781,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']); @@ -790,7 +837,7 @@ class TipsWindow true, [ 'onclick' => 'deleteImage(this, \''.$value['id'].'\', \''.$namePath.'\')', - 'class' => 'remove-image', + 'class' => 'remove-image main_menu_icon', ] ); $outputImagesTip .= html_print_div( @@ -812,16 +859,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', @@ -829,41 +912,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); - 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, @@ -871,9 +948,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/config_process.php b/pandora_console/include/config_process.php index 234144c53d..fe1c1d7ff1 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 = 'PC230316'; +$build_version = 'PC230317'; $pandora_version = 'v7.0NG.769'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/include/functions_html.php b/pandora_console/include/functions_html.php index 2be81a9800..40b0752d9d 100644 --- a/pandora_console/include/functions_html.php +++ b/pandora_console/include/functions_html.php @@ -4565,12 +4565,6 @@ function html_print_image( // Dont use safe_input here or the performance will dead. $style = ''; - if (empty($options) === false && isset($options['class']) === true) { - $options['class'] .= ' main_menu_icon'; - } else { - $options['class'] = 'main_menu_icon invert_filter'; - } - if (!empty($options)) { // Deprecated or value-less attributes. if (isset($options['align'])) { diff --git a/pandora_console/include/functions_profile.php b/pandora_console/include/functions_profile.php index f9d52ae289..57c821375b 100644 --- a/pandora_console/include/functions_profile.php +++ b/pandora_console/include/functions_profile.php @@ -192,7 +192,7 @@ function profile_print_profile_table($id, $json_profile=false, $return=false, $c $table->width = '100%'; $table->class = 'info_table'; - echo '
'; + echo '
'; echo '

'.$title.'

'; $table->data = []; @@ -312,12 +312,12 @@ function profile_print_profile_table($id, $json_profile=false, $return=false, $c true, [ 'onclick' => 'delete_profile(event, this)', - 'class' => 'invert_filter', + 'class' => 'main_menu_icon invert_filter', ] ); } else { $data['actions'] = '
'; - $data['actions'] .= html_print_input_image('del', 'images/delete.svg', 1, 'width:40px; height: 28px', true); + $data['actions'] .= html_print_input_image('del', 'images/delete.svg', 1, '', true, ['class' => 'main_menu_icon invert_filter']); $data['actions'] .= html_print_input_hidden('delete_profile', 1, true); $data['actions'] .= html_print_input_hidden('id_user_profile', $profile['id_up'], true); $data['actions'] .= html_print_input_hidden('id_user', $id, true); @@ -391,7 +391,7 @@ function profile_print_profile_table($id, $json_profile=false, $return=false, $c $data['last_hierarchy'] = html_print_checkbox('no_hierarchy', 1, false, true); - $data['last_actions'] = html_print_input_image('add', 'images/validate.svg', 1, 'width: 40px; height: 28px', true); + $data['last_actions'] = html_print_input_image('add', 'images/validate.svg', 1, '', true, ['class' => 'main_menu_icon invert_filter']); $data['last_actions'] .= html_print_input_hidden('id', $id, true); $data['last_actions'] .= html_print_input_hidden('add_profile', 1, true); $data['last_actions'] .= '
'; diff --git a/pandora_console/include/javascript/pandora_events.js b/pandora_console/include/javascript/pandora_events.js index e3f4040205..2f657779a6 100644 --- a/pandora_console/include/javascript/pandora_events.js +++ b/pandora_console/include/javascript/pandora_events.js @@ -972,6 +972,9 @@ function openSoundEventModal(settings) { width: 600, height: 600, open: function() { + $(".ui-widget-overlay") + .css("background", "black") + .css("opacity", 0.5); $.ajax({ method: "post", url: settings.url, diff --git a/pandora_console/include/javascript/pandora_ui.js b/pandora_console/include/javascript/pandora_ui.js index 944c454747..95ffe898b0 100644 --- a/pandora_console/include/javascript/pandora_ui.js +++ b/pandora_console/include/javascript/pandora_ui.js @@ -352,10 +352,10 @@ function load_modal(settings) { } } else { // No onsumbit configured. Directly close. - d.dialog("close"); if (document.getElementById(settings.form) != undefined) { document.getElementById(settings.form).submit(); } + d.dialog("close"); } }; diff --git a/pandora_console/include/javascript/tipsWindow.js b/pandora_console/include/javascript/tipsWindow.js index 1f63c2bbe2..94d28c9339 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/pandora.css b/pandora_console/include/styles/pandora.css index 01801cd5bc..bf60df270e 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -304,6 +304,8 @@ td input[type="checkbox"] { input[type="image"] { border: 0px; background-color: transparent; + height: auto; + padding: 0px; } .container-div-input-password input { @@ -1421,7 +1423,7 @@ div#menu_container { div#menu { width: 45px; float: left; - z-index: 2; + z-index: 3; position: absolute; } @@ -1436,7 +1438,7 @@ div#head { min-width: 882px; background-color: #fff; color: #000; - z-index: 2; + z-index: 3; } .fixed_header { @@ -1793,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; @@ -8255,6 +8257,11 @@ div.graph div.legend table { justify-content: center; } +.flex_justify_end { + display: flex; + justify-content: end; +} + .span_priority { width: 20px; height: 10px; @@ -10546,6 +10553,18 @@ button div.cog.rotation { animation: rotation 4s infinite linear; } +div.status_dot { + mask: url(../../images/status_dot.svg) no-repeat center / contain; + -webkit-mask: url(../../images/status_dot.svg) no-repeat center / contain; +} + +.status_dot.ok { + background-color: #82b92e; +} + +.status_dot.critical { + background-color: #e63c52; +} @keyframes rotation { from { transform: rotate(0deg); @@ -11245,8 +11264,9 @@ img.main_menu_icon[src$=".svg"] { } input.main_menu_icon[src$=".svg"] { - width: 22px; - height: 22px; + width: 20px; + height: 20px; + padding: 0px; } .header_help_icon { diff --git a/pandora_console/include/styles/pandora_black.css b/pandora_console/include/styles/pandora_black.css index 62af20b92f..35a0c64e54 100644 --- a/pandora_console/include/styles/pandora_black.css +++ b/pandora_console/include/styles/pandora_black.css @@ -1515,3 +1515,13 @@ div.fixed-bottom-box span.select2 { border-radius: 6px; } + +.ui-dialog .tips_header.ui-dialog-titlebar { + color: white !important; + background-color: #222222 !important; +} + +#tips_window_modal > div.window > div.description > #title_tip, +#tips_window_modal > div.window > div.description > #text_tip { + color: white !important; +} 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/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/index.php b/pandora_console/index.php index a2c9d62167..441bcc63fa 100755 --- a/pandora_console/index.php +++ b/pandora_console/index.php @@ -1522,13 +1522,6 @@ require 'include/php_to_js_values.php';