style review

This commit is contained in:
fbsanchez 2019-06-03 10:46:52 +02:00
parent 69054571ab
commit 88b0802472
11 changed files with 200 additions and 205 deletions

View File

@ -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] .= ' <span id="latest_value" class="invisible">'.__('Latest value').': ';
$table->data[0][1] .= '<span id="value">&nbsp;</span></span>';
@ -117,7 +113,7 @@ $table->data[1][1] = html_print_select(
true,
'',
false,
'width: 250px;'
'min-width: 250px;'
);
$table->data[1][1] .= '<span id="advanced_action" class="advanced_actions invisible"><br>';
$table->data[1][1] .= __('Number of alerts match from').' ';
@ -127,9 +123,9 @@ $table->data[1][1] .= html_print_input_text('fires_max', '', '', 4, 10, true);
$table->data[1][1] .= '</span>';
if (check_acl($config['id_user'], 0, 'LM')) {
$table->data[1][1] .= '<a style="margin-left:5px;" href="index.php?sec=galertas&sec2=godmode/alerts/configure_alert_action&pure='.$pure.'">';
$table->data[1][1] .= '<a href="index.php?sec=galertas&sec2=godmode/alerts/configure_alert_action&pure='.$pure.'">';
$table->data[1][1] .= html_print_image('images/add.png', true);
$table->data[1][1] .= '<span style="margin-left:5px;vertical-align:middle;">'.__('Create Action').'</span>';
$table->data[1][1] .= '<span style="margin-left:0.5em;">'.__('Create Action').'</span>';
$table->data[1][1] .= '</a>';
}
@ -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] .= '<a href="index.php?sec=galertas&sec2=godmode/alerts/configure_alert_template&pure='.$pure.'">';
$table->data[2][1] .= html_print_image('images/add.png', true);
$table->data[2][1] .= '<span style="margin-left:5px;vertical-align:middle;">'.__('Create Template').'</span>';
$table->data[2][1] .= '<span style="margin-left:0.5em;">'.__('Create Template').'</span>';
$table->data[2][1] .= '</a>';
}
$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] .= '<span style="margin-left:0.5em;">'.__('seconds').'</span>';
if (!isset($step)) {
echo '<form class="add_alert_form" method="post">';

View File

@ -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);

View File

@ -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');

View File

@ -1130,10 +1130,10 @@ function events_print_event_table(
}
$events_table = html_print_table($table, true);
$out = '<table width="100%"><tr><td style="width: 90%; vertical-align: top; padding-top: 0px;">';
$out .= $events_table;
$out = $events_table;
if (!$tactical_view) {
$out .= '<table width="100%"><tr><td style="width: 90%; vertical-align: top; padding-top: 0px;">';
if ($agent_id != 0) {
$out .= '</td><td style="width: 200px; vertical-align: top;">';
$out .= '<table cellpadding=0 cellspacing=0 class="databox"><tr><td>';
@ -1149,9 +1149,9 @@ function events_print_event_table(
<legend>'.__('Event graph by agent').'</legend>'.grafico_eventos_grupo(180, 60).'</fieldset>';
$out .= '</td></tr></table>';
}
}
$out .= '</td></tr></table>';
$out .= '</td></tr></table>';
}
unset($table);

View File

@ -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']

View File

@ -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;

View File

@ -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 {

View File

@ -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;
}

View File

@ -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 '<form class="'.$class.'" method="post" action="'.$url.'">';

View File

@ -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';

View File

@ -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';