style:format

This commit is contained in:
dichgrem
2025-10-20 15:51:17 +08:00
parent 69ff02fdbb
commit c056ca8a4b

View File

@@ -7,17 +7,17 @@ function index()
end
-- Menu
entry({"admin", "network", "zzz"}, cbi("zzz"), "ZZZ", 60).dependent = false
entry({ "admin", "network", "zzz" }, cbi("zzz"), "ZZZ", 60).dependent = false
-- Settings
entry({"admin", "network", "zzz", "service_control"}, call("service_control")).leaf = true
entry({ "admin", "network", "zzz", "service_control" }, call("service_control")).leaf = true
-- Status API
entry({"admin", "network", "zzz", "get_status"}, call("act_status")).leaf = true
entry({ "admin", "network", "zzz", "get_status" }, call("act_status")).leaf = true
end
function service_control()
local sys = require "luci.sys"
local sys = require("luci.sys")
local action = luci.http.formvalue("action")
local result = { success = false, message = "" }
@@ -48,8 +48,8 @@ function service_control()
end
function act_status()
local sys = require "luci.sys"
local util = require "luci.util"
local sys = require("luci.sys")
local util = require("luci.util")
local status = {}
-- Get status
@@ -59,7 +59,6 @@ function act_status()
if status.running then
status.process_info = util.trim(sys.exec("ps | grep -v grep | grep zzz"))
end
-- Get log
local log_file = "/tmp/zzz.log"
if nixio.fs.access(log_file) then