2 Copyright (C) 2011 Pau Escrich <pau@dabax.net>
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License along
15 with this program; if not, write to the Free Software Foundation, Inc.,
16 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 The full GNU General Public License is included in this distribution in
19 the file called "COPYING".
22 local sys = require("luci.sys")
23 local bmx6json = require("luci.model.bmx6json")
25 m = Map("bmx6", "bmx6")
28 local tunnelsOut = m:section(TypedSection,"tunOut",translate("Networks to fetch"),translate("Gateways announcements to fetch"))
29 tunnelsOut.addremove = true
30 tunnelsOut.anonymous = true
31 tunnelsOut:option(Value,"tunOut","Name")
32 tunnelsOut:option(Value,"network", translate("Network to fetch"))
34 local tunoptions = bmx6json.getOptions("tunOut")
36 for _,o in ipairs(tunoptions) do
37 if o.name ~= nil and o.name ~= "network" then
38 help = bmx6json.getHtmlHelp(o)
39 value = tunnelsOut:option(Value,o.name,o.name,help)
46 local tunnelsIn = m:section(TypedSection,"tunIn",translate("Networks to offer"),translate("Gateways to announce in the network"))
47 tunnelsIn.addremove = true
48 tunnelsIn.anonymous = true
49 tunnelsIn:option(Value,"tunIn","Name")
50 tunnelsIn:option(Value,"network", translate("Network to offer"))
52 local tunInoptions = bmx6json.getOptions("tunIn")
54 for _,o in ipairs(tunInoptions) do
55 if o.name ~= nil and o.name ~= "network" then
56 help = bmx6json.getHtmlHelp(o)
57 value = tunnelsIn:option(Value,o.name,o.name,help)
62 function m.on_commit(self,map)
63 --Not working. If test returns error the changes are still commited
64 local msg = bmx6json.testandreload()