feat: add section_id parameter to getNetworkInterfaces function

This commit is contained in:
Ivan K
2025-02-24 17:39:56 +03:00
parent 99ccd9fbb3
commit 76b5ceae5c

View File

@@ -41,10 +41,14 @@ function formatDiagnosticOutput(output) {
.replace(/\r/g, '\n');
}
function getNetworkInterfaces(o) {
function getNetworkInterfaces(o, section_id) {
const excludeInterfaces = ['br-lan', 'eth0', 'eth1', 'wan', 'phy0-ap0', 'phy1-ap0', 'pppoe-wan'];
return network.getDevices().then(devices => {
// Reset the options by creating a new keylist
o.keylist = [];
o.vallist = [];
devices.forEach(device => {
if (device.dev && device.dev.name) {
const deviceName = device.dev.name;
@@ -226,7 +230,7 @@ function createConfigSection(section, map, network) {
o.depends('mode', 'vpn');
o.ucisection = s.section;
o.load = function (section_id) {
return getNetworkInterfaces(this).then(() => {
return getNetworkInterfaces(this, section_id).then(() => {
return this.super('load', section_id);
});
};
@@ -1047,4 +1051,4 @@ return view.extend({
return map_promise;
}
});
});