1
0
mirror of https://github.com/kenzok8/small-package synced 2025-09-20 19:11:30 +08:00
Files
small-package/luci-app-bypass/luasrc/model/cbi/bypass/log.lua
github-actions[bot] f924d0bc26 update-03.08
2022-03-08 15:37:46 +08:00

21 lines
384 B
Lua

local fs=require "nixio.fs"
f=SimpleForm("logview")
f.reset=false
f.submit=false
t=f:field(TextValue,"conf")
t.rmempty=true
t.rows=20
function t.cfgvalue()
if nixio.fs.access("/var/log/bypass.log") then
local logs = luci.util.execi("cat /var/log/bypass.log")
local s = ""
for line in logs do
s = line .. "\n" .. s
end
return s
end
end
t.readonly = "readonly"
return f