From 72990ab177c008d424b738022cf91873865a735a Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Wed, 8 Mar 2023 16:41:26 +0100 Subject: [PATCH 1/4] #9662 Fixed pandora black --- pandora_console/include/styles/menu.css | 4 +- .../include/styles/pandora_black.css | 87 +++++++++++++++++-- 2 files changed, 80 insertions(+), 11 deletions(-) diff --git a/pandora_console/include/styles/menu.css b/pandora_console/include/styles/menu.css index db1eebb9da..b8085838bb 100644 --- a/pandora_console/include/styles/menu.css +++ b/pandora_console/include/styles/menu.css @@ -598,7 +598,7 @@ ul li { display: flex; align-items: center; justify-content: space-evenly; - min-height: 53px; + min-height: 50px; } .tabs_li { @@ -637,7 +637,7 @@ ul li { } .tabs_collapsed { - height: 53px; + height: 50px; display: flex; justify-content: center; align-items: center; diff --git a/pandora_console/include/styles/pandora_black.css b/pandora_console/include/styles/pandora_black.css index b09d441686..da9f58a9de 100644 --- a/pandora_console/include/styles/pandora_black.css +++ b/pandora_console/include/styles/pandora_black.css @@ -67,11 +67,22 @@ table.agent_info_table tr { color: #fff !important; } -div#head, -#menu_tabs { +div#head { border-bottom: 1px solid #1a1a1a; } +.menu_full_classic #menu_tabs { + height: 49px; + border-bottom: 1px solid #82b92e; + padding-bottom: 2px; +} + +.menu_full_collapsed #menu_tabs { + height: 49px; + border-bottom: 1px solid #82b92e; + padding-bottom: 1px; +} + #menu_full { border-right: 1px solid #111; } @@ -248,13 +259,10 @@ ol.steps li a { /* Tabs icons change color */ /* menu.css */ -.operation { - background-color: #252525; -} - +.operation, .godmode, #menu_full { - background-color: #1a1a1a; + background-color: #222; } .button_collapse { @@ -264,11 +272,72 @@ ol.steps li a { .operation .selected, .godmode .selected, .menu_icon:hover { - background-color: #080808; + background-color: #191919; +} + +.submenu_text, +.span_has_menu_text, +.title_menu_classic span { + font-size: 14px; + font-weight: normal; + letter-spacing: -0.3px; + height: 18px; + color: #fff; +} + +.head_tab_selected span { + color: #fff; +} + +.tabs_selected { + background-color: #1d7874; +} + +.operation .menu_icon ul.submenu > li, +.godmode .menu_icon ul.submenu > li { + background-color: #222; + padding-left: 24px !important; +} + +.submenu_not_selected:hover { + background-color: #171717 !important; + color: #fff !important; +} + +.submenu_selected { + margin-bottom: 0px; + background-color: #171717 !important; +} + +.submenu_selected_no_submenu { + background-color: #111 !important; + color: #ffffff !important; } .sub_subMenu { - background-color: #343434; + font-weight: normal; + background-color: #171717; + padding-left: 1.5em; + color: #fff !important; +} + +.sub_subMenu.selected { + font-weight: 600; + background-color: #111 !important; +} + +.sub_subMenu:hover { + background-color: #141414; +} + +.sub_subMenu.selected a { + color: #fff !important; +} + +.span_has_menu_text { + font-weight: normal; + font-size: 9.4pt; + color: #fff; } /* footer */ From 54e6a99cc3c0ca65593a71a7e1b1aa0c6fab1749 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Wed, 8 Mar 2023 17:09:42 +0100 Subject: [PATCH 2/4] Dashboard pagination visual position --- pandora_console/include/styles/pandora.css | 3 +++ pandora_console/views/dashboard/listWidgets.php | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index f694d788c6..43e66868bd 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -7535,6 +7535,9 @@ div.graph div.legend table { .pdd_t_0px { padding-top: 0px; } +.pdd_t_0px_important { + padding-top: 0px !important; +} .pdd_t_3px { padding-top: 3px; diff --git a/pandora_console/views/dashboard/listWidgets.php b/pandora_console/views/dashboard/listWidgets.php index c7cac752f0..5ce90af8c7 100644 --- a/pandora_console/views/dashboard/listWidgets.php +++ b/pandora_console/views/dashboard/listWidgets.php @@ -48,6 +48,7 @@ $inputs = [ 'class' => 'search_input', 'autofocus' => true, ], + 'class' => 'pdd_t_0px_important', ], ]; @@ -58,9 +59,8 @@ HTML::printForm( ] ); -ui_pagination($total, '#', $offset, 9); -$output = '
'; +$output = '
'; foreach ($widgets as $widget) { $urlWidgets = $config['homedir']; @@ -97,3 +97,5 @@ foreach ($widgets as $widget) { $output .= '
'; echo $output; + +ui_pagination($total, '#', $offset, 9, false, 'offset', false, 'center mrgn_top_10px'); From bb1d9c323d4772ba05cd5e51a281ab578453569a Mon Sep 17 00:00:00 2001 From: Pablo Aragon Date: Wed, 8 Mar 2023 17:12:15 +0100 Subject: [PATCH 3/4] Admin tools --- pandora_console/godmode/setup/links.php | 98 +++++++++++++------ .../include/class/Diagnostics.class.php | 14 ++- .../include/styles/diagnostics.css | 4 +- pandora_console/include/styles/omnishell.css | 16 --- 4 files changed, 78 insertions(+), 54 deletions(-) diff --git a/pandora_console/godmode/setup/links.php b/pandora_console/godmode/setup/links.php index f1a5e9fca2..7bd589fe27 100644 --- a/pandora_console/godmode/setup/links.php +++ b/pandora_console/godmode/setup/links.php @@ -25,7 +25,20 @@ if (! check_acl($config['id_user'], 0, 'PM') && ! is_user_admin($config['id_user } // Header -ui_print_page_header(__('Link management'), 'images/extensions.png', false, '', true, ''); +ui_print_standard_header( + __('Admin tools'), + 'images/extensions.png', + false, + '', + true, + [], + [ + [ + 'link' => '', + 'label' => __('Link management'), + ], + ] +); if (isset($_POST['create'])) { @@ -98,7 +111,7 @@ if ((isset($_GET['form_add'])) or (isset($_GET['form_edit']))) { $link = ''; } - echo ''; + echo '
'; echo ''; if ($creation_mode == 1) { echo ""; @@ -112,17 +125,42 @@ if ((isset($_GET['form_add'])) or (isset($_GET['form_edit']))) { } echo "'>"; - echo ' - - '; - echo ' - - '; - echo ''; + echo ''; + echo ''; + echo ''; echo '
'.__('Link name').'
'.__('Link').' -
'; + echo html_print_label_input_block( + __('Link name'), + html_print_input_text( + 'name', + $nombre, + '', + 50, + 255, + true, + false, + true, + '', + 'text_input' + ) + ); + echo ''; + echo html_print_label_input_block( + __('Link'), + html_print_input_text( + 'link', + $link, + '', + 50, + 255, + true, + false, + true, + '', + 'text_input' + ) + ); + echo '
'; - echo ""; - echo "
"; if (isset($_GET['form_add']) === true) { $actionForPerform = __('Create'); $iconForPerform = 'wand'; @@ -131,16 +169,14 @@ if ((isset($_GET['form_add'])) or (isset($_GET['form_edit']))) { $iconForPerform = 'update'; } - html_print_div( - [ - 'class' => 'action-buttons', - 'content' => html_print_submit_button( - $actionForPerform, - 'crtbutton', - false, - [ 'icon' => $iconForPerform ] - ), - ], + html_print_action_buttons( + html_print_submit_button( + $actionForPerform, + 'crtbutton', + false, + [ 'icon' => $iconForPerform ], + true + ) ); echo '
'; @@ -185,16 +221,14 @@ if ((isset($_GET['form_add'])) or (isset($_GET['form_edit']))) { echo ""; echo "
"; - html_print_div( - [ - 'class' => 'action-buttons', - 'content' => html_print_submit_button( - __('Add'), - 'form_add', - false, - [ 'icon' => 'wand' ] - ), - ], + html_print_action_buttons( + html_print_submit_button( + __('Add'), + 'form_add', + false, + [ 'icon' => 'wand' ], + true + ) ); echo '
'; diff --git a/pandora_console/include/class/Diagnostics.class.php b/pandora_console/include/class/Diagnostics.class.php index 02bec5060d..f7a660f2c4 100644 --- a/pandora_console/include/class/Diagnostics.class.php +++ b/pandora_console/include/class/Diagnostics.class.php @@ -155,13 +155,19 @@ class Diagnostics extends Wizard ]; // Header. - ui_print_page_header( - __('%s Diagnostic tool', $this->product_name), + ui_print_standard_header( + __('Admin tools'), 'images/gm_massive_operations.png', false, '', true, - $header_buttons + $header_buttons, + [ + [ + 'link' => '', + 'label' => __('%s Diagnostic tool', $this->product_name), + ], + ] ); // Print all Methods Diagnostic Info. @@ -1569,7 +1575,7 @@ class Diagnostics extends Wizard [ 'id' => $tableId, 'class' => 'info_table caption_table', - 'style' => 'width: 100%', + 'style' => 'width: 99%', 'columns' => $columns, 'column_names' => $columnNames, 'ajax_data' => [ diff --git a/pandora_console/include/styles/diagnostics.css b/pandora_console/include/styles/diagnostics.css index 6591adabff..706038cbd0 100644 --- a/pandora_console/include/styles/diagnostics.css +++ b/pandora_console/include/styles/diagnostics.css @@ -8,8 +8,8 @@ text-align: center; font-size: 1.5em; font-weight: bolder; - color: #fff; - background: #282828; + color: #000; + background: var(--secondary-color); padding: 8px; } diff --git a/pandora_console/include/styles/omnishell.css b/pandora_console/include/styles/omnishell.css index 03810e9a89..7d97fdd866 100644 --- a/pandora_console/include/styles/omnishell.css +++ b/pandora_console/include/styles/omnishell.css @@ -489,14 +489,6 @@ li > .select2-selection { padding: 0px !important; } -.box-flat { - margin: 20px; -} - -.mrgn_20px { - margin: 20px !important; -} - .omnishell_results_wrapper { max-width: 100% !important; } @@ -547,10 +539,6 @@ ul.datatable_filter > li > div.action-buttons > button { height: auto !important; } -.action_buttons_right_content { - padding-left: 20px; -} - #image-1, #image-2 { padding-left: 0px !important; @@ -560,10 +548,6 @@ ul.datatable_filter > li > div.action-buttons > button { margin-bottom: 10px !important; } -.dataTables_length { - margin-bottom: 50px !important; -} - .item_status_tree_view { position: initial; } From e21d9968e818e2015fb6088f5fd3511b503402b7 Mon Sep 17 00:00:00 2001 From: daniel Date: Wed, 8 Mar 2023 19:25:25 +0100 Subject: [PATCH 4/4] fixed styles --- pandora_console/general/header.php | 4 - .../godmode/agentes/module_manager.php | 216 ------------------ .../agentes/module_manager_editor_common.php | 8 +- pandora_console/include/class/HTML.class.php | 2 +- pandora_console/include/functions_ui.php | 4 +- pandora_console/include/styles/pandora.css | 3 +- pandora_console/index.php | 4 + 7 files changed, 13 insertions(+), 228 deletions(-) diff --git a/pandora_console/general/header.php b/pandora_console/general/header.php index c4915e366d..81526eb129 100644 --- a/pandora_console/general/header.php +++ b/pandora_console/general/header.php @@ -471,10 +471,6 @@ echo sprintf('
', $menuTypeClass);
- - - - diff --git a/pandora_console/godmode/agentes/module_manager.php b/pandora_console/godmode/agentes/module_manager.php index 1c6cd62be4..fe27bf4bb1 100644 --- a/pandora_console/godmode/agentes/module_manager.php +++ b/pandora_console/godmode/agentes/module_manager.php @@ -34,7 +34,6 @@ $url = sprintf( $url_id_agente ); -enterprise_include('godmode/agentes/module_manager.php'); $isFunctionPolicies = enterprise_include_once('include/functions_policies.php'); require_once $config['homedir'].'/include/functions_modules.php'; require_once $config['homedir'].'/include/functions_agents.php'; @@ -51,196 +50,10 @@ if (isset($policy_page) === false) { $checked = (bool) get_parameter('checked'); $sec2 = (string) get_parameter('sec2'); -// Table for filter bar. -$filterTable = new stdClass(); -$filterTable->class = 'fixed_filter_bar'; -$filterTable->data = []; -$filterTable->cellstyle[0][0] = 'width:0'; -$filterTable->data[0][0] = __('Search'); -$filterTable->data[1][0] .= html_print_input_text( - 'search_string', - $search_string, - '', - 30, - 255, - true, - false, - false, - '', - '' -); -$filterTable->data[0][0] .= html_print_input_hidden('search', 1, true); - -if ((bool) $policy_page === false) { - $filterTable->data[0][1] = __('Show in hierachy mode'); - $filterTable->data[1][1] = html_print_checkbox_switch( - 'status_hierachy_mode', - '', - ((string) $checked === 'true'), - true, - false, - 'onChange=change_mod_filter();' - ); -} - -$filterTable->data[1][2] = html_print_submit_button( - __('Filter'), - 'filter', - false, - [ - 'icon' => 'search', - 'class' => 'float-right', - 'mode' => 'secondary mini', - ], - true -); - -// Print filter table. -echo '
'; -html_print_table($filterTable); -echo '
'; -// Check if there is at least one server of each type available to assign that -// kind of modules. If not, do not show server type in combo. -$network_available = db_get_sql( - 'SELECT count(*) - FROM tserver - WHERE server_type = '.SERVER_TYPE_NETWORK -); -// POSTGRESQL AND ORACLE COMPATIBLE. -$wmi_available = db_get_sql( - 'SELECT count(*) - FROM tserver - WHERE server_type = '.SERVER_TYPE_WMI -); -// POSTGRESQL AND ORACLE COMPATIBLE. -$plugin_available = db_get_sql( - 'SELECT count(*) - FROM tserver - WHERE server_type = '.SERVER_TYPE_PLUGIN -); -// POSTGRESQL AND ORACLE COMPATIBLE. -$prediction_available = db_get_sql( - 'SELECT count(*) - FROM tserver - WHERE server_type = '.SERVER_TYPE_PREDICTION -); -// POSTGRESQL AND ORACLE COMPATIBLE. -$web_available = db_get_sql( - 'SELECT count(*) -FROM tserver -WHERE server_type = '.SERVER_TYPE_WEB -); -// POSTGRESQL AND ORACLE COMPATIBLE. -// Development mode to use all servers. -if ($develop_bypass || is_metaconsole()) { - $network_available = 1; - $wmi_available = 1; - $plugin_available = 1; - // FIXME when prediction predictions server modules can be configured. - // on metaconsole. - $prediction_available = (is_metaconsole() === true) ? 0 : 1; -} - -$modules = []; -$modules['dataserver'] = __('Create a new data server module'); -if ($network_available) { - $modules['networkserver'] = __('Create a new network server module'); -} - -if ($plugin_available) { - $modules['pluginserver'] = __('Create a new plugin server module'); -} - -if ($wmi_available) { - $modules['wmiserver'] = __('Create a new WMI server module'); -} - -if ($prediction_available) { - $modules['predictionserver'] = __('Create a new prediction server module'); -} - -if (is_metaconsole() === true || $web_available >= '1') { - $modules['webserver'] = __('Create a new web Server module'); -} - -if (enterprise_installed() === true) { - set_enterprise_module_types($modules); -} - -if (strstr($sec2, 'enterprise/godmode/policies/policies') !== false) { - // It is unset because the policies haven't a table tmodule_synth and the - // some part of code to apply this kind of modules in policy agents. - // But in the future maybe will be good to make this feature, but remember - // the modules to show in syntetic module policy form must be the policy - // modules from the same policy. - unset($modules['predictionserver']); - if (enterprise_installed() === true) { - unset($modules['webux']); - } -} - -if (($policy_page === true) || (isset($agent) === true)) { - if ($policy_page === true) { - $show_creation = is_management_allowed(); - } else { - if (isset($all_groups) === false) { - $all_groups = agents_get_all_groups_agent( - $agent['id_agente'], - $agent['id_grupo'] - ); - } - - $show_creation = check_acl_one_of_groups($config['id_user'], $all_groups, 'AW') === true; - } -} else { - $show_creation = false; -} - -if ($show_creation === true) { - // Create module/type combo. - $tableCreateModule = new stdClass(); - $tableCreateModule->id = 'create'; - $tableCreateModule->class = 'create_module_dialog'; - $tableCreateModule->width = '100%'; - $tableCreateModule->data = []; - $tableCreateModule->style = []; - - $tableCreateModule->data['caption_type'] = html_print_input_hidden('edit_module', 1); - $tableCreateModule->data['caption_type'] .= __('Type'); - $tableCreateModule->data['type'] = html_print_select( - $modules, - 'moduletype', - '', - '', - '', - '', - true, - false, - false, - '', - false, - 'width:380px;' - ); - - // Link for get more modules. - if ((bool) $config['disable_help'] === false) { - $tableCreateModule->data['get_more_modules'] = html_print_anchor( - [ - 'href' => 'https://pandorafms.com/Library/Library/', - 'target' => '_blank', - 'class' => 'color-black-grey', - 'content' => __('Get more modules on Monitoring Library'), - ], - true - ); - } -} - if (isset($id_agente) === false) { return; } - $module_action = (string) get_parameter('module_action'); if ($module_action === 'delete') { @@ -1256,35 +1069,6 @@ if ((bool) check_acl_one_of_groups($config['id_user'], $all_groups, 'AW') === tr [ 'type' => 'data_table' ] ); echo ''; - - - $modalCreateModule = '
'; - $modalCreateModule .= html_print_table($tableCreateModule, true); - $modalCreateModule .= html_print_div( - [ - 'class' => 'action-buttons', - 'content' => html_print_submit_button( - __('Create'), - 'create_module', - false, - [ - 'icon' => 'next', - 'mode' => 'mini secondary', - ], - true - ), - ], - true - ); - $modalCreateModule .= '
'; - - html_print_div( - [ - 'id' => 'modal', - 'style' => 'display: none', - 'content' => $modalCreateModule, - ] - ); } ?> diff --git a/pandora_console/godmode/agentes/module_manager_editor_common.php b/pandora_console/godmode/agentes/module_manager_editor_common.php index aba3daf8f4..085afcb455 100644 --- a/pandora_console/godmode/agentes/module_manager_editor_common.php +++ b/pandora_console/godmode/agentes/module_manager_editor_common.php @@ -444,7 +444,7 @@ $tableBasicThresholds->data = []; $tableBasicThresholds->rowclass['caption_warning_threshold'] = 'field_half_width pdd_t_10px'; $tableBasicThresholds->rowclass['warning_threshold'] = 'field_half_width'; $tableBasicThresholds->data['caption_warning_threshold'][0] .= __('Warning threshold').' '; -if ($edit_module === false || (isset($stringTypeModule) === true && $stringTypeModule === false)) { +if ($edit_module === false && (isset($stringTypeModule) === false || $stringTypeModule === false)) { $tableBasicThresholds->data['caption_warning_threshold'][0] .= '('.__('Min / Max').')'; $tableBasicThresholds->data['warning_threshold'][0] .= html_print_input_text( 'min_warning', @@ -482,7 +482,7 @@ if ($edit_module === false || (isset($stringTypeModule) === true && $stringTypeM ); } -if ($edit_module === false || (isset($stringTypeModule) === true && $stringTypeModule === true)) { +if ($edit_module === false && isset($stringTypeModule) === true && $stringTypeModule === true) { $basicThresholdsIntervalWarning = []; $basicThresholdsIntervalWarning[] = ''.__('Inverse interval').''; $basicThresholdsIntervalWarning[] = html_print_checkbox_switch( @@ -531,7 +531,7 @@ $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 ($edit_module === false || (isset($stringTypeModule) === true && $stringTypeModule === false)) { +if ($edit_module === false && (isset($stringTypeModule) === false || $stringTypeModule === false)) { $tableBasicThresholds->data['caption_critical_threshold'][0] .= '('.__('Min / Max').')'; $tableBasicThresholds->data['critical_threshold'][0] .= html_print_input_text( 'min_critical', @@ -569,7 +569,7 @@ if ($edit_module === false || (isset($stringTypeModule) === true && $stringTypeM ); } -if ($edit_module === false || (isset($stringTypeModule) === true && $stringTypeModule === true)) { +if ($edit_module === false && isset($stringTypeModule) === true && $stringTypeModule === true) { $basicThresholdsIntervalCritical = []; $basicThresholdsIntervalCritical[] = ''.__('Inverse interval').''; $basicThresholdsIntervalCritical[] = html_print_checkbox_switch( diff --git a/pandora_console/include/class/HTML.class.php b/pandora_console/include/class/HTML.class.php index a8f7c54985..ca74f7dc46 100644 --- a/pandora_console/include/class/HTML.class.php +++ b/pandora_console/include/class/HTML.class.php @@ -544,7 +544,7 @@ class HTML 'container_class' => $input['toggle_container_class'], 'img_a' => $input['toggle_img_a'], 'img_b' => $input['toggle_img_b'], - 'clean' => (isset($input['toggle_clean']) ? $input['toggle_clean'] : true), + 'clean' => (isset($input['toggle_clean']) ? $input['toggle_clean'] : false), ] ); } else { diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index ae8fbb4a84..166166518f 100755 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -4519,8 +4519,8 @@ function ui_print_toggle($data) (isset($data['toggle_class']) === true) ? $data['toggle_class'] : '', (isset($data['container_class']) === true) ? $data['container_class'] : 'white-box-content', (isset($data['main_class']) === true) ? $data['main_class'] : 'box-flat white_table_graph', - (isset($data['img_a']) === true) ? $data['img_a'] : 'images/arrow_down_green.png', - (isset($data['img_b']) === true) ? $data['img_b'] : 'images/arrow_right_green.png', + (isset($data['img_a']) === true) ? $data['img_a'] : 'images/arrow@svg.svg', + (isset($data['img_b']) === true) ? $data['img_b'] : 'images/arrow@svg.svg', (isset($data['clean']) === true) ? $data['clean'] : false, (isset($data['reverseImg']) === true) ? $data['reverseImg'] : false, (isset($data['switch']) === true) ? $data['switch'] : false, diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index 43e66868bd..e2afb9534a 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -297,6 +297,7 @@ td input[type="checkbox"] { padding: 10px; margin-top: 2px; display: table-cell; + height: 15px; } input[type="image"] { @@ -4816,7 +4817,7 @@ div#dialog_messages table th:last-child { z-index: 900000; position: absolute; width: 550px; - margin-top: -5px; + margin-top: 55px; border-radius: 5px; } diff --git a/pandora_console/index.php b/pandora_console/index.php index a78d97d926..ccf64a9841 100755 --- a/pandora_console/index.php +++ b/pandora_console/index.php @@ -1169,6 +1169,10 @@ if ($config['pure'] == 0) { $menuTypeClass = ($menuCollapsed === true) ? 'collapsed' : 'classic'; // Container. echo '
'; + + // Notifications content wrapper + echo ''; + // Header. echo '