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

pull/1/head
ben 1 year ago
parent eb8fc3b185
commit 539d28fb23

@ -6,7 +6,7 @@ local uci = require "luci.model.uci".cursor()
m = Map("easymesh", m = Map("easymesh",
translate("PrivateRouter Easy Mesh"), translate("PrivateRouter Easy Mesh"),
translate("Batman-adv (Better Approach To Mobile Adhoc Networking - Advanced) is a protocol used for wireless mesh networking, allowing for the creation of a robust, decentralized, and scalable network that can be leveraged by apps to facilitate seamless communication between devices in environments where a traditional network infrastructure may be unfeasible.") translate("Powered by Batman-adv (Better Approach To Mobile Adhoc Networking - Advanced) 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.")
.. "<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>'
) )
@ -47,12 +47,13 @@ s = m:section(TypedSection, "easymesh", translate("Settings"), translate("Genera
s.anonymous = true s.anonymous = true
---- Eanble ---- Eanble
o = s:option(Flag, "enabled", translate("Enable"), translate("Enable or disable EASY MESH")) o = s:option(Flag, "enabled", translate("Enable"), translate("Enable or disable Easy Mesh"))
o.default = 0 o.default = 0
o.rmempty = false o.rmempty = false
function o.write(self, section, value) function o.write(self, section, value)
Flag.write(self, section, value) Flag.write(self, section, value)
-- Run init start -- Run init start
luci.sys.call("uci commit")
luci.sys.call("/etc/init.d/easymesh start") luci.sys.call("/etc/init.d/easymesh start")
end end
@ -63,7 +64,7 @@ o:value("server", translate("Mesh Server"))
o:value("client", translate("Mesh Client")) o:value("client", translate("Mesh Client"))
o.rmempty = false o.rmempty = false
apRadio = s:option(ListValue, "apRadio", translate("MESH Radio device"), translate("The radio device MESH will use")) apRadio = s:option(ListValue, "apRadio", translate("Mesh Radio device"), translate("The WiFi radio device Mesh will use"))
uci:foreach("wireless", "wifi-device", uci:foreach("wireless", "wifi-device",
function(s) function(s)
apRadio:value(s['.name']) apRadio:value(s['.name'])
@ -73,9 +74,9 @@ o.default = "radio0"
o.rmempty = false o.rmempty = false
---- mesh ---- mesh
o = s:option(Value, "mesh_id", translate("MESH ID")) o = s:option(Value, "mesh_id", translate("Mesh ID"))
o.default = "easymesh" o.default = "easymesh"
o.description = translate("MESH ID") o.description = translate("Mesh ID")
enable = s:option(Flag, "encryption", translate("Encryption"), translate("")) enable = s:option(Flag, "encryption", translate("Encryption"), translate(""))
enable.default = 0 enable.default = 0
@ -111,31 +112,33 @@ o:depends("kvr", 1)
--enable.rmempty = false --enable.rmempty = false
---- ap_mode ---- ap_mode
enable = s:option(Flag, "ap_mode", translate("Enable AP Node"), translate("Enable or disable Static IP Node")) enable = s:option(Flag, "ap_mode", translate("Enable as DHCP Mesh Node"), translate("Enable DHCP node. Connect to mesh gateway before enabling."))
enable.default = 0 enable.default = 0
enable.rmempty = false enable.rmempty = false
o = s:option(Value, "ipaddr", translate("IPv4-Address")) ---- static ip
o.default = "192.168.8.101" --o = s:option(Value, "ipaddr", translate("IPv4-Address"))
o.datatype = "ip4addr" --o.default = "192.168.8.101"
o:depends("ap_mode", 1) --o.datatype = "ip4addr"
--o:depends("ap_mode", 1)
o = s:option(Value, "netmask", translate("IPv4 netmask")) ---- so = s:option(Value, "netmask", translate("IPv4 netmask"))
o.default = "255.255.255.0" --o.default = "255.255.255.0"
o.datatype = "ip4addr" --o.datatype = "ip4addr"
o:depends("ap_mode", 1) --o:depends("ap_mode", 1)
o = s:option(Value, "gateway", translate("IPv4 gateway")) o = s:option(Value, "gateway", translate("Mesh IPv4 gateway"))
o.default = "192.168.8.1" o.default = "192.168.8.1"
o.datatype = "ip4addr" o.datatype = "ip4addr"
o:depends("ap_mode", 1) o:depends("ap_mode", 1)
o = s:option(Value, "dns", translate("Use custom DNS servers")) 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"
o:depends("ap_mode", 1) o:depends("ap_mode", 1)
function m.on_commit(self) function m.on_commit(self)
luci.sys.call("uci commit")
luci.sys.call("/etc/init.d/easymesh start &") luci.sys.call("/etc/init.d/easymesh start &")
end end

Loading…
Cancel
Save