From 26451c41a1d685bfe43a6a8dbf867a173fce5229 Mon Sep 17 00:00:00 2001 From: Tatiana Llorente Date: Fri, 29 Mar 2019 11:05:52 +0100 Subject: [PATCH] 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';
'.__('Subject').''.__('Type').''.__('Author').'