From ff9ee7a4f076cc5fd57be60bc2b536252c532b9d Mon Sep 17 00:00:00 2001 From: daniel Date: Thu, 23 Feb 2023 10:24:03 +0100 Subject: [PATCH] restyling --- .../include/class/SnmpConsole.class.php | 26 ++++-- pandora_console/include/functions_html.php | 15 +++ pandora_console/include/styles/pandora.css | 8 +- pandora_console/include/styles/tables.css | 15 +++ .../operation/agentes/estado_agente.php | 92 +++++++++++++++---- .../agentes/interface_view.functions.php | 7 +- .../operation/agentes/status_monitor.php | 12 ++- pandora_console/operation/tree.php | 4 +- 8 files changed, 146 insertions(+), 33 deletions(-) diff --git a/pandora_console/include/class/SnmpConsole.class.php b/pandora_console/include/class/SnmpConsole.class.php index 96553d2ac4..9e99cad7ef 100644 --- a/pandora_console/include/class/SnmpConsole.class.php +++ b/pandora_console/include/class/SnmpConsole.class.php @@ -383,12 +383,11 @@ class SnmpConsole extends HTML 5 => __('Other'), ]; - $this->tableId = 'snmp_console'; - + $tableId = 'snmp_console'; // Load datatables user interface. ui_print_datatable( [ - 'id' => $this->tableId, + 'id' => $tableId, 'class' => 'info_table', 'style' => 'width: 100%', 'columns' => $columns, @@ -490,16 +489,25 @@ class SnmpConsole extends HTML echo $e->getMessage(); } - echo '
'; - html_print_submit_button(__('Validate'), 'updatebt', false, 'class="sub ok"'); - echo ' '; - html_print_submit_button( + $buttons[] = html_print_submit_button( + __('Validate'), + 'updatebt', + false, + 'class="sub ok"', + true + ); + $buttons[] = html_print_submit_button( __('Delete'), 'deletebt', false, - 'class="sub delete" onClick="javascript:return confirm(\''.__('Are you sure?').'\')"' + 'class="sub delete" onClick="javascript:return confirm(\''.__('Are you sure?').'\')"', + true + ); + + html_print_action_buttons( + implode('', $buttons), + ['type' => 'form_action'] ); - echo '
'; echo '
'; echo '

'.__('Status').'

'; diff --git a/pandora_console/include/functions_html.php b/pandora_console/include/functions_html.php index f409e44b90..9a9306c8d6 100644 --- a/pandora_console/include/functions_html.php +++ b/pandora_console/include/functions_html.php @@ -6731,4 +6731,19 @@ function html_print_menu_button(array $options, bool $return=false) ], $return ); +} + + +function html_print_label_input_block(?string $label, $calbackFn):string +{ + $output = '
'; + if ($label !== null) { + $output .= ''; + } + + $output .= $calbackFn; + + $output .= '
'; + + return $output; } \ No newline at end of file diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index 6765c40ab3..3d053975be 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -10909,6 +10909,11 @@ pre.external_tools_output { margin: -25px -25px 25px -25px; } +.white_table_graph.fixed_filter_bar { + border-radius: 0; + top: 110px; +} + /* .fixed_filter_bar tr { display: flex; @@ -10929,10 +10934,7 @@ pre.external_tools_output { font-size: 10pt; } -.fixed_filter_bar input, .filter_table input, -.fixed_filter_bar .select2-container .select2-selection--single, -.filter_table .select2-container .select2-selection--single, .table_modal_alternate input, table.table_modal_alternate span.select2 diff --git a/pandora_console/include/styles/tables.css b/pandora_console/include/styles/tables.css index 26809aaa38..2c53775706 100644 --- a/pandora_console/include/styles/tables.css +++ b/pandora_console/include/styles/tables.css @@ -520,3 +520,18 @@ a.pandora_pagination.current:hover { .datatable_form { margin: 0 1em; } + +table.nueva-clase td > div { + display: flex; + flex-direction: column; + justify-content: center; + align-items: normal; +} + +table.nueva-clase td > div label { + color: #161628; + font-size: 13px; + line-height: 16px; + text-align: left; + margin-bottom: 10px; +} diff --git a/pandora_console/operation/agentes/estado_agente.php b/pandora_console/operation/agentes/estado_agente.php index b95c6a6b4a..49ee7c4e12 100644 --- a/pandora_console/operation/agentes/estado_agente.php +++ b/pandora_console/operation/agentes/estado_agente.php @@ -231,25 +231,79 @@ $searchForm = ''; $searchForm .= '
'; $table = new stdClass(); -$table->style[0] = 'width: 15%'; -$table->style[2] = 'width: 15%'; -$table->class[0] = 'databox filters bolder'; +$table->width = '100%'; +$table->class = 'nueva-clase'; -$table->data['group'][0] = __('Group'); -$table->data['group'][1] = html_print_select_groups(false, $access, true, 'group_id', $group_id, 'this.form.submit()', '', '', true, false, true, '', false); +$table->data['group'][0] = '
'; +$table->data['group'][0] .= ''; +$table->data['group'][0] .= html_print_select_groups( + false, + $access, + true, + 'group_id', + $group_id, + 'this.form.submit()', + '', + '', + true, + false, + true, + '', + false +); +$table->data['group'][0] .= '
'; -$table->data['group'][2] = __('Recursion'); -$table->data['group'][3] = html_print_checkbox_switch('recursion', 1, $recursion, true); +$table->data['group'][1] = '
'; +$table->data['group'][1] .= ''; +$table->data['group'][1] .= html_print_checkbox_switch( + 'recursion', + 1, + $recursion, + true +); +$table->data['group'][1] .= '
'; -$table->data['status'][0] = __('Status'); -$table->data['status'][1] = html_print_select($fields, 'status', $status, 'this.form.submit()', __('All'), AGENT_STATUS_ALL, true, false, true, '', false, 'width: 90px;'); +$table->data['group'][2] = html_print_label_input_block( + __('Status'), + html_print_select( + $fields, + 'status', + $status, + 'this.form.submit()', + __('All'), + AGENT_STATUS_ALL, + true, + false, + true, + '', + false + ) +); -$table->data['search_fields'][0] = __('Search'); -$table->data['search_fields'][1] = html_print_input_text('search', $search, '', 35, 255, true); +$table->data['search_fields'][0] = html_print_label_input_block( + __('Search'), + html_print_input_text( + 'search', + $search, + '', + 35, + 255, + true + ) +); + +$table->data['search_fields'][1] = html_print_label_input_block( + __('Search in custom fields'), + html_print_input_text( + 'search_custom', + $search_custom, + '', + 35, + 255, + true + ) +); -$table->data['search_fields'][2] = __('Search in custom fields'); -$table->data['search_fields'][3] = html_print_input_text('search_custom', $search_custom, '', 35, 255, true); -// $table->colspan['search_fields'][3] = '2'; $searchForm .= html_print_table($table, true); $searchForm .= html_print_div( [ @@ -267,13 +321,18 @@ $searchForm .= html_print_div( ], true ); - $searchForm .= '
'; ui_toggle( $searchForm, ''.__('Filters').'', - 'filter_form' + 'filter_form', + '', + true, + false, + '', + 'white-box-content', + 'box-flat white_table_graph fixed_filter_bar' ); if (empty($search) === false) { @@ -708,7 +767,6 @@ $tableAgents = new stdClass(); $tableAgents->cellpadding = 0; $tableAgents->cellspacing = 0; $tableAgents->id = 'agent_list'; -$tableAgents->styleTable = 'margin: 0 10px'; $tableAgents->class = 'info_table tactical_table'; $tableAgents->head = []; diff --git a/pandora_console/operation/agentes/interface_view.functions.php b/pandora_console/operation/agentes/interface_view.functions.php index 644b96099f..dc51d5a3b4 100644 --- a/pandora_console/operation/agentes/interface_view.functions.php +++ b/pandora_console/operation/agentes/interface_view.functions.php @@ -172,7 +172,12 @@ function print_filters($sec) $filters, __('Interface filter'), __('Interface filter'), - 'ui_toggle_if_filter' + 'ui_toggle_if_filter', + true, + false, + '', + 'white-box-content', + 'box-flat white_table_graph fixed_filter_bar' ); unset($table); diff --git a/pandora_console/operation/agentes/status_monitor.php b/pandora_console/operation/agentes/status_monitor.php index 899c5c36ac..8a46b432d1 100644 --- a/pandora_console/operation/agentes/status_monitor.php +++ b/pandora_console/operation/agentes/status_monitor.php @@ -983,7 +983,17 @@ $tableFilter->data[4][2] = html_print_submit_button( $filters = '
'; $filters .= html_print_table($tableFilter, true); $filters .= '
'; -ui_toggle($filters, ''.__('Filters').''); +ui_toggle( + $filters, + ''.__('Filters').'', + 'filter_form', + '', + true, + false, + '', + 'white-box-content', + 'box-flat white_table_graph fixed_filter_bar' +); unset($table); // End Build Search Form. diff --git a/pandora_console/operation/tree.php b/pandora_console/operation/tree.php index a662da4d99..9f7eedbe6e 100755 --- a/pandora_console/operation/tree.php +++ b/pandora_console/operation/tree.php @@ -301,9 +301,9 @@ if (is_metaconsole() === true) { false, true, false, - 'box-flat agent_details_col', + '', 'white-box-content', - 'mrgn_lft_20px mrgn_right_20px width_available' + 'box-flat white_table_graph fixed_filter_bar' ); }