From e99ad97e17c6b16380e2d8f5a0930e950ea4cc72 Mon Sep 17 00:00:00 2001 From: Jose Gonzalez Date: Tue, 7 Feb 2023 15:33:29 +0100 Subject: [PATCH] Fixes and improvements --- .../agentes/module_manager_editor_common.php | 65 ++----------------- .../godmode/users/configure_profile.php | 4 +- .../godmode/users/configure_user.php | 4 +- .../godmode/users/profile_list.php | 2 +- pandora_console/godmode/users/user_list.php | 8 +-- .../godmode/users/user_management.php | 38 ++--------- pandora_console/images/suitcase@svg.svg | 10 +++ pandora_console/images/tag@svg.svg | 9 +++ pandora_console/include/functions_html.php | 23 +++++++ pandora_console/include/styles/pandora.css | 2 +- .../include/styles/select2.min.css | 2 +- 11 files changed, 63 insertions(+), 104 deletions(-) create mode 100644 pandora_console/images/suitcase@svg.svg create mode 100644 pandora_console/images/tag@svg.svg diff --git a/pandora_console/godmode/agentes/module_manager_editor_common.php b/pandora_console/godmode/agentes/module_manager_editor_common.php index cd149dd5ca..1af7a2ea4a 100644 --- a/pandora_console/godmode/agentes/module_manager_editor_common.php +++ b/pandora_console/godmode/agentes/module_manager_editor_common.php @@ -719,17 +719,7 @@ $table_advanced->cellclass = []; $table_advanced->colspan = []; $table_advanced->rowspan = []; -$table_advanced->rowclass['title_1'] = 'w100p'; -$table_advanced->cellstyle['title_1'][0] = 'width: 40px;'; -$table_advanced->cellstyle['title_1'][1] = 'width: 100%;'; -$table_advanced->data['title_1'][0] = html_print_div( - [ - 'class' => 'section_table_title_line', - 'content' => '', - ], - true -); -$table_advanced->data['title_1'][1] = html_print_subtitle_table(__('Identification and Categorization'), [], true); +$table_advanced->data['title_1'] = html_print_full_subtitle_table(__('Identification and Categorization')); $table_advanced->rowclass['captions_custom_category'] = 'field_half_width pdd_t_10px'; $table_advanced->rowclass['custom_id_category'] = 'field_half_width'; $table_advanced->data['captions_custom_category'][0] = __('Custom ID'); @@ -1054,17 +1044,7 @@ $table_advanced->data['textarea_crit_warn_instructions'][1] = html_print_textare $largeClassDisabledBecauseInPolicy ); -$table_advanced->rowclass['title_2'] = 'w100p mrgn_top_20px'; -$table_advanced->cellstyle['title_2'][0] = 'width: 40px;'; -$table_advanced->cellstyle['title_2'][1] = 'width: 100%;'; -$table_advanced->data['title_2'][0] = html_print_div( - [ - 'class' => 'section_table_title_line', - 'content' => '', - ], - true -); -$table_advanced->data['title_2'][1] = html_print_subtitle_table(__('Execution interval'), [], true); +$table_advanced->data['title_2'] = html_print_full_subtitle_table(__('Execution interval')); $table_advanced->data['caption_execution_interval'][0] = __('Interval'); $table_advanced->data['execution_interval'][0] = ''.$outputExecutionInterval.''; @@ -1100,17 +1080,7 @@ if (isset($id_agente) === true && (int) $moduletype === MODULE_DATA) { $table_advanced->rowclass['cron_section'] = 'table_section full_section'; $table_advanced->data['cron_section'] = html_print_table($tableCron, true); -$table_advanced->rowclass['title_3'] = 'w100p mrgn_top_20px'; -$table_advanced->cellstyle['title_3'][0] = 'width: 40px;'; -$table_advanced->cellstyle['title_3'][1] = 'width: 100%;'; -$table_advanced->data['title_3'][0] = html_print_div( - [ - 'class' => 'section_table_title_line', - 'content' => '', - ], - true -); -$table_advanced->data['title_3'][1] = html_print_subtitle_table(__('Thresholds and state changes'), [], true); +$table_advanced->data['title_3'] = html_print_full_subtitle_table(__('Thresholds and state changes')); $table_advanced->rowclass['caption_min_max_values'] = 'w50p pdd_t_10px'; $table_advanced->rowclass['min_max_values'] = 'w50p'; @@ -1332,17 +1302,7 @@ $table_advanced->data['ff_keep_counters'][0] = html_print_checkbox_switch( $disabledBecauseInPolicy ); -$table_advanced->rowclass['title_4'] = 'w100p mrgn_top_20px'; -$table_advanced->cellstyle['title_4'][0] = 'width: 40px;'; -$table_advanced->cellstyle['title_4'][1] = 'width: 100%;'; -$table_advanced->data['title_4'][0] = html_print_div( - [ - 'class' => 'section_table_title_line', - 'content' => '', - ], - true -); -$table_advanced->data['title_4'][1] = html_print_subtitle_table(__('Data and their processing'), [], true); +$table_advanced->data['title_4'] = html_print_full_subtitle_table(__('Data and their processing')); $table_advanced->rowclass['caption_process_unit'] = 'w50p'; $table_advanced->rowclass['process_unit'] = 'w50p'; @@ -1372,22 +1332,7 @@ $table_advanced->data['process_unit'][1] = html_print_extended_select_for_post_p $disabledBecauseInPolicy ); -$table_advanced->rowclass['title_5'] = 'w100p mrgn_top_20px'; -$table_advanced->cellstyle['title_5'][0] = 'width: 40px;'; -$table_advanced->cellstyle['title_5'][1] = 'width: 100%;'; -$table_advanced->data['title_5'][0] = html_print_div( - [ - 'class' => 'section_table_title_line', - 'content' => '', - ], - true -); -$table_advanced->data['title_5'][1] = html_print_subtitle_table( - __('Notifications and alerts'), - [], - true -); - +$table_advanced->data['title_5'] = html_print_full_subtitle_table(__('Notifications and alerts')); $table_advanced->data['caption_export_target'][0] = __('Export target'); if ($__code_from === 'policies') { diff --git a/pandora_console/godmode/users/configure_profile.php b/pandora_console/godmode/users/configure_profile.php index 7ce1a25da1..579a99b5aa 100644 --- a/pandora_console/godmode/users/configure_profile.php +++ b/pandora_console/godmode/users/configure_profile.php @@ -61,11 +61,11 @@ if (is_metaconsole() === false) { 'profile' => [ 'active' => false, 'text' => ''.html_print_image( - 'images/profiles.png', + 'images/suitcase@svg.svg', true, [ 'title' => __('Profile management'), - 'class' => 'invert_filter', + 'class' => 'invert_filter main_menu_icon', ] ).'', ], diff --git a/pandora_console/godmode/users/configure_user.php b/pandora_console/godmode/users/configure_user.php index 2bf7a48960..706dcc6a0a 100644 --- a/pandora_console/godmode/users/configure_user.php +++ b/pandora_console/godmode/users/configure_user.php @@ -249,11 +249,11 @@ if (is_metaconsole() === true) { 'profile' => [ 'active' => false, 'text' => ''.html_print_image( - 'images/profiles.png', + 'images/suitcase@svg.svg', true, [ 'title' => __('Profile management'), - 'class' => 'invert_filter', + 'class' => 'invert_filter main_menu_icon', ] ).'', ], diff --git a/pandora_console/godmode/users/profile_list.php b/pandora_console/godmode/users/profile_list.php index 8b9984bf31..5e7525405c 100644 --- a/pandora_console/godmode/users/profile_list.php +++ b/pandora_console/godmode/users/profile_list.php @@ -68,7 +68,7 @@ if (is_metaconsole() === false) { 'profile' => [ 'active' => false, 'text' => ''.html_print_image( - 'images/profiles.png', + 'images/suitcase@svg.svg', true, [ 'title' => __('Profile management'), diff --git a/pandora_console/godmode/users/user_list.php b/pandora_console/godmode/users/user_list.php index 42c8b0d9c1..7d59008407 100644 --- a/pandora_console/godmode/users/user_list.php +++ b/pandora_console/godmode/users/user_list.php @@ -251,18 +251,18 @@ if (is_metaconsole() === true) { true, [ 'title' => __('User management'), - 'class' => 'invert_filter', + 'class' => 'invert_filter main_menu_icon', ] ).'', ], 'profile' => [ 'active' => false, 'text' => ''.html_print_image( - 'images/profiles.png', + 'images/suitcase@svg.svg', true, [ 'title' => __('Profile management'), - 'class' => 'invert_filter', + 'class' => 'invert_filter main_menu_icon', ] ).'', ], @@ -276,7 +276,7 @@ if (is_metaconsole() === true) { true, [ 'title' => __('User management'), - 'class' => 'invert_filter', + 'class' => 'invert_filter main_menu_icon', ] ).'', ], diff --git a/pandora_console/godmode/users/user_management.php b/pandora_console/godmode/users/user_management.php index d73da04b4d..5119c5ced4 100644 --- a/pandora_console/godmode/users/user_management.php +++ b/pandora_console/godmode/users/user_management.php @@ -138,14 +138,7 @@ $userManagementTable->colspan = []; $userManagementTable->rowspan = []; // Title for Profile information. -$userManagementTable->data['title_profile_information'][0] = html_print_div( - [ - 'class' => 'section_table_title_line', - 'content' => '', - ], - true -); -$userManagementTable->data['title_profile_information'][1] = html_print_subtitle_table(__('Profile information'), [], true); +$userManagementTable->data['title_profile_information'] = html_print_full_subtitle_table(__('Profile information')); // Id user. if ($new_user === true) { @@ -395,14 +388,7 @@ $userManagementTable->data['fields_userSessionTime'][0] .= ui_print_input_placeh ); // Title for Autorefresh. -$userManagementTable->data['title_autorefresh'][0] = html_print_div( - [ - 'class' => 'section_table_title_line', - 'content' => '', - ], - true -); -$userManagementTable->data['title_autorefresh'][1] = html_print_subtitle_table(__('Autorefresh'), [], true); +$userManagementTable->data['title_autorefresh'] = html_print_full_subtitle_table(__('Autorefresh')); // Autorefresh selects. $select_out = html_print_select( @@ -557,15 +543,8 @@ $userManagementTable->data['fields_autorefreshTime'][0] .= ui_print_input_placeh ); // Title for Language and Appearance. -$userManagementTable->data['title_lookAndFeel'][0] = html_print_div( - [ - 'class' => 'section_table_title_line', - 'content' => '', - ], - true -); -$userManagementTable->data['title_lookAndFeel'][1] = html_print_subtitle_table(__('Language and Appearance'), [], true); - +$userManagementTable->data['title_lookAndFeel'] = html_print_full_subtitle_table(__('Language and Appearance')); +// Language and color scheme. $userManagementTable->rowclass['captions_lang_colorscheme'] = 'field_half_width'; $userManagementTable->rowclass['fields_lang_colorscheme'] = 'field_half_width'; $userManagementTable->data['captions_lang_colorscheme'][0] = __('Language'); @@ -664,14 +643,7 @@ $userManagementTable->data['fields_timezone'][1] = html_print_div( ); // Title for Language and Appearance. -$userManagementTable->data['title_additionalSettings'][0] = html_print_div( - [ - 'class' => 'section_table_title_line', - 'content' => '', - ], - true -); -$userManagementTable->data['title_additionalSettings'][1] = html_print_subtitle_table(__('Additional settings'), [], true); +$userManagementTable->data['title_additionalSettings'] = html_print_full_subtitle_table(__('Additional settings')); $userManagementTable->rowclass['captions_addSettings'] = 'field_half_width'; $userManagementTable->rowclass['fields_addSettings'] = 'field_half_width'; diff --git a/pandora_console/images/suitcase@svg.svg b/pandora_console/images/suitcase@svg.svg new file mode 100644 index 0000000000..472812be5c --- /dev/null +++ b/pandora_console/images/suitcase@svg.svg @@ -0,0 +1,10 @@ + + + + Dark / 20 / suitcase@svg + Created with Sketch. + + + + + \ No newline at end of file diff --git a/pandora_console/images/tag@svg.svg b/pandora_console/images/tag@svg.svg new file mode 100644 index 0000000000..49604b2688 --- /dev/null +++ b/pandora_console/images/tag@svg.svg @@ -0,0 +1,9 @@ + + + + Dark / 20 / tag@svg + Created with Sketch. + + + + \ No newline at end of file diff --git a/pandora_console/include/functions_html.php b/pandora_console/include/functions_html.php index f094e4a1c7..33981b7523 100644 --- a/pandora_console/include/functions_html.php +++ b/pandora_console/include/functions_html.php @@ -6597,6 +6597,29 @@ function html_print_subtitle_table(string $caption, array $options=[], bool $ret } +/** + * Same behaviour like html_print_subtitle_table, in this case, return all formed subtitle with the new Pandora's style. + * + * @param string $caption Caption of title. + * @param array $options Available options. + * - `id`: string + * - `style`: string + * - `class`: string. `section_table_title` by default. + * - `wrapper`: string. Must be a valid tag. + * - `wrapper_attributes`: string. Valid attributes for a wrapper. + * + * @return array. + */ +function html_print_full_subtitle_table(string $caption, array $options=[]) +{ + $output = []; + $output[0] = html_print_div([ 'class' => 'section_table_title_line' ], true); + $output[1] = html_print_subtitle_table($caption, $options, true); + + return $output; +} + + /** * Prints a menu button. * diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index 6ebb9a9b69..70494669bd 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -1723,7 +1723,7 @@ div.title_line { #menu_tab_frame_view_bc { position: sticky; top: 59px; - z-index: 10000; + z-index: 1000; display: flex; align-items: flex-end; justify-content: space-between; diff --git a/pandora_console/include/styles/select2.min.css b/pandora_console/include/styles/select2.min.css index ddace20c46..ba24d67270 100644 --- a/pandora_console/include/styles/select2.min.css +++ b/pandora_console/include/styles/select2.min.css @@ -71,7 +71,7 @@ position: absolute; left: -100000px; width: 100%; - z-index: 1051; + z-index: 999; } .select2-results { display: block;