Merge branch 'ent-8735-vista-de-interfaces-referencia-mal-los-agentes' into 'develop'
Ent 8735 vista de interfaces referencia mal los agentes See merge request artica/pandorafms!4800
This commit is contained in:
commit
7168f1d848
|
@ -329,7 +329,7 @@ class AgentWizard extends HTML
|
|||
}
|
||||
}
|
||||
|
||||
if (count($this->datalist) === 1 && $this->targetIp === '') {
|
||||
if (empty($this->datalist) === false && count($this->datalist) === 1 && $this->targetIp === '') {
|
||||
$this->targetIp = $this->datalist[0];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3236,8 +3236,8 @@ function agents_get_network_interfaces($agents=false, $agents_filter=false)
|
|||
$ni_by_agents = [];
|
||||
foreach ($agents as $agent) {
|
||||
$agent_id = (isset($agent['id_agente'])) ? $agent['id_agente'] : $agent;
|
||||
$agent_group_id = (isset($agent['id_grupo']) === true) ? $agent['id_grupo'] : '';
|
||||
$agent_name = (isset($agent['alias']) === true) ? $agent['alias'] : '';
|
||||
$agent_group_id = (isset($agent['id_grupo']) === true) ? $agent['id_grupo'] : agents_get_agent_group($agent_id);
|
||||
$agent_name = (isset($agent['alias']) === true) ? $agent['alias'] : agents_get_alias($agent_id);
|
||||
$agent_interfaces = [];
|
||||
|
||||
$accepted_module_types = [];
|
||||
|
|
|
@ -552,14 +552,18 @@ function print_table(
|
|||
|
||||
$all_interfaces = [];
|
||||
|
||||
foreach ($data as $value) {
|
||||
$agent_alias = agents_get_alias($value['name']);
|
||||
foreach ($data as $key => $value) {
|
||||
if (empty($value['name']) === false) {
|
||||
$agent_alias = $value['name'];
|
||||
} else {
|
||||
$agent_alias = agents_get_alias($key);
|
||||
}
|
||||
|
||||
foreach ($value['interfaces'] as $if_name => $interface) {
|
||||
$interface['agent_id'] = $value['name'];
|
||||
$interface['agent_id'] = $key;
|
||||
$interface['agent_alias'] = $agent_alias;
|
||||
$interface['if_name'] = $if_name;
|
||||
$all_interfaces[$if_name] = $interface;
|
||||
$all_interfaces[$key][$if_name] = $interface;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -569,21 +573,24 @@ function print_table(
|
|||
) {
|
||||
$filtered_interfaces = $all_interfaces;
|
||||
} else {
|
||||
foreach ($all_interfaces as $key => $value) {
|
||||
// Filter interfaces array.
|
||||
$filtered_interfaces = array_filter(
|
||||
$all_interfaces,
|
||||
$filtered_interfaces[$key] = array_filter(
|
||||
$value,
|
||||
function ($interface) use ($selected_interfaces) {
|
||||
return in_array(
|
||||
$interface['status_module_id'],
|
||||
$selected_interfaces
|
||||
) === true;
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$data = [];
|
||||
|
||||
foreach ($filtered_interfaces as $if_name => $agent_interfaces) {
|
||||
foreach ($filtered_interfaces as $interfaces) {
|
||||
foreach ($interfaces as $if_name => $agent_interfaces) {
|
||||
// Get usage modules.
|
||||
$usage_module_in = db_get_row(
|
||||
'tagente_modulo',
|
||||
|
@ -681,6 +688,7 @@ function print_table(
|
|||
|
||||
$loop_index++;
|
||||
}
|
||||
}
|
||||
|
||||
// Sort array of previously processed table values.
|
||||
if ($sort === 'up') {
|
||||
|
|
Loading…
Reference in New Issue