From 88b0802472b198c04384f00730c61c4d057dd6ed Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Mon, 3 Jun 2019 10:46:52 +0200 Subject: [PATCH] style review --- .../godmode/alerts/alert_list.builder.php | 24 ++- .../godmode/alerts/alert_list.list.php | 25 ++- .../godmode/reporting/reporting_builder.php | 29 ++-- pandora_console/include/functions_events.php | 8 +- pandora_console/include/functions_ui.php | 1 + pandora_console/include/styles/discovery.css | 7 +- pandora_console/include/styles/pandora.css | 155 +----------------- pandora_console/include/styles/tables.css | 150 +++++++++++++++++ .../operation/agentes/alerts_status.php | 2 +- .../operation/reporting/custom_reporting.php | 2 +- pandora_console/operation/search_reports.php | 2 +- 11 files changed, 200 insertions(+), 205 deletions(-) create mode 100644 pandora_console/include/styles/tables.css diff --git a/pandora_console/godmode/alerts/alert_list.builder.php b/pandora_console/godmode/alerts/alert_list.builder.php index ca3a099bf3..c97fe2feff 100644 --- a/pandora_console/godmode/alerts/alert_list.builder.php +++ b/pandora_console/godmode/alerts/alert_list.builder.php @@ -37,14 +37,10 @@ $table->head = []; $table->data = []; $table->size = []; $table->size = []; -$table->size[0] = '5%'; -$table->size[1] = '25%'; -$table->size[2] = '5%'; -$table->size[3] = '20%'; -$table->style[0] = 'font-weight: bold; '; -$table->style[1] = 'font-weight: bold; '; -$table->style[2] = 'font-weight: bold; '; -$table->style[3] = 'font-weight: bold; '; +$table->style[0] = 'font-weight: bold;'; +$table->style[1] = 'font-weight: bold;display: flex;align-items: baseline;'; +$table->style[2] = 'font-weight: bold;'; +$table->style[3] = 'font-weight: bold;'; // This is because if this view is reused after list alert view then // styles in the previous view can affect this table. @@ -89,7 +85,7 @@ $table->data[0][1] = html_print_select( true, '', ($id_agente == 0), - 'width: 250px;' + 'min-width: 250px;margin-right: 0.5em;' ); $table->data[0][1] .= ' '; @@ -117,7 +113,7 @@ $table->data[1][1] = html_print_select( true, '', false, - 'width: 250px;' + 'min-width: 250px;' ); $table->data[1][1] .= ''; if (check_acl($config['id_user'], 0, 'LM')) { - $table->data[1][1] .= ''; + $table->data[1][1] .= ''; $table->data[1][1] .= html_print_image('images/add.png', true); - $table->data[1][1] .= ''.__('Create Action').''; + $table->data[1][1] .= ''.__('Create Action').''; $table->data[1][1] .= ''; } @@ -162,13 +158,13 @@ if ($own_info['is_admin'] || check_acl($config['id_user'], 0, 'PM')) { if (check_acl($config['id_user'], 0, 'LM')) { $table->data[2][1] .= ''; $table->data[2][1] .= html_print_image('images/add.png', true); - $table->data[2][1] .= ''.__('Create Template').''; + $table->data[2][1] .= ''.__('Create Template').''; $table->data[2][1] .= ''; } $table->data[3][0] = __('Threshold'); $table->data[3][1] = html_print_input_text('module_action_threshold', '0', '', 5, 7, true); - $table->data[3][1] .= ' '.__('seconds'); + $table->data[3][1] .= ''.__('seconds').''; if (!isset($step)) { echo '
'; diff --git a/pandora_console/godmode/alerts/alert_list.list.php b/pandora_console/godmode/alerts/alert_list.list.php index 4b3a3395cf..f830f47dbd 100644 --- a/pandora_console/godmode/alerts/alert_list.list.php +++ b/pandora_console/godmode/alerts/alert_list.list.php @@ -438,11 +438,11 @@ if (! $id_agente) { $table->style = []; $table->style[0] = 'font-weight: bold;'; $table->head[0] = __('Agent').ui_get_sorting_arrows($url_up_agente, $url_down_agente, $selectAgentUp, $selectAgentDown); - $table->size[0] = '4%'; - $table->size[1] = '8%'; - $table->size[2] = '8%'; - $table->size[3] = '4%'; - $table->size[4] = '4%'; + $table->headstyle[0] = 'width: 100%; min-width: 12em;'; + $table->headstyle[1] = 'min-width: 15em;'; + $table->headstyle[2] = 'min-width: 20em;'; + $table->headstyle[3] = 'min-width: 1em;'; + $table->headstyle[4] = 'min-width: 15em;'; /* if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK) { @@ -450,16 +450,11 @@ if (! $id_agente) { }*/ } else { $table->head[0] = __('Module').ui_get_sorting_arrows($url_up_module, $url_down_module, $selectModuleUp, $selectModuleDown); - // Different sizes or the layout screws up - $table->size[0] = '0%'; - $table->size[1] = '10%'; - $table->size[2] = '30%'; - /* - if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK) { - $table->size[4] = '25%'; - } */ - $table->size[3] = '1%'; - $table->size[4] = '1%'; + $table->headstyle[0] = 'width: 100%; min-width: 15em;'; + $table->headstyle[1] = 'min-width: 15em;'; + $table->headstyle[2] = 'min-width: 20em;'; + $table->headstyle[3] = 'min-width: 1em;'; + $table->headstyle[4] = 'min-width: 15em;'; } $table->head[1] = __('Template').ui_get_sorting_arrows($url_up_template, $url_down_template, $selectTemplateUp, $selectTemplateDown); diff --git a/pandora_console/godmode/reporting/reporting_builder.php b/pandora_console/godmode/reporting/reporting_builder.php index 44e616977d..f872b6357e 100755 --- a/pandora_console/godmode/reporting/reporting_builder.php +++ b/pandora_console/godmode/reporting/reporting_builder.php @@ -771,31 +771,28 @@ switch ($action) { $table->head[1] = __('Description'); $table->head[2] = __('HTML'); $table->head[3] = __('XML'); - $table->size[0] = '20%'; - $table->size[1] = '30%'; + $table->size[0] = '60%'; + $table->size[1] = '20%'; $table->size[2] = '2%'; - $table->headstyle[2] = 'min-width: 35px;'; + $table->headstyle[2] = 'min-width: 35px;text-align: center;'; $table->size[3] = '2%'; - $table->headstyle[3] = 'min-width: 35px;'; + $table->headstyle[3] = 'min-width: 35px;text-align: center;'; $table->size[4] = '2%'; - $table->headstyle[4] = 'min-width: 35px;'; - $table->size[5] = '2%'; - $table->headstyle[5] = 'min-width: 35px;'; - $table->size[6] = '2%'; - $table->headstyle[6] = 'min-width: 35px;'; - $table->size[7] = '5%'; - $table->headstyle['csv'] = 'min-width: 65px;'; - $table->style[7] = 'text-align: center;'; - - $table->headstyle[9] = 'min-width: 100px;'; - $table->style[9] = 'text-align: center;'; + $table->headstyle[4] = 'min-width: 35px;text-align: center;'; $next = 4; // Calculate dinamically the number of the column. - if (enterprise_hook('load_custom_reporting_1') !== ENTERPRISE_NOT_HOOK) { + if (enterprise_hook('load_custom_reporting_1', [$table]) !== ENTERPRISE_NOT_HOOK) { $next = 7; } + $table->size[$next] = '2%'; + $table->style[$next] = 'text-align: center;'; + + $table->headstyle[($next + 2)] = 'min-width: 100px;'; + $table->style[($next + 2)] = 'text-align: center;'; + + // Admin options only for RM flag. if (check_acl($config['id_user'], 0, 'RM')) { $table->head[$next] = __('Private'); diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index 7f1118ce3f..a282efa300 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -1130,10 +1130,10 @@ function events_print_event_table( } $events_table = html_print_table($table, true); - $out = '
'; - $out .= $events_table; + $out = $events_table; if (!$tactical_view) { + $out .= '
'; if ($agent_id != 0) { $out .= ''; $out .= '
'; @@ -1149,9 +1149,9 @@ function events_print_event_table( '.__('Event graph by agent').''.grafico_eventos_grupo(180, 60).''; $out .= '
'; } - } - $out .= '
'; + $out .= '
'; + } unset($table); diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index 2ecc7bc96d..e2d5450759 100755 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -1756,6 +1756,7 @@ function ui_process_page_head($string, $bitfield) [ 'common' => 'include/styles/common.css', 'menu' => 'include/styles/menu.css', + 'tables' => 'include/styles/tables.css', $config['style'] => 'include/styles/'.$config['style'].'.css', ], $config['css'] diff --git a/pandora_console/include/styles/discovery.css b/pandora_console/include/styles/discovery.css index 7eb14460ce..b8da30aede 100644 --- a/pandora_console/include/styles/discovery.css +++ b/pandora_console/include/styles/discovery.css @@ -131,9 +131,9 @@ div.arrow_box:before { } .breadcrumbs_container { - padding-left: 10px; padding-top: 4px; text-indent: 0.25em; + padding-left: 2.5em; } .breadcrumb_link { @@ -167,6 +167,11 @@ form.discovery * { font-size: 10pt; } +form.discovery .label_select b { + font-family: "lato", "Open Sans", sans-serif; + font-weight: bolder; +} + .edit_discovery_info { display: flex; align-items: flex-start; diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index f8cb6dcdd8..cc1f3c48f4 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -814,38 +814,6 @@ input.datos { border: #ccc outset 3px; } -td.datos3, -td.datos4 { - background-color: #fff; - color: #000; - border-bottom: 2px solid #82b92e; - border-left: none; - border-right: none; - height: 30px; - font-size: 8.6pt; - font-weight: normal; -} - -td.datos4 { - /*Add because in php the function html_print_table write style in cell and this is style head.*/ - text-align: center; -} - -td.datos3 *, -td.datos4 * { - font-size: 8.6pt; - font-weight: normal; -} - -/*td.datos_id { - color: #1a313a; -}*/ - -/* user list php */ -tr.disabled_row_user * { - color: grey; -} - /* global syles */ .bg { /* op menu */ @@ -1085,7 +1053,7 @@ div.title_line { } .breadcrumbs_container { - padding-left: 10px; + padding-left: 2.5em; padding-top: 4px; text-indent: 0.25em; color: #848484; @@ -4893,6 +4861,7 @@ input:checked + .p-slider:before { .label_select, .label_select_simple { + font-family: "lato-bolder", "Open Sans", sans-serif; margin-bottom: 15px; } @@ -4974,125 +4943,6 @@ input:checked + .p-slider:before { color: #4d4d4d; } -/* This is to use divs like tables */ -.table_div { - display: table; -} -.table_thead, -.table_tbody { - display: table-row; -} -.table_th { - font-weight: bold; -} -.table_th, -.table_td { - display: table-cell; - vertical-align: middle; - padding: 10px; -} -/* Tables with 3 columns */ -.table_three_columns .table_th, -.table_three_columns .table_td { - width: 33%; -} - -/* - * --------------------------------------------------------------------- - * - TABLES TO SHOW INFORMATION - * --------------------------------------------------------------------- - */ - -table.info_table { - background-color: #fff; - margin-bottom: 10px; - border-spacing: 0; - border-collapse: collapse; - overflow: hidden; - border-radius: 5px; -} - -table.info_table > tbody > tr:nth-child(even) { - background-color: #f5f5f5; -} - -table.info_table tr:first-child > th { - background-color: #fff; - color: #000; - text-align: left; - vertical-align: middle; -} - -table.info_table th { - font-size: 7.5pt; - letter-spacing: 0.3pt; - color: #000; - background-color: #fff; -} - -table.info_table tr th { - border-bottom: 1px solid #e2e2e2; -} - -/* Radius top */ -table.info_table > thead > tr:first-child > th:first-child { - border-top-left-radius: 4px; -} -table.info_table > thead > tr:first-child > th:last-child { - border-top-right-radius: 4px; -} - -/* Radius bottom */ -table.info_table > tbody > tr:last-child > td:first-child { - border-top-left-radius: 4px; -} -table.info_table > tbody > tr:last-child > td:last-child { - border-top-right-radius: 4px; -} - -table.info_table > thead > tr > th, -table.info_table > tbody > tr > th, -table.info_table > thead > tr > th a { - padding: 0.1em; - font-weight: normal; - color: #000; - font-size: 1.2em; - margin-left: 0.5em; -} - -table.info_table > tbody > tr { - border-bottom: 1px solid #e2e2e2; -} - -table.info_table > tbody > tr > td { - -moz-border-radius: 0px; - -webkit-border-radius: 0px; - border-radius: 0px; - border: none; - padding-left: 9px; - padding-right: 9px; - padding-top: 7px; - padding-bottom: 7px; -} - -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; -} - -.info_table.profile_list > thead > tr > th > a.tip { - padding: 0px; -} - /* This class is for the icons of actions and operations in the tables. */ .action_buttons a[href] img, .action_buttons input[type="image"], @@ -5817,6 +5667,7 @@ div#status_pie { display: flex; align-items: center; flex-wrap: wrap; + padding: 0 1em 0; } .white_table_graph_content { diff --git a/pandora_console/include/styles/tables.css b/pandora_console/include/styles/tables.css new file mode 100644 index 0000000000..ac2cdcc951 --- /dev/null +++ b/pandora_console/include/styles/tables.css @@ -0,0 +1,150 @@ +/* + * --------------------------------------------------------------------- + * - TABLES + * --------------------------------------------------------------------- + */ +/* This is to use divs like tables */ +.table_div { + display: table; +} +.table_thead, +.table_tbody { + display: table-row; +} +.table_th { + font-weight: bold; +} +.table_th, +.table_td { + display: table-cell; + vertical-align: middle; + padding: 10px; +} +/* Tables with 3 columns */ +.table_three_columns .table_th, +.table_three_columns .table_td { + width: 33%; +} + +table.info_table { + background-color: #fff; + margin-bottom: 10px; + border-spacing: 0; + border-collapse: collapse; + overflow: hidden; + border-radius: 5px; +} + +table.info_table > tbody > tr:nth-child(even) { + background-color: #f5f5f5; +} + +table.info_table tr:first-child > th { + background-color: #fff; + color: #000; + text-align: left; + vertical-align: middle; +} + +table.info_table th { + font-size: 7.5pt; + letter-spacing: 0.3pt; + color: #000; + background-color: #fff; +} + +table.info_table tr th { + border-bottom: 1px solid #e2e2e2; +} + +/* Radius top */ +table.info_table > thead > tr:first-child > th:first-child { + border-top-left-radius: 4px; +} +table.info_table > thead > tr:first-child > th:last-child { + border-top-right-radius: 4px; +} + +/* Radius bottom */ +table.info_table > tbody > tr:last-child > td:first-child { + border-top-left-radius: 4px; +} +table.info_table > tbody > tr:last-child > td:last-child { + border-top-right-radius: 4px; +} + +table.info_table > thead > tr > th, +table.info_table > tbody > tr > th, +table.info_table > thead > tr > th a, +table.info_table > thead > tr > th > span { + padding: 0.1em; + font-weight: normal; + color: #000; + font-size: 1.2em; + margin-left: 0.5em; +} + +table.info_table > tbody > tr { + border-bottom: 1px solid #e2e2e2; +} + +table.info_table > tbody > tr > td { + -moz-border-radius: 0px; + -webkit-border-radius: 0px; + border-radius: 0px; + border: none; + padding-left: 9px; + padding-right: 9px; + padding-top: 7px; + padding-bottom: 7px; +} + +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; +} + +.info_table.profile_list > thead > tr > th > a.tip { + padding: 0px; +} + +td.datos3, +td.datos4 { + background-color: #fff; + color: #000; + border-bottom: 2px solid #82b92e; + border-left: none; + border-right: none; + height: 30px; + font-size: 8.6pt; + font-weight: normal; +} + +td.datos4 { + /*Add because in php the function html_print_table write style in cell and this is style head.*/ + text-align: center; +} + +td.datos3 *, +td.datos4 * { + font-size: 8.6pt; + font-weight: normal; +} + +/*td.datos_id { + color: #1a313a; +}*/ + +/* user list php */ +tr.disabled_row_user * { + color: grey; +} diff --git a/pandora_console/operation/agentes/alerts_status.php b/pandora_console/operation/agentes/alerts_status.php index e231266667..92937a22e3 100755 --- a/pandora_console/operation/agentes/alerts_status.php +++ b/pandora_console/operation/agentes/alerts_status.php @@ -614,7 +614,7 @@ foreach ($alerts['alerts_simple'] as $alert) { if (!empty($table->data)) { $class = ''; if ($agent_view_page === true) { - $class = 'white_table_graph_content w100p no-padding-imp'; + $class = 'w100p no-padding-imp'; } echo ''; diff --git a/pandora_console/operation/reporting/custom_reporting.php b/pandora_console/operation/reporting/custom_reporting.php index a5267a21bd..68ff8c80c0 100644 --- a/pandora_console/operation/reporting/custom_reporting.php +++ b/pandora_console/operation/reporting/custom_reporting.php @@ -36,7 +36,7 @@ $table->head[1] = __('Description'); $table->head[2] = __('HTML'); $table->head[3] = __('XML'); -enterprise_hook('load_custom_reporting_1'); +enterprise_hook('load_custom_reporting_1', [$table]); $table->align = []; $table->align[2] = 'center'; diff --git a/pandora_console/operation/search_reports.php b/pandora_console/operation/search_reports.php index 668f6f717b..a3b95357a3 100755 --- a/pandora_console/operation/search_reports.php +++ b/pandora_console/operation/search_reports.php @@ -35,7 +35,7 @@ if ($reports === false || !$searchReports) { $table->head[1] = __('Description'); $table->head[2] = __('HTML'); $table->head[3] = __('XML'); - enterprise_hook('load_custom_reporting_1'); + enterprise_hook('load_custom_reporting_1', [$table]); $table->align = []; $table->align[2] = 'center';