7962d4da1c8f2687abd7b80f13ea33fb56b0d5b0
[project/luci.git] / modules / admin-full / luasrc / model / cbi / admin_network / routes.lua
1 --[[
2 LuCI - Lua Configuration Interface
3
4 Copyright 2008 Steven Barth <steven@midlink.org>
5
6 Licensed under the Apache License, Version 2.0 (the "License");
7 you may not use this file except in compliance with the License.
8 You may obtain a copy of the License at
9
10 http://www.apache.org/licenses/LICENSE-2.0
11
12 $Id$
13 ]]--
14
15 require("luci.tools.webadmin")
16 m = Map("network", translate("a_n_routes"), translate("a_n_routes1"))
17
18 local routes6 = luci.sys.net.routes6()
19 local bit = require "bit"
20
21 s = m:section(TypedSection, "route", translate("a_n_routes_static4"))
22 s.addremove = true
23 s.anonymous = true
24
25 s.template = "cbi/tblsection"
26
27 iface = s:option(ListValue, "interface", translate("interface"))
28 luci.tools.webadmin.cbi_add_networks(iface)
29
30 s:option(Value, "target", translate("target"), translate("a_n_r_target1"))
31 s:option(Value, "netmask", translate("netmask"), translate("a_n_r_netmask1")).rmemepty = true
32 s:option(Value, "gateway", translate("gateway"))
33
34 if routes6 then
35 s = m:section(TypedSection, "route6", translate("a_n_routes_static6"))
36 s.addremove = true
37 s.anonymous = true
38
39 s.template = "cbi/tblsection"
40
41 iface = s:option(ListValue, "interface", translate("interface"))
42 luci.tools.webadmin.cbi_add_networks(iface)
43
44 s:option(Value, "target", translate("target"), translate("a_n_r_target6"))
45 s:option(Value, "gateway", translate("gateway6")).rmempty = true
46 end
47
48
49 return m