#13055 changes in interface view
This commit is contained in:
parent
a31f96314f
commit
b10247abdf
|
@ -597,6 +597,7 @@ function print_table(
|
||||||
} else {
|
} else {
|
||||||
foreach ($all_interfaces as $key => $value) {
|
foreach ($all_interfaces as $key => $value) {
|
||||||
// Filter interfaces array.
|
// Filter interfaces array.
|
||||||
|
if (empty($selected_interfaces) === false && in_array('', $selected_interfaces) === false) {
|
||||||
$filtered_interfaces[$key] = array_filter(
|
$filtered_interfaces[$key] = array_filter(
|
||||||
$value,
|
$value,
|
||||||
function ($interface) use ($selected_interfaces) {
|
function ($interface) use ($selected_interfaces) {
|
||||||
|
@ -606,6 +607,9 @@ function print_table(
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
} else {
|
||||||
|
$filtered_interfaces = $all_interfaces;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -265,13 +265,16 @@ function load_agent_interfaces_selector(selected_agents) {
|
||||||
},
|
},
|
||||||
function (data, status) {
|
function (data, status) {
|
||||||
$("#module").html('');
|
$("#module").html('');
|
||||||
|
var option = $("<option></option>")
|
||||||
|
.attr ("value", "")
|
||||||
|
.html ("Any");
|
||||||
|
$("#selected_interfaces").append(option);
|
||||||
if (data) {
|
if (data) {
|
||||||
Object.values(data).forEach(function(obj) {
|
Object.values(data).forEach(function(obj) {
|
||||||
for (const [key, value] of Object.entries(obj.interfaces)) {
|
for (const [key, value] of Object.entries(obj.interfaces)) {
|
||||||
option = $("<option></option>")
|
option = $("<option></option>")
|
||||||
.attr ("value", value.status_module_id)
|
.attr ("value", value.status_module_id)
|
||||||
.html (key + ' (' + obj.agent_alias + ')');
|
.html ('(' + obj.agent_alias + ') ' + key);
|
||||||
$("#selected_interfaces").append(option);
|
$("#selected_interfaces").append(option);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -169,6 +169,8 @@ if (is_ajax()) {
|
||||||
},
|
},
|
||||||
[]
|
[]
|
||||||
);
|
);
|
||||||
|
} else {
|
||||||
|
echo json_encode([]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue