luci-app-bmx6: several improvements and fixes, adapt main and advanced configuration to new config syntax
This commit is contained in:
parent
821e52f54f
commit
b68f809a3f
3 changed files with 14 additions and 16 deletions
|
@ -34,7 +34,8 @@ else
|
||||||
options = options.OPTIONS
|
options = options.OPTIONS
|
||||||
end
|
end
|
||||||
|
|
||||||
local general = m:section(NamedSection,"general","general","General Options")
|
local general = m:section(NamedSection,"general","bmx6")
|
||||||
|
general.addremove = true
|
||||||
|
|
||||||
local name = ""
|
local name = ""
|
||||||
local help = ""
|
local help = ""
|
||||||
|
|
|
@ -35,21 +35,17 @@ end
|
||||||
-- Getting a list of interfaces
|
-- Getting a list of interfaces
|
||||||
local eth_int = luci.sys.net.devices()
|
local eth_int = luci.sys.net.devices()
|
||||||
|
|
||||||
-- Getting the most important options from general
|
local tunDev = m:section(TypedSection,"tunDev",translate("Tunnel device"),translate("Define incoming ipip tunnel interface name"))
|
||||||
local general = m:section(NamedSection,"general","general","General")
|
tunDev.addremove = true
|
||||||
general.addremove = false
|
tunDev.anonymous = true
|
||||||
general:option(Value,"globalPrefix","Global ip prefix","Specify global prefix for interfaces: NETADDR/LENGTH. If you are using IPv6 leave blank to let bmx6 autoassign an ULA IPv6 address.")
|
tunDev:option(Value,"tunDev",translate("Name"),translate("Name for the tunnel network device"))
|
||||||
|
tunDev:option(Value,"tun4Address", translate("IPv4 address/length"),translate("Specify default IPv4 tunnel address and announced range (ex. 10.1.2.3/24)"))
|
||||||
if m:get("ipVersion","ipVersion") == "6" then
|
tunDev:option(Value,"tun6Address", translate("IPv6 address/length"),translate("Specify default IPv6 tunnel address and announced range (ex. 2012:0:0:123:0:0:0:1/64)"))
|
||||||
general:option(Value,"tun4Address","IPv4 address or range","specify default IPv4 tunnel address and announced range")
|
|
||||||
end
|
|
||||||
|
|
||||||
-- IP section
|
-- IP section
|
||||||
-- ipVersion section is important, we are allways showing it
|
local ipV = m:section(NamedSection,"ipVersion","ipVersion",translate("Miscellaneous IP options"))
|
||||||
local ipV = m:section(NamedSection,"ipVersion","ipVersion","IP options")
|
|
||||||
ipV.addremove = false
|
ipV.addremove = false
|
||||||
local lipv = ipV:option(ListValue,"ipVersion","IP version")
|
local lipv = ipV:option(ListValue,"ipVersion",translate("IP version"))
|
||||||
lipv:value("4","4")
|
|
||||||
lipv:value("6","6")
|
lipv:value("6","6")
|
||||||
lipv.default = "6"
|
lipv.default = "6"
|
||||||
|
|
||||||
|
@ -88,10 +84,10 @@ for _,o in ipairs(ipoptions) do
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Interfaces section
|
-- Interfaces section
|
||||||
local interfaces = m:section(TypedSection,"dev","Devices","")
|
local interfaces = m:section(TypedSection,"dev",translate("Devices"),translate("Network devices to mesh with"))
|
||||||
interfaces.addremove = true
|
interfaces.addremove = true
|
||||||
interfaces.anonymous = true
|
interfaces.anonymous = true
|
||||||
local intlv = interfaces:option(ListValue,"dev","Device")
|
local intlv = interfaces:option(ListValue,"dev",translate("Device"))
|
||||||
|
|
||||||
for _,i in ipairs(eth_int) do
|
for _,i in ipairs(eth_int) do
|
||||||
intlv:value(i,i)
|
intlv:value(i,i)
|
||||||
|
|
|
@ -95,7 +95,9 @@ Visit <a href="http://bmx6.net">bmx6.net</a> for more info.
|
||||||
sta.tun4Address,sta.myLocalId,sta.uptime,sta.cpu,sta.nodes]);
|
sta.tun4Address,sta.myLocalId,sta.uptime,sta.cpu,sta.nodes]);
|
||||||
return res;
|
return res;
|
||||||
});
|
});
|
||||||
|
//]]></script>
|
||||||
|
|
||||||
|
<script type="text/javascript">//<![CDATA[
|
||||||
new TablePooler(5,"/cgi-bin/bmx6-info", {'interfaces':''}, "ifaces_table", function(st){
|
new TablePooler(5,"/cgi-bin/bmx6-info", {'interfaces':''}, "ifaces_table", function(st){
|
||||||
var res = Array();
|
var res = Array();
|
||||||
var ifaces = st.interfaces;
|
var ifaces = st.interfaces;
|
||||||
|
@ -109,6 +111,5 @@ Visit <a href="http://bmx6.net">bmx6.net</a> for more info.
|
||||||
});
|
});
|
||||||
//]]></script>
|
//]]></script>
|
||||||
|
|
||||||
|
|
||||||
<%+footer%>
|
<%+footer%>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue