mirror of
https://github.com/caiwx86/small-packages.git
synced 2026-11-02 08:43:56 +08:00
update 2026-07-26 04:43:32
This commit is contained in:
1 parent
4007fe9cb7
commit
95b3db1274
3 files changed
+47
-2
No files matched your search
@@ -70,6 +70,7 @@ function index()
|
||||
entry({"admin", "services", appname, "get_now_use_node"}, call("get_now_use_node")).leaf = true
|
||||
entry({"admin", "services", appname, "get_redir_log"}, call("get_redir_log")).leaf = true
|
||||
entry({"admin", "services", appname, "get_socks_log"}, call("get_socks_log")).leaf = true
|
||||
entry({"admin", "services", appname, "get_acl_log"}, call("get_acl_log")).leaf = true
|
||||
entry({"admin", "services", appname, "get_log"}, call("get_log")).leaf = true
|
||||
entry({"admin", "services", appname, "clear_log"}, call("clear_log")).leaf = true
|
||||
entry({"admin", "services", appname, "index_status"}, call("index_status")).leaf = true
|
||||
@@ -266,6 +267,18 @@ function get_socks_log()
|
||||
end
|
||||
end
|
||||
|
||||
function get_acl_log()
|
||||
local id = http.formvalue("id")
|
||||
local path = "/tmp/log/passwall2_acl_" .. id .. ".log"
|
||||
if nixio.fs.access(path) then
|
||||
local content = luci.sys.exec("tail -n 5000 '" .. path .. "'")
|
||||
content = content:gsub("\n", "<br />")
|
||||
http.write(content)
|
||||
else
|
||||
http.write(string.format("<script>alert('%s');window.close();</script>", i18n.translate("Not enabled log")))
|
||||
end
|
||||
end
|
||||
|
||||
function get_log()
|
||||
-- luci.sys.exec("[ -f /tmp/log/passwall2.log ] && sed '1!G;h;$!d' /tmp/log/passwall2.log > /tmp/log/passwall2_show.log")
|
||||
http.write(luci.sys.exec("[ -f '/tmp/log/passwall2.log' ] && cat /tmp/log/passwall2.log"))
|
||||
|
||||
Reference in new issue
Block a user