mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-11-05 01:44:16 +08:00
🎁 Sync 2026-10-18 22:41:16
This commit is contained in:
1 parent
3eca35a513
commit
3159b4f938
88 files changed
+5597
-1051
No files matched your search
@@ -253,6 +253,7 @@ function get_redir_log()
|
||||
local path = api.TMP_PATH .. "/acl/" .. id
|
||||
|
||||
local function alert(msg)
|
||||
http.prepare_content("text/html; charset=utf-8")
|
||||
http.write(string.format("<script>alert('%s');window.close();</script>", i18n.translate(msg)))
|
||||
end
|
||||
|
||||
@@ -273,9 +274,8 @@ function get_redir_log()
|
||||
end
|
||||
|
||||
if fs.access(path .. "/" .. name .. ".log") then
|
||||
local content = luci.sys.exec("tail -n 5000 ".. path .. "/" .. name .. ".log")
|
||||
content = content:gsub("\n", "<br />")
|
||||
http.write(content)
|
||||
http.prepare_content("text/plain; charset=utf-8")
|
||||
http.write(luci.sys.exec("tail -n 5000 " .. util.shellquote(path)))
|
||||
else
|
||||
alert("Not enabled log")
|
||||
end
|
||||
@@ -285,10 +285,10 @@ function get_socks_log()
|
||||
local name = http.formvalue("name")
|
||||
local path = api.TMP_PATH .. "/" .. name .. ".log"
|
||||
if fs.access(path) then
|
||||
local content = luci.sys.exec("tail -n 5000 ".. path)
|
||||
content = content:gsub("\n", "<br />")
|
||||
http.write(content)
|
||||
http.prepare_content("text/plain; charset=utf-8")
|
||||
http.write(luci.sys.exec("tail -n 5000 " .. util.shellquote(path)))
|
||||
else
|
||||
http.prepare_content("text/html; charset=utf-8")
|
||||
http.write(string.format("<script>alert('%s');window.close();</script>", i18n.translate("Not enabled log")))
|
||||
end
|
||||
end
|
||||
@@ -308,21 +308,22 @@ function get_chinadns_log()
|
||||
end
|
||||
end
|
||||
if fs.access(path) then
|
||||
local content = luci.sys.exec("tail -n 5000 ".. path)
|
||||
content = content:gsub("\n", "<br />")
|
||||
http.write(content)
|
||||
http.prepare_content("text/plain; charset=utf-8")
|
||||
http.write(luci.sys.exec("tail -n 5000 " .. util.shellquote(path)))
|
||||
else
|
||||
http.prepare_content("text/html; charset=utf-8")
|
||||
http.write(string.format("<script>alert('%s');window.close();</script>", i18n.translate("Not enabled log")))
|
||||
end
|
||||
end
|
||||
|
||||
function get_smartdns_log()
|
||||
local path = api.TMP_PATH .. "/acl/default/smartdns.log"
|
||||
http.prepare_content("text/plain; charset=utf-8")
|
||||
if fs.access(path) then
|
||||
http.prepare_content("text/plain; charset=utf-8")
|
||||
http.write(luci.sys.exec("tail -n 5000 " .. util.shellquote(path)))
|
||||
else
|
||||
http.write(i18n.translate("Not enabled log"))
|
||||
http.prepare_content("text/html; charset=utf-8")
|
||||
http.write(string.format("<script>alert('%s');window.close();</script>", i18n.translate("Not enabled log")))
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in new issue
Block a user