mirror of
https://github.com/caiwx86/small-packages.git
synced 2026-07-27 08:31:44 +08:00
update 2026-05-22 01:53:55
This commit is contained in:
parent
cafaac05d2
commit
533dbc85c9
@ -1423,11 +1423,12 @@ function act_reset()
|
||||
end
|
||||
|
||||
function act_restart()
|
||||
luci.sys.call("/etc/init.d/shadowsocksr restart > /dev/null 2>&1 &")
|
||||
luci.http.redirect(luci.dispatcher.build_url("admin", "services", "shadowsocksr"))
|
||||
end
|
||||
|
||||
function act_delete()
|
||||
luci.sys.call("/etc/init.d/shadowsocksr restart &")
|
||||
luci.sys.call("/etc/init.d/shadowsocksr restart > /dev/null 2>&1 &")
|
||||
luci.http.redirect(luci.dispatcher.build_url("admin", "services", "shadowsocksr", "servers"))
|
||||
end
|
||||
|
||||
|
||||
@ -50,6 +50,7 @@ luci.http.setfilehandler(function(meta, chunk, eof)
|
||||
luci.sys.call("rm -rf " .. temp_dir)
|
||||
nixio.fs.remove(file_path)
|
||||
fd = nixio.open(file_path, "w")
|
||||
luci.sys.call("ls /tmp/sub_md5_* >/dev/null 2>&1 && rm -f /tmp/sub_md5_*")
|
||||
luci.sys.call("echo '' > /var/log/ssrplus.log")
|
||||
end
|
||||
|
||||
@ -96,6 +97,7 @@ luci.http.setfilehandler(function(meta, chunk, eof)
|
||||
-- 清理临时文件
|
||||
luci.sys.call("rm -rf " .. temp_dir)
|
||||
nixio.fs.remove(file_path)
|
||||
luci.sys.call("ls /tmp/sub_md5_* >/dev/null 2>&1 && rm -f /tmp/sub_md5_*")
|
||||
end
|
||||
end)
|
||||
|
||||
|
||||
@ -719,9 +719,9 @@ node.render = function(self, section, scope)
|
||||
Button.render(self, section, scope)
|
||||
end
|
||||
node.write = function(self, section)
|
||||
uci:set("shadowsocksr", '@global[0]', 'global_server', section)
|
||||
uci:save("shadowsocksr")
|
||||
uci:commit("shadowsocksr")
|
||||
local safe_section = luci.util.shellquote(section)
|
||||
local cmd = string.format("uci set shadowsocksr.@global[0].global_server=%s && uci commit shadowsocksr", safe_section)
|
||||
luci.sys.call(cmd)
|
||||
luci.http.redirect(luci.dispatcher.build_url("admin", "services", "shadowsocksr", "restart"))
|
||||
end
|
||||
|
||||
|
||||
@ -534,7 +534,14 @@ function import_ssr_url(btn, urlname, sid) {
|
||||
return false;
|
||||
}
|
||||
|
||||
let finalSSBackend = preferredSSBackend();
|
||||
let finalSSBackend;
|
||||
const finalXray = (params.security && params.security !== "none") || // TLS/XTLS/Reality
|
||||
(params.type && ["ws", "httpupgrade", "xhttp", "splithttp", "grpc", "quic", "kcp", "http", "h2"].includes(params.type));
|
||||
if (finalXray && has_xray === "true") {
|
||||
finalSSBackend = "v2ray";
|
||||
} else {
|
||||
finalSSBackend = preferredSSBackend();
|
||||
}
|
||||
if (finalSSBackend === null) {
|
||||
s.innerHTML = "<font style=\'color:red\'><%:No available core (Shadowsocks or Xray) to import this node.%></font>";
|
||||
return false;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user