mirror of
https://github.com/itdoginfo/podkop.git
synced 2025-12-08 04:26:55 +03:00
feat: add section_id parameter to getNetworkInterfaces function
This commit is contained in:
@@ -41,10 +41,14 @@ function formatDiagnosticOutput(output) {
|
|||||||
.replace(/\r/g, '\n');
|
.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'];
|
const excludeInterfaces = ['br-lan', 'eth0', 'eth1', 'wan', 'phy0-ap0', 'phy1-ap0', 'pppoe-wan'];
|
||||||
|
|
||||||
return network.getDevices().then(devices => {
|
return network.getDevices().then(devices => {
|
||||||
|
// Reset the options by creating a new keylist
|
||||||
|
o.keylist = [];
|
||||||
|
o.vallist = [];
|
||||||
|
|
||||||
devices.forEach(device => {
|
devices.forEach(device => {
|
||||||
if (device.dev && device.dev.name) {
|
if (device.dev && device.dev.name) {
|
||||||
const deviceName = device.dev.name;
|
const deviceName = device.dev.name;
|
||||||
@@ -226,7 +230,7 @@ function createConfigSection(section, map, network) {
|
|||||||
o.depends('mode', 'vpn');
|
o.depends('mode', 'vpn');
|
||||||
o.ucisection = s.section;
|
o.ucisection = s.section;
|
||||||
o.load = function (section_id) {
|
o.load = function (section_id) {
|
||||||
return getNetworkInterfaces(this).then(() => {
|
return getNetworkInterfaces(this, section_id).then(() => {
|
||||||
return this.super('load', section_id);
|
return this.super('load', section_id);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user