45 lines
1.2 KiB
Lua
45 lines
1.2 KiB
Lua
modules = {"panel","app","locale"};
|
|
|
|
---------------- Application module app configuration ---------------
|
|
|
|
app = {}
|
|
require "app"
|
|
|
|
function app.apply()
|
|
print(
|
|
"<br><b><center>Apply module app !</center></b><br>"..
|
|
"<center>Damit die Änderungen wirksam werden, musste die Anwendung neu gestartet werden !</center><br>"
|
|
);
|
|
os.execute("/root/ctrlapp stop")
|
|
os.execute("sleep 2")
|
|
os.execute("/root/ctrlapp start")
|
|
end
|
|
|
|
function app.validate()
|
|
print("<br><b><center>Validate modlue app !</center></b><br>");
|
|
end
|
|
|
|
---------------- Witty Administration localisation ------------------
|
|
|
|
locale = {}
|
|
require "locale";
|
|
|
|
---------------- Witty Administration Tabs configuration ------------
|
|
|
|
tabs = {}
|
|
require "tabs";
|
|
|
|
panel = {};
|
|
require "panel"
|
|
|
|
function panel.apply()
|
|
local mqttBroker = app.mqttBroker[1]
|
|
local mqttRoot = app.mqttRoot[1]
|
|
print(
|
|
"<br><b><center>Apply module panel !</center></b><br>"..
|
|
"<center>Damit die Änderungen wirksam werden, wird die Konfiguration via MQTT publiziert !</center><br>"
|
|
);
|
|
os.execute("mosquitto_pub -h "..mqttBroker.. " -t "..mqttRoot.."/ctrl/cmd/panel/config -m apply")
|
|
os.execute("sleep 2")
|
|
os.execute("mosquitto_pub -h "..mqttBroker.. " -t "..mqttRoot.."/ctrl/cmd/panel/config -m publish")
|
|
end |