2 LuCI - Lua Configuration Interface
4 Copyright 2008 Steven Barth <steven@midlink.org>
5 Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
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
11 http://www.apache.org/licenses/LICENSE-2.0
15 require("luci.tools.webadmin")
16 m = Map("ddns", translate("ddns"), translate("ddns_desc"))
18 s = m:section(TypedSection, "service", "")
21 s:option(Flag, "enabled", translate("enable"))
23 svc = s:option(ListValue, "service_name", translate("service"))
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")
32 s:option(Value, "domain", translate("hostname")).rmempty = true
33 s:option(Value, "username", translate("username")).rmempty = true
34 pw = s:option(Value, "password", translate("password"))
38 src = s:option(ListValue, "ip_source")
39 src:value("network", translate("network"))
40 src:value("interface", translate("interface"))
41 src:value("web", "URL")
43 iface = s:option(ListValue, "ip_network", translate("network"))
44 iface:depends("ip_source", "network")
46 luci.tools.webadmin.cbi_add_networks(iface)
48 iface = s:option(ListValue, "ip_interface", translate("interface"))
49 iface:depends("ip_source", "interface")
51 for k, v in pairs(luci.sys.net.devices()) do
55 web = s:option(Value, "ip_url", "URL")
56 web:depends("ip_source", "web")
59 s:option(Value, "update_url").optional = true
61 s:option(Value, "check_interval").default = 10
62 unit = s:option(ListValue, "check_unit")
63 unit.default = "minutes"
64 unit:value("minutes", "min")
65 unit:value("hours", "h")
67 s:option(Value, "force_interval").default = 72
68 unit = s:option(ListValue, "force_unit")
69 unit.default = "hours"
70 unit:value("minutes", "min")
71 unit:value("hours", "h")