mirror of
https://github.com/itdoginfo/podkop.git
synced 2025-12-06 03:26:51 +03:00
chore: remove comments support for proxy url
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -42,39 +42,20 @@ function createSectionContent(section) {
|
||||
o.textarea = true;
|
||||
o.rmempty = false;
|
||||
o.sectionDescriptions = new Map();
|
||||
o.placeholder =
|
||||
"vless://uuid@server:port?type=tcp&security=tls#main\n// backup ss://method:pass@server:port\n// backup2 vless://uuid@server:port?type=grpc&security=reality#alt\n// backup3 trojan://04agAQapcl@127.0.0.1:33641?type=tcp&security=none#trojan-tcp-none \n// socks5://127.0.0.1:1080";
|
||||
o.placeholder = "vless://uuid@server:port?type=tcp&security=tls#main";
|
||||
o.validate = function (section_id, value) {
|
||||
// Optional
|
||||
if (!value || value.length === 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
try {
|
||||
const activeConfigs = main.splitProxyString(value);
|
||||
const validation = main.validateProxyUrl(value);
|
||||
|
||||
if (!activeConfigs.length) {
|
||||
return _(
|
||||
"No active configuration found. One configuration is required.",
|
||||
);
|
||||
}
|
||||
|
||||
if (activeConfigs.length > 1) {
|
||||
return _(
|
||||
"Multiply active configurations found. Please leave one configuration.",
|
||||
);
|
||||
}
|
||||
|
||||
const validation = main.validateProxyUrl(activeConfigs[0]);
|
||||
|
||||
if (validation.valid) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return validation.message;
|
||||
} catch (e) {
|
||||
return `${_("Invalid URL format:")} ${e?.message}`;
|
||||
if (validation.valid) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return validation.message;
|
||||
};
|
||||
|
||||
o = section.option(
|
||||
|
||||
@@ -83,6 +83,43 @@ function createSettingsContent(section) {
|
||||
return true;
|
||||
};
|
||||
|
||||
o = section.option(
|
||||
widgets.DeviceSelect,
|
||||
"source_network_interfaces",
|
||||
_("Source Network Interface"),
|
||||
_("Select the network interface from which the traffic will originate"),
|
||||
);
|
||||
o.default = "br-lan";
|
||||
o.noaliases = true;
|
||||
o.nobridges = false;
|
||||
o.noinactive = false;
|
||||
o.multiple = true;
|
||||
o.filter = function (section_id, value) {
|
||||
// Block specific interface names from being selectable
|
||||
const blocked = ["wan", "phy0-ap0", "phy1-ap0", "pppoe-wan"];
|
||||
if (blocked.includes(value)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Try to find the device object by its name
|
||||
const device = this.devices.find((dev) => dev.getName() === value);
|
||||
|
||||
// If no device is found, allow the value
|
||||
if (!device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Check the type of the device
|
||||
const type = device.getType();
|
||||
|
||||
// Consider any Wi-Fi / wireless / wlan device as invalid
|
||||
const isWireless =
|
||||
type === "wifi" || type === "wireless" || type.includes("wlan");
|
||||
|
||||
// Allow only non-wireless devices
|
||||
return !isWireless;
|
||||
};
|
||||
|
||||
o = section.option(
|
||||
form.Flag,
|
||||
"enable_output_network_interface",
|
||||
@@ -139,43 +176,6 @@ function createSettingsContent(section) {
|
||||
return !isWireless;
|
||||
};
|
||||
|
||||
o = section.option(
|
||||
widgets.DeviceSelect,
|
||||
"source_network_interfaces",
|
||||
_("Source Network Interface"),
|
||||
_("Select the network interface from which the traffic will originate"),
|
||||
);
|
||||
o.default = "br-lan";
|
||||
o.noaliases = true;
|
||||
o.nobridges = false;
|
||||
o.noinactive = false;
|
||||
o.multiple = true;
|
||||
o.filter = function (section_id, value) {
|
||||
// Block specific interface names from being selectable
|
||||
const blocked = ["wan", "phy0-ap0", "phy1-ap0", "pppoe-wan"];
|
||||
if (blocked.includes(value)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Try to find the device object by its name
|
||||
const device = this.devices.find((dev) => dev.getName() === value);
|
||||
|
||||
// If no device is found, allow the value
|
||||
if (!device) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Check the type of the device
|
||||
const type = device.getType();
|
||||
|
||||
// Consider any Wi-Fi / wireless / wlan device as invalid
|
||||
const isWireless =
|
||||
type === "wifi" || type === "wireless" || type.includes("wlan");
|
||||
|
||||
// Allow only non-wireless devices
|
||||
return !isWireless;
|
||||
};
|
||||
|
||||
o = section.option(
|
||||
form.Flag,
|
||||
"enable_badwan_interface_monitoring",
|
||||
|
||||
Reference in New Issue
Block a user