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",
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>'
)
@ -47,12 +47,13 @@ s = m:section(TypedSection, "easymesh", translate("Settings"), translate("Genera
s.anonymous = true
---- 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.rmempty = false
function o.write(self, section, value)
Flag.write(self, section, value)
-- Run init start
luci.sys.call("uci commit")
luci.sys.call("/etc/init.d/easymesh start")
end
@ -63,7 +64,7 @@ o:value("server", translate("Mesh Server"))
o:value("client", translate("Mesh Client"))
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",
function(s)
apRadio:value(s['.name'])
@ -73,9 +74,9 @@ o.default = "radio0"
o.rmempty = false
---- mesh
o = s:option(Value, "mesh_id", translate("MESH ID"))
o = s:option(Value, "mesh_id", translate("Mesh ID"))
o.default = "easymesh"
o.description = translate("MESH ID")
o.description = translate("Mesh ID")
enable = s:option(Flag, "encryption", translate("Encryption"), translate(""))
enable.default = 0
@ -111,31 +112,33 @@ o:depends("kvr", 1)
--enable.rmempty = false
---- 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.rmempty = false
o = s:option(Value, "ipaddr", translate("IPv4-Address"))
o.default = "192.168.8.101"
o.datatype = "ip4addr"
o:depends("ap_mode", 1)
---- static ip
--o = s:option(Value, "ipaddr", translate("IPv4-Address"))
--o.default = "192.168.8.101"
--o.datatype = "ip4addr"
--o:depends("ap_mode", 1)
o = s:option(Value, "netmask", translate("IPv4 netmask"))
o.default = "255.255.255.0"
o.datatype = "ip4addr"
o:depends("ap_mode", 1)
---- so = s:option(Value, "netmask", translate("IPv4 netmask"))
--o.default = "255.255.255.0"
--o.datatype = "ip4addr"
--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.datatype = "ip4addr"
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.datatype = "ip4addr"
o:depends("ap_mode", 1)
function m.on_commit(self)
luci.sys.call("uci commit")
luci.sys.call("/etc/init.d/easymesh start &")
end

Loading…
Cancel
Save