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

pull/1/head
ben 1 year ago
parent 6ee428b15c
commit 633344d114

@ -43,20 +43,13 @@ v:option(DummyValue, "Neighbor", translate("Neighbor"))
v:option(DummyValue, "lastseen", translate("lastseen"))
-- Basic
s = m:section(TypedSection, "easymesh", translate("Mesh Gateway & Node Settings"), translate("Choose Mesh Gateway or Mesh Node WiFi Settings"))
s = m:section(TypedSection, "easymesh", translate("Mesh Gateway & Node WiFi Settings"), translate("Choose Mesh Gateway or Mesh Node WiFi Settings: Begin by completing this section on your mesh server and nodes. Ensure each radio's WiFi network name is consistent. For example: easymesh_AC, easymesh_N."))
s.anonymous = true
---- Eanble
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
o = s:option(ListValue, "role", translate("Mesh Device Type"))
o:value("off", translate("Mesh Node"))
@ -75,7 +68,7 @@ o.rmempty = false
---- mesh
o = s:option(Value, "mesh_id", translate("Mesh ID"))
o.default = "easymesh"
o.default = "easymesh_AC"
o.description = translate("Mesh ID")
enable = s:option(Flag, "encryption", translate("Encryption"), translate(""))
@ -106,23 +99,38 @@ o.default = "-88"
o.atatype = "range(-1,-120)"
o:depends("kvr", 1)
---- Apply MESH settings
--ctrl = m:section(TypedSection, "easymesh", "Apply Mesh WiFi Settings to Server or Node")
--ctrl.anonymous = true
--ctrl.addremove = false
----btnStop = ctrl:option(Button, "_btn_start", translate("Apply Mesh WiFi Settings"))
--function btnStop.write()
-- io.popen("/etc/init.d/easymesh start")
--end
---- 802.11F
--enable = s:option(Flag, "iapp", translate("inter-access point protocol"), translate("Wireless Access Points (APs) running on different vendors can communicate with each other"))
--enable.default = 0
--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 = m:section(TypedSection, "easymesh", translate("Enable Router as DHCP Mesh Node"), translate("Set up Easy Mesh WiFi on your server and nodes first. All mesh nodes will utilize your mesh server for DHCP. "))
s.anonymous = true
---- ap_mode
enable = s:option(Flag, "ap_mode", translate("Enable as DHCP Mesh Node"), translate("Important: Connect to your mesh gateway WiFi before enabling."))
enable = s:option(Flag, "ap_mode", translate("Enable as DHCP Mesh Node"), translate("Important: Setup your mesh WiFi network before enabling."))
enable.default = 0
enable.rmempty = false
---- static ip
--o = s:option(Value, "ipaddr", translate("IPv4-Address"))
--o.default = "192.168.8.101"
---- ip address
--o = s:option(Value, "ipaddr", translate("Static IP Address"))
--o.default = "192.168.8.2"
--o.datatype = "ip4addr"
--o:depends("ap_mode", 1)
---- o = s:option(Value, "dns", translate("Mesh Server IPv4 DNS"))
--o.default = "192.168.8.1"
--o.datatype = "ip4addr"
--o:depends("ap_mode", 1)
@ -131,34 +139,31 @@ enable.rmempty = false
--o.datatype = "ip4addr"
--o:depends("ap_mode", 1)
o = s:option(Value, "gateway", translate("Set Hostname for this DHCP Mesh Node"))
o = s:option(Value, "gateway", translate("Set Hostname for this Mesh Node"))
o.default = "node1"
o.datatype = "string"
o:depends("ap_mode", 1)
-- MESH Node Control: Start/Stop DHCP MESH Node
ctrl = m:section(TypedSection, "easymesh", "Node Control: Start/Stop Mesh Node")
-- MESH Node Control: apply mesh settings
ctrl = m:section(TypedSection, "easymesh", "Click Save Then Enable or Disable Your Mesh WiFi settings")
ctrl.anonymous = true
ctrl.addremove = false
btnStop = ctrl:option(Button, "_btn_start", translate("Enable Mesh Node"))
btnStop = ctrl:option(Button, "_btn_start", translate("Enable Easy Mesh"))
function btnStop.write()
io.popen("/etc/init.d/easymesh start")
end
btnStart = ctrl:option(Button, "_btn_stop", translate("Disable Mesh Node"))
btnStart = ctrl:option(Button, "_btn_stop", translate("Disable Easy Mesh"))
function btnStart.write()
io.popen("/etc/init.d/easymesh stop")
end
---- 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")
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

Loading…
Cancel
Save