update 2026-09-26 17:00:06

This commit is contained in:
action committed 2026-09-26 17:00:06 +08:00
1 parent 97ae9f68da
commit bcc9ceb04a
4756 files changed
+1670713

No files matched your search

+29
View File
@@ -0,0 +1,29 @@
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 port = tonumber(uci:get_first("kai", "kai", "port")) or 8197
if port < 1 or port > 65535 or port % 1 ~= 0 then
port = 8197
end
local status = {
running = (sys.call("pidof kai_bin >/dev/null") == 0),
port = port
}
http.prepare_content("application/json")
http.write_json(status)
end