style review

This commit is contained in:
fbsanchez 2019-06-03 14:30:23 +02:00
parent 551a21ed86
commit 7a09a80ace
5 changed files with 109 additions and 67 deletions

View File

@ -356,9 +356,35 @@ echo "<td style='vertical-align: top;'>".__('Agents').'</td>';
echo '<td></td>'; echo '<td></td>';
echo "<td style='vertical-align: top;'>".__('Modules').'</td>'; echo "<td style='vertical-align: top;'>".__('Modules').'</td>';
echo '</tr><tr>'; echo '</tr><tr>';
echo '<td>'.html_print_select(agents_get_group_agents(), 'id_agents[]', 0, false, '', '', true, true, true, '', false, '').'</td>'; echo '<td style="width: 50%;">'.html_print_select(
echo "<td style='vertical-align: center; text-align: center;'>".html_print_image('images/darrowright.png', true).'</td>'; agents_get_group_agents(),
echo '<td>'.html_print_select([], 'module[]', 0, false, '', 0, true, true, true, '', false, '').'</td>'; 'id_agents[]',
0,
false,
'',
'',
true,
true,
true,
'w100p',
false,
''
).'</td>';
echo "<td style='width: 3em;vertical-align: center; text-align: center;'>".html_print_image('images/darrowright.png', true).'</td>';
echo '<td style="width: 50%;">'.html_print_select(
[],
'module[]',
0,
false,
'',
0,
true,
true,
true,
'w100p',
false,
''
).'</td>';
echo '</tr><tr>'; echo '</tr><tr>';
echo "<td colspan='3'>"; echo "<td colspan='3'>";
echo "<table cellpadding='4'><tr>"; echo "<table cellpadding='4'><tr>";

View File

@ -824,23 +824,28 @@ if (check_login()) {
$table->head[7] = __('Data'); $table->head[7] = __('Data');
$table->head[8] = __('Graph'); $table->head[8] = __('Graph');
$table->head[9] = __('Last contact').ui_get_sorting_arrows($url_up_last, $url_down_last, $selectLastContactUp, $selectLastContactDown); $table->head[9] = __('Last contact').ui_get_sorting_arrows($url_up_last, $url_down_last, $selectLastContactUp, $selectLastContactDown);
$table->align = [ $table->align = [];
'left', $table->align[0] = 'left';
'left', $table->align[1] = 'left';
'left', $table->align[2] = 'left';
'left', $table->align[3] = 'left';
'left', $table->align[4] = 'left';
'left', $table->align[5] = 'left';
'left', $table->align[6] = 'center';
'left', $table->align[7] = 'left';
'left', $table->align[8] = 'center';
]; $table->align[9] = 'right';
$table->headstyle[2] = 'min-width: 60px'; $table->headstyle[2] = 'min-width: 85px';
$table->headstyle[3] = 'min-width: 100px'; $table->headstyle[3] = 'min-width: 130px';
$table->headstyle[5] = 'min-width: 60px'; $table->size[3] = '30%';
$table->headstyle[8] = 'min-width: 85px'; $table->style[3] = 'max-width: 28em;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;';
$table->headstyle[9] = 'min-width: 100px'; $table->size[4] = '30%';
$table->headstyle[5] = 'min-width: 85px';
$table->headstyle[6] = 'min-width: 125px; text-align: center;';
$table->headstyle[7] = 'min-width: 125px;';
$table->headstyle[8] = 'min-width: 85px; text-align: center;';
$table->headstyle[9] = 'min-width: 120px; text-align: right;';
$last_modulegroup = 0; $last_modulegroup = 0;
$rowIndex = 0; $rowIndex = 0;
@ -879,14 +884,14 @@ if (check_login()) {
$last_modulegroup = $module['id_module_group']; $last_modulegroup = $module['id_module_group'];
} }
// End of title of group // End of title of group.
} }
$data = []; $data = [];
if (($module['id_modulo'] != 1) && ($module['id_tipo_modulo'] != 100)) { if (($module['id_modulo'] != 1) && ($module['id_tipo_modulo'] != 100)) {
if ($agent_w) { if ($agent_w) {
if ($module['flag'] == 0) { if ($module['flag'] == 0) {
$data[0] = '<a href="index.php?'.'sec=estado&amp;'.'sec2=operation/agentes/ver_agente&amp;'.'id_agente='.$id_agente.'&amp;'.'id_agente_modulo='.$module['id_agente_modulo'].'&amp;'.'flag=1&amp;'.'refr=60">'.html_print_image('images/target.png', true, ['border' => '0', 'title' => __('Force')]).'</a>'; $data[0] = '<a href="index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;id_agente='.$id_agente.'&amp;id_agente_modulo='.$module['id_agente_modulo'].'&amp;flag=1&amp;refr=60">'.html_print_image('images/target.png', true, ['border' => '0', 'title' => __('Force')]).'</a>';
} else { } else {
$data[0] = '<a href="index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;id_agente='.$id_agente.'&amp;id_agente_modulo='.$module['id_agente_modulo'].'&amp;refr=60">'.html_print_image('images/refresh.png', true, ['border' => '0', 'title' => __('Refresh')]).'</a>'; $data[0] = '<a href="index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;id_agente='.$id_agente.'&amp;id_agente_modulo='.$module['id_agente_modulo'].'&amp;refr=60">'.html_print_image('images/refresh.png', true, ['border' => '0', 'title' => __('Refresh')]).'</a>';
} }
@ -1074,7 +1079,7 @@ if (check_login()) {
if ($data_macro) { if ($data_macro) {
$salida = $data_macro; $salida = $data_macro;
} else { } else {
$salida .= '&nbsp;'.'<i>'.io_safe_output($module['unit']).'</i>'; $salida .= '&nbsp;<i>'.io_safe_output($module['unit']).'</i>';
} }
} }
} else { } else {
@ -1120,17 +1125,17 @@ if (check_login()) {
$draw_events = 0; $draw_events = 0;
} }
$link = "winopeng_var('".'operation/agentes/stat_win.php?'."type=$graph_type&amp;".'period='.SECONDS_1DAY.'&amp;'.'id='.$module['id_agente_modulo'].'&amp;'.'label='.rawurlencode( $link = "winopeng_var('".'operation/agentes/stat_win.php?'."type=$graph_type&amp;".'period='.SECONDS_1DAY.'&amp;id='.$module['id_agente_modulo'].'&amp;label='.rawurlencode(
urlencode( urlencode(
base64_encode($module['nombre']) base64_encode($module['nombre'])
) )
).'&amp;'.'refresh='.SECONDS_10MINUTES.'&amp;'."draw_events=$draw_events', 'day_".$win_handle."', 1000, 650)"; ).'&amp;refresh='.SECONDS_10MINUTES.'&amp;'."draw_events=$draw_events', 'day_".$win_handle."', 1000, 650)";
if (!is_snapshot_data($module['datos'])) { if (!is_snapshot_data($module['datos'])) {
$data[8] .= '<a href="javascript:'.$link.'">'.html_print_image('images/chart_curve.png', true, ['border' => '0', 'alt' => '']).'</a> &nbsp;&nbsp;'; $data[8] .= '<a href="javascript:'.$link.'">'.html_print_image('images/chart_curve.png', true, ['border' => '0', 'alt' => '']).'</a> &nbsp;&nbsp;';
} }
$server_name = ''; $server_name = '';
$data[8] .= "<a href='javascript: ".'show_module_detail_dialog('.$module['id_agente_modulo'].', '.$id_agente.', '.'"'.$server_name.'", '.(0).', '.SECONDS_1DAY.', " '.modules_get_agentmodule_name($module['id_agente_modulo'])."\")'>".html_print_image('images/binary.png', true, ['border' => '0', 'alt' => '']).'</a>'; $data[8] .= "<a href='javascript: ".'show_module_detail_dialog('.$module['id_agente_modulo'].', '.$id_agente.', "'.$server_name.'", '.(0).', '.SECONDS_1DAY.', " '.modules_get_agentmodule_name($module['id_agente_modulo'])."\")'>".html_print_image('images/binary.png', true, ['border' => '0', 'alt' => '']).'</a>';
} }
if ($module['estado'] == 3) { if ($module['estado'] == 3) {
@ -1177,7 +1182,7 @@ if (check_login()) {
ui_print_info_message([ 'no_close' => true, 'message' => __('This agent doesn\'t have any active monitors.') ]); ui_print_info_message([ 'no_close' => true, 'message' => __('This agent doesn\'t have any active monitors.') ]);
} }
} else { } else {
$url = 'index.php?'.'sec=estado&'.'sec2=operation/agentes/ver_agente&'.'id_agente='.$id_agente.'&'.'refr=&filter_monitors=1&'.'status_filter_monitor='.$status_filter_monitor.'&'.'status_text_monitor='.$status_text_monitor.'&'.'status_module_group='.$status_module_group; $url = 'index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$id_agente.'&refr=&filter_monitors=1&status_filter_monitor='.$status_filter_monitor.'&status_text_monitor='.$status_text_monitor.'&status_module_group='.$status_module_group;
if ($paginate_module) { if ($paginate_module) {
ui_pagination( ui_pagination(

View File

@ -2343,14 +2343,21 @@ function graphic_agentaccess(
$date = get_system_time(); $date = get_system_time();
$datelimit = ($date - $period); $datelimit = ($date - $period);
$data_array = []; $data_array = [];
$interval = agents_get_interval($id_agent);
$data = db_get_all_rows_sql( $data = db_get_all_rows_sql(
"SELECT count(*) as data, min(utimestamp) as utimestamp sprintf(
FROM tagent_access 'SELECT utimestamp, count(*) as data
WHERE id_agent = $id_agent FROM tagent_access
AND utimestamp > $datelimit WHERE id_agent = %d
AND utimestamp < $date AND utimestamp > %d
GROUP by ROUND(utimestamp / 1800)" AND utimestamp < %d
GROUP BY ROUND(utimestamp/%d)',
$id_agent,
$datelimit,
$date,
$interval
)
); );
if (isset($data) && is_array($data)) { if (isset($data) && is_array($data)) {

View File

@ -437,27 +437,27 @@ select:-internal-list-box {
* --------------------------------------------------------------------- * ---------------------------------------------------------------------
*/ */
.w10p { .w10p {
max-width: 10%; width: 10%;
} }
.w20p { .w20p {
max-width: 20%; width: 20%;
} }
.w30p { .w30p {
max-width: 30%; width: 30%;
} }
.w40p { .w40p {
max-width: 40%; width: 40%;
} }
.w50p { .w50p {
max-width: 50%; width: 50%;
} }
.w100p { .w100p {
max-width: 100%; width: 100%;
} }
.padding-2 { .padding-2 {

View File

@ -26,7 +26,7 @@
width: 33%; width: 33%;
} }
table.info_table { .info_table {
background-color: #fff; background-color: #fff;
margin-bottom: 10px; margin-bottom: 10px;
border-spacing: 0; border-spacing: 0;
@ -35,48 +35,48 @@ table.info_table {
border-radius: 5px; border-radius: 5px;
} }
table.info_table > tbody > tr:nth-child(even) { .info_table > tbody > tr:nth-child(even) {
background-color: #f5f5f5; background-color: #f5f5f5;
} }
table.info_table tr:first-child > th { .info_table tr:first-child > th {
background-color: #fff; background-color: #fff;
color: #000; color: #000;
text-align: left; text-align: left;
vertical-align: middle; vertical-align: middle;
} }
table.info_table th { .info_table th {
font-size: 7.5pt; font-size: 7.5pt;
letter-spacing: 0.3pt; letter-spacing: 0.3pt;
color: #000; color: #000;
background-color: #fff; background-color: #fff;
} }
table.info_table tr th { .info_table tr th {
border-bottom: 1px solid #e2e2e2; border-bottom: 1px solid #e2e2e2;
} }
/* Radius top */ /* Radius top */
table.info_table > thead > tr:first-child > th:first-child { .info_table > thead > tr:first-child > th:first-child {
border-top-left-radius: 4px; border-top-left-radius: 4px;
} }
table.info_table > thead > tr:first-child > th:last-child { .info_table > thead > tr:first-child > th:last-child {
border-top-right-radius: 4px; border-top-right-radius: 4px;
} }
/* Radius bottom */ /* Radius bottom */
table.info_table > tbody > tr:last-child > td:first-child { .info_table > tbody > tr:last-child > td:first-child {
border-top-left-radius: 4px; border-top-left-radius: 4px;
} }
table.info_table > tbody > tr:last-child > td:last-child { .info_table > tbody > tr:last-child > td:last-child {
border-top-right-radius: 4px; border-top-right-radius: 4px;
} }
table.info_table > thead > tr > th, .info_table > thead > tr > th,
table.info_table > tbody > tr > th, .info_table > tbody > tr > th,
table.info_table > thead > tr > th a, .info_table > thead > tr > th a,
table.info_table > thead > tr > th > span { .info_table > thead > tr > th > span {
padding: 0.1em; padding: 0.1em;
font-weight: normal; font-weight: normal;
color: #000; color: #000;
@ -84,11 +84,11 @@ table.info_table > thead > tr > th > span {
margin-left: 0.5em; margin-left: 0.5em;
} }
table.info_table > tbody > tr { .info_table > tbody > tr {
border-bottom: 1px solid #e2e2e2; border-bottom: 1px solid #e2e2e2;
} }
table.info_table > tbody > tr > td { .info_table > tbody > tr > td {
-moz-border-radius: 0px; -moz-border-radius: 0px;
-webkit-border-radius: 0px; -webkit-border-radius: 0px;
border-radius: 0px; border-radius: 0px;
@ -99,26 +99,28 @@ table.info_table > tbody > tr > td {
padding-bottom: 7px; padding-bottom: 7px;
} }
table.info_table > tbody > tr > td > img, .info_table > tbody > tr > td > img,
table.info_table > thead > tr > th > img, .info_table > thead > tr > th > img,
table.info_table > tbody > tr > td > div > a > img, .info_table > tbody > tr > td > div > a > img,
table.info_table > tbody > tr > td > span > img, .info_table > tbody > tr > td > span > img,
table.info_table > tbody > tr > td > span > a > img, .info_table > tbody > tr > td > span > a > img,
table.info_table > tbody > tr > td > a > img, .info_table > tbody > tr > td > a > img,
table.info_table > tbody > tr > td > form > a > img { .info_table > tbody > tr > td > form > a > img {
vertical-align: middle; vertical-align: middle;
} }
table.info_table > tbody > tr:hover { .info_table > tbody > tr:hover {
background-color: #eee; background-color: #eee;
} }
.info_table.profile_list > thead > tr > th > a.tip { .info_.profile_list > thead > tr > th > a.tip {
padding: 0px; padding: 0px;
} }
td.datos3, .info_table .datos3,
td.datos4 { .datos3,
.info_table .datos4,
.datos4 {
background-color: #fff; background-color: #fff;
color: #000; color: #000;
border-bottom: 2px solid #82b92e; border-bottom: 2px solid #82b92e;
@ -129,13 +131,15 @@ td.datos4 {
font-weight: normal; font-weight: normal;
} }
td.datos4 { .datos4 {
/*Add because in php the function html_print_table write style in cell and this is style head.*/ /*Add because in php the function html_print_table write style in cell and this is style head.*/
text-align: center; text-align: center;
} }
td.datos3 *, .datos3 *,
td.datos4 * { .datos4 *,
.info_table .datos3 *,
.info_table .datos4 * {
font-size: 8.6pt; font-size: 8.6pt;
font-weight: normal; font-weight: normal;
} }