mirror of
https://github.com/itdoginfo/podkop.git
synced 2026-02-01 15:20:55 +03:00
chore: remove comments support for proxy url
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user