immortalwrt/package/ctcgfw/luci-app-filebrowser/luasrc/controller/filebrowser.lua

20 lines
613 B
Lua
Raw Normal View History

module("luci.controller.filebrowser", package.seeall)
function index()
if not nixio.fs.access("/etc/config/filebrowser") then
return
end
2020-03-25 16:46:20 +08:00
entry({"admin", "nas"}, firstchild(), _("NAS") , 45).dependent = false
local page
2020-02-03 19:47:26 +08:00
page = entry({"admin", "nas", "filebrowser"}, cbi("filebrowser"), _("文件管理器"), 100)
page.dependent = true
2020-03-08 16:21:32 +08:00
entry({"admin","nas","filebrowser","status"},call("act_status")).leaf=true
end
function act_status()
local e={}
e.running=luci.sys.call("pgrep filebrowser >/dev/null")==0
luci.http.prepare_content("application/json")
luci.http.write_json(e)
end