style review

This commit is contained in:
fbsanchez 2019-06-18 17:40:31 +02:00
parent d290b91b28
commit c3ebe88178
9 changed files with 168 additions and 36 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 387 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

View File

@ -109,7 +109,7 @@ if ($in_process_event) {
$id_evento = get_parameter('id_evento', 0); $id_evento = get_parameter('id_evento', 0);
// Check acl. // Check acl.
var_dump(events_update_status($id_evento, EVENT_PROCESS, $filter)); echo events_update_status($id_evento, EVENT_PROCESS, $filter);
return; return;
} }
@ -354,6 +354,12 @@ function load_form_filter() {
// Close dialog. // Close dialog.
$("#load-filter-select").dialog('close'); $("#load-filter-select").dialog('close');
// Update indicator.
$("#current_filter").text($('#filter_id option:selected').text());
// Search.
dt_events.draw(false);
} }
$(document).ready (function() { $(document).ready (function() {

View File

@ -1614,9 +1614,9 @@ function agents_get_interval($id_agent)
* *
* @param Agent object. * @param Agent object.
* *
* @return The interval value and status of last contact * @return The interval value and status of last contact or True /False
*/ */
function agents_get_interval_status($agent) function agents_get_interval_status($agent, $return_html=true)
{ {
$return = ''; $return = '';
$last_time = time_w_fixed_tz($agent['ultimo_contacto']); $last_time = time_w_fixed_tz($agent['ultimo_contacto']);
@ -1624,9 +1624,18 @@ function agents_get_interval_status($agent)
$diferencia = ($now - $last_time); $diferencia = ($now - $last_time);
$time = ui_print_timestamp($last_time, true, ['style' => 'font-size:6.5pt']); $time = ui_print_timestamp($last_time, true, ['style' => 'font-size:6.5pt']);
$min_interval = modules_get_agentmodule_mininterval_no_async($agent['id_agente']); $min_interval = modules_get_agentmodule_mininterval_no_async($agent['id_agente']);
$return = $time; if ($return_html) {
$return = $time;
} else {
$return = true;
}
if ($diferencia > ($min_interval['min_interval'] * 2) && $min_interval['num_interval'] > 0) { if ($diferencia > ($min_interval['min_interval'] * 2) && $min_interval['num_interval'] > 0) {
$return = '<b><span style="color: #ff0000;">'.$time.'</span></b>'; if ($return_html) {
$return = '<b><span style="color: #ff0000;">'.$time.'</span></b>';
} else {
$return = false;
}
} }
return $return; return $return;
@ -3367,3 +3376,35 @@ function agents_get_image_status($status)
return $image_status; return $image_status;
} }
/**
* Animation GIF to show agent's status.
*
* @return string HTML code with heartbeat image.
*/
function agents_get_status_animation($up=true)
{
switch ($up) {
case true:
default:
return html_print_image(
'images/heartbeat_green.gif',
true,
[
'width' => '170',
'height' => '40',
]
);
case false:
return html_print_image(
'images/heartbeat_red.gif',
true,
[
'width' => '170',
'height' => '40',
]
);
}
}

View File

@ -31,3 +31,51 @@ div.agent_details_agent_alias * {
border-bottom: 1px solid #ebebeb; border-bottom: 1px solid #ebebeb;
padding-bottom: 3em; padding-bottom: 3em;
} }
#rect1,
#rect2 {
z-index: 10;
position: absolute;
height: 238px;
width: 0px;
background: #3d84a8;
}
.agent-animation {
height: 300px;
width: 600px;
background: #3d84a8;
border-radius: 3px;
position: relative;
padding: 32px;
}
.agent-animation:before {
content: "";
position: absolute;
left: 30px;
top: 30px;
height: 240px;
width: 2px;
background: #48466d;
}
.agent-animation:after {
content: "";
position: absolute;
left: 30px;
bottom: 30px;
height: 2px;
width: 540px;
background: #48466d;
}
.agent-animation svg {
position: absolute;
left: 32px;
top: 30px;
width: 540px !important;
}
.agent-animation svg .cls-1 {
fill: none;
stroke: #abedd8;
stroke-miterlimit: 10;
stroke-width: 2px;
}

View File

@ -146,6 +146,11 @@ fieldset {
.event.flex-row.h100p.nowrap div { .event.flex-row.h100p.nowrap div {
max-width: 98%; max-width: 98%;
} }
.event.flex-row.h100p.nowrap .mini-criticity {
width: 10px;
min-width: 10px;
max-width: 10px;
}
.filter_summary { .filter_summary {
margin-bottom: 3em; margin-bottom: 3em;

View File

@ -439,6 +439,12 @@ select:-internal-list-box {
.w120px { .w120px {
width: 120px; width: 120px;
} }
.mw120px {
min-width: 120px;
}
.mw250px {
min-width: 250px;
}
.w20px { .w20px {
width: 20px; width: 20px;
} }
@ -5574,7 +5580,7 @@ div#status_pie {
.agent_details_content { .agent_details_content {
display: flex; display: flex;
align-items: center; align-items: flex-start;
padding: 20px; padding: 20px;
padding-bottom: 0; padding-bottom: 0;
} }

View File

@ -82,6 +82,9 @@ if (! check_acl_one_of_groups($config['id_user'], $all_groups, 'AR')
return; return;
} }
$alive_animation = agents_get_status_animation(
agents_get_interval_status($agent, false)
);
/* /*
* START: TABLE AGENT BUILD. * START: TABLE AGENT BUILD.
@ -252,7 +255,7 @@ $table_agent = '
</div> </div>
</div> </div>
<div class="agent_details_info"> <div class="agent_details_info">
'.$table_agent_os.$table_agent_ip.$table_agent_version.$table_agent_description.$remote_cfg.' '.$alive_animation.$table_agent_os.$table_agent_ip.$table_agent_version.$table_agent_description.$remote_cfg.'
</div> </div>
</div>'; </div>';

View File

@ -173,6 +173,16 @@ if (is_ajax()) {
function ($carry, $item) { function ($carry, $item) {
$tmp = (object) $item; $tmp = (object) $item;
$tmp->evento = io_safe_output($tmp->evento); $tmp->evento = io_safe_output($tmp->evento);
$tmp->ack_utimestamp = ui_print_timestamp(
$tmp->ack_utimestamp,
true
);
$tmp->timestamp = ui_print_timestamp(
$tmp->timestamp,
true
);
$tmp->data = format_numeric($tmp->data, 1);
$carry[] = $tmp; $carry[] = $tmp;
return $carry; return $carry;
} }
@ -756,29 +766,9 @@ $in = '<div class="filter_input"><label>'.__('Repeated').'</label>';
$in .= $data.'</div>'; $in .= $data.'</div>';
$inputs[] = $in; $inputs[] = $in;
// Source. // Free search.
$data = html_print_input_text('source', $source, '', '', 255, true); $data = html_print_input_text('search', $search, '', '', 255, true);
$in = '<div class="filter_input"><label>'.__('Source').'</label>'; $in = '<div class="filter_input"><label>'.__('Free search').'</label>';
$in .= $data.'</div>';
$inputs[] = $in;
// Extra ID.
$data = html_print_input_text('id_extra', $id_extra, '', 11, 255, true);
$in = '<div class="filter_input"><label>'.__('Extra ID').'</label>';
$in .= $data.'</div>';
$inputs[] = $in;
// Comment.
$data = html_print_input_text(
'user_comment',
$user_comment,
'',
'',
255,
true
);
$in = '<div class="filter_input"><label>'.__('Comment').'</label>';
$in .= $data.'</div>'; $in .= $data.'</div>';
$inputs[] = $in; $inputs[] = $in;
@ -804,9 +794,30 @@ $buttons[] = [
$adv_inputs = []; $adv_inputs = [];
// Free search.
$data = html_print_input_text('search', $search, '', '', 255, true); // Source.
$in = '<div class="filter_input"><label>'.__('Free search').'</label>'; $data = html_print_input_text('source', $source, '', '', 255, true);
$in = '<div class="filter_input"><label>'.__('Source').'</label>';
$in .= $data.'</div>';
$adv_inputs[] = $in;
// Extra ID.
$data = html_print_input_text('id_extra', $id_extra, '', 11, 255, true);
$in = '<div class="filter_input"><label>'.__('Extra ID').'</label>';
$in .= $data.'</div>';
$adv_inputs[] = $in;
// Comment.
$data = html_print_input_text(
'user_comment',
$user_comment,
'',
'',
255,
true
);
$in = '<div class="filter_input"><label>'.__('Comment').'</label>';
$in .= $data.'</div>'; $in .= $data.'</div>';
$adv_inputs[] = $in; $adv_inputs[] = $in;
@ -1042,7 +1053,10 @@ try {
); );
$default_fields = [ $default_fields = [
'evento', [
'text' => 'evento',
'class' => 'mw120px',
],
'id_evento', 'id_evento',
// 'id_agente', // 'id_agente',
// 'id_usuario', // 'id_usuario',
@ -1078,7 +1092,7 @@ try {
],[ ],[
'text' => 'm', 'text' => 'm',
'extra' => $checkbox_all, 'extra' => $checkbox_all,
'class' => 'w20px', 'class' => 'mw120px',
], ],
]; ];
$fields = explode(',', $config['event_fields']); $fields = explode(',', $config['event_fields']);
@ -1088,13 +1102,22 @@ try {
$fields = $default_fields; $fields = $default_fields;
} }
$evento_id = array_search('evento', $fields);
if ($evento_id !== false) {
$fields[$evento_id] = [
'text' => 'evento',
'class' => 'mw250px',
];
}
// Always add options column. // Always add options column.
$fields = array_merge( $fields = array_merge(
$fields, $fields,
[ [
[ [
'text' => 'options', 'text' => 'options',
'class' => 'action_buttons w120px', 'class' => 'action_buttons mw120px',
],[ ],[
'text' => 'm', 'text' => 'm',
'extra' => $checkbox_all, 'extra' => $checkbox_all,