Update 'luasrc/model/cbi/easymesh.lua'

pull/1/head
ben 12 months ago
parent f3d20d8afe
commit d9ca24ca70

@ -5,8 +5,8 @@ local sys = require "luci.sys"
local uci = require "luci.model.uci".cursor() local uci = require "luci.model.uci".cursor()
m = Map("easymesh", m = Map("easymesh",
translate("PrivateRouter Easy Mesh"), translate("Easy Mesh WiFi Setup"),
translate("Powered by Batman-adv (Better Approach To Mobile Adhoc Networking - Advanced). First setup your Mesh Server then setup the nodes. When configuring a Mesh Node, initially activate your mesh WiFi on the radio device and establish a connection. Subsequently, enable it as a DHCP node. The default settings are typically adequate for most Internet Access Gateway Mesh configurations.") translate("Powered by Batman-adv (Better Approach To Mobile Adhoc Networking - Advanced). First setup your Mesh Gateway Server then setup the nodes. When configuring a Mesh Node, first activate your mesh WiFi on the radio device and establish a connection. Then enable it as a DHCP node. The default settings are typically adequate for most Mesh WiFi configurations.")
.. "<br/>" .. translate("Official website:") .. ' <a href="https://www.open-mesh.org/projects/batman-adv/wiki" target="_blank">https://www.open-mesh.org/projects/batman-adv/wiki</a>' .. "<br/>" .. translate("Official website:") .. ' <a href="https://www.open-mesh.org/projects/batman-adv/wiki" target="_blank">https://www.open-mesh.org/projects/batman-adv/wiki</a>'
) )
@ -43,7 +43,7 @@ v:option(DummyValue, "Neighbor", translate("Neighbor"))
v:option(DummyValue, "lastseen", translate("lastseen")) v:option(DummyValue, "lastseen", translate("lastseen"))
-- Basic -- Basic
s = m:section(TypedSection, "easymesh", translate("Settings"), translate("General Settings")) s = m:section(TypedSection, "easymesh", translate("Mesh Gateway & Node Settings"), translate("Choose Mesh Gateway or Mesh Node WiFi Settings"))
s.anonymous = true s.anonymous = true
---- Eanble ---- Eanble
@ -58,8 +58,8 @@ function o.write(self, section, value)
end end
o = s:option(ListValue, "role", translate("role")) o = s:option(ListValue, "role", translate("Mesh Device Type"))
o:value("off", translate("off")) o:value("off", translate("Mesh Node"))
o:value("server", translate("Mesh Server")) o:value("server", translate("Mesh Server"))
o:value("client", translate("Mesh Client")) o:value("client", translate("Mesh Client"))
o.rmempty = false o.rmempty = false
@ -111,8 +111,12 @@ o:depends("kvr", 1)
--enable.default = 0 --enable.default = 0
--enable.rmempty = false --enable.rmempty = false
-- NodeMode
s = m:section(TypedSection, "easymesh", translate("Enable Router as Mesh Node"), translate("Add Mesh WiFi on Gateway and Node first. Mesh Node will use your gateway for DHCP. "))
s.anonymous = true
---- ap_mode ---- ap_mode
enable = s:option(Flag, "ap_mode", translate("Enable as DHCP Mesh Node"), translate("Enable DHCP node. Connect to mesh gateway WiFi before enabling.")) enable = s:option(Flag, "ap_mode", translate("Enable as DHCP Mesh Node"), translate("Important: Connect to your mesh gateway WiFi before enabling."))
enable.default = 0 enable.default = 0
enable.rmempty = false enable.rmempty = false
@ -132,6 +136,22 @@ o.default = "node1"
o.datatype = "string" o.datatype = "string"
o:depends("ap_mode", 1) o:depends("ap_mode", 1)
-- MESH Node Control: Start/Stop DHCP MESH Node
ctrl = m:section(TypedSection, "easymesh", "Node Control: Start/Stop Mesh Node")
ctrl.anonymous = true
ctrl.addremove = false
btnStop = ctrl:option(Button, "_btn_start", translate("Enable Mesh Node"))
function btnStop.write()
io.popen("/etc/init.d/easymesh start")
end
btnStart = ctrl:option(Button, "_btn_stop", translate("Disable Mesh Node"))
function btnStart.write()
io.popen("/etc/init.d/easymesh stop")
end
---- o = s:option(Value, "dns", translate("Mesh IPv4 DNS")) ---- o = s:option(Value, "dns", translate("Mesh IPv4 DNS"))
--o.default = "192.168.8.1" --o.default = "192.168.8.1"
--o.datatype = "ip4addr" --o.datatype = "ip4addr"

Loading…
Cancel
Save