mirror of
https://github.com/itdoginfo/podkop.git
synced 2026-01-27 04:40:37 +03:00
feat: add selector proxy type support
This commit is contained in:
@@ -23,8 +23,9 @@ function createSectionContent(section) {
|
||||
_("Select how to configure the proxy"),
|
||||
);
|
||||
o.value("url", _("Connection URL"));
|
||||
o.value("outbound", _("Outbound Config"));
|
||||
o.value("selector", _("Selector"));
|
||||
o.value("urltest", _("URLTest"));
|
||||
o.value("outbound", _("Outbound Config"));
|
||||
o.default = "url";
|
||||
o.depends("connection_type", "proxy");
|
||||
|
||||
@@ -32,7 +33,7 @@ function createSectionContent(section) {
|
||||
form.TextValue,
|
||||
"proxy_string",
|
||||
_("Proxy Configuration URL"),
|
||||
"",
|
||||
_("vless://, ss://, trojan://, socks4/5://, hy2/hysteria2:// links")
|
||||
);
|
||||
o.depends("proxy_config_type", "url");
|
||||
o.rows = 5;
|
||||
@@ -42,7 +43,6 @@ function createSectionContent(section) {
|
||||
o.textarea = true;
|
||||
o.rmempty = false;
|
||||
o.sectionDescriptions = new Map();
|
||||
o.placeholder = "vless://uuid@server:port?type=tcp&security=tls#main";
|
||||
o.validate = function (section_id, value) {
|
||||
// Optional
|
||||
if (!value || value.length === 0) {
|
||||
@@ -81,13 +81,36 @@ function createSectionContent(section) {
|
||||
return validation.message;
|
||||
};
|
||||
|
||||
o = section.option(
|
||||
form.DynamicList,
|
||||
"selector_proxy_links",
|
||||
_("Selector Proxy Links"),
|
||||
_("vless://, ss://, trojan://, socks4/5://, hy2/hysteria2:// links")
|
||||
);
|
||||
o.depends("proxy_config_type", "selector");
|
||||
o.rmempty = false;
|
||||
o.validate = function (section_id, value) {
|
||||
// Optional
|
||||
if (!value || value.length === 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
const validation = main.validateProxyUrl(value);
|
||||
|
||||
if (validation.valid) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return validation.message;
|
||||
};
|
||||
|
||||
o = section.option(
|
||||
form.DynamicList,
|
||||
"urltest_proxy_links",
|
||||
_("URLTest Proxy Links"),
|
||||
_("vless://, ss://, trojan://, socks4/5://, hy2/hysteria2:// links")
|
||||
);
|
||||
o.depends("proxy_config_type", "urltest");
|
||||
o.placeholder = "vless://, ss://, trojan://, socks4/5://, hy2/hysteria2:// links";
|
||||
o.rmempty = false;
|
||||
o.validate = function (section_id, value) {
|
||||
// Optional
|
||||
|
||||
Reference in New Issue
Block a user