mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-04-08 18:55:09 +02:00
Merge branch 'ent-13055-arreglar-algunos-puntos-en-filtros-de-vista-interfaces' into 'develop'
Ent 13055 Arreglar algunos puntos en filtros de vista Interfaces See merge request artica/pandorafms!7030
This commit is contained in:
commit
a15734e926
pandora_console/operation/agentes
@ -597,15 +597,19 @@ function print_table(
|
||||
} else {
|
||||
foreach ($all_interfaces as $key => $value) {
|
||||
// Filter interfaces array.
|
||||
$filtered_interfaces[$key] = array_filter(
|
||||
$value,
|
||||
function ($interface) use ($selected_interfaces) {
|
||||
return in_array(
|
||||
$interface['status_module_id'],
|
||||
$selected_interfaces
|
||||
);
|
||||
}
|
||||
);
|
||||
if (empty($selected_interfaces) === false && in_array('', $selected_interfaces) === false) {
|
||||
$filtered_interfaces[$key] = array_filter(
|
||||
$value,
|
||||
function ($interface) use ($selected_interfaces) {
|
||||
return in_array(
|
||||
$interface['status_module_id'],
|
||||
$selected_interfaces
|
||||
);
|
||||
}
|
||||
);
|
||||
} else {
|
||||
$filtered_interfaces = $all_interfaces;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -265,13 +265,16 @@ function load_agent_interfaces_selector(selected_agents) {
|
||||
},
|
||||
function (data, status) {
|
||||
$("#module").html('');
|
||||
|
||||
var option = $("<option></option>")
|
||||
.attr ("value", "")
|
||||
.html ("Any");
|
||||
$("#selected_interfaces").append(option);
|
||||
if (data) {
|
||||
Object.values(data).forEach(function(obj) {
|
||||
for (const [key, value] of Object.entries(obj.interfaces)) {
|
||||
option = $("<option></option>")
|
||||
.attr ("value", value.status_module_id)
|
||||
.html (key + ' (' + obj.agent_alias + ')');
|
||||
.html ('(' + obj.agent_alias + ') ' + key);
|
||||
$("#selected_interfaces").append(option);
|
||||
}
|
||||
});
|
||||
|
@ -169,6 +169,8 @@ if (is_ajax()) {
|
||||
},
|
||||
[]
|
||||
);
|
||||
} else {
|
||||
echo json_encode([]);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user