Polishing agent main view

This commit is contained in:
Jose Gonzalez 2023-01-02 16:50:13 +01:00
parent 9f3d2db92a
commit 03226b1f23
10 changed files with 375 additions and 225 deletions

View File

@ -59,6 +59,7 @@ ui_print_warning_message(
] ]
); );
$table = new stdClass();
$table->width = '100%'; $table->width = '100%';
$table->class = 'databox filters'; $table->class = 'databox filters';
$table->data = []; $table->data = [];

View File

@ -59,23 +59,22 @@ $result = integria_api_call(null, null, null, null, 'get_incidents', $params, fa
$result = json_decode($result, true); $result = json_decode($result, true);
$count = count($result); if (empty($result) === true) {
$result = array_slice($result, $offset, $config['block_size']);
if (empty($result)) {
$result = []; $result = [];
$count = 0; $count = 0;
echo '<div class="nf">'.__('No incidents associated to this agent').'</div><br />'; echo '<div class="nf">'.__('No incidents associated to this agent').'</div><br />';
return; return;
} else {
$count = count($result);
$result = array_slice($result, $offset, $config['block_size']);
} }
// Show pagination // Show pagination.
ui_pagination($count, $url, $offset, 0, false, 'offset'); ui_pagination($count, $url, $offset, 0, false, 'offset');
// ($count + $offset) it's real count of incidents because it's use LIMIT $offset in query. // ($count + $offset) it's real count of incidents because it's use LIMIT $offset in query.
echo '<br />'; echo '<br />';
// Show headers // Show headers.
$table->width = '100%'; $table->width = '100%';
$table->class = 'databox'; $table->class = 'databox';
$table->cellpadding = 4; $table->cellpadding = 4;

View File

@ -573,8 +573,7 @@ if ($id_agente) {
$total_incidents = agents_get_count_incidents($id_agente); $total_incidents = agents_get_count_incidents($id_agente);
// TODO. OVERRIDE.
$total_incidents = 1;
// Incident tab. // Incident tab.
if ($total_incidents > 0) { if ($total_incidents > 0) {
$incidenttab['text'] = html_print_menu_button( $incidenttab['text'] = html_print_menu_button(

View File

@ -590,7 +590,7 @@ if ($edit_module === false || (isset($stringTypeModule) === true && $stringTypeM
); );
} }
$table_simple->rowstyle['thresholds_table'] = 'margin-top: 15px;height: 320px;width: 100%'; $table_simple->rowstyle['thresholds_table'] = 'margin-top: 15px;height: 340px;width: 100%';
$table_simple->cellclass['thresholds_table'][0] = 'table_section half_section_left'; $table_simple->cellclass['thresholds_table'][0] = 'table_section half_section_left';
$table_simple->data['thresholds_table'][0] = html_print_table($tableBasicThresholds, true); $table_simple->data['thresholds_table'][0] = html_print_table($tableBasicThresholds, true);
if (modules_is_string_type($id_module_type) === false || (bool) $edit === true) { if (modules_is_string_type($id_module_type) === false || (bool) $edit === true) {

View File

@ -4024,7 +4024,7 @@ function ui_toggle(
); );
// Options. // Options.
$style = 'overflow:hidden;'; $style = 'overflow:hidden;width: -webkit-fill-available;width: -moz-fill-available;';
if ($hidden_default) { if ($hidden_default) {
$style .= 'height:0;position:absolute;'; $style .= 'height:0;position:absolute;';
$original = $img_b; $original = $img_b;

View File

@ -6082,6 +6082,7 @@ div#status_pie {
} }
.white_table_graph_header div#bullets_modules { .white_table_graph_header div#bullets_modules {
display: flex;
float: right; float: right;
} }
@ -10344,7 +10345,7 @@ table#advanced > tbody > tr,
flex-wrap: nowrap; flex-wrap: nowrap;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
/*min-height: 55px;*/ height: auto;
} }
table#simple tr td:nth-child(even):not(:nth-child(2)), table#simple tr td:nth-child(even):not(:nth-child(2)),
@ -10582,7 +10583,8 @@ tr.bring_next_field {
} }
.floating_form tr { .floating_form tr {
height: 46px; min-height: 46px;
height: auto;
} }
.floating_form td { .floating_form td {
@ -10822,8 +10824,14 @@ pre.external_tools_output {
.subsection_header_title { .subsection_header_title {
font-size: 13pt; font-size: 13pt;
font-weight: initial;
} }
.regular_font { .regular_font {
font-family: "Pandora-Regular" !important; font-family: "Pandora-Regular" !important;
} }
.width_available {
width: -webkit-fill-available !important;
width: -moz-fill-available !important;
}

View File

@ -444,15 +444,21 @@ if ($free_search != '') {
if ($agent_view_page === true) { if ($agent_view_page === true) {
// Create controlled toggle content. // Create controlled toggle content.
ui_toggle( html_print_div(
[
'class' => 'agent_details_first_row agent_details_line',
'content' => ui_toggle(
$html_content, $html_content,
__('Full list of alerts'), '<span class="subsection_header_title">'.__('Full list of alerts').'</span>',
'status_monitor_agent', 'status_monitor_agent',
!$alerts_defined, !$alerts_defined,
false, false,
'', true,
'white_table_graph_content no-padding-imp', 'box-shadow agent_details_col',
'white_table_graph_content' 'white-box-content',
'mrgn_lft_20px mrgn_right_20px width_available'
),
],
); );
} else { } else {
// Dump entire content. // Dump entire content.

View File

@ -74,8 +74,7 @@ if (check_acl_one_of_groups($config['id_user'], $all_groups, 'AR') === false
return; return;
} }
// $alive_animation = agents_get_starmap($id_agente, 200, 50); $alive_animation = agents_get_starmap($id_agente, 200, 50);
$alive_animation = agents_get_starmap($id_agente, 1000, 100);
/* /*
* START: TABLE AGENT BUILD. * START: TABLE AGENT BUILD.
@ -142,7 +141,13 @@ $agent_details_agent_status_image = html_print_div(
true true
); );
$table_agent_header = $agent_details_agent_caption.$agent_details_agent_data.$agent_details_agent_status_image; $agentStatusHeader = html_print_div(
[
'class' => 'agent_details_header',
'content' => $agent_details_agent_caption.$agent_details_agent_data.$agent_details_agent_status_image,
],
true
);
// Fixed width non interactive charts. // Fixed width non interactive charts.
$status_chart_width = 150; $status_chart_width = 150;
@ -153,15 +158,28 @@ $table_status->id = 'agent_status_main';
$table_status->width = '100%'; $table_status->width = '100%';
$table_status->cellspacing = 0; $table_status->cellspacing = 0;
$table_status->cellpadding = 0; $table_status->cellpadding = 0;
$table_status->class = 'white_table white_table_no_border'; $table_status->class = 'floating_form';
$table_status->style[0] = 'width: 30%; text-align: end;'; $table_status->style[0] = 'height: 46px; width: 30%; padding-right: 5px; text-align: end;';
// $table_status->style[0] = 'width: 30%; text-align: end;'; $table_status->style[1] = 'height: 46px; width: 70%; padding-left: 5px; font-family: \'Pandora-Regular\';';
// $table_status->style[1] = 'width: 70%; font-family: \'Pandora-Regular\';';
$table_status->style[1] = 'width: 70%;';
$table_status->headstyle[1] = 'padding-top:6px; padding-bottom:6px;padding-right: 10px;';
$agentStatusGraph = html_print_div(
[
'id' => 'status_pie',
'style' => 'width: '.$graph_width.'px;',
'content' => graph_agent_status(
$id_agente,
$graph_width,
$graph_width,
true,
false,
false,
true
),
],
true
);
/*
$table_agent_graph = '<div id="status_pie" style="width: '.$graph_width.'px;">'; $table_agent_graph = '<div id="status_pie" style="width: '.$graph_width.'px;">';
$table_agent_graph .= graph_agent_status( $table_agent_graph .= graph_agent_status(
$id_agente, $id_agente,
@ -172,8 +190,9 @@ $table_agent_graph .= graph_agent_status(
false, false,
true true
); );
$table_agent_graph .= '</div>'; $table_agent_graph .= '</div>';*/
/*
$table_agent_os = '<p>'.ui_print_os_icon( $table_agent_os = '<p>'.ui_print_os_icon(
$agent['id_os'], $agent['id_os'],
false, false,
@ -187,8 +206,12 @@ $table_agent_os = '<p>'.ui_print_os_icon(
'width' => '20px;', 'width' => '20px;',
] ]
); );
$table_agent_os .= (empty($agent['os_version']) === true) ? get_os_name((int) $agent['id_os']) : $agent['os_version'].'</p>'; */
$table_status->data['agent_os'][0] = __('OS');
$table_status->data['agent_os'][1] = (empty($agent['os_version']) === true) ? get_os_name((int) $agent['id_os']) : $agent['os_version'];
// $table_agent_os .= (empty($agent['os_version']) === true) ? get_os_name((int) $agent['id_os']) : $agent['os_version'].'</p>';
$addresses = agents_get_addresses($id_agente); $addresses = agents_get_addresses($id_agente);
$address = agents_get_address($id_agente); $address = agents_get_address($id_agente);
@ -199,6 +222,9 @@ foreach ($addresses as $k => $add) {
} }
if (empty($address) === false) { if (empty($address) === false) {
$table_status->data['ip_address'][0] = __('IP address');
$table_status->data['ip_address'][1] = (empty($address) === true) ? '<em>'.__('N/A').'</em>' : $address;
/*
$table_agent_ip = '<p>'.html_print_image( $table_agent_ip = '<p>'.html_print_image(
'images/world.png', 'images/world.png',
true, true,
@ -210,8 +236,16 @@ if (empty($address) === false) {
$table_agent_ip .= '<span class="align-top inline">'; $table_agent_ip .= '<span class="align-top inline">';
$table_agent_ip .= (empty($address) === true) ? '<em>'.__('N/A').'</em>' : $address; $table_agent_ip .= (empty($address) === true) ? '<em>'.__('N/A').'</em>' : $address;
$table_agent_ip .= '</span></p>'; $table_agent_ip .= '</span></p>';
*/
} }
$table_status->data['agent_version'][0] = __('Agent Version');
$table_status->data['agent_version'][1] = (empty($agent['agent_version']) === true) ? '<i>'.__('N/A').'</i>' : $agent['agent_version'];
$table_status->data['description'][0] = __('Description');
$table_status->data['description'][1] = (empty($agent['comentarios']) === true) ? '<em>'.__('N/A').'</em>' : $agent['comentarios'];
/*
$table_agent_version = '<p>'.html_print_image( $table_agent_version = '<p>'.html_print_image(
'images/version.png', 'images/version.png',
true, true,
@ -235,7 +269,9 @@ $table_agent_description = '<p>'.html_print_image(
$table_agent_description .= '<span class="align-top inline">'; $table_agent_description .= '<span class="align-top inline">';
$table_agent_description .= (empty($agent['comentarios']) === true) ? '<em>'.__('N/A').'</em>' : $agent['comentarios']; $table_agent_description .= (empty($agent['comentarios']) === true) ? '<em>'.__('N/A').'</em>' : $agent['comentarios'];
$table_agent_description .= '</span></p>'; $table_agent_description .= '</span></p>';
*/
/*
$table_agent_count_modules = reporting_tiny_stats( $table_agent_count_modules = reporting_tiny_stats(
$agent, $agent,
true, true,
@ -243,6 +279,21 @@ $table_agent_count_modules = reporting_tiny_stats(
// Useless. // Useless.
':', ':',
true true
);*/
$agentCountModules = html_print_div(
[
'class' => 'agent_details_bullets',
'content' => reporting_tiny_stats(
$agent,
true,
'agent',
// Useless.
':',
true
),
],
true
); );
$has_remote_conf = enterprise_hook( $has_remote_conf = enterprise_hook(
@ -250,13 +301,9 @@ $has_remote_conf = enterprise_hook(
[$agent['id_agente']] [$agent['id_agente']]
); );
if ($has_remote_conf) { if ((bool) $has_remote_conf) {
$remote_cfg = '<p>'.html_print_image( $table_status->data['remote_config'][0] = __('Remote configuration');
'images/remote_configuration.png', $table_status->data['remote_config'][1] = __('Enabled');
true,
['class' => 'invert_filter']
);
$remote_cfg .= __('Remote configuration enabled').'</p>';
$satellite_server = (int) db_get_value_filter( $satellite_server = (int) db_get_value_filter(
'satellite_server', 'satellite_server',
@ -271,19 +318,11 @@ if ($has_remote_conf) {
['id_server' => $satellite_server] ['id_server' => $satellite_server]
); );
$remote_cfg .= '<p>'.html_print_image( $table_status->data['remote_config'][0] = __('Satellite server');
'images/satellite.png', $table_status->data['remote_config'][1] = $satellite_name;
true,
['class' => 'invert_filter']
);
$remote_cfg .= $satellite_name.'</p>';
} }
} else {
$remote_cfg = '';
} }
// $table_agent_count_modules .= ui_print_help_tip(__('Agent statuses are re-calculated by the server, they are not shown in real time.'), true); // $table_agent_count_modules .= ui_print_help_tip(__('Agent statuses are re-calculated by the server, they are not shown in real time.'), true);
/* /*
$table_agent = html_print_div( $table_agent = html_print_div(
@ -294,19 +333,13 @@ if ($has_remote_conf) {
true true
); );
*/ */
$table_agent = ' $table_agent = $agentStatusHeader.'
<div class="agent_details_header">
'.$table_agent_header.'
</div>
<div class="agent_details_content"> <div class="agent_details_content">
<div class="agent_details_graph"> <div class="agent_details_graph">
'.$table_agent_graph.' '.$agentStatusGraph.$agentCountModules.'
<div class="agent_details_bullets">
'.$table_agent_count_modules.'
</div>
</div> </div>
<div class="agent_details_info"> <div class="agent_details_info">
'.$alive_animation.$table_agent_os.$table_agent_ip.$table_agent_version.$table_agent_description.$remote_cfg.' '.$alive_animation.html_print_table($table_status, true).'
</div> </div>
</div>'; </div>';
@ -344,10 +377,9 @@ $table_contact->id = 'agent_contact_main';
$table_contact->width = '100%'; $table_contact->width = '100%';
$table_contact->cellspacing = 0; $table_contact->cellspacing = 0;
$table_contact->cellpadding = 0; $table_contact->cellpadding = 0;
$table_contact->class = 'white_table white_table_no_border'; $table_contact->class = 'floating_form';
$table_contact->style[0] = 'width: 30%; text-align: end;'; $table_contact->style[0] = 'height: 46px; width: 30%; padding-right: 5px; text-align: end;';
$table_contact->style[1] = 'width: 70%; font-family: \'Pandora-Regular\';'; $table_contact->style[1] = 'height: 46px; width: 70%; padding-left: 5px; font-family: \'Pandora-Regular\';';
$table_contact->headstyle[1] = 'padding-top:6px; padding-bottom:6px;padding-right: 10px;';
$agentContactCaption = html_print_div( $agentContactCaption = html_print_div(
[ [
@ -357,7 +389,6 @@ $agentContactCaption = html_print_div(
true true
); );
// $table_contact->head[0] = $agentContactCaption;
$buttonsRefreshAgent = html_print_button( $buttonsRefreshAgent = html_print_button(
__('Refresh data'), __('Refresh data'),
'refresh_data', 'refresh_data',
@ -386,14 +417,12 @@ $buttons_refresh_agent_view = html_print_div(
true true
); );
// $table_contact->head[1] = $buttons_refresh_agent_view;
// Data for agent contact. // Data for agent contact.
$intervalHumanTime = human_time_description_raw($agent['intervalo']); $intervalHumanTime = human_time_description_raw($agent['intervalo']);
$lastContactDate = ui_print_timestamp($agent['ultimo_contacto'], true); $lastContactDate = ui_print_timestamp($agent['ultimo_contacto'], true);
$remoteContactDate = ($agent['ultimo_contacto_remoto'] === '01-01-1970 00:00:00') ? __('Never') : date_w_fixed_tz($agent['ultimo_contacto_remoto']); $remoteContactDate = ($agent['ultimo_contacto_remoto'] === '01-01-1970 00:00:00') ? __('Never') : date_w_fixed_tz($agent['ultimo_contacto_remoto']);
$lastAndRemoteContact = sprintf('%s / %s', $lastContactDate, $remoteContactDate); $lastAndRemoteContact = sprintf('%s / %s', $lastContactDate, $remoteContactDate);
$progress = agents_get_next_contact($id_agente); $progress = agents_get_next_contact($id_agente);
$progressOverride = ($progress > 100) ? clippy_context_help('agent_out_of_limits') : '';
$tempTimeToShow = ($agent['intervalo'] - (strtotime('now') - strtotime($agent['ultimo_contacto']))); $tempTimeToShow = ($agent['intervalo'] - (strtotime('now') - strtotime($agent['ultimo_contacto'])));
$progressCaption = ($tempTimeToShow >= 0) ? sprintf('%d s', $tempTimeToShow) : __('Out of bounds'); $progressCaption = ($tempTimeToShow >= 0) ? sprintf('%d s', $tempTimeToShow) : __('Out of bounds');
$ajaxNextContactInterval = (empty($agent['intervalo']) === true) ? 0 : (100 / $agent['intervalo']); $ajaxNextContactInterval = (empty($agent['intervalo']) === true) ? 0 : (100 / $agent['intervalo']);
@ -430,10 +459,10 @@ $table_contact->data[] = $data;
// Next contact progress. // Next contact progress.
$data = []; $data = [];
$data[0] = __('Next contact').$progressOverride; $data[0] = __('Next contact');
$data[1] = ui_progress( $data[1] = ui_progress(
$progress, $progress,
'100%', '97%',
2.1, 2.1,
'#BBB', '#BBB',
true, true,
@ -501,50 +530,59 @@ $table_contact->data[] = $data;
* START: TABLE DATA BUILD * START: TABLE DATA BUILD
*/ */
$table_data = new stdClass(); $data_opcional = new stdClass();
$table_data->id = 'agent_data_main'; $data_opcional->id = 'agent_data_main';
$table_data->width = '100%'; // $data_opcional->styleTable = 'width: 100%; padding: 0; border: 0; margin: 0';
$table_data->cellspacing = 0; $data_opcional->class = 'floating_form';
$table_data->cellpadding = 0; $data_opcional->cellspacing = 0;
$table_data->class = 'box-shadow white_table white_table_droppable align-top'; $data_opcional->cellpadding = 0;
$table_data->style = array_fill(0, 3, 'width: 25%;'); // $table_data->class = 'box-shadow agent_details_col mrgn_lft_20px mrgn_right_20px white_table white_table_droppable align-top';
$data_opcional->style[0] = 'height: 46px; width: 25%; padding-right: 5px; font-family: \'Pandora-Bold\'; text-align: end;';
$data_opcional->style[1] = 'height: 46px; width: 75%; padding-left: 5px; font-family: \'Pandora-Regular\';';
/*
$table_data->headstyle[0] = 'border-bottom: 0';
$table_data->headstyle[1] = 'border-bottom: 0';
$table_data->head[0] = html_print_image( $table_data->head[0] = html_print_image(
'images/arrow_down_green.png', 'images/arrow_down_green.png',
true, true,
$options [ 'class' => 'pdd_r_10px' ]
); );
$table_data->head[0] .= ' <span class="vertical_middle bolder pdd_l_20px">'.__('Agent info').'</span>'; $table_data->head[0] .= '<span class="subsection_header_title">'.__('Agent info').'</span>';
$table_data->head_colspan[0] = 4; $table_data->head_colspan[0] = 4;
*/
// Gis and url address. // Gis and url address.
$data_opcional = []; $agentAdditionalContent = '';
// Position Information. // Position Information.
if ((bool) $config['activate_gis'] === true) { if ((bool) $config['activate_gis'] === true) {
$data_opcional[] = '<b>'.__('Position (Long, Lat)').'</b>'; $data_opcional->data['agent_position'][0] = '<span>'.__('Position (Long, Lat)').'</span>';
$dataPositionAgent = gis_get_data_last_position_agent( $dataPositionAgent = gis_get_data_last_position_agent(
$agent['id_agente'] $agent['id_agente']
); );
if ($dataPositionAgent === false) { if ($dataPositionAgent === false) {
$data_opcional[] = __('There is no GIS data.'); $data_opcional->data['agent_position'][1] = __('There is no GIS data.');
} else { } else {
$data_opcional[] = html_print_anchor( $dataOptionalOutput = html_print_anchor(
[ [
'href' => 'index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;tab=gis&amp;id_agente='.$id_agente, 'href' => 'index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;tab=gis&amp;id_agente='.$id_agente,
'content' => (empty($dataPositionAgent['description']) === false) ? $dataPositionAgent['description'] : $dataPositionAgent['stored_longitude'].', '.$dataPositionAgent['stored_latitude'], 'content' => $dataPositionAgent['stored_longitude'].', '.$dataPositionAgent['stored_latitude'],
], ],
true true
); );
if (empty($dataPositionAgent['description']) === false) {
$dataOptionalOutput .= ' ('.$dataPositionAgent['description'].')';
} }
array_push($data_opcional); $data_opcional->data['agent_position'][1] = $dataOptionalOutput;
}
} }
// If the url description is set. // If the url description is set.
if (empty($agent['url_address']) === false) { if (empty($agent['url_address']) === false) {
$data_opcional[] = '<b>'.__('Url address').'</b>'; $data_opcional->data['url_address'][0] = '<span>'.__('Url address').'</span>';
$data_opcional[] = html_print_anchor( $data_opcional->data['url_address'][1] = html_print_anchor(
[ [
'href' => $agent['url_address'], 'href' => $agent['url_address'],
'content' => $agent['url_address'], 'content' => $agent['url_address'],
@ -556,8 +594,8 @@ if (empty($agent['url_address']) === false) {
// Other IP address and timezone offset. // Other IP address and timezone offset.
if (empty($addresses) === false) { if (empty($addresses) === false) {
$data_opcional[] = '<b>'.__('Other IP addresses').'</b>'; $data_opcional->data['other_ip_address'][0] = '<span>'.__('Other IP addresses').'</span>';
$data_opcional[] = html_print_div( $data_opcional->data['other_ip_address'][1] = html_print_div(
[ [
'class' => 'overflow-y mx_height50px', 'class' => 'overflow-y mx_height50px',
'content' => implode('<br>', $addresses), 'content' => implode('<br>', $addresses),
@ -568,16 +606,16 @@ if (empty($addresses) === false) {
// Timezone Offset. // Timezone Offset.
if ((int) $agent['timezone_offset'] !== 0) { if ((int) $agent['timezone_offset'] !== 0) {
$data_opcional[] = '<b>'.__('Timezone Offset').'</b>'; $data_opcional->data['timezone_offset'][0] = '<span>'.__('Timezone Offset').'</span>';
$data_opcional[] = $agent['timezone_offset']; $data_opcional->data['timezone_offset'][1] = $agent['timezone_offset'];
} }
/*
$data_opcional = array_chunk($data_opcional, 4); $data_opcional = array_chunk($data_opcional, 2);
foreach ($data_opcional as $key => $value) { foreach ($data_opcional as $key => $value) {
$table_data->data[] = $data_opcional[$key]; $table_data->data[] = $data_opcional[$key];
} }
*/
// Custom fields. // Custom fields.
$fields = db_get_all_rows_filter( $fields = db_get_all_rows_filter(
'tagent_custom_fields', 'tagent_custom_fields',
@ -616,7 +654,7 @@ for ($i = 0; $i < $custom_fields_count; $i++) {
$j = ($i + 1); $j = ($i + 1);
$second_column = $custom_fields[$j]; $second_column = $custom_fields[$j];
if (is_array($second_column)) { if (is_array($second_column) === true) {
$columns = array_merge($first_column, $second_column); $columns = array_merge($first_column, $second_column);
} else { } else {
$columns = $first_column; $columns = $first_column;
@ -646,26 +684,38 @@ $access_agent = db_get_value_sql(
WHERE id_agent = '.$id_agente WHERE id_agent = '.$id_agente
); );
if ($config['agentaccess'] && $access_agent > 0) { if ((bool) $config['agentaccess'] === true && $access_agent > 0) {
$table_access_rate = '<div class="white_table_graph" id="table_access_rate">'; $agentAccessRateHeader = html_print_div(
$table_access_rate .= '<div class="white_table_graph_header">'; [
$table_access_rate .= html_print_image( 'class' => 'agent_details_header',
'images/arrow_down_green.png', 'content' => '<span class="subsection_header_title">'.__('Agent access rate (Last 24h)').'</span>',
],
true true
); );
$table_access_rate .= '<span>';
$table_access_rate .= __('Agent access rate (Last 24h)'); $agentAccessRateContent = html_print_div(
$table_access_rate .= '</span>'; [
$table_access_rate .= '</div>'; 'class' => 'white-table-graph-content',
$table_access_rate .= '<div class="white_table_graph_content white-table-graph-content">'; 'content' => graphic_agentaccess(
$table_access_rate .= graphic_agentaccess(
$id_agente, $id_agente,
SECONDS_1DAY, SECONDS_1DAY,
true, true,
true true
),
],
true
); );
$table_access_rate .= '</div>';
$table_access_rate .= '</div>'; $agentAccessRate = html_print_div(
[
'class' => 'box-shadow agent_details_col mrgn_right_20px',
'id' => 'table_access_rate',
'content' => $agentAccessRateHeader.$agentAccessRateContent,
],
true
);
} else {
$agentAccessRate = '';
} }
/* /*
@ -932,6 +982,66 @@ if (!empty($network_interfaces)) {
}); });
</script> </script>
<?php <?php
$agent_contact = html_print_div(
[
'class' => 'agent_details_header',
'content' => $agentContactCaption.$buttons_refresh_agent_view,
],
true
);
$agent_contact .= html_print_table($table_contact, true);
$agentDetails = html_print_div(
[
'class' => 'box-shadow agent_details_col mrgn_lft_20px mrgn_right_20px',
'content' => $table_agent,
],
true
);
$agentContact = html_print_div(
[
'class' => 'box-shadow agent_details_col mrgn_right_20px',
'content' => $agent_contact,
],
true
);
$agentEventsHeader = html_print_div(
[
'class' => 'agent_details_header',
'content' => '<span class="subsection_header_title">'.__('Events (Last 24h)').'</span>',
],
true
);
$agentEventsGraph = html_print_div(
[
'class' => 'white-table-graph-content',
'content' => graph_graphic_agentevents(
$id_agente,
95,
70,
SECONDS_1DAY,
'',
true,
true,
500
),
],
true
);
$agentEvents = html_print_div(
[
'class' => 'box-shadow agent_details_col mrgn_lft_20px mrgn_right_20px',
'content' => $agentEventsHeader.$agentEventsGraph,
],
true
);
/*
$table_events = '<div class="white_table_graph" id="table_events">'; $table_events = '<div class="white_table_graph" id="table_events">';
$table_events .= '<div class="white_table_graph_header">'; $table_events .= '<div class="white_table_graph_header">';
$table_events .= html_print_image( $table_events .= html_print_image(
@ -942,6 +1052,7 @@ $table_events .= '<span>';
$table_events .= __('Events (Last 24h)'); $table_events .= __('Events (Last 24h)');
$table_events .= '</span>'; $table_events .= '</span>';
$table_events .= '</div>'; $table_events .= '</div>';
$table_events .= '<div class="white_table_graph_content white-table-graph-content">'; $table_events .= '<div class="white_table_graph_content white-table-graph-content">';
$table_events .= graph_graphic_agentevents( $table_events .= graph_graphic_agentevents(
$id_agente, $id_agente,
@ -955,32 +1066,34 @@ $table_events .= graph_graphic_agentevents(
); );
$table_events .= '</div>'; $table_events .= '</div>';
$table_events .= '</div>'; $table_events .= '</div>';
*/
/* /*
* EVENTS TABLE END. * EVENTS TABLE END.
*/ */
if (empty($data_opcional) === true) {
$agent_contact = html_print_div( $agentAdditionalInfo = '';
[ } else {
'class' => 'agent_details_header', // if (count($table_data->data) === 1 && (bool) $config['activate_gis'] === true && $dataPositionAgent === false) {
'content' => $agentContactCaption.$buttons_refresh_agent_view, if (empty($data_opcional) === true && (bool) $config['activate_gis'] === true && $dataPositionAgent === false) {
], $agentAdditionalInfo = '';
true } else {
// $agentAdditionalInfo = html_print_table($table_data, true);$agentAdditionalContent
$agentAdditionalInfo = ui_toggle(
html_print_table($data_opcional, true),
'<span class="subsection_header_title">'.__('Agent data').'</span>',
'status_monitor_agent',
false,
false,
true,
'box-shadow agent_details_col w100p',
'mrgn_lft_20px mrgn_right_20px',
'mrgn_lft_20px mrgn_right_20px w100p'
); );
$agent_contact .= html_print_table($table_contact, true);
if (empty($table_data->data) === true) {
$agent_info = '';
} else {
if (count($table_data->data) === 1 && (bool) $config['activate_gis'] === true && $dataPositionAgent === false) {
$agent_info = '';
} else {
$agent_info = html_print_table($table_data, true);
} }
} }
$agent_incidents = !isset($table_incident) ? '' : html_print_table($table_incident, true); $agentIncidents = (isset($table_incident) === false) ? '' : html_print_table($table_incident, true);
/* /*
echo '<div class="agent_details_first_row"> echo '<div class="agent_details_first_row">
<div class="box-shadow agent_details_col mrgn_lft_20px mrgn_right_20px">'.$table_agent.'</div> <div class="box-shadow agent_details_col mrgn_lft_20px mrgn_right_20px">'.$table_agent.'</div>
@ -988,40 +1101,50 @@ $agent_incidents = !isset($table_incident) ? '' : html_print_table($table_incide
</div>'.$agent_info; </div>'.$agent_info;
*/ */
$agentDetails = html_print_div( html_print_div(
[ [
'class' => 'box-shadow floating_form agent_details_col mrgn_lft_20px mrgn_right_20px', 'class' => 'agent_details_first_row agent_details_line',
'content' => $table_agent,
],
true
);
$agentContact = html_print_div(
[
'class' => 'box-shadow floating_form agent_details_col mrgn_right_20px',
'content' => $agent_contact,
],
true
);
$agentFirstRow = html_print_div(
[
'class' => 'agent_details_first_row',
'content' => $agentDetails.$agentContact, 'content' => $agentDetails.$agentContact,
], ]
true
); );
echo $agentFirstRow; html_print_div(
[
'class' => 'agent_details_first_row agent_details_line',
'content' => $agentEvents.$agentAccessRate,
]
);
if (empty($agentAdditionalInfo) === false) {
html_print_div(
[
'class' => 'agent_details_first_row agent_details_line',
'content' => $agentAdditionalInfo,
]
);
}
if (empty($agentIncidents) === false) {
html_print_div(
[
'class' => 'agent_details_first_row agent_details_line',
'content' => $agentIncidents,
]
);
}
/*
// Show both graphs, events and access rate. // Show both graphs, events and access rate.
if ($table_access_rate) { if ($table_access_rate) {
echo '<div class="agent_access_rate_events">'.$table_access_rate.$table_events.'</div>'; echo '<div class="agent_access_rate_events agent_details_line">'.$table_access_rate.$table_events.'</div>';
} else { } else {
echo '<div class="w100p">'.$table_events.'</div>'; echo '<div class="w100p">'.$table_events.'</div>';
} }
echo $agent_incidents; echo $agent_incidents;
*/
if (isset($table_interface) === true) { if (isset($table_interface) === true) {
ui_toggle( ui_toggle(

View File

@ -182,9 +182,12 @@ echo html_print_div(
$html_toggle = ob_get_clean(); $html_toggle = ob_get_clean();
ui_toggle( html_print_div(
[
'class' => 'agent_details_first_row agent_details_line',
'content' => ui_toggle(
$html_toggle, $html_toggle,
__('List of modules').$help_not_init.ui_print_help_tip( '<span class="subsection_header_title">'.__('List of modules').'</span>'.$help_not_init.ui_print_help_tip(
__('To see the list of modules paginated, enable this option in the Styles Configuration.'), __('To see the list of modules paginated, enable this option in the Styles Configuration.'),
true true
).reporting_tiny_stats( ).reporting_tiny_stats(
@ -192,16 +195,20 @@ ui_toggle(
true, true,
'modules', 'modules',
':', ':',
true true,
), ),
'status_monitor_agent', 'status_monitor_agent',
false, false,
false, false,
'', true,
'white_table_graph_content no-padding-imp' 'box-shadow agent_details_col',
// 'mrgn_lft_20px mrgn_right_20px',
'white-box-content',
'mrgn_lft_20px mrgn_right_20px width_available'
),
],
); );
?> ?>
<script type="text/javascript"> <script type="text/javascript">
var sort_field = '<?php echo $sort_field; ?>'; var sort_field = '<?php echo $sort_field; ?>';

View File

@ -21,15 +21,22 @@ if (!isset($id_agente)) {
require_once 'include/functions_events.php'; require_once 'include/functions_events.php';
ui_require_css_file('events'); ui_require_css_file('events');
ui_toggle(
"<div class='w100p' id='event_list'>".html_print_image('images/spinner.gif', true).'</div>', html_print_div(
[
'class' => 'agent_details_first_row agent_details_line',
'content' => ui_toggle(
'<div class=\'w100p\' id=\'event_list\'>'.html_print_image('images/spinner.gif', true).'</div>',
'<span class="subsection_header_title">'.__('Latest events for this agent').'</span>',
__('Latest events for this agent'), __('Latest events for this agent'),
__('Latest events for this agent'), 'latest_events_agent',
'',
false, false,
false, true,
'', 'box-shadow agent_details_col',
'white_table_graph_content no-padding-imp' 'white-box-content',
'mrgn_lft_20px mrgn_right_20px width_available'
),
],
); );
?> ?>