From 41f6ea0d6ef3048d7a97d8d65026a2cd55b4f977 Mon Sep 17 00:00:00 2001 From: daniel Date: Fri, 24 Feb 2023 12:16:30 +0100 Subject: [PATCH 1/3] restyling --- pandora_console/extensions/module_groups.php | 101 ++++++++++++++----- pandora_console/include/styles/pandora.css | 9 -- 2 files changed, 74 insertions(+), 36 deletions(-) diff --git a/pandora_console/extensions/module_groups.php b/pandora_console/extensions/module_groups.php index d8b432da08..5e0a1aadd9 100644 --- a/pandora_console/extensions/module_groups.php +++ b/pandora_console/extensions/module_groups.php @@ -266,32 +266,68 @@ function mainModuleGroups() ] ); - echo " - "; - echo ""; + $output = ""; - echo '
'; - echo __('Search by agent group').' '; - html_print_input_text('agent_group_search', $agent_group_search); - - echo ''; - echo __('Search by module group').' '; - html_print_input_text('module_group_search', $module_group_search); - - echo ''; - html_print_submit_button( - __('Search'), - 'srcbutton', - false, - [ - 'icon' => 'search', - 'mode' => 'secondary', - ] + $output .= ""; + $output .= ''; + $output .= '
'; + $output .= html_print_label_input_block( + __('Search by agent group'), + html_print_input_text( + 'agent_group_search', + $agent_group_search, + '', + 50, + 255, + true + ) + ); + + $output .= ''; + $output .= html_print_label_input_block( + __('Search by module group'), + html_print_input_text( + 'module_group_search', + $module_group_search, + '', + 50, + 255, + true + ) + ); + $output .= '
'; + + $output .= html_print_div( + [ + 'class' => 'action-buttons', + 'content' => html_print_submit_button( + __('Filter'), + 'srcbutton', + false, + [ + 'icon' => 'search', + 'mode' => 'mini', + ], + true + ), + ], + true + ); + + $output .= ''; + + ui_toggle( + $output, + ''.__('Filters').'', + 'filter_form', + '', + true, + false, + '', + 'white-box-content', + 'box-flat white_table_graph fixed_filter_bar' ); - echo ''; - echo '
'; - echo '
'; $cell_style = ' min-width: 60px; @@ -386,13 +422,24 @@ function mainModuleGroups() $table->headstyle = $headstyle; $table->data = $data; - ui_pagination($counter); - echo "
"; html_print_table($table); echo '
'; - ui_pagination($counter); + $tablePagination = ui_pagination( + $counter, + false, + 0, + 0, + true, + 'offset', + false + ); + + html_print_action_buttons( + '', + [ 'right_content' => $tablePagination ] + ); echo "
"; echo ''; diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index 76f249e5a4..63877db4b4 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -1981,18 +1981,9 @@ table.databox { background-color: #fff; border-spacing: 0px; border-radius: 6px; - /*-moz-box-shadow: 0 3px 6px 0 rgb(0 0 0 / 13%);*/ - /* -webkit-box-shadow: 0 3px 6px 0 rgb(0 0 0 / 13%); */ - /* box-shadow: 0 3px 6px 0 rgb(0 0 0 / 13%); */ - border: 2px solid #c0ccdc; - padding: 20px; margin-bottom: 20px; width: calc(100% - 40px); width: -webkit-fill-available; - /* - width: -webkit-fill-available; - width: -moz-available; - */ } .databox > tbody > tr > td { From fcf380851b7a95843439f7aaa0ffd7026348131d Mon Sep 17 00:00:00 2001 From: daniel Date: Fri, 24 Feb 2023 13:09:03 +0100 Subject: [PATCH 2/3] restyling --- pandora_console/extensions/agents_modules.php | 200 +++++++++++++----- pandora_console/extensions/module_groups.php | 23 +- 2 files changed, 160 insertions(+), 63 deletions(-) diff --git a/pandora_console/extensions/agents_modules.php b/pandora_console/extensions/agents_modules.php index dbf41a648b..604bb3a3f5 100644 --- a/pandora_console/extensions/agents_modules.php +++ b/pandora_console/extensions/agents_modules.php @@ -397,55 +397,135 @@ function mainAgentsModules() 1 => __('Show module data'), ]; - $filter_type_label = ''.__('Information to be shown').''; - $filter_type = html_print_select($show_select, 'show_type', $show_type, '', '', 0, true, false, false, '', false, 'min-width: 180px;'); - - // Groups. - $filter_groups_label = ''.__('Group').''; - $filter_groups = html_print_select_groups(false, 'AR', true, 'group_id', $group_id, '', '', '', true, false, true, '', false, 'width: auto;'); - - $filter_recursion_label = ''; - // Groups module. - $filter_module_groups_label = ''.__('Module group').''; - $filter_module_groups = html_print_select_from_sql( - 'SELECT * FROM tmodule_group ORDER BY name', - 'modulegroup', - $modulegroup, - '', - __('All'), - 0, - true, - false, - true, - false, - 'width: auto;' + $filter_type = html_print_label_input_block( + __('Information to be shown'), + html_print_select( + $show_select, + 'show_type', + $show_type, + '', + '', + 0, + true, + false, + false, + '', + false, + 'width: 100%;' + ) + ); + + $filter_groups = html_print_label_input_block( + __('Group'), + html_print_select_groups( + false, + 'AR', + true, + 'group_id', + $group_id, + '', + '', + '', + true, + false, + true, + '', + false, + 'width: 100%;' + ) + ); + + $filter_groups .= html_print_label_input_block( + __('Recursion'), + html_print_checkbox_switch('recursion', 1, 0, true), + [ + 'div_class' => 'add-input-reverse', + 'label_class' => 'label-thin', + ] + ); + + $filter_module_groups = html_print_label_input_block( + __('Module group'), + html_print_select_from_sql( + 'SELECT * FROM tmodule_group ORDER BY name', + 'modulegroup', + $modulegroup, + '', + __('All'), + 0, + true, + false, + true, + false, + 'width: 100%;' + ) ); - // Agent. $agents = agents_get_group_agents($group_id); if ((empty($agents)) || $agents == -1) { $agents = []; } - $filter_agents_label = ''.__('Agents').''; - $filter_agents = html_print_select($agents, 'id_agents2[]', $agents_id, '', '', 0, true, true, true, '', false, 'min-width: 180px; max-width: 200px;'); + $filter_agents = html_print_label_input_block( + __('Agents'), + html_print_select( + $agents, + 'id_agents2[]', + $agents_id, + '', + '', + 0, + true, + true, + true, + '', + false, + 'width: 100%;' + ) + ); // Type show. $selection = [ 0 => __('Show common modules'), 1 => __('Show all modules'), ]; - $filter_type_show_label = ''.__('Show common modules').''; - $filter_type_show = html_print_select($selection, 'selection_agent_module', $selection_a_m, '', '', 0, true, false, true, '', false, 'min-width: 180px;'); + $filter_type_show = html_print_label_input_block( + __('Show common modules'), + html_print_select( + $selection, + 'selection_agent_module', + $selection_a_m, + '', + '', + 0, + true, + false, + true, + '', + false, + 'width: 100%;' + ) + ); // Modules. $all_modules = select_modules_for_agent_group($group_id, $agents_id, $selection_a_m, false); - $filter_modules_label = ''.__('Module').''; - $filter_modules = html_print_select($all_modules, 'module[]', $modules_selected, '', '', 0, true, true, false, '', false, 'min-width: 180px; max-width: 200px;'); - - // Update. - $filter_update = html_print_submit_button(__('Update item'), 'edit_item', false, 'class="sub upd"', true); + $filter_modules = html_print_label_input_block( + __('Module'), + html_print_select( + $all_modules, + 'module[]', + $modules_selected, + '', + '', + 0, + true, + true, + false, + '', + false, + 'width: 100%;' + ) + ); $onheader = [ 'updated_time' => $updated_time, @@ -566,36 +646,39 @@ function mainAgentsModules() if ($config['pure'] != 1) { $show_filters = ''; - $show_filters .= '
'.__('Recursion').''; - $filter_recursion = html_print_checkbox('recursion', 1, 0, true).'
'; + $show_filters .= '
'; $show_filters .= ''; - $show_filters .= ''; - $show_filters .= ''; + $show_filters .= ''; + $show_filters .= ''; + $show_filters .= ''; $show_filters .= ''; $show_filters .= ''; - $show_filters .= ''; - $show_filters .= ''; - $show_filters .= ''; - $show_filters .= ''; - $show_filters .= ''; - $show_filters .= ''; - $show_filters .= ''; - $show_filters .= ''; - $show_filters .= ''; $show_filters .= ''; - $show_filters .= ''; $show_filters .= ''; - $show_filters .= ''; $show_filters .= ''; $show_filters .= ''; - $show_filters .= ''; - $show_filters .= "'; - $show_filters .= ''; $show_filters .= '
'.$filter_type_label.''.$filter_type.''.$filter_type.''.$filter_groups.''.$filter_module_groups.'
'.$filter_groups_label.''.$filter_groups.'   '.$filter_recursion_label.$filter_recursion.''.$filter_module_groups_label.''.$filter_module_groups.'
'.$filter_agents_label.''.$filter_agents.''.$filter_type_show_label.''.$filter_type_show.''.$filter_modules_label.''.$filter_modules.'
".$filter_update.'
'; + $show_filters .= html_print_div( + [ + 'class' => 'action-buttons', + 'content' => html_print_submit_button( + __('Filter'), + 'srcbutton', + false, + [ + 'icon' => 'search', + 'mode' => 'mini', + ], + true + ), + ], + true + ); $show_filters .= ''; ui_toggle( $show_filters, - __('Filters ').ui_print_help_tip(__('Secondary groups and agent subgroups will be taken into account.'), true), + ''.__('Filters ').''.ui_print_help_tip(__('Secondary groups and agent subgroups will be taken into account.'), true), 'filter_form', '', true, @@ -804,7 +887,20 @@ function mainAgentsModules() // Prepare pagination. $url = 'index.php?extension_in_menu=estado&sec=extensions&sec2=extensions/agents_modules&save_serialize=1&hor_offset='.$hor_offset.'&selection_a_m='.$selection_a_m; - ui_pagination($total_pagination, $url); + $tablePagination = ui_pagination( + $total_pagination, + $url, + 0, + 0, + true, + 'offset', + false + ); + + html_print_action_buttons( + '', + [ 'right_content' => $tablePagination ] + ); foreach ($agents as $agent) { // Get stats for this group. diff --git a/pandora_console/extensions/module_groups.php b/pandora_console/extensions/module_groups.php index 5e0a1aadd9..8c10de81c2 100644 --- a/pandora_console/extensions/module_groups.php +++ b/pandora_console/extensions/module_groups.php @@ -441,17 +441,18 @@ function mainModuleGroups() [ 'right_content' => $tablePagination ] ); - echo "
"; - echo ''; - echo "'; - echo "'; - echo "'; - echo "'; - echo "'; - echo "'; - echo "'; - echo '
".__('Legend').'
".__('Orange cell when the module group and agent have at least one alarm fired.').'
".__('Red cell when the module group and agent have at least one module in critical status and the others in any status').'
".__('Yellow cell when the module group and agent have at least one in warning status and the others in grey or green status').'
".__('Grey cell when the module group and agent have at least one in unknown status and the others in green status').'
".__('Green cell when the module group and agent have all modules in OK status').'
".__('Blue cell when the module group and agent have all modules in not init status.').'
'; - echo '
'; + $show_legend = '
'; + $show_legend .= ''; + $show_legend .= "'; + $show_legend .= "'; + $show_legend .= "'; + $show_legend .= "'; + $show_legend .= "'; + $show_legend .= "'; + $show_legend .= '
".__('Orange cell when the module group and agent have at least one alarm fired.').'
".__('Red cell when the module group and agent have at least one module in critical status and the others in any status').'
".__('Yellow cell when the module group and agent have at least one in warning status and the others in grey or green status').'
".__('Grey cell when the module group and agent have at least one in unknown status and the others in green status').'
".__('Green cell when the module group and agent have all modules in OK status').'
".__('Blue cell when the module group and agent have all modules in not init status.').'
'; + $show_legend .= '
'; + + ui_toggle($show_legend, __('Legend')); } else { ui_print_info_message(['no_close' => true, 'message' => __('This table shows in columns the modules group and in rows agents group. The cell shows all modules') ]); ui_print_info_message(['no_close' => true, 'message' => __('There are no defined groups or module groups') ]); From 0a5571cd4ded64022455a850b78841077c2ffde2 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Fri, 24 Feb 2023 13:21:00 +0100 Subject: [PATCH 3/3] SNMP browser icons --- .../include/class/SnmpConsole.class.php | 97 ++++++++----------- pandora_console/include/styles/pandora.css | 14 +++ 2 files changed, 53 insertions(+), 58 deletions(-) diff --git a/pandora_console/include/class/SnmpConsole.class.php b/pandora_console/include/class/SnmpConsole.class.php index 7104958234..6264b1879a 100644 --- a/pandora_console/include/class/SnmpConsole.class.php +++ b/pandora_console/include/class/SnmpConsole.class.php @@ -519,14 +519,21 @@ class SnmpConsole extends HTML __('Validate'), 'updatebt', false, - 'class="sub ok"', + [ + 'class' => 'sub ok', + 'icon' => 'next', + ], true ); $buttons[] = html_print_submit_button( __('Delete'), 'deletebt', false, - 'class="sub delete" onClick="javascript:return confirm(\''.__('Are you sure?').'\')"', + [ + 'icon' => 'delete', + 'mode' => 'secondary', + 'onClick' => "javascript:return confirm(\''.__('Are you sure?').'\')", + ], true ); @@ -535,60 +542,33 @@ class SnmpConsole extends HTML ['type' => 'form_action'] ); - echo '
'; - echo '

'.__('Status').'

'; - echo html_print_image( - 'images/pixel_green.png', - true, - [ - 'width' => '20', - 'height' => '20', - ] - ).' - '.__('Validated'); - echo '
'; - echo html_print_image( - 'images/pixel_red.png', - true, - [ - 'width' => '20', - 'height' => '20', - ] - ).' - '.__('Not validated'); - echo '
'; - echo '
'; - echo '

'.__('Alert').'

'; - echo html_print_image( - 'images/pixel_yellow.png', - true, - [ - 'width' => '20', - 'height' => '20', - ] - ).' - '.__('Fired'); - echo '
'; - echo html_print_image( - 'images/pixel_gray.png', - true, - [ - 'width' => '20', - 'height' => '20', - ] - ).' - '.__('Not fired'); - echo '
'; - echo '
'; - echo '

'.__('Action').'

'; - echo html_print_image('images/ok.png', true).' - '.__('Validate'); - echo '
'; - echo html_print_image('images/cross.png', true, ['class' => 'invert_filter']).' - '.__('Delete'); - echo '
'; - echo '
'; + echo ''; + echo ''; + echo ''; + echo ''; // Load own javascript file. echo $this->loadJS(); @@ -916,12 +896,13 @@ class SnmpConsole extends HTML $tmp->action = ''; if ($status != 1) { $tmp->action .= ''.html_print_image( - 'images/ok.png', + 'images/validate.svg', true, [ 'border' => '0', 'title' => __('Validate'), 'onclick' => 'validate_trap(\''.$tmp->id_trap.'\')', + 'class' => 'main_menu_icon', ] ).' '; } @@ -929,39 +910,39 @@ class SnmpConsole extends HTML if ($tmp->source === '') { if (\users_is_admin()) { $tmp->action .= ''.html_print_image( - 'images/cross.png', + 'images/delete.svg', true, [ 'border' => '0', 'title' => __('Delete'), - 'class' => 'invert_filter', + 'class' => 'invert_filter main_menu_icon', 'onclick' => 'delete_trap(\''.$tmp->id_trap.'\')', ] ).' '; } } else { $tmp->action .= ''.html_print_image( - 'images/cross.png', + 'images/delete.svg', true, [ 'border' => '0', 'title' => __('Delete'), - 'class' => 'invert_filter', + 'class' => 'invert_filter main_menu_icon', 'onclick' => 'delete_trap(\''.$tmp->id_trap.'\')', ] ).' '; } $tmp->action .= ''.html_print_image( - 'images/eye.png', + 'images/see-details@svg.svg', true, [ 'alt' => __('Show more'), 'title' => __('Show more'), - 'class' => 'invert_filter', + 'class' => 'invert_filter main_menu_icon', ] ).''; - $tmp->action .= ''.html_print_image('images/edit.png', true, ['alt' => __('SNMP trap editor'), 'title' => __('SNMP trap editor')]).''; + $tmp->action .= ''.html_print_image('images/edit.svg', true, ['alt' => __('SNMP trap editor'), 'title' => __('SNMP trap editor'), 'class' => 'main_menu_icon']).''; $tmp->m = html_print_checkbox_extended('snmptrapid[]', $tmp->id_trap, false, false, '', 'class="chk"', true); diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index 63877db4b4..40ab68cace 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -7029,6 +7029,20 @@ div.graph div.legend table { line-height: 17px; vertical-align: top; width: 120px; + position: relative; +} + +.snmp_view_div > span { + padding: 2px 10px 2px 10px; + border-radius: 10px; +} + +.snmp_view_div > h3 { + text-transform: unset; +} + +#legend_snmp_browser > tbody > tr > td { + vertical-align: top; } .display_in {
'; echo '

'.__('Severity').'

'; foreach (get_priorities() as $num => $name) { echo ''.$name.''; echo '
'; } - echo '
'; + echo '
'; + echo '

'.__('Status').'

'; + echo ''.__('Validated').''; + echo '
'; + echo ''.__('Not validated').''; + echo '
'; + echo '

'.__('Alert').'

'; + echo ''.__('Alert').''; + echo '
'; + echo ''.__('Not fired').''; + echo '
'; + echo '

'.__('Action').'

'; + echo '
'; + echo html_print_image('images/validate.svg', true, ['class' => 'main_menu_icon']).' - '.__('Validate'); + echo '
'; + echo html_print_image('images/delete.svg', true, ['class' => 'main_menu_icon']).' - '.__('Delete'); + echo '