mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-10-30 09:55:13 +08:00
🌴 Sync 2026-03-05 23:51:42
This commit is contained in:
1 parent
97c049ed0a
commit
0acff03804
14253 files changed
+3893239
No files matched your search
@@ -0,0 +1,25 @@
|
||||
local http = require "luci.http"
|
||||
|
||||
module("luci.controller.kai", package.seeall)
|
||||
|
||||
function index()
|
||||
if not nixio.fs.access("/etc/config/kai") then
|
||||
return
|
||||
end
|
||||
local page
|
||||
page = entry({"admin", "services","kai"}, cbi("kai"), _("KAI"), 100)
|
||||
page.dependent = true
|
||||
entry({"admin", "services", "kai_status"}, call("kai_status"))
|
||||
|
||||
end
|
||||
|
||||
function kai_status()
|
||||
local sys = require "luci.sys"
|
||||
local uci = require "luci.model.uci".cursor()
|
||||
local status = {
|
||||
running = (sys.call("pidof kai_bin >/dev/null") == 0),
|
||||
port = 8197
|
||||
}
|
||||
luci.http.prepare_content("application/json")
|
||||
luci.http.write_json(status)
|
||||
end
|
||||
Reference in new issue
Block a user