mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 08:14:38 +02:00
Merge branch 'ent-11474-inventario-all-no-se-muestra-en-metaconsola' into 'develop'
Ent 11474 inventario all no se muestra en metaconsola See merge request artica/pandorafms!6055
This commit is contained in:
commit
5e65dfa639
@ -738,6 +738,7 @@ function inventory_get_datatable(
|
|||||||
if ($inventory_module_name[0] !== '0'
|
if ($inventory_module_name[0] !== '0'
|
||||||
&& $inventory_module_name !== ''
|
&& $inventory_module_name !== ''
|
||||||
&& $inventory_module_name !== 'all'
|
&& $inventory_module_name !== 'all'
|
||||||
|
&& $inventory_module_name !== '0'
|
||||||
) {
|
) {
|
||||||
array_push($where, "tmodule_inventory.name IN ('".implode("','", (array) $inventory_module_name)."')");
|
array_push($where, "tmodule_inventory.name IN ('".implode("','", (array) $inventory_module_name)."')");
|
||||||
}
|
}
|
||||||
@ -824,6 +825,8 @@ function inventory_get_datatable(
|
|||||||
}
|
}
|
||||||
|
|
||||||
foreach ($agent_data as $id_agent => $data_agent) {
|
foreach ($agent_data as $id_agent => $data_agent) {
|
||||||
|
$rows_tmp['agent'] = $data_agent[0]['name_agent'];
|
||||||
|
|
||||||
foreach ($data_agent as $key => $agent_row) {
|
foreach ($data_agent as $key => $agent_row) {
|
||||||
if (isset($rows_tmp['agent']) === false) {
|
if (isset($rows_tmp['agent']) === false) {
|
||||||
$rows_tmp['agent'] = $agent_row['name_agent'];
|
$rows_tmp['agent'] = $agent_row['name_agent'];
|
||||||
|
@ -333,7 +333,7 @@ $inventory_search_string = (string) get_parameter('search_string');
|
|||||||
$order_by_agent = (bool) get_parameter('order_by_agent');
|
$order_by_agent = (bool) get_parameter('order_by_agent');
|
||||||
$export = (string) get_parameter('export');
|
$export = (string) get_parameter('export');
|
||||||
$utimestamp = (int) get_parameter('utimestamp');
|
$utimestamp = (int) get_parameter('utimestamp');
|
||||||
$submit_filter = (bool) get_parameter('submit_filter');
|
$submit_filter = (bool) get_parameter('srcbutton');
|
||||||
|
|
||||||
$pagination_url_parameters = [
|
$pagination_url_parameters = [
|
||||||
'inventory_id_agent' => $inventory_id_agent,
|
'inventory_id_agent' => $inventory_id_agent,
|
||||||
@ -381,6 +381,7 @@ if ($is_metaconsole === true) {
|
|||||||
WHERE tmodule_inventory.id_module_inventory = tagent_module_inventory.id_module_inventory';
|
WHERE tmodule_inventory.id_module_inventory = tagent_module_inventory.id_module_inventory';
|
||||||
if ($inventory_id_agent > 0) {
|
if ($inventory_id_agent > 0) {
|
||||||
$sql .= ' AND id_agente = '.$inventory_id_agent;
|
$sql .= ' AND id_agente = '.$inventory_id_agent;
|
||||||
|
$agents_node = [$inventory_id_agent => $inventory_id_agent];
|
||||||
}
|
}
|
||||||
|
|
||||||
$result_module = db_get_all_rows_sql($sql);
|
$result_module = db_get_all_rows_sql($sql);
|
||||||
@ -426,10 +427,10 @@ if ($is_metaconsole === true) {
|
|||||||
WHERE tmodule_inventory.id_module_inventory = tagent_module_inventory.id_module_inventory';
|
WHERE tmodule_inventory.id_module_inventory = tagent_module_inventory.id_module_inventory';
|
||||||
if ($inventory_id_agent > 0) {
|
if ($inventory_id_agent > 0) {
|
||||||
$sql .= ' AND id_agente = '.$inventory_id_agent;
|
$sql .= ' AND id_agente = '.$inventory_id_agent;
|
||||||
|
$agents_node = [$inventory_id_agent => $inventory_id_agent];
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = db_get_all_rows_sql($sql);
|
$result = db_get_all_rows_sql($sql);
|
||||||
|
|
||||||
if ($result !== false) {
|
if ($result !== false) {
|
||||||
$result_module = array_merge($result_module, $result);
|
$result_module = array_merge($result_module, $result);
|
||||||
if ($submit_filter === true) {
|
if ($submit_filter === true) {
|
||||||
@ -450,7 +451,6 @@ if ($is_metaconsole === true) {
|
|||||||
$data_tmp['dbhost'] = $server['dbhost'];
|
$data_tmp['dbhost'] = $server['dbhost'];
|
||||||
$data_tmp['server_uid'] = $server['server_uid'];
|
$data_tmp['server_uid'] = $server['server_uid'];
|
||||||
$data_tmp['data'] = $rows_meta;
|
$data_tmp['data'] = $rows_meta;
|
||||||
|
|
||||||
$nodos[$server['id']] = $data_tmp;
|
$nodos[$server['id']] = $data_tmp;
|
||||||
if ($result_data !== ERR_NODATA) {
|
if ($result_data !== ERR_NODATA) {
|
||||||
$inventory_data .= $result_data;
|
$inventory_data .= $result_data;
|
||||||
@ -732,7 +732,7 @@ ui_toggle(
|
|||||||
'white-box-content',
|
'white-box-content',
|
||||||
'box-flat white_table_graph fixed_filter_bar'
|
'box-flat white_table_graph fixed_filter_bar'
|
||||||
);
|
);
|
||||||
|
/*
|
||||||
if (is_metaconsole() === true) {
|
if (is_metaconsole() === true) {
|
||||||
$filteringFunction = 'active_inventory_submit()';
|
$filteringFunction = 'active_inventory_submit()';
|
||||||
ui_print_info_message(['no_close' => true, 'message' => __('You must select at least one filter.'), 'force_class' => 'select_one_filter']);
|
ui_print_info_message(['no_close' => true, 'message' => __('You must select at least one filter.'), 'force_class' => 'select_one_filter']);
|
||||||
@ -757,7 +757,8 @@ if (is_metaconsole() === true) {
|
|||||||
} else {
|
} else {
|
||||||
$filteringFunction = '';
|
$filteringFunction = '';
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
$filteringFunction = '';
|
||||||
if ($inventory_module !== 'basic') {
|
if ($inventory_module !== 'basic') {
|
||||||
if (is_metaconsole() === true) {
|
if (is_metaconsole() === true) {
|
||||||
if ($order_by_agent === true) {
|
if ($order_by_agent === true) {
|
||||||
@ -770,14 +771,14 @@ if ($inventory_module !== 'basic') {
|
|||||||
|
|
||||||
foreach ($nodos as $nodo) {
|
foreach ($nodos as $nodo) {
|
||||||
$agents = '';
|
$agents = '';
|
||||||
|
|
||||||
foreach ($nodo['data'] as $agent_rows) {
|
foreach ($nodo['data'] as $agent_rows) {
|
||||||
$modules = '';
|
$modules = '';
|
||||||
foreach ($agent_rows['row'] as $row) {
|
|
||||||
$data = [];
|
|
||||||
|
|
||||||
|
foreach ($agent_rows['row'] as $key => $row) {
|
||||||
$columns = explode(';', io_safe_output($row['data_format']));
|
$columns = explode(';', io_safe_output($row['data_format']));
|
||||||
array_push($columns, 'Timestamp');
|
array_push($columns, 'Timestamp');
|
||||||
|
$data = [];
|
||||||
$data_rows = explode(PHP_EOL, $row['data']);
|
$data_rows = explode(PHP_EOL, $row['data']);
|
||||||
foreach ($data_rows as $data_row) {
|
foreach ($data_rows as $data_row) {
|
||||||
// Exclude results don't match filter.
|
// Exclude results don't match filter.
|
||||||
@ -799,18 +800,17 @@ if ($inventory_module !== 'basic') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$id_table = 'id_'.$row['id_module_inventory'].'_'.$nodo['server_uid'];
|
$id_table = 'id_'.$row['id_module_inventory'].'_'.$nodo['server_uid'];
|
||||||
|
|
||||||
$table = ui_print_datatable(
|
$table = ui_print_datatable(
|
||||||
[
|
[
|
||||||
'id' => $id_table,
|
'id' => $id_table,
|
||||||
'class' => 'info_table',
|
'class' => 'info_table w100p',
|
||||||
'style' => 'width: 99%',
|
'style' => 'width: 99%',
|
||||||
'columns' => $columns,
|
'columns' => $columns,
|
||||||
'column_names' => $columns,
|
'column_names' => $columns,
|
||||||
'no_sortable_columns' => [],
|
'no_sortable_columns' => [],
|
||||||
'data_element' => $data,
|
'data_element' => $data,
|
||||||
'searching' => true,
|
'searching' => true,
|
||||||
'dom_elements' => 'lftipB',
|
'dom_elements' => 'ftip',
|
||||||
'order' => [
|
'order' => [
|
||||||
'field' => $columns[0],
|
'field' => $columns[0],
|
||||||
'direction' => 'asc',
|
'direction' => 'asc',
|
||||||
@ -853,7 +853,10 @@ if ($inventory_module !== 'basic') {
|
|||||||
'',
|
'',
|
||||||
'',
|
'',
|
||||||
true,
|
true,
|
||||||
true
|
true,
|
||||||
|
'',
|
||||||
|
'white-box-content w100p',
|
||||||
|
'box-shadow white_table_graph w100p',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -881,12 +884,13 @@ if ($inventory_module !== 'basic') {
|
|||||||
|
|
||||||
foreach ($nodos as $nodo_key => $nodo) {
|
foreach ($nodos as $nodo_key => $nodo) {
|
||||||
$agents = '';
|
$agents = '';
|
||||||
foreach ($nodo['data'] as $module_rows) {
|
|
||||||
|
foreach ($nodo['data'] as $module_key => $module_rows) {
|
||||||
$agent = '';
|
$agent = '';
|
||||||
|
$data = [];
|
||||||
foreach ($module_rows as $row) {
|
foreach ($module_rows as $row) {
|
||||||
$columns = explode(';', io_safe_output($row['data_format']));
|
$columns = explode(';', io_safe_output($row['data_format']));
|
||||||
array_push($columns, 'Timestamp');
|
array_push($columns, 'Timestamp');
|
||||||
$data = [];
|
|
||||||
|
|
||||||
$data_explode = explode(PHP_EOL, $row['data']);
|
$data_explode = explode(PHP_EOL, $row['data']);
|
||||||
foreach ($data_explode as $values) {
|
foreach ($data_explode as $values) {
|
||||||
@ -907,21 +911,21 @@ if ($inventory_module !== 'basic') {
|
|||||||
array_push($data, $data_tmp);
|
array_push($data, $data_tmp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$id_table = 'id_'.$row['id_module_inventory'].'_'.$nodo['server_uid'];
|
$id_table = 'id_'.$row['id_module_inventory'].'_'.$nodo['server_uid'];
|
||||||
|
|
||||||
$table = ui_print_datatable(
|
$table = ui_print_datatable(
|
||||||
[
|
[
|
||||||
'id' => $id_table,
|
'id' => $id_table,
|
||||||
'class' => 'info_table',
|
'class' => 'info_table w100p',
|
||||||
'style' => 'width: 99%',
|
'style' => 'width: 99%',
|
||||||
'columns' => $columns,
|
'columns' => $columns,
|
||||||
'column_names' => $columns,
|
'column_names' => $columns,
|
||||||
'no_sortable_columns' => [],
|
'no_sortable_columns' => [],
|
||||||
'data_element' => $data,
|
'data_element' => $data,
|
||||||
'searching' => true,
|
'searching' => true,
|
||||||
'dom_elements' => 'lftipB',
|
'dom_elements' => 'ftip',
|
||||||
'order' => [
|
'order' => [
|
||||||
'field' => $columns[0],
|
'field' => $columns[0],
|
||||||
'direction' => 'asc',
|
'direction' => 'asc',
|
||||||
@ -956,15 +960,18 @@ if ($inventory_module !== 'basic') {
|
|||||||
false,
|
false,
|
||||||
$id_table
|
$id_table
|
||||||
);
|
);
|
||||||
}
|
|
||||||
|
|
||||||
$agents .= ui_toggle(
|
$agents .= ui_toggle(
|
||||||
$agent,
|
$agent,
|
||||||
$module_rows[0]['name'],
|
$module_key,
|
||||||
'',
|
'',
|
||||||
'',
|
'',
|
||||||
true,
|
true,
|
||||||
true
|
true,
|
||||||
|
'',
|
||||||
|
'white-box-content w100p',
|
||||||
|
'box-shadow white_table_graph w100p',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user