modules/admin-core: Added several cross-references to relevant configuration pages
[project/luci.git] / applications / luci-ddns / luasrc / model / cbi / ddns / ddns.lua
1 --[[
2 LuCI - Lua Configuration Interface
3
4 Copyright 2008 Steven Barth <steven@midlink.org>
5 Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
6
7 Licensed under the Apache License, Version 2.0 (the "License");
8 you may not use this file except in compliance with the License.
9 You may obtain a copy of the License at
10
11         http://www.apache.org/licenses/LICENSE-2.0
12
13 $Id$
14 ]]--
15 require("luci.tools.webadmin")
16 m = Map("ddns", translate("ddns"), translate("ddns_desc"))
17
18 s = m:section(TypedSection, "service", "")
19 s.addremove = true
20
21 s:option(Flag, "enabled", translate("enable"))
22
23 svc = s:option(ListValue, "service_name", translate("service"))
24 svc.rmempty = true
25 svc:value("")
26 svc:value("dyndns.org")
27 svc:value("changeip.com")
28 svc:value("zoneedit.com")
29 svc:value("no-ip.com")
30 svc:value("freedns.afraid.org")
31
32 s:option(Value, "domain", translate("hostname")).rmempty = true
33 s:option(Value, "username", translate("username")).rmempty = true
34 s:option(Value, "password", translate("password")).rmempty = true
35
36 src = s:option(ListValue, "ip_source")
37 src:value("network", translate("network"))
38 src:value("interface", translate("interface"))
39 src:value("web", "URL")
40
41 iface = s:option(ListValue, "ip_network", translate("network"))
42 iface:depends("ip_source", "network")
43 iface.rmempty = true
44 luci.tools.webadmin.cbi_add_networks(iface)
45
46 iface = s:option(ListValue, "ip_interface", translate("interface"))
47 iface:depends("ip_source", "interface")
48 iface.rmempty = true
49 for k, v in pairs(luci.sys.net.devices()) do
50         iface:value(v)
51 end
52
53 web = s:option(Value, "ip_url", "URL")
54 web:depends("ip_source", "web")
55 web.rmempty = true
56
57 s:option(Value, "update_url").optional = true
58
59 s:option(Value, "check_interval").default = 10
60 unit = s:option(ListValue, "check_unit")
61 unit.default = "minutes"
62 unit:value("minutes", "min")
63 unit:value("hours", "h")
64
65 s:option(Value, "force_interval").default = 72
66 unit = s:option(ListValue, "force_unit")
67 unit.default = "hours"
68 unit:value("minutes", "min")
69 unit:value("hours", "h")
70
71
72 return m