diff --git a/LuCI/controller/cronosagent.lua b/LuCI/controller/cronosagent.lua index 52b4f00..830fed0 100644 --- a/LuCI/controller/cronosagent.lua +++ b/LuCI/controller/cronosagent.lua @@ -1,12 +1,14 @@ -module("cronosagent", package.seeall) +module("luci.controller.cronosagent", package.seeall) function index() entry({ "admin", "cronosagent" }, alias("admin", "cronosagent", "configure", "restart"), "CronosAgent") - entry({ "admin", "cronosagent", "configure" }, cbi("cronosagent"), "Configure", 10) + entry({ "admin", "cronosagent", "configure" }, cbi("cronosagent/configure"), "Configure", 10) entry({ "admin", "cronosagent", "restart" }, call("restartCronosAgent"), "Restart", 20) end function restartCronosAgent() luci.sys.init.stop("cronosagent") luci.sys.init.start("cronosagent") + luci.http.write("Done!") + -- luci.http.redirect("/") end diff --git a/LuCI/cronosagent b/LuCI/cronosagent new file mode 100644 index 0000000..0a838ee --- /dev/null +++ b/LuCI/cronosagent @@ -0,0 +1,5 @@ +config cronosagent + option number '123456' + option repeaterAddress '1.1.1.1' + option serverAddress 'master.dstar.su' + option serverPassword 'password' diff --git a/LuCI/model/cbi/cronosagent.lua b/LuCI/model/cbi/cronosagent/configure.lua similarity index 88% rename from LuCI/model/cbi/cronosagent.lua rename to LuCI/model/cbi/cronosagent/configure.lua index ee8e1e1..7d33e4d 100644 --- a/LuCI/model/cbi/cronosagent.lua +++ b/LuCI/model/cbi/cronosagent/configure.lua @@ -1,6 +1,6 @@ local map = Map("cronosagent", "CronosAgent") -local section = map:section(TypedSection, "global", "", "Configuration") +local section = map:section(TypedSection, "cronosagent", "Configuration") local number = section:option(Value, "number", "Repeater ID", "DMR ID assigned to your repeater" ) local repeater = section:option(Value, "repeaterAddress", "Repeater Address", "Address of your KAIROS repeater" ) @@ -13,3 +13,5 @@ repeater.datatype = "ip4addr" server.datatype = "host" password.datatype = "string" password.password = true + +return map \ No newline at end of file diff --git a/LuCI/readme.txt b/LuCI/readme.txt new file mode 100644 index 0000000..a57b8f9 --- /dev/null +++ b/LuCI/readme.txt @@ -0,0 +1,3 @@ +/usr/lib/lua/luci/controller/cronosagent.lua +/usr/lib/lua/luci/model/cbi/cronosagent/configure.lua +/etc/config/cronosagent