feat: add support for outbound JSON configuration in sing-box

This commit is contained in:
Ivan K
2025-02-22 14:15:27 +03:00
parent 615928db4e
commit d8d8d79d68
2 changed files with 29 additions and 49 deletions

View File

@@ -53,23 +53,6 @@ function getNetworkInterfaces(o) {
});
}
function getNetworkInterfaces(o) {
const excludeInterfaces = ['br-lan', 'eth0', 'eth1', 'wan', 'phy0-ap0', 'phy1-ap0', 'pppoe-wan'];
return network.getDevices().then(devices => {
devices.forEach(device => {
if (device.dev && device.dev.name) {
const deviceName = device.dev.name;
if (!excludeInterfaces.includes(deviceName) && !/^lan\d+$/.test(deviceName)) {
o.value(deviceName, deviceName);
}
}
});
}).catch(error => {
console.error('Failed to get network devices:', error);
});
}
// Общая функция для создания конфигурационных секций
function createConfigSection(section, map, network) {
const s = section;
@@ -226,7 +209,6 @@ function createConfigSection(section, map, network) {
o.depends('mode', 'vpn');
o.ucisection = s.section;
getNetworkInterfaces(o);
getNetworkInterfaces(o);
o = s.taboption('basic', form.Flag, 'domain_list_enabled', _('Community Lists'));
o.default = '0';