From 845cb85c557c1ac05cfa032af7bc216c3b4337b0 Mon Sep 17 00:00:00 2001 From: Tatiana Llorente Date: Wed, 27 Mar 2019 17:03:55 +0100 Subject: [PATCH 01/12] New design for tables - #3707 Former-commit-id: 923414d8bf98d6264e6cebc27706118e16710b70 --- pandora_console/extensions/agents_alerts.php | 19 +- .../extensions/users_connected.php | 6 +- pandora_console/general/logon_ok.php | 4 +- .../godmode/agentes/fields_manager.php | 17 +- .../godmode/agentes/modificar_agente.php | 4 +- .../godmode/agentes/planned_downtime.list.php | 4 +- .../godmode/events/event_responses.list.php | 4 +- .../godmode/groups/modu_group_list.php | 9 +- pandora_console/godmode/reporting/graphs.php | 6 +- .../godmode/reporting/map_builder.php | 5 +- .../godmode/reporting/reporting_builder.php | 3 +- .../godmode/servers/servers.build_table.php | 4 +- pandora_console/include/ajax/module.php | 8 +- pandora_console/include/functions_ui.php | 39 ++-- pandora_console/include/styles/pandora.css | 167 ++++++++++++++++++ .../operation/agentes/alerts_status.php | 12 +- .../operation/agentes/estado_agente.php | 23 +-- .../operation/agentes/pandora_networkmap.php | 22 ++- .../operation/agentes/status_monitor.php | 6 +- .../operation/events/events.build_table.php | 7 + .../operation/servers/recon_view.php | 6 +- 21 files changed, 312 insertions(+), 63 deletions(-) diff --git a/pandora_console/extensions/agents_alerts.php b/pandora_console/extensions/agents_alerts.php index 46272504f6..5b0cc4a72d 100755 --- a/pandora_console/extensions/agents_alerts.php +++ b/pandora_console/extensions/agents_alerts.php @@ -378,7 +378,7 @@ function mainAgentsAlerts() 'alerts_agents' ); - echo ''; + echo '
'; echo "'; if ($hor_offset > 0) { @@ -478,6 +478,23 @@ function mainAgentsAlerts() } echo '
".__('Agents').' / '.__('Alert templates').'
'; + + ui_pagination( + $nagents, + false, + 0, + 0, + false, + 'offset', + true, + 'pagination-bottom', + '', + [ + 'count' => '', + 'offset' => 'offset_param', + ], + 'alerts_agents' + ); } } diff --git a/pandora_console/extensions/users_connected.php b/pandora_console/extensions/users_connected.php index 562d757a20..e26b0dab1e 100644 --- a/pandora_console/extensions/users_connected.php +++ b/pandora_console/extensions/users_connected.php @@ -66,10 +66,10 @@ function users_extension_main_god($god=true) $rows = []; echo "
".__('No other users connected').'
'; } else { - $table->cellpadding = 4; - $table->cellspacing = 4; + $table->cellpadding = 0; + $table->cellspacing = 0; $table->width = '100%'; - $table->class = 'databox data'; + $table->class = 'info_table'; $table->size = []; $table->data = []; $table->head = []; diff --git a/pandora_console/general/logon_ok.php b/pandora_console/general/logon_ok.php index 21c9713a48..9e83e0b793 100644 --- a/pandora_console/general/logon_ok.php +++ b/pandora_console/general/logon_ok.php @@ -195,7 +195,9 @@ if (!empty($all_data)) { echo '
'; $table = new stdClass(); - $table->class = 'databox data'; + $table->class = 'info_table'; + $table->cellpadding = 0; + $table->cellspacing = 0; $table->width = '100%'; // Don't specify px $table->data = []; diff --git a/pandora_console/godmode/agentes/fields_manager.php b/pandora_console/godmode/agentes/fields_manager.php index 0be7166062..ee94813a59 100644 --- a/pandora_console/godmode/agentes/fields_manager.php +++ b/pandora_console/godmode/agentes/fields_manager.php @@ -97,11 +97,22 @@ if ($delete_field) { } } -$fields = db_get_all_fields_in_table('tagent_custom_fields'); +// Prepare pagination. +$offset = (int) get_parameter('offset'); +$limit = $config['block_size']; +$count_fields = db_get_value('count(*)', 'tagent_custom_fields'); + +$fields = db_get_all_rows_filter( + 'tagent_custom_fields', + [ + 'limit' => $limit, + 'offset' => $offset, + ] +); $table = new stdClass(); $table->width = '100%'; -$table->class = 'databox data'; +$table->class = 'info_table'; if ($fields) { $table->head = []; $table->head[0] = __('ID'); @@ -142,7 +153,9 @@ foreach ($fields as $field) { } if ($fields) { + ui_pagination($count_fields, false, $offset); html_print_table($table); + ui_pagination($count_fields, false, $offset, 0, false, 'offset', true, 'pagination-bottom'); } echo '
'; diff --git a/pandora_console/godmode/agentes/modificar_agente.php b/pandora_console/godmode/agentes/modificar_agente.php index 4673bf2f46..cee4f06f8e 100644 --- a/pandora_console/godmode/agentes/modificar_agente.php +++ b/pandora_console/godmode/agentes/modificar_agente.php @@ -441,7 +441,7 @@ if (($config['dbtype'] == 'oracle') && ($agents !== false)) { ui_pagination($total_agents, "index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id=$ag_group&recursion=$recursion&search=$search&sort_field=$sortField&sort=$sort&disabled=$disabled&os=$os", $offset); if ($agents !== false) { - echo ""; + echo "
"; echo ''; echo "
'.__('Agent name').' '.''.html_print_image('images/sort_up.png', true, ['style' => $selectNameUp]).''.''.html_print_image('images/sort_down.png', true, ['style' => $selectNameDown]).''; echo '".__('R').' '.''.html_print_image('images/sort_up.png', true, ['style' => $selectRemoteUp]).''.''.html_print_image('images/sort_down.png', true, ['style' => $selectRemoteDown]).''; @@ -670,7 +670,7 @@ if ($agents !== false) { } echo '
'; - ui_pagination($total_agents, "index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id=$ag_group&search=$search&sort_field=$sortField&sort=$sort&disabled=$disabled&os=$os", $offset); + ui_pagination($total_agents, "index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id=$ag_group&search=$search&sort_field=$sortField&sort=$sort&disabled=$disabled&os=$os", $offset, 0, false, 'offset', true, 'pagination-bottom'); echo "
"; } else { ui_print_info_message(['no_close' => true, 'message' => __('There are no defined agents') ]); diff --git a/pandora_console/godmode/agentes/planned_downtime.list.php b/pandora_console/godmode/agentes/planned_downtime.list.php index 790944b472..a9529248b0 100755 --- a/pandora_console/godmode/agentes/planned_downtime.list.php +++ b/pandora_console/godmode/agentes/planned_downtime.list.php @@ -393,7 +393,7 @@ else { // View available downtimes present in database (if any of them) $table = new StdClass(); - $table->class = 'databox data'; + $table->class = 'info_table'; $table->width = '100%'; $table->cellstyle = []; @@ -518,9 +518,9 @@ else { } html_print_table($table); + ui_pagination($downtimes_number, "index.php?sec=estado&sec2=godmode/agentes/planned_downtime.list&$filter_params_str", $offset, 0, false, 'offset', true, 'pagination-bottom'); echo '
'; - echo '
'; // CSV export button echo '
'; html_print_button( diff --git a/pandora_console/godmode/events/event_responses.list.php b/pandora_console/godmode/events/event_responses.list.php index e3b27a32d4..10f9b4c47b 100644 --- a/pandora_console/godmode/events/event_responses.list.php +++ b/pandora_console/godmode/events/event_responses.list.php @@ -36,7 +36,9 @@ if (empty($event_responses)) { $table = new stdClass(); $table->width = '100%'; -$table->class = 'databox data'; +$table->class = 'info_table'; +$table->cellpadding = 0; +$table->cellspacing = 0; $table->size = []; $table->size[0] = '200px'; diff --git a/pandora_console/godmode/groups/modu_group_list.php b/pandora_console/godmode/groups/modu_group_list.php index 9dbc9311a6..6af3f98197 100644 --- a/pandora_console/godmode/groups/modu_group_list.php +++ b/pandora_console/godmode/groups/modu_group_list.php @@ -212,14 +212,11 @@ if ($delete_group) { } } +// Prepare pagination. $total_groups = db_get_num_rows('SELECT * FROM tmodule_group'); - $url = ui_get_url_refresh(['offset' => false]); - $offset = (int) get_parameter('offset', 0); -ui_pagination($total_groups, $url, $offset); - $sql = 'SELECT * FROM tmodule_group @@ -230,7 +227,7 @@ $groups = db_get_all_rows_sql($sql); $table = new stdClass(); $table->width = '100%'; -$table->class = 'databox data'; +$table->class = 'info_table'; if (!empty($groups)) { $table->head = []; @@ -257,7 +254,9 @@ if (!empty($groups)) { array_push($table->data, $data); } + ui_pagination($total_groups, $url, $offset); html_print_table($table); + ui_pagination($total_groups, $url, $offset, 0, false, 'offset', true, 'pagination-bottom'); } else { ui_print_info_message( [ diff --git a/pandora_console/godmode/reporting/graphs.php b/pandora_console/godmode/reporting/graphs.php index 633ed82f4d..0e1a0c3afc 100644 --- a/pandora_console/godmode/reporting/graphs.php +++ b/pandora_console/godmode/reporting/graphs.php @@ -159,7 +159,9 @@ ui_pagination(count($graphs)); if (!empty($graphs)) { $table = new stdClass(); $table->width = '100%'; - $table->class = 'databox data'; + $table->class = 'info_table'; + $table->cellpadding = 0; + $table->cellspacing = 0; $table->align = []; $table->head = []; $table->head[0] = __('Graph name'); @@ -213,6 +215,7 @@ if (!empty($graphs)) { echo ""; html_print_input_hidden('multiple_delete', 1); html_print_table($table); + ui_pagination(count($graphs), false, 0, 0, false, 'offset', true, 'pagination-bottom'); echo "
"; html_print_submit_button(__('Delete'), 'delete_btn', false, 'class="sub delete"'); echo '
'; @@ -228,7 +231,6 @@ if (!empty($graphs)) { } echo '
'; - ui_pagination(count($graphs)); } else { include_once $config['homedir'].'/general/firts_task/custom_graphs.php'; } diff --git a/pandora_console/godmode/reporting/map_builder.php b/pandora_console/godmode/reporting/map_builder.php index 6a20eeb30d..79130eda11 100644 --- a/pandora_console/godmode/reporting/map_builder.php +++ b/pandora_console/godmode/reporting/map_builder.php @@ -327,7 +327,9 @@ echo '
'; $table = new stdClass(); $table->width = '100%'; -$table->class = 'databox data'; +$table->class = 'info_table'; +$table->cellpadding = 0; +$table->cellspacing = 0; $table->data = []; $table->head = []; $table->head[0] = __('Map name'); @@ -462,6 +464,7 @@ if (!$maps && !is_metaconsole()) { } html_print_table($table); + ui_pagination($total_maps, $url, $offset, $pagination, false, 'offset', true, 'pagination-bottom'); } if ($maps) { diff --git a/pandora_console/godmode/reporting/reporting_builder.php b/pandora_console/godmode/reporting/reporting_builder.php index 7253b931d4..84a9eb0267 100755 --- a/pandora_console/godmode/reporting/reporting_builder.php +++ b/pandora_console/godmode/reporting/reporting_builder.php @@ -646,7 +646,7 @@ switch ($action) { $table = new stdClass(); $table->id = 'report_list'; $table->width = '100%'; - $table->class = 'databox data'; + $table->class = 'info_table'; $table->cellpadding = 0; $table->cellspacing = 0; @@ -887,6 +887,7 @@ switch ($action) { } html_print_table($table); + ui_pagination($total_reports, $url, $offset, $pagination, false, 'offset', true, 'pagination-bottom'); } else { ui_print_info_message([ 'no_close' => true, 'message' => __('No data found.') ]); } diff --git a/pandora_console/godmode/servers/servers.build_table.php b/pandora_console/godmode/servers/servers.build_table.php index 2bb4f6ab00..65a76690e0 100644 --- a/pandora_console/godmode/servers/servers.build_table.php +++ b/pandora_console/godmode/servers/servers.build_table.php @@ -40,7 +40,9 @@ if ($servers === false) { $table = new StdClass(); $table->width = '100%'; -$table->class = 'databox data'; +$table->class = 'info_table'; +$table->cellpadding = 0; +$table->cellspacing = 0; $table->size = []; $table->style = []; diff --git a/pandora_console/include/ajax/module.php b/pandora_console/include/ajax/module.php index 6e93f12165..fb62ff8339 100755 --- a/pandora_console/include/ajax/module.php +++ b/pandora_console/include/ajax/module.php @@ -758,9 +758,9 @@ if (check_login()) { $table = new stdClass(); $table->width = '100%'; - $table->cellpadding = 4; - $table->cellspacing = 4; - $table->class = 'databox data'; + $table->cellpadding = 0; + $table->cellspacing = 0; + $table->class = 'info_table'; $table->head = []; $table->data = []; @@ -1199,7 +1199,7 @@ if (check_login()) { false, 'offset', true, - '', + 'pagination-bottom', 'pagination_list_modules(offset_param)', [ 'count' => '', diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index eee8138e1e..71227e27ca 100755 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -1884,7 +1884,7 @@ function ui_pagination( if ($print_total_items) { $output = "'; @@ -1910,10 +1910,11 @@ function ui_pagination( // Show the count of items if ($print_total_items) { - $output .= sprintf(__('Total items: %s'), $count); - $output .= '
'; + $output .= '
'.sprintf(__('Total items: %s'), $count).'
'; } + $output .= "
"; + // Show GOTO FIRST PAGE button if ($number_of_pages > $block_limit) { if (!empty($script)) { @@ -1929,10 +1930,10 @@ function ui_pagination( $script_modified ); - $output .= " '; + $output .= "".html_print_image('images/go_first.png', true, ['class' => 'bot']).''; } else { - $output .= " '; + $output .= "".html_print_image('images/go_first.png', true, ['class' => 'bot']).''; } } @@ -1958,10 +1959,10 @@ function ui_pagination( $script_modified ); - $output .= "'; } else { - $output .= "'; + $output .= "".html_print_image('images/go_previous.png', true, ['class' => 'bot']).''; } } @@ -1970,9 +1971,9 @@ function ui_pagination( $actual_page = (int) ($offset / $pagination); if ($iterator == $actual_page) { - $output .= ""; + $output .= "
"; } else { - $output .= ''; + $output .= "
"; } $offset_page = ($iterator * $pagination); @@ -1990,15 +1991,15 @@ function ui_pagination( $script_modified ); - $output .= "'; } else { - $output .= "'; + $output .= "".html_print_image('images/go_next.png', true, ['class' => 'bot']).''; } } @@ -2047,13 +2048,15 @@ function ui_pagination( $script_modified ); - $output .= "'; } else { - $output .= "'; + $output .= "".html_print_image('images/go_last.png', true, ['class' => 'bot']).''; } } + $output .= '
'; + // total_number // End div and layout $output .= '
'; diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index 6631a5dc48..af40f50077 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -5006,3 +5006,170 @@ select#autorefresh_list:-internal-list-box { .table_three_columns .table_td { width: 33%; } + +/* + * --------------------------------------------------------------------- + * - TABLES TO SHOW INFORMATION + * --------------------------------------------------------------------- + */ + +table.info_table { + background-color: #fff; + /* margin-bottom: 20px;*/ + border-spacing: 0; +} + +table.info_table tr:nth-child(even) { + background-color: #f5f5f5; +} + +table.info_table tr:first-child > th { + background-color: #373737; + color: #fff; + /*font-size: 9pt;*/ +} + +table.info_table tr:first-child > th span { + /*font-size: 9pt;*/ +} + +table.info_table th { + color: #fff; + background-color: #666; + font-size: 7.5pt; + letter-spacing: 0.3pt; +} + +table.info_table > thead > tr:first-child > th:last-child { + border-right: 1px solid #373737; + border-top-right-radius: 4px; +} + +table.info_table > thead > tr:first-child > th:first-child { + border-left: 1px solid #373737; + border-top-left-radius: 4px; +} + +table.info_table > thead > tr > th, +table.info_table > tbody > tr > th, +table.info_table > thead > tr > th a { + padding: 9px 7px; + font-weight: normal; + color: #fff; +} + +table.info_table > tbody > tr > td { + -moz-border-radius: 0px; + -webkit-border-radius: 0px; + border-radius: 0px; + border: none; + /*padding: 9px 7px;*/ + padding-left: 9px; + padding-right: 9px; + padding-top: 7px; + padding-bottom: 7px; + border-bottom: 1px solid #e2e2e2; +} + +table.info_table > tbody > tr:last-child > td:first-child { + border-bottom-left-radius: 4px; +} + +table.info_table > tbody > tr > td:first-child { + border-left: 1px solid #e2e2e2; +} + +table.info_table > tbody > tr:last-child > td:last-child { + border-bottom-right-radius: 4px; +} + +table.info_table > tbody > tr > td:last-child { + border-right: 1px solid #e2e2e2; +} + +table.info_table > tbody > tr > td > img, +table.info_table > thead > tr > th > img, +table.info_table > tbody > tr > td > div > a > img, +table.info_table > tbody > tr > td > span > img, +table.info_table > tbody > tr > td > span > a > img, +table.info_table > tbody > tr > td > a > img, +table.info_table > tbody > tr > td > form > a > img { + vertical-align: middle; +} + +table.info_table > tbody > tr:hover { + background-color: #eee; +} + +table.info_table td:last-child img { + border-radius: 4px; + /* border: 2px solid #dcdcdc !important;*/ + /* padding: 2px;*/ + border: 1px solid #dcdcdc !important; + padding: 1px; + box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.1); +} + +.pagination { + display: flex; + justify-content: space-between; + align-items: flex-end; + margin-bottom: 10px; +} + +.pagination .page_number { + border: 1px solid #cacaca; + border-right: 0px; + text-align: center; +} + +.pagination .page_number a { + padding: 5px; + width: 12px; + display: block; +} + +.pagination .total_number > *:first-child { + border-top-left-radius: 2px; + border-bottom-left-radius: 2px; +} + +.pagination .total_number > *:last-child { + border-top-right-radius: 2px; + border-bottom-right-radius: 2px; + border-right: 1px solid #cacaca !important; +} + +.pagination .page_number_active { + font-weight: bold; + background-color: #82b92e; + color: #fff; + border-color: #82b92e; +} + +.pagination .page_number_active a { + color: #fff; +} + +.pagination .total_pages { +} + +.pagination .total_number { + display: flex; + justify-content: flex-end; +} + +.pagination a { + margin: 0 !important; +} + +.pagination .pagination-arrows { + border: 1px solid #cacaca; + border-right: 0px; +} + +.pagination-bottom { + margin-bottom: 15px; + margin-top: 10px; + align-items: flex-start; +} diff --git a/pandora_console/operation/agentes/alerts_status.php b/pandora_console/operation/agentes/alerts_status.php index f0d7565c70..706a1a8552 100755 --- a/pandora_console/operation/agentes/alerts_status.php +++ b/pandora_console/operation/agentes/alerts_status.php @@ -442,7 +442,7 @@ if ($print_agent) { $table = new stdClass(); $table->width = '100%'; -$table->class = 'databox data'; +$table->class = 'info_table'; $table->cellpadding = '0'; $table->cellspacing = '0'; $table->size = []; @@ -608,6 +608,16 @@ if (!empty($table->data)) { 'offset_simple' ); html_print_table($table); + ui_pagination( + $countAlertsSimple, + $url, + $offset_simple, + 0, + false, + 'offset_simple', + true, + 'pagination-bottom' + ); if (!is_metaconsole()) { if (check_acl($config['id_user'], $id_group, 'AW') || check_acl($config['id_user'], $id_group, 'LM')) { diff --git a/pandora_console/operation/agentes/estado_agente.php b/pandora_console/operation/agentes/estado_agente.php index b823ad02d9..16c080edd3 100644 --- a/pandora_console/operation/agentes/estado_agente.php +++ b/pandora_console/operation/agentes/estado_agente.php @@ -631,7 +631,7 @@ $table = new stdClass(); $table->cellpadding = 0; $table->cellspacing = 0; $table->width = '100%'; -$table->class = 'databox data'; +$table->class = 'info_table'; $table->head = []; $table->head[0] = __('Agent').' '.''.html_print_image('images/sort_up.png', true, ['style' => $selectNameUp, 'alt' => 'up']).''.''.html_print_image('images/sort_down.png', true, ['style' => $selectNameDown, 'alt' => 'down']).''; @@ -795,14 +795,6 @@ foreach ($agents as $agent) { if (!empty($table->data)) { html_print_table($table); - if (check_acl($config['id_user'], 0, 'AW') || check_acl($config['id_user'], 0, 'AM')) { - echo '
'; - echo ''; - html_print_input_hidden('new_agent', 1); - html_print_submit_button(__('Create agent'), 'crt', false, 'class="sub next"'); - echo ''; - echo '
'; - } ui_pagination( $total_agents, @@ -819,8 +811,19 @@ if (!empty($table->data)) { 0, false, 'offset', - false + true, + 'pagination-bottom' ); + + if (check_acl($config['id_user'], 0, 'AW') || check_acl($config['id_user'], 0, 'AM')) { + echo '
'; + echo '
'; + html_print_input_hidden('new_agent', 1); + html_print_submit_button(__('Create agent'), 'crt', false, 'class="sub next"'); + echo '
'; + echo '
'; + } + unset($table); } else { ui_print_info_message([ 'no_close' => true, 'message' => __('There are no defined agents') ]); diff --git a/pandora_console/operation/agentes/pandora_networkmap.php b/pandora_console/operation/agentes/pandora_networkmap.php index 604d800307..67407eb319 100644 --- a/pandora_console/operation/agentes/pandora_networkmap.php +++ b/pandora_console/operation/agentes/pandora_networkmap.php @@ -612,7 +612,9 @@ switch ($tab) { $table = new stdClass(); $table->width = '100%'; - $table->class = 'databox data'; + $table->class = 'info_table'; + $table->cellpadding = 0; + $table->cellspacing = 0; $table->headstyle['copy'] = 'text-align: center;'; $table->headstyle['edit'] = 'text-align: center;'; @@ -657,11 +659,24 @@ switch ($tab) { $id_groups = array_keys(users_get_groups()); - $network_maps = db_get_all_rows_filter( + // Prepare pagination. + $offset = (int) get_parameter('offset'); + $limit = $config['block_size']; + $count_maps = db_get_value_filter( + 'count(*)', 'tmap', ['id_group' => $id_groups] ); + $network_maps = db_get_all_rows_filter( + 'tmap', + [ + 'id_group' => $id_groups, + 'limit' => $limit, + 'offset' => $offset, + ] + ); + if ($network_maps !== false) { $table->data = []; @@ -732,7 +747,9 @@ switch ($tab) { $table->data[] = $data; } + ui_pagination($count_maps, false, $offset); html_print_table($table); + ui_pagination($count_maps, false, 0, 0, false, 'offset', true, 'pagination-bottom'); } else { ui_print_info_message(['no_close' => true, 'message' => __('There are no maps defined.') ]); } @@ -756,4 +773,3 @@ switch ($tab) { } break; } - diff --git a/pandora_console/operation/agentes/status_monitor.php b/pandora_console/operation/agentes/status_monitor.php index fa0473c771..9a51210216 100644 --- a/pandora_console/operation/agentes/status_monitor.php +++ b/pandora_console/operation/agentes/status_monitor.php @@ -987,7 +987,7 @@ if ($autosearch) { if ($result === false) { $result = []; } else { - ui_pagination($count, false, $offset); + ui_pagination($count, false, $offset, 0, false, 'offset', true); } } else { // For each server defined and not disabled: @@ -1073,7 +1073,7 @@ if (!empty($result)) { $table->cellpadding = 0; $table->cellspacing = 0; $table->width = '100%'; - $table->class = 'databox data'; + $table->class = 'info_table'; $table->head = []; $table->data = []; $table->size = []; @@ -1659,6 +1659,8 @@ if (!empty($result)) { } html_print_table($table); + + ui_pagination($count, false, $offset, 0, false, 'offset', true, 'pagination-bottom'); } else { if ($first_interaction) { ui_print_info_message(['no_close' => true, 'message' => __('This group doesn\'t have any monitor')]); diff --git a/pandora_console/operation/events/events.build_table.php b/pandora_console/operation/events/events.build_table.php index d38bd1918e..d4b3ed3a30 100644 --- a/pandora_console/operation/events/events.build_table.php +++ b/pandora_console/operation/events/events.build_table.php @@ -929,6 +929,13 @@ if ($group_rep == 2) { } html_print_table($table); + if ($allow_pagination) { + $params_to_paginate = $params; + unset($params_to_paginate['offset']); + $url_paginate = 'index.php?'.http_build_query($params_to_paginate, '', '&'); + ui_pagination($total_events, $url_paginate, $offset, $pagination, false, 'offset', true, 'pagination-bottom'); + } + echo '
'; if ($allow_action) { diff --git a/pandora_console/operation/servers/recon_view.php b/pandora_console/operation/servers/recon_view.php index 84a057d69c..b647d0ef20 100644 --- a/pandora_console/operation/servers/recon_view.php +++ b/pandora_console/operation/servers/recon_view.php @@ -76,10 +76,10 @@ if ($servers === false) { } $table = new StdClass(); - $table->cellpadding = 4; - $table->cellspacing = 4; + $table->cellpadding = 0; + $table->cellspacing = 0; $table->width = '100%'; - $table->class = 'databox data'; + $table->class = 'info_table'; $table->head = []; $table->data = []; $table->align = []; From 26451c41a1d685bfe43a6a8dbf867a173fce5229 Mon Sep 17 00:00:00 2001 From: Tatiana Llorente Date: Fri, 29 Mar 2019 11:05:52 +0100 Subject: [PATCH 02/12] New design for the tables - #3707 Former-commit-id: 17d66da1d4d0365db38923e15e9c261c12d23544 --- pandora_console/godmode/admin_access_logs.php | 7 +-- .../godmode/alerts/alert_actions.php | 2 +- .../godmode/alerts/alert_commands.php | 2 +- .../godmode/alerts/alert_list.list.php | 7 ++- .../godmode/alerts/alert_templates.php | 3 +- pandora_console/godmode/category/category.php | 11 ++++- .../godmode/events/event_filter.php | 2 +- pandora_console/godmode/groups/group_list.php | 7 +-- .../modules/manage_network_components.php | 3 +- .../modules/manage_network_templates.php | 19 +++++++- pandora_console/godmode/servers/plugin.php | 2 +- pandora_console/godmode/setup/gis.php | 1 + pandora_console/godmode/setup/links.php | 2 +- pandora_console/godmode/setup/news.php | 2 +- pandora_console/godmode/setup/os.list.php | 18 +++++++- pandora_console/godmode/tag/tag.php | 3 +- pandora_console/godmode/users/user_list.php | 3 +- pandora_console/include/styles/pandora.css | 46 +++++++++++++------ .../operation/gis_maps/gis_map.php | 2 +- .../operation/messages/message_list.php | 6 +-- pandora_console/operation/users/user_edit.php | 2 +- 21 files changed, 109 insertions(+), 41 deletions(-) diff --git a/pandora_console/godmode/admin_access_logs.php b/pandora_console/godmode/admin_access_logs.php index 93c668f00c..0a2c545eb1 100644 --- a/pandora_console/godmode/admin_access_logs.php +++ b/pandora_console/godmode/admin_access_logs.php @@ -183,10 +183,10 @@ if (empty($result)) { } $table = new stdClass(); -$table->cellpadding = 4; -$table->cellspacing = 4; +$table->cellpadding = 0; +$table->cellspacing = 0; $table->width = '100%'; -$table->class = 'databox data'; +$table->class = 'info_table'; $table->size = []; $table->data = []; $table->head = []; @@ -247,6 +247,7 @@ foreach ($result as $row) { } html_print_table($table); +ui_pagination($count, $url, 0, 0, false, 'offset', true, 'pagination-bottom'); if ($enterprise_include !== ENTERPRISE_NOT_HOOK) { enterprise_hook('enterpriseAuditFooter'); diff --git a/pandora_console/godmode/alerts/alert_actions.php b/pandora_console/godmode/alerts/alert_actions.php index 6140d5407a..1530c6207f 100644 --- a/pandora_console/godmode/alerts/alert_actions.php +++ b/pandora_console/godmode/alerts/alert_actions.php @@ -221,7 +221,7 @@ if ($delete_action) { $table = new stdClass(); $table->width = '100%'; -$table->class = 'databox data'; +$table->class = 'info_table'; $table->data = []; $table->head = []; $table->head[0] = __('Name'); diff --git a/pandora_console/godmode/alerts/alert_commands.php b/pandora_console/godmode/alerts/alert_commands.php index 455ae72d73..8bbfa01dee 100644 --- a/pandora_console/godmode/alerts/alert_commands.php +++ b/pandora_console/godmode/alerts/alert_commands.php @@ -388,7 +388,7 @@ if ($copy_command) { } $table->width = '100%'; -$table->class = 'databox data'; +$table->class = 'info_table'; $table->data = []; $table->head = []; diff --git a/pandora_console/godmode/alerts/alert_list.list.php b/pandora_console/godmode/alerts/alert_list.list.php index 77bb7067bb..ee6411fe96 100644 --- a/pandora_console/godmode/alerts/alert_list.list.php +++ b/pandora_console/godmode/alerts/alert_list.list.php @@ -407,7 +407,7 @@ $table = new stdClass(); if (is_metaconsole()) { $table->class = 'alert_list databox'; } else { - $table->class = 'databox data'; + $table->class = 'info_table'; } $table->width = '100%'; @@ -815,6 +815,11 @@ foreach ($simple_alerts as $alert) { if (isset($data)) { html_print_table($table); + if ($id_agente) { + ui_pagination($total, 'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=alert&id_agente='.$id_agente.$form_params.$sort_params, 0, 0, false, 'offset', true, 'pagination-bottom'); + } else { + ui_pagination($total, 'index.php?sec='.$sec.'&sec2=godmode/alerts/alert_list'.$form_params.$sort_params, 0, 0, false, 'offset', true, 'pagination-bottom'); + } } else { ui_print_info_message(['no_close' => true, 'message' => __('No alerts defined') ]); } diff --git a/pandora_console/godmode/alerts/alert_templates.php b/pandora_console/godmode/alerts/alert_templates.php index f00dbe5827..90e01b712d 100644 --- a/pandora_console/godmode/alerts/alert_templates.php +++ b/pandora_console/godmode/alerts/alert_templates.php @@ -339,7 +339,7 @@ if ($templates === false) { $table = new stdClass(); $table->width = '100%'; -$table->class = 'databox data'; +$table->class = 'info_table'; $table->data = []; $table->head = []; $table->head[0] = __('Name'); @@ -396,6 +396,7 @@ foreach ($templates as $template) { ui_pagination($total_templates, $url); if (isset($data)) { html_print_table($table); + ui_pagination($total_templates, $url, 0, 0, false, 'offset', true, 'pagination-bottom'); } else { ui_print_info_message(['no_close' => true, 'message' => __('No alert templates defined') ]); } diff --git a/pandora_console/godmode/category/category.php b/pandora_console/godmode/category/category.php index 727be02057..ba7155cc6b 100755 --- a/pandora_console/godmode/category/category.php +++ b/pandora_console/godmode/category/category.php @@ -82,7 +82,13 @@ $filter['limit'] = (int) $config['block_size']; // Search action: This will filter the display category view $result = false; -$result = categories_get_all_categories(); +$result = db_get_all_rows_filter( + 'tcategory', + [ + 'limit' => $filter['limit'], + 'offset' => $filter['offset'], + ] +); // Display categories previously filtered or not $rowPair = true; @@ -94,7 +100,7 @@ if (!empty($result)) { $table = new stdClass(); $table->width = '100%'; - $table->class = 'databox data'; + $table->class = 'info_table'; $table->data = []; $table->head = []; @@ -131,6 +137,7 @@ if (!empty($result)) { } html_print_table($table); + ui_pagination($total_categories, $url, $offset, 0, false, 'offset', true, 'pagination-bottom'); } else { // No categories available or selected ui_print_info_message(['no_close' => true, 'message' => __('No categories found') ]); diff --git a/pandora_console/godmode/events/event_filter.php b/pandora_console/godmode/events/event_filter.php index 40d60650f6..59bd219ee6 100644 --- a/pandora_console/godmode/events/event_filter.php +++ b/pandora_console/godmode/events/event_filter.php @@ -113,7 +113,7 @@ if ($filters === false) { $table = new stdClass(); $table->width = '100%'; -$table->class = 'databox data'; +$table->class = 'info_table'; $table->head = []; $table->head[0] = __('Name'); diff --git a/pandora_console/godmode/groups/group_list.php b/pandora_console/godmode/groups/group_list.php index 6fc899a5d8..e24342ff6d 100644 --- a/pandora_console/godmode/groups/group_list.php +++ b/pandora_console/godmode/groups/group_list.php @@ -515,7 +515,7 @@ if ($tab == 'tree') { $table = new StdClass(); $table->width = '100%'; - $table->class = 'databox data'; + $table->class = 'info_table'; $table->head = []; $table->head[0] = __('ID'); $table->head[1] = __('Name'); @@ -592,7 +592,7 @@ if ($tab == 'tree') { $block_size, true, 'offset', - false + true ); html_print_table($table); echo ui_pagination( @@ -602,7 +602,8 @@ if ($tab == 'tree') { $block_size, true, 'offset', - true + true, + 'pagination-bottom' ); } else { ui_print_info_message(['no_close' => true, 'message' => __('There are no defined groups') ]); diff --git a/pandora_console/godmode/modules/manage_network_components.php b/pandora_console/godmode/modules/manage_network_components.php index f1fae1785d..6014ef08c5 100644 --- a/pandora_console/godmode/modules/manage_network_components.php +++ b/pandora_console/godmode/modules/manage_network_components.php @@ -634,7 +634,7 @@ unset($table); $table->width = '100%'; $table->head = []; -$table->class = 'databox data'; +$table->class = 'info_table'; $table->head[0] = __('Module name'); $table->head[1] = __('Type'); $table->head[3] = __('Description'); @@ -698,6 +698,7 @@ if (isset($data)) { echo "
"; html_print_input_hidden('multiple_delete', 1); html_print_table($table); + ui_pagination($total_components, $url, 0, 0, false, 'offset', true, 'pagination-bottom'); echo "
"; html_print_submit_button(__('Delete'), 'delete_btn', false, 'class="sub delete"'); echo '
'; diff --git a/pandora_console/godmode/modules/manage_network_templates.php b/pandora_console/godmode/modules/manage_network_templates.php index b179bdfd91..10468e75bf 100644 --- a/pandora_console/godmode/modules/manage_network_templates.php +++ b/pandora_console/godmode/modules/manage_network_templates.php @@ -189,7 +189,20 @@ if ($export_profile) { exit; } -$result = db_get_all_rows_in_table('tnetwork_profile', 'name'); +// Prepare pagination. +$offset = (int) get_parameter('offset'); +$limit = $config['block_size']; +$count_network_templates = db_get_value('count(*)', 'tnetwork_profile'); + +$result = db_get_all_rows_filter( + 'tnetwork_profile', + [ + 'order' => 'name', + 'limit' => $limit, + 'offset' => $offset, + ] +); + if ($result === false) { $result = []; } @@ -197,7 +210,7 @@ if ($result === false) { $table->cellpadding = 0; $table->cellspacing = 0; $table->width = '100%'; -$table->class = 'databox data'; +$table->class = 'info_table'; $table->head = []; $table->head[0] = __('Name'); @@ -241,7 +254,9 @@ foreach ($result as $row) { if (!empty($table->data)) { echo ''; html_print_input_hidden('multiple_delete', 1); + ui_pagination($count_network_templates, false, $offset); html_print_table($table); + ui_pagination($count_network_templates, false, $offset, 0, false, 'offset', true, 'pagination-bottom'); echo "
"; html_print_submit_button(__('Delete'), 'delete_btn', false, 'class="sub delete"'); echo '
'; diff --git a/pandora_console/godmode/servers/plugin.php b/pandora_console/godmode/servers/plugin.php index b04643e1c3..9520bb6625 100644 --- a/pandora_console/godmode/servers/plugin.php +++ b/pandora_console/godmode/servers/plugin.php @@ -954,7 +954,7 @@ if (($create != '') || ($view != '')) { if (defined('METACONSOLE')) { echo ''; } else { - echo '
'; + echo '
'; } echo ''; diff --git a/pandora_console/godmode/setup/gis.php b/pandora_console/godmode/setup/gis.php index 946d0526ea..3acd113014 100755 --- a/pandora_console/godmode/setup/gis.php +++ b/pandora_console/godmode/setup/gis.php @@ -63,6 +63,7 @@ switch ($action) { break; } +$table->class = 'info_table'; $table->width = '98%'; $table->head[0] = __('Map connection name'); $table->head[1] = __('Group'); diff --git a/pandora_console/godmode/setup/links.php b/pandora_console/godmode/setup/links.php index f5016e666e..450115590a 100644 --- a/pandora_console/godmode/setup/links.php +++ b/pandora_console/godmode/setup/links.php @@ -137,7 +137,7 @@ if ((isset($_GET['form_add'])) or (isset($_GET['form_edit']))) { if (empty($rows)) { ui_print_info_message(['no_close' => true, 'message' => __("There isn't links") ]); } else { - echo "
'.__('Name').'
"; + echo "
"; echo "'; echo "'; diff --git a/pandora_console/godmode/setup/news.php b/pandora_console/godmode/setup/news.php index 7b663bad53..3339b8cd88 100644 --- a/pandora_console/godmode/setup/news.php +++ b/pandora_console/godmode/setup/news.php @@ -231,7 +231,7 @@ if ((isset($_GET['form_add'])) || (isset($_GET['form_edit']))) { ui_print_info_message(['no_close' => true, 'message' => __('There are no defined news') ]); } else { // Main list view for Links editor - echo "
".__('Link name').'".__('Delete').'
"; + echo "
"; echo ''; echo ''; echo ''; diff --git a/pandora_console/godmode/setup/os.list.php b/pandora_console/godmode/setup/os.list.php index f00b8cb00d..5673dd476a 100644 --- a/pandora_console/godmode/setup/os.list.php +++ b/pandora_console/godmode/setup/os.list.php @@ -25,7 +25,7 @@ if (! check_acl($config['id_user'], 0, 'PM') && ! is_user_admin($config['id_user $table = new stdClass(); $table->width = '100%'; -$table->class = 'databox data'; +$table->class = 'info_table'; $table->head[0] = ''; $table->head[1] = __('ID'); @@ -37,7 +37,19 @@ $table->align[4] = 'center'; $table->size[0] = '20px'; $table->size[4] = '20px'; -$osList = db_get_all_rows_in_table('tconfig_os'); +// Prepare pagination. +$offset = (int) get_parameter('offset'); +$limit = $config['block_size']; +$count_osList = db_get_value('count(*)', 'tconfig_os'); + +$osList = db_get_all_rows_filter( + 'tconfig_os', + [ + 'offset' => $offset, + 'limit' => $limit, + ] +); + if ($osList === false) { $osList = []; } @@ -69,7 +81,9 @@ foreach ($osList as $os) { } if (isset($data)) { + ui_pagination($count_osList, false, $offset); html_print_table($table); + ui_pagination($count_osList, false, $offset, 0, false, 'offset', true, 'pagination-bottom'); } else { ui_print_info_message(['no_close' => true, 'message' => __('There are no defined operating systems') ]); } diff --git a/pandora_console/godmode/tag/tag.php b/pandora_console/godmode/tag/tag.php index d717a9095e..e8678bb1ad 100644 --- a/pandora_console/godmode/tag/tag.php +++ b/pandora_console/godmode/tag/tag.php @@ -191,7 +191,7 @@ if (!empty($result)) { $table = new stdClass(); $table->width = '100%'; - $table->class = 'databox data'; + $table->class = 'info_table'; $table->data = []; $table->head = []; @@ -284,6 +284,7 @@ if (!empty($result)) { } html_print_table($table); + ui_pagination($total_tags, $url, 0, 0, false, 'offset', true, 'pagination-bottom'); } else { if (is_metaconsole()) { ui_toggle($filter_form, __('Show Options')); diff --git a/pandora_console/godmode/users/user_list.php b/pandora_console/godmode/users/user_list.php index 6b4d19ad28..b5904225a2 100644 --- a/pandora_console/godmode/users/user_list.php +++ b/pandora_console/godmode/users/user_list.php @@ -304,7 +304,7 @@ $table = new stdClass(); $table->cellpadding = 0; $table->cellspacing = 0; $table->width = '100%'; -$table->class = 'databox data'; +$table->class = 'info_table'; $table->head = []; $table->data = []; @@ -535,6 +535,7 @@ foreach ($info as $user_id => $user_info) { } html_print_table($table); +ui_pagination(count($info), false, 0, 0, false, 'offset', true, 'pagination-bottom'); echo '
'; unset($table); diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index b81387a4e5..e4b3e86cd2 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -3958,7 +3958,7 @@ span.log_zone_line_error { background-color: #eee; } .checkselected { - background-color: #eee; + background-color: #eee !important; } .tag-wrapper { padding: 0 10px 0 0; @@ -5040,18 +5040,22 @@ select#autorefresh_list:-internal-list-box { table.info_table { background-color: #fff; - /* margin-bottom: 20px;*/ + margin-bottom: 10px; border-spacing: 0; } -table.info_table tr:nth-child(even) { +table.info_table tbody tr:nth-child(even) { background-color: #f5f5f5; } table.info_table tr:first-child > th { - background-color: #373737; - color: #fff; + /*background-color: #373737;*/ + /*color: #fff;*/ /*font-size: 9pt;*/ + background-color: #fff; + border-top: 1px solid #e2e2e2; + color: #000; + text-align: left !important; } table.info_table tr:first-child > th span { @@ -5059,19 +5063,35 @@ table.info_table tr:first-child > th span { } table.info_table th { - color: #fff; - background-color: #666; + /*color: #fff;*/ + /*background-color: #666;*/ font-size: 7.5pt; letter-spacing: 0.3pt; + color: #000; + background-color: #fff; +} + +table.info_table > thead > tr > th:first-child { + border-left: 1px solid #e2e2e2; +} + +table.info_table > thead > tr > th:last-child { + border-right: 1px solid #e2e2e2; +} + +table.info_table tr th { + border-bottom: 1px solid #e2e2e2; } table.info_table > thead > tr:first-child > th:last-child { - border-right: 1px solid #373737; + /*border-right: 1px solid #373737;*/ + /*border-right: 1px solid #e2e2e2;*/ border-top-right-radius: 4px; } table.info_table > thead > tr:first-child > th:first-child { - border-left: 1px solid #373737; + /*border-left: 1px solid #373737;*/ + /* border-left: 1px solid #e2e2e2;*/ border-top-left-radius: 4px; } @@ -5079,8 +5099,8 @@ table.info_table > thead > tr > th, table.info_table > tbody > tr > th, table.info_table > thead > tr > th a { padding: 9px 7px; - font-weight: normal; - color: #fff; + font-weight: bold; + color: #000; } table.info_table > tbody > tr > td { @@ -5150,7 +5170,7 @@ table.info_table td:last-child img { .pagination .page_number a { padding: 5px; - width: 12px; + min-width: 12px; display: block; } @@ -5195,6 +5215,6 @@ table.info_table td:last-child img { .pagination-bottom { margin-bottom: 15px; - margin-top: 10px; + margin-top: 0px; align-items: flex-start; } diff --git a/pandora_console/operation/gis_maps/gis_map.php b/pandora_console/operation/gis_maps/gis_map.php index 9e6ea1a50a..6b6f5fad25 100644 --- a/pandora_console/operation/gis_maps/gis_map.php +++ b/pandora_console/operation/gis_maps/gis_map.php @@ -96,7 +96,7 @@ $maps = gis_get_maps(); $table = new stdClass(); $table->width = '100%'; -$table->class = 'databox data'; +$table->class = 'info_table'; $table->head = []; $table->head['name'] = __('Name'); diff --git a/pandora_console/operation/messages/message_list.php b/pandora_console/operation/messages/message_list.php index 9427159432..88153b8fc9 100644 --- a/pandora_console/operation/messages/message_list.php +++ b/pandora_console/operation/messages/message_list.php @@ -135,9 +135,9 @@ if (empty($messages)) { } else { $table = new stdClass(); $table->width = '100%'; - $table->class = 'databox data'; - $table->cellpadding = 4; - $table->cellspacing = 4; + $table->class = 'info_table'; + $table->cellpadding = 0; + $table->cellspacing = 0; $table->head = []; $table->data = []; $table->align = []; diff --git a/pandora_console/operation/users/user_edit.php b/pandora_console/operation/users/user_edit.php index a5e3390c69..47e0f9f687 100644 --- a/pandora_console/operation/users/user_edit.php +++ b/pandora_console/operation/users/user_edit.php @@ -575,7 +575,7 @@ if (!defined('METACONSOLE')) { $table = new stdClass(); $table->width = '100%'; -$table->class = 'databox data'; +$table->class = 'info_table'; if (defined('METACONSOLE')) { $table->width = '100%'; $table->class = 'databox data'; From f497d3bd2e4b2b32af35be06bc49806e7b26a844 Mon Sep 17 00:00:00 2001 From: Tatiana Llorente Date: Tue, 2 Apr 2019 13:42:30 +0200 Subject: [PATCH 03/12] Added class to action buttons and moved checkbox to the left side Former-commit-id: 1d7ba8fa06e734a3e45f7bc1ca2f78d0d8978122 --- pandora_console/extensions/agents_alerts.php | 4 +- pandora_console/godmode/admin_access_logs.php | 10 +++ .../godmode/agentes/fields_manager.php | 3 +- .../godmode/agentes/modificar_agente.php | 6 +- .../godmode/alerts/alert_actions.php | 4 + .../godmode/alerts/alert_commands.php | 1 + .../godmode/alerts/alert_list.list.php | 5 +- .../godmode/alerts/alert_templates.php | 3 +- pandora_console/godmode/category/category.php | 3 +- .../godmode/events/event_filter.php | 45 ++++++----- .../godmode/events/event_responses.list.php | 3 +- pandora_console/godmode/extensions.php | 3 +- pandora_console/godmode/groups/group_list.php | 3 +- .../godmode/groups/modu_group_list.php | 1 + .../godmode/modules/manage_nc_groups.php | 16 ++-- .../modules/manage_network_components.php | 9 ++- .../modules/manage_network_templates.php | 29 ++++--- .../godmode/modules/module_list.php | 4 +- pandora_console/godmode/netflow/nf_edit.php | 28 ++++--- pandora_console/godmode/reporting/graphs.php | 19 +++-- .../godmode/reporting/map_builder.php | 4 + .../godmode/reporting/reporting_builder.php | 16 ++-- pandora_console/godmode/servers/plugin.php | 3 + .../godmode/servers/servers.build_table.php | 14 ++-- pandora_console/godmode/setup/gis.php | 7 +- pandora_console/godmode/setup/links.php | 4 +- pandora_console/godmode/setup/news.php | 5 +- pandora_console/godmode/setup/os.list.php | 2 + pandora_console/godmode/tag/tag.php | 3 +- .../godmode/users/profile_list.php | 5 +- pandora_console/godmode/users/user_list.php | 1 + pandora_console/images/go_first_g.png | Bin 0 -> 245 bytes pandora_console/images/go_last_g.png | Bin 0 -> 241 bytes pandora_console/images/go_next_g.png | Bin 0 -> 209 bytes pandora_console/images/go_previous_g.png | Bin 0 -> 199 bytes pandora_console/include/functions_ui.php | 49 ++++++------ pandora_console/include/styles/pandora.css | 75 ++++++++++-------- .../operation/agentes/alerts_status.php | 66 +++++++-------- .../operation/agentes/pandora_networkmap.php | 5 ++ .../operation/gis_maps/gis_map.php | 3 +- .../operation/incidents/incident.php | 65 ++++++++------- .../operation/messages/message_list.php | 13 ++- .../operation/servers/recon_view.php | 1 + 43 files changed, 324 insertions(+), 216 deletions(-) create mode 100644 pandora_console/images/go_first_g.png create mode 100644 pandora_console/images/go_last_g.png create mode 100644 pandora_console/images/go_next_g.png create mode 100644 pandora_console/images/go_previous_g.png diff --git a/pandora_console/extensions/agents_alerts.php b/pandora_console/extensions/agents_alerts.php index 5b0cc4a72d..373ff97819 100755 --- a/pandora_console/extensions/agents_alerts.php +++ b/pandora_console/extensions/agents_alerts.php @@ -379,6 +379,7 @@ function mainAgentsAlerts() ); echo '
'.__('Subject').''.__('Type').''.__('Author').'
'; + echo ''; echo "'; if ($hor_offset > 0) { @@ -424,6 +425,7 @@ function mainAgentsAlerts() echo ''; } + echo ''; if (($hor_offset + $block) < $ntemplates) { $new_hor_offset = ($hor_offset + $block); echo "
".__('Agents').' / '.__('Alert templates').''.io_safe_output($tname).html_print_image('images/information_alerts.png', true, ['title' => io_safe_output($tname), 'style' => 'margin-left:5px' ]).'
@@ -455,7 +457,7 @@ function mainAgentsAlerts() $cellstyle = 'background:'.COL_ALERTFIRED.';'; } - echo ' '; + echo ' '; $uniqid = uniqid(); echo '
'; diff --git a/pandora_console/godmode/admin_access_logs.php b/pandora_console/godmode/admin_access_logs.php index 0a2c545eb1..67a933d8cb 100644 --- a/pandora_console/godmode/admin_access_logs.php +++ b/pandora_console/godmode/admin_access_logs.php @@ -246,6 +246,16 @@ foreach ($result as $row) { } } +foreach ($table->rowclass as $key => $value) { + if (strpos($value, 'limit_scroll') !== false) { + $table->colspan[$key] = [7]; + } else { + if ($enterprise_include !== ENTERPRISE_NOT_HOOK) { + $table->cellclass[$key][6] = 'action_buttons'; + } + } +} + html_print_table($table); ui_pagination($count, $url, 0, 0, false, 'offset', true, 'pagination-bottom'); diff --git a/pandora_console/godmode/agentes/fields_manager.php b/pandora_console/godmode/agentes/fields_manager.php index ee94813a59..20a9db547a 100644 --- a/pandora_console/godmode/agentes/fields_manager.php +++ b/pandora_console/godmode/agentes/fields_manager.php @@ -146,8 +146,9 @@ foreach ($fields as $field) { $data[2] = html_print_image('images/icono_stop.png', true, ['style' => 'width:21px;height:21px;']); } + $table->cellclass[][3] = 'action_buttons'; $data[3] = ''.html_print_image('images/config.png', true, ['alt' => __('Edit'), 'title' => __('Edit'), 'border' => '0']).''; - $data[3] .= '  '.html_print_image('images/cross.png', true, ['alt' => __('Delete'), 'title' => __('Delete'), 'border' => '0']).''; + $data[3] .= ''.html_print_image('images/cross.png', true, ['alt' => __('Delete'), 'title' => __('Delete'), 'border' => '0']).''; array_push($table->data, $data); } diff --git a/pandora_console/godmode/agentes/modificar_agente.php b/pandora_console/godmode/agentes/modificar_agente.php index cee4f06f8e..b8d551091e 100644 --- a/pandora_console/godmode/agentes/modificar_agente.php +++ b/pandora_console/godmode/agentes/modificar_agente.php @@ -442,6 +442,7 @@ ui_pagination($total_agents, "index.php?sec=gagente&sec2=godmode/agentes/modific if ($agents !== false) { echo ""; + echo ''; echo ''; echo "'; echo ''; echo "'; + echo ''; $color = 1; $rowPair = true; @@ -628,7 +630,7 @@ if ($agents !== false) { $offsetArg = $offset; } - echo "
'.__('Agent name').' '.''.html_print_image('images/sort_up.png', true, ['style' => $selectNameUp]).''.''.html_print_image('images/sort_down.png', true, ['style' => $selectNameDown]).''; echo '".__('R').' '.''.html_print_image('images/sort_up.png', true, ['style' => $selectRemoteUp]).''.''.html_print_image('images/sort_down.png', true, ['style' => $selectRemoteDown]).''; @@ -453,6 +454,7 @@ if ($agents !== false) { echo ''.__('Description').'".__('Actions').'
"; + echo ""; if ($agent['disabled']) { echo "cellclass[] = [ + 2 => 'action_buttons', + 3 => 'action_buttons', + ]; $data[2] = ''.html_print_image('images/copy.png', true).''; $data[3] = 'cellclass[]['action'] = 'action_buttons'; if (! $command['internal']) { $data['action'] = ''; $data['action'] .= 'cellclass[][4] = 'action_buttons'; $data[4] = ''; if ($alert['disabled']) { $data[4] .= html_print_input_image('enable', 'images/lightbulb_off.png', 1, 'padding:0px', true); @@ -742,7 +743,7 @@ foreach ($simple_alerts as $alert) { // To manage alert is necessary LW permissions in the agent group if (check_acl_one_of_groups($config['id_user'], $all_groups, 'LW')) { - $data[4] .= '  '; + $data[4] .= ''; if (!$alert['standby']) { $data[4] .= html_print_input_image('standby_off', 'images/bell.png', 1, 'padding:0px;', true); $data[4] .= html_print_input_hidden('standbyon_alert', 1, true); @@ -771,7 +772,7 @@ foreach ($simple_alerts as $alert) { // To manage alert is necessary LW permissions in the agent group if (check_acl_one_of_groups($config['id_user'], $all_groups, 'LW')) { - $data[4] .= '  '; + $data[4] .= ''; $is_cluster = (bool) get_parameter('id_cluster'); if (!$is_cluster) { if ($alert['disabled']) { diff --git a/pandora_console/godmode/alerts/alert_templates.php b/pandora_console/godmode/alerts/alert_templates.php index 90e01b712d..f346673f46 100644 --- a/pandora_console/godmode/alerts/alert_templates.php +++ b/pandora_console/godmode/alerts/alert_templates.php @@ -350,7 +350,7 @@ $table->head[4] = __('Op.'); $table->style = []; $table->style[0] = 'font-weight: bold'; $table->size = []; -$table->size[4] = '85px'; +$table->size[4] = '60px'; $table->align = []; $table->align[1] = 'left'; $table->align[4] = 'left'; @@ -375,6 +375,7 @@ foreach ($templates as $template) { $data[3] = alerts_get_alert_templates_type_name($template['type']); if (check_acl($config['id_user'], $template['id_group'], 'LM')) { + $table->cellclass[][4] = 'action_buttons'; $data[4] = ''; $data[4] .= html_print_input_hidden('duplicate_template', 1, true); $data[4] .= html_print_input_hidden('source_id', $template['id'], true); diff --git a/pandora_console/godmode/category/category.php b/pandora_console/godmode/category/category.php index ba7155cc6b..e1a61a4db6 100755 --- a/pandora_console/godmode/category/category.php +++ b/pandora_console/godmode/category/category.php @@ -129,7 +129,8 @@ if (!empty($result)) { $data[1] .= ''.html_print_image('images/cross.png', true, ['title' => 'Delete']).''; } else { $data[0] = "".$category['name'].''; - $data[1] = "".html_print_image('images/config.png', true, ['title' => 'Edit']).'  '; + $table->cellclass[][1] = 'action_buttons'; + $data[1] = "".html_print_image('images/config.png', true, ['title' => 'Edit']).''; $data[1] .= ''.html_print_image('images/cross.png', true, ['title' => 'Delete']).''; } diff --git a/pandora_console/godmode/events/event_filter.php b/pandora_console/godmode/events/event_filter.php index 59bd219ee6..60ba973996 100644 --- a/pandora_console/godmode/events/event_filter.php +++ b/pandora_console/godmode/events/event_filter.php @@ -116,28 +116,30 @@ $table->width = '100%'; $table->class = 'info_table'; $table->head = []; -$table->head[0] = __('Name'); -$table->head[1] = __('Group'); -$table->head[2] = __('Event type'); -$table->head[3] = __('Event status'); -$table->head[4] = __('Severity'); -$table->head[5] = __('Action').html_print_checkbox('all_delete', 0, false, true, false); +$table->head[0] = html_print_checkbox('all_delete', 0, false, true, false); +$table->head[1] = __('Name'); +$table->head[2] = __('Group'); +$table->head[3] = __('Event type'); +$table->head[4] = __('Event status'); +$table->head[5] = __('Severity'); +$table->head[6] = __('Action'); $table->style = []; -$table->style[0] = 'font-weight: bold'; +$table->style[1] = 'font-weight: bold'; $table->align = []; -$table->align[1] = 'left'; $table->align[2] = 'left'; $table->align[3] = 'left'; - $table->align[4] = 'left'; + $table->align[5] = 'left'; +$table->align[6] = 'left'; $table->size = []; -$table->size[0] = '50%'; -$table->size[1] = '5px'; -$table->size[2] = '80px'; +$table->size[0] = '20px'; +$table->size[1] = '50%'; +$table->size[2] = '5px'; $table->size[3] = '80px'; $table->size[4] = '80px'; -$table->size[5] = '40px'; +$table->size[5] = '80px'; +$table->size[6] = '40px'; $table->data = []; $total_filters = db_get_all_rows_filter('tevent_filter', false, 'COUNT(*) AS total'); @@ -147,13 +149,14 @@ $total_filters = $total_filters[0]['total']; foreach ($filters as $filter) { $data = []; - $data[0] = ''.$filter['id_name'].''; - $data[1] = ui_print_group_icon($filter['id_group_filter'], true); - $data[2] = events_get_event_types($filter['event_type']); - $data[3] = events_get_status($filter['status']); - $data[4] = events_get_severity_types($filter['severity']); - $data[5] = "".html_print_image('images/cross.png', true, ['title' => __('Delete')]).''.html_print_checkbox_extended('delete_multiple[]', $filter['id_filter'], false, false, '', 'class="check_delete"', true); + $data[0] = html_print_checkbox_extended('delete_multiple[]', $filter['id_filter'], false, false, '', 'class="check_delete"', true); + $data[1] = ''.$filter['id_name'].''; + $data[2] = ui_print_group_icon($filter['id_group_filter'], true); + $data[3] = events_get_event_types($filter['event_type']); + $data[4] = events_get_status($filter['status']); + $data[5] = events_get_severity_types($filter['severity']); + $table->cellclass[][6] = 'action_buttons'; + $data[6] = "".html_print_image('images/cross.png', true, ['title' => __('Delete')]).''; array_push($table->data, $data); } @@ -188,8 +191,6 @@ echo ''; ?> width = '100%'; $table->id = 'table_filemanager'; if (!defined('METACONSOLE')) { - $table->class = 'databox data'; + $table->class = 'info_table'; $table->title = ''.__('Index of %s', $relative_directory).''; } @@ -582,13 +629,6 @@ function filemanager_file_explorer( $table->head[2] = __('Last modification'); $table->head[3] = __('Size'); $table->head[4] = __('Actions'); - if (!defined('METACONSOLE')) { - $table->headstyle[0] = 'background-color:#82B92E'; - $table->headstyle[1] = 'background-color:#82B92E'; - $table->headstyle[2] = 'background-color:#82B92E'; - $table->headstyle[3] = 'background-color:#82B92E'; - $table->headstyle[4] = 'background-color:#82B92E'; - } $prev_dir = explode('/', $relative_directory); $prev_dir_str = ''; @@ -608,85 +648,6 @@ function filemanager_file_explorer( $table->colspan[0][1] = 5; } - if (is_writable($real_directory)) { - $table->rowstyle[1] = 'display: none;'; - $table->data[1][0] = ''; - $table->data[1][1] = ''; - - $table->data[1][1] .= ''; - - $table->data[1][1] .= ''; - - $table->data[1][1] .= ''; - - $table->colspan[1][1] = 5; - } - foreach ($files as $fileinfo) { $fileinfo['realpath'] = str_replace('\\', '/', $fileinfo['realpath']); $relative_path = str_replace($_SERVER['DOCUMENT_ROOT'], '', $fileinfo['realpath']); @@ -815,10 +776,45 @@ function filemanager_file_explorer( if (defined('METACONSOLE')) { echo "
"; } else { - echo "
"; + $tabs_dialog = ''; + + echo ''; + + echo ''; + + echo ' '; + + echo "'; } else { - echo "
"; + echo "
"; echo "".__('The directory is read-only'); echo '
'; } diff --git a/pandora_console/include/styles/menu.css b/pandora_console/include/styles/menu.css index dcb9db06cb..7846a3f9a6 100644 --- a/pandora_console/include/styles/menu.css +++ b/pandora_console/include/styles/menu.css @@ -260,11 +260,6 @@ ul li { } /* End */ -ul li a:hover { - color: #e2144a; -} /* Hover Styles */ -/*li ul li a { padding: 2px 5px; } Sub Menu Styles */ - /* * --------------------------------------------------------------------- * - MAIN LEFT MENU and SUBMENU - diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index e64e94329c..48a66017ed 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -1014,7 +1014,6 @@ div#cont { } td.datos3, -/*td.datos3 **/ td.datos4 { background-color: #fff; color: #000 !important; @@ -1026,12 +1025,9 @@ td.datos4 { font-weight: normal; } -td.datos4 /*, -td.datos4 */ { +td.datos4 { /*Add !important because in php the function html_print_table write style in cell and this is style head.*/ text-align: center !important; - /* background-color: #666; - color: white !important;*/ } td.datos3 *, @@ -5162,6 +5158,186 @@ table.info_table > tbody > tr:hover { background-color: #fff !important; } +/* Tables to upload files */ +#table_filemanager tr:first-child th span { + font-weight: bold; +} + +.file_table_buttons { + text-align: right; + margin-bottom: 10px; +} + +.file_table_buttons a img { + border: 1px solid #e2e2e2; + padding: 5px; + border-radius: 4px; + margin-right: 10px; + box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.1); +} + +#file_table_modal { + display: flex; + justify-content: space-between; + margin-bottom: 40px; +} + +#file_table_modal .create_folder, +#file_table_modal .create_text_file, +#file_table_modal .upload_file { + width: 33%; + border-top-left-radius: 4px; + border-top-right-radius: 4px; + margin-right: 2px; + background-color: #e6e6e6; +} + +.file_table_buttons a:last-child img, +#file_table_modal .upload_file { + margin-right: 0px !important; +} + +#file_table_modal li a { + display: block; + padding: 5px; +} + +#file_table_modal li img, +#file_table_modal li span { + vertical-align: middle; +} + +#file_table_modal li img { + margin-right: 10px; +} + +#create_folder, +#create_text_file, +#upload_file { + margin-bottom: 30px; +} + +#create_folder input#text-dirname, +#create_text_file input#text-name_file { + width: 100%; + margin-right: 5px; + box-sizing: border-box; + margin-bottom: 10px; +} + +#upload_file input#file-file { + width: 70%; +} + +#create_folder input#submit-crt, +#create_text_file input#submit-create, +#upload_file input#submit-go { + float: right; +} + +#upload_file input#submit-go { + margin-top: 10px; +} + +.file_table_modal_active { + background-color: #fff !important; + border: 1px solid #e6e6e6; + border-bottom: none; +} + +/* Inventory table */ +.inventory_table_buttons { + text-align: right; + margin-bottom: 10px; +} + +.inventory_table_buttons a { + font-weight: bolder; + display: inline-block; + border: 1px solid #e2e2e2; + padding: 8px; + border-radius: 4px; + box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.1); +} + +.inventory_table_buttons a img, +.inventory_table_buttons a span { + vertical-align: middle; +} + +.inventory_table_buttons a img { + padding-left: 10px; +} + +.inventory_tables thead th span:first-child { + float: left; + font-weight: bold; +} + +.inventory_tables thead th span { + font-size: 8.6pt; +} + +.inventory_tables tbody > tr:first-child { + font-weight: bold; +} + +/* Tag view */ +table.info_table.agent_info_table { + margin-bottom: 20px; +} +table.agent_info_table tr { + background-color: #fff !important; +} + +table.agent_info_table > tbody > tr > td { + border-bottom: none; +} + +table.agent_info_table > tbody > tr:last-child > td { + border-bottom: 1px solid #e2e2e2; +} + +table.agent_info_table thead > tr:first-child th { + background-color: #f5f5f5; +} + +table.agent_info_table thead > tr:first-child th span, +table.agent_info_table thead > tr:first-child th { + font-weight: bold; + font-size: 8.6pt; +} + +table.info_table.agent_info_table td { + padding-left: 20px; + padding-right: 20px; +} + +table.info_table.agent_info_table table#agent_table { + padding-top: 15px; +} + +table.info_table.agent_info_table table#module_table { + padding-top: 10px; + padding-bottom: 15px; +} + +table.info_table.agent_info_table table.info_table { + margin-bottom: 0; +} + +.agent_info_table_opened { + background-color: #82b92e !important; + color: #fff !important; + border-color: #82b92e !important; +} + +.agent_info_table_closed { + background-color: #fff !important; + color: #000 !important; + border-radius: 4px; +} + /* Arrows to sort the tables. */ .sort_arrow { display: inline-grid; diff --git a/pandora_console/index.php b/pandora_console/index.php index 78f4c76571..7fb469f2da 100755 --- a/pandora_console/index.php +++ b/pandora_console/index.php @@ -1254,6 +1254,11 @@ require 'include/php_to_js_values.php';