From a476d008ac82c12cff7697770e598cd644adacfe Mon Sep 17 00:00:00 2001 From: "manuel.montes" Date: Thu, 26 Jul 2018 15:30:49 +0200 Subject: [PATCH] fix bug in metaconsole view events --- .../godmode/events/custom_events.php | 32 +++++++++---------- .../operation/events/events.build_table.php | 16 ++++++---- 2 files changed, 26 insertions(+), 22 deletions(-) diff --git a/pandora_console/godmode/events/custom_events.php b/pandora_console/godmode/events/custom_events.php index 134cb76a72..3ca3d625bb 100644 --- a/pandora_console/godmode/events/custom_events.php +++ b/pandora_console/godmode/events/custom_events.php @@ -65,10 +65,10 @@ if ($fields_selected[0]!='') { foreach ($fields_selected as $field_selected) { switch ($field_selected) { case 'id_evento': - $result = __('Event id'); + $result = __('Event Id'); break; case 'evento': - $result = __('Event name'); + $result = __('Event Name'); break; case 'id_agente': $result = __('Agent name'); @@ -86,10 +86,10 @@ if ($fields_selected[0]!='') { $result = __('Timestamp'); break; case 'event_type': - $result = __('Event type'); + $result = __('Event Type'); break; case 'id_agentmodule': - $result = __('Agent module'); + $result = __('Module Name'); break; case 'id_alert_am': $result = __('Alert'); @@ -107,7 +107,7 @@ if ($fields_selected[0]!='') { $result = __('Source'); break; case 'id_extra': - $result = __('Extra id'); + $result = __('Extra Id'); break; case 'owner_user': $result = __('Owner'); @@ -119,13 +119,13 @@ if ($fields_selected[0]!='') { $result = __('Instructions'); break; case 'server_name': - $result = __('Server name'); + $result = __('Server Name'); break; case 'data': $result = __('Data'); - case 'module_status': - $result = __('Module status'); break; + case 'module_status': + $result = __('Module Status'); break; } $result_selected[$field_selected] = $result; @@ -155,27 +155,27 @@ $table->data = array(); $fields_available = array(); -$fields_available['id_evento'] = __('Event id'); -$fields_available['evento'] = __('Event name'); -$fields_available['id_agente'] = __('Agent name'); +$fields_available['id_evento'] = __('Event Id'); +$fields_available['evento'] = __('Event Name'); +$fields_available['id_agente'] = __('Agent Name'); $fields_available['id_usuario'] = __('User'); $fields_available['id_grupo'] = __('Group'); $fields_available['estado'] = __('Status'); $fields_available['timestamp'] = __('Timestamp'); -$fields_available['event_type'] = __('Event type'); -$fields_available['id_agentmodule'] = __('Agent module'); +$fields_available['event_type'] = __('Event Type'); +$fields_available['id_agentmodule'] = __('Module Name'); $fields_available['id_alert_am'] = __('Alert'); $fields_available['criticity'] = __('Severity'); $fields_available['user_comment'] = __('Comment'); $fields_available['tags'] = __('Tags'); $fields_available['source'] = __('Source'); -$fields_available['id_extra'] = __('Extra id'); +$fields_available['id_extra'] = __('Extra Id'); $fields_available['owner_user'] = __('Owner'); $fields_available['ack_utimestamp'] = __('ACK Timestamp'); $fields_available['instructions'] = __('Instructions'); -$fields_available['server_name'] = __('Server name'); +$fields_available['server_name'] = __('Server Name'); $fields_available['data'] = __('Data'); -$fields_available['module_status'] = __('Module status'); +$fields_available['module_status'] = __('Module Status'); //remove fields already selected foreach ($fields_available as $key=>$available) { diff --git a/pandora_console/operation/events/events.build_table.php b/pandora_console/operation/events/events.build_table.php index c92f0dc795..4d6649cc1b 100644 --- a/pandora_console/operation/events/events.build_table.php +++ b/pandora_console/operation/events/events.build_table.php @@ -158,7 +158,7 @@ else { $i++; } if (in_array('id_agente', $show_fields)) { - $table->head[$i] = __('Agent name'); + $table->head[$i] = __('Agent Name'); $table->align[$i] = 'left'; $table->style[$i] = 'max-width: 350px; word-break: break-all;'; $i++; @@ -188,14 +188,14 @@ else { $i++; } if (in_array('event_type', $show_fields)) { - $table->head[$i] = __('Event type'); + $table->head[$i] = __('Event Type'); $table->align[$i] = 'left'; $table->style[$i] = 'min-width: 85px;'; $i++; } if (in_array('id_agentmodule', $show_fields)) { - $table->head[$i] = __('Agent Module'); + $table->head[$i] = __('Module Name'); $table->align[$i] = 'left'; $i++; @@ -256,7 +256,7 @@ else { $i++; } if (in_array('module_status', $show_fields)) { - $table->head[$i] = __('Module status'); + $table->head[$i] = __('Module Status'); $table->align[$i] = 'left'; $i++; @@ -675,10 +675,14 @@ else { $table->cellclass[count($table->data)][$i] = $myclass; $i++; } - if (in_array('data',$show_fields)) { + if (in_array('data',$show_fields)) { $data[$i] = $event["data"]; + if($data[$i] %1 == 0) + $data[$i]= number_format($data[$i], 0); + else + $data[$i]= number_format($data[$i], 2); $table->cellclass[count($table->data)][$i] = $myclass; - $i++; + $i++; } if (in_array('module_status',$show_fields)) { $data[$i] = modules_get_modules_status ($event["module_status"]);