small-package/luci-app-filebrowser/luasrc/controller/filebrowser.lua

23 lines
649 B
Lua
Raw Normal View History

2023-03-10 23:57:34 +08:00
module("luci.controller.filebrowser", package.seeall)
function index()
if not nixio.fs.access("/etc/config/filebrowser") then
return
end
entry({"admin", "nas"}, firstchild(), _("NAS"), 45).dependent = false
local page = entry({"admin", "nas", "filebrowser"}, cbi("filebrowser"), _("文件管理器"), 100)
page.dependent = true
page.acl_depends = { "luci-app-filebrowser" }
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