module custom id in event list + minor fixes

This commit is contained in:
fbsanchez 2020-09-17 16:51:23 +02:00
parent 867fccf604
commit bc166dfba2
3 changed files with 18 additions and 3 deletions

View File

@ -114,6 +114,7 @@ $fields_available['server_name'] = __('Server Name');
$fields_available['data'] = __('Data');
$fields_available['module_status'] = __('Module Status');
$fields_available['mini_severity'] = __('Severity mini');
$fields_available['module_custom_id'] = __('Module custom ID');
// Remove fields already selected.

View File

@ -207,6 +207,7 @@ function events_get_all_fields()
$columns['server_name'] = __('Server name');
$columns['data'] = __('Data');
$columns['module_status'] = __('Module status');
$columns['module_custom_id'] = __('Module custom id');
return $columns;
}
@ -291,6 +292,9 @@ function events_get_column_name($field, $table_alias=false)
case 'module_status':
return __('Module Status');
case 'module_custom_id':
return __('Module custom ID');
case 'options':
return __('Options');

View File

@ -292,6 +292,7 @@ if (is_ajax()) {
if (!is_metaconsole()) {
$fields[] = 'am.nombre as module_name';
$fields[] = 'am.id_agente_modulo as id_agentmodule';
$fields[] = 'am.custom_id as module_custom_id';
$fields[] = 'ta.server_name as server_name';
} else {
$fields[] = 'ts.server_name as server_name';
@ -470,9 +471,13 @@ $tags_select_with = [];
$tags_select_without = [];
$tag_with_temp = [];
$tag_without_temp = [];
$tag_with = json_decode(base64_decode($tag_with), true);
$tag_without = json_decode(base64_decode($tag_without), true);
if (is_array($tag_with) === false) {
$tag_with = json_decode(base64_decode($tag_with), true);
}
if (is_array($tag_without) === false) {
$tag_without = json_decode(base64_decode($tag_without), true);
}
foreach ($tags as $id_tag => $tag) {
if (is_array($tag_with) === true
@ -1315,10 +1320,12 @@ try {
// 'timestamp_rep',
// 'timestamp_rep_min',
// 'module_name',
// 'custom_id',
[
'text' => 'options',
'class' => 'action_buttons w120px',
],[
],
[
'text' => 'm',
'extra' => $checkbox_all,
'class' => 'mw120px',
@ -2004,6 +2011,9 @@ function process_datatables_item(item) {
/* Module name */
item.id_agentmodule = item.module_name;
// Module custom_id.
item.custom_id = item.module_custom_id;
}
/* Datatables auxiliary functions ends */