mirror of
https://github.com/kenzok8/small-package
synced 2025-01-09 04:37:59 +08:00
update 2024-03-04 03:46:45
This commit is contained in:
parent
0ded4909e5
commit
c69a2d3401
@ -6,7 +6,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=luci-app-passwall
|
||||
PKG_VERSION:=4.75-3
|
||||
PKG_VERSION:=4.75-4
|
||||
PKG_RELEASE:=
|
||||
|
||||
PKG_CONFIG_DEPENDS:= \
|
||||
|
@ -141,17 +141,17 @@ sources.validate = function(self, value, t)
|
||||
end
|
||||
sources.write = dynamicList_write
|
||||
|
||||
local TCP_NODE = uci:get(appname, "@global[0]", "tcp_node")
|
||||
--local TCP_NODE = uci:get(appname, "@global[0]", "tcp_node")
|
||||
tcp_node = s:option(ListValue, "tcp_node", "<a style='color: red'>" .. translate("TCP Node") .. "</a>")
|
||||
tcp_node.default = "default"
|
||||
tcp_node.default = "nil"
|
||||
tcp_node:value("nil", translate("Close"))
|
||||
tcp_node:value("default", translate("Use global config") .. "(" .. TCP_NODE .. ")")
|
||||
--tcp_node:value("default", translate("Use global config") .. "(" .. TCP_NODE .. ")")
|
||||
|
||||
local UDP_NODE = uci:get(appname, "@global[0]", "udp_node")
|
||||
--local UDP_NODE = uci:get(appname, "@global[0]", "udp_node")
|
||||
udp_node = s:option(ListValue, "udp_node", "<a style='color: red'>" .. translate("UDP Node") .. "</a>")
|
||||
udp_node.default = "default"
|
||||
udp_node.default = "nil"
|
||||
udp_node:value("nil", translate("Close"))
|
||||
udp_node:value("default", translate("Use global config") .. "(" .. UDP_NODE .. ")")
|
||||
--udp_node:value("default", translate("Use global config") .. "(" .. UDP_NODE .. ")")
|
||||
udp_node:value("tcp", translate("Same as the tcp node"))
|
||||
|
||||
for k, v in pairs(nodes_table) do
|
||||
@ -258,6 +258,9 @@ o:value("disable", translate("No Proxy"))
|
||||
o:value("proxy", translate("Proxy"))
|
||||
o:depends({ udp_node = "nil", ['!reverse'] = true })
|
||||
|
||||
o = s:option(DummyValue, "", " ")
|
||||
o.template = appname .. "/global/proxy"
|
||||
|
||||
o = s:option(Flag, "filter_proxy_ipv6", translate("Filter Proxy Host IPv6"), translate("Experimental feature."))
|
||||
o.default = "0"
|
||||
o:depends({ tcp_node = "nil", ['!reverse'] = true })
|
||||
@ -388,8 +391,10 @@ o.description = translate("The default DNS used when not in the domain name rule
|
||||
.. "<li>" .. translate("Remote DNS can avoid more DNS leaks, but some domestic domain names maybe to proxy!") .. "</li>"
|
||||
.. "<li>" .. translate("Direct DNS Internet experience may be better, but DNS will be leaked!") .. "</li>"
|
||||
.. "</ul>"
|
||||
local _depends = {tcp_proxy_mode = "proxy"}
|
||||
if api.is_finded("chinadns-ng") then
|
||||
o:depends("chinadns_ng", false)
|
||||
_depends["chinadns_ng"] = false
|
||||
end
|
||||
o:depends(_depends)
|
||||
|
||||
return m
|
||||
|
@ -458,6 +458,9 @@ localhost_udp_proxy_mode:value("disable", translate("No Proxy"))
|
||||
localhost_udp_proxy_mode:value("proxy", translate("Proxy"))
|
||||
localhost_udp_proxy_mode.default = "default"
|
||||
|
||||
o = s:taboption("Proxy", DummyValue, "", " ")
|
||||
o.template = appname .. "/global/proxy"
|
||||
|
||||
tips = s:taboption("Proxy", DummyValue, "tips", " ")
|
||||
tips.rawhtml = true
|
||||
tips.cfgvalue = function(t, n)
|
||||
|
108
luci-app-passwall/luasrc/view/passwall/global/proxy.htm
Normal file
108
luci-app-passwall/luasrc/view/passwall/global/proxy.htm
Normal file
@ -0,0 +1,108 @@
|
||||
<div class="cbi-value">
|
||||
<label class="cbi-value-title">
|
||||
<%:Switch Mode%>
|
||||
</label>
|
||||
<div class="cbi-value-field">
|
||||
<div>
|
||||
<input class="btn cbi-button cbi-button-apply" type="button" onclick="switch_gfw_mode()" value="<%:GFW List%>" />
|
||||
<input class="btn cbi-button cbi-button-apply" type="button" onclick="switch_chnroute_mode()" value="<%:Not China List%>" />
|
||||
<input class="btn cbi-button cbi-button-apply" type="button" onclick="switch_returnhome_mode()" value="<%:China List%>" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var opt = {
|
||||
base: 'cbid.passwall.<%=self.cfgid or section%>',
|
||||
client: true,
|
||||
get: function (opt) {
|
||||
var obj;
|
||||
var id = this.base + '.' + opt;
|
||||
obj = document.getElementsByName(id)[0] || document.getElementById(id);
|
||||
if (obj) {
|
||||
var combobox = document.getElementById('cbi.combobox.' + id);
|
||||
if (combobox) {
|
||||
obj.combobox = combobox;
|
||||
}
|
||||
var div = document.getElementById(id);
|
||||
if (div && div.getElementsByTagName("li").length > 0) {
|
||||
obj = div;
|
||||
}
|
||||
return obj;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
},
|
||||
set: function (opt, val) {
|
||||
var obj;
|
||||
obj = this.get(opt);
|
||||
if (obj) {
|
||||
var event = document.createEvent("HTMLEvents");
|
||||
event.initEvent("change", true, true);
|
||||
if (obj.type === 'checkbox') {
|
||||
obj.checked = val;
|
||||
} else {
|
||||
obj.value = val;
|
||||
if (obj.combobox) {
|
||||
obj.combobox.value = val;
|
||||
}
|
||||
|
||||
var list = obj.getElementsByTagName("li");
|
||||
if (list.length > 0) {
|
||||
for (var i = 0; i < list.length; i++) {
|
||||
var li = list[i];
|
||||
var data = li.getAttribute("data-value");
|
||||
li.removeAttribute("selected");
|
||||
li.removeAttribute("display");
|
||||
if (data && data == val) {
|
||||
li.setAttribute("selected", true);
|
||||
li.setAttribute("display", "0");
|
||||
}
|
||||
}
|
||||
var input = document.getElementsByName(obj.id)[0];
|
||||
if (input) {
|
||||
input.value = val;
|
||||
} else {
|
||||
var input = document.createElement("input");
|
||||
input.setAttribute("type", "hidden");
|
||||
input.setAttribute("name", obj.id);
|
||||
input.setAttribute("value", val);
|
||||
obj.appendChild(input);
|
||||
}
|
||||
}
|
||||
}
|
||||
try {
|
||||
obj.dispatchEvent(event);
|
||||
} catch (err) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function switch_gfw_mode() {
|
||||
opt.set("use_gfw_list", true);
|
||||
opt.set("chn_list", "0");
|
||||
opt.set("tcp_proxy_mode", "disable");
|
||||
opt.set("udp_proxy_mode", "disable");
|
||||
opt.set("localhost_tcp_proxy_mode", "default");
|
||||
opt.set("localhost_udp_proxy_mode", "default");
|
||||
}
|
||||
|
||||
function switch_chnroute_mode() {
|
||||
opt.set("use_gfw_list", true);
|
||||
opt.set("chn_list", "direct");
|
||||
opt.set("tcp_proxy_mode", "proxy");
|
||||
opt.set("udp_proxy_mode", "proxy");
|
||||
opt.set("localhost_tcp_proxy_mode", "default");
|
||||
opt.set("localhost_udp_proxy_mode", "default");
|
||||
}
|
||||
|
||||
function switch_returnhome_mode() {
|
||||
opt.set("use_gfw_list", false);
|
||||
opt.set("chn_list", "proxy");
|
||||
opt.set("tcp_proxy_mode", "disable");
|
||||
opt.set("udp_proxy_mode", "disable");
|
||||
opt.set("localhost_tcp_proxy_mode", "default");
|
||||
opt.set("localhost_udp_proxy_mode", "default");
|
||||
}
|
||||
</script>
|
@ -277,9 +277,6 @@ msgstr "GFW列表"
|
||||
msgid "Not China List"
|
||||
msgstr "中国列表以外"
|
||||
|
||||
msgid "Game Mode"
|
||||
msgstr "游戏模式"
|
||||
|
||||
msgid "China List"
|
||||
msgstr "中国列表"
|
||||
|
||||
@ -292,12 +289,12 @@ msgstr "路由器本机"
|
||||
msgid "Same as the %s default proxy mode"
|
||||
msgstr "与 %s 默认代理模式相同"
|
||||
|
||||
msgid "Switch Mode"
|
||||
msgstr "切换模式"
|
||||
|
||||
msgid "Want different devices to use different proxy modes/ports/nodes? Please use access control."
|
||||
msgstr "希望不同设备使用不同的代理模式/端口/节点?请使用访问控制。"
|
||||
|
||||
msgid "China list or gfwlist cannot be used together with outside China list!"
|
||||
msgstr "中国列表不能和中国列表外或防火墙表一起使用!"
|
||||
|
||||
msgid "Operation"
|
||||
msgstr "操作"
|
||||
|
||||
|
@ -799,17 +799,13 @@ run_redir() {
|
||||
_args="${_args} udp_redir_port=${UDP_REDIR_PORT}"
|
||||
config_file=$(echo $config_file | sed "s/TCP/TCP_UDP/g")
|
||||
}
|
||||
local v2ray_dns_mode=$(config_t_get global v2ray_dns_mode tcp)
|
||||
[ "${DNS_MODE}" != "sing-box" ] && [ "${DNS_MODE}" != "udp" ] && {
|
||||
DNS_MODE="sing-box"
|
||||
v2ray_dns_mode="tcp"
|
||||
}
|
||||
[ "${DNS_MODE}" = "sing-box" ] && {
|
||||
resolve_dns=1
|
||||
config_file=$(echo $config_file | sed "s/.json/_DNS.json/g")
|
||||
_args="${_args} remote_dns_query_strategy=${DNS_QUERY_STRATEGY}"
|
||||
FILTER_PROXY_IPV6=0
|
||||
[ "${DNS_CACHE}" == "0" ] && _args="${_args} dns_cache=0"
|
||||
local v2ray_dns_mode=$(config_t_get global v2ray_dns_mode tcp)
|
||||
_args="${_args} remote_dns_protocol=${v2ray_dns_mode}"
|
||||
_args="${_args} dns_listen_port=${dns_listen_port}"
|
||||
local logout=""
|
||||
@ -854,11 +850,6 @@ run_redir() {
|
||||
_args="${_args} udp_redir_port=${UDP_REDIR_PORT}"
|
||||
config_file=$(echo $config_file | sed "s/TCP/TCP_UDP/g")
|
||||
}
|
||||
local v2ray_dns_mode=$(config_t_get global v2ray_dns_mode tcp)
|
||||
[ "${DNS_MODE}" != "xray" ] && [ "${DNS_MODE}" != "udp" ] && {
|
||||
DNS_MODE="xray"
|
||||
v2ray_dns_mode="tcp"
|
||||
}
|
||||
[ "${DNS_MODE}" = "xray" ] && {
|
||||
resolve_dns=1
|
||||
config_file=$(echo $config_file | sed "s/.json/_DNS.json/g")
|
||||
@ -869,6 +860,7 @@ run_redir() {
|
||||
[ "${DNS_CACHE}" == "0" ] && _args="${_args} dns_cache=0"
|
||||
_args="${_args} dns_listen_port=${dns_listen_port}"
|
||||
_args="${_args} remote_dns_tcp_server=${REMOTE_DNS}"
|
||||
local v2ray_dns_mode=$(config_t_get global v2ray_dns_mode tcp)
|
||||
[ "$v2ray_dns_mode" = "tcp+doh" ] && {
|
||||
remote_dns_doh=$(config_t_get global remote_dns_doh "https://1.1.1.1/dns-query")
|
||||
_args="${_args} remote_dns_doh=${remote_dns_doh}"
|
||||
|
Loading…
Reference in New Issue
Block a user