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 m = Map("ddns", translate("ddns"), translate("ddns_desc"))
17 s = m:section(TypedSection, "service", "")
20 s:option(Flag, "enabled", translate("enable"))
22 svc = s:option(ListValue, "service_name", translate("service"))
25 svc:value("dyndns.org")
26 svc:value("changeip.com")
27 svc:value("zoneedit.com")
28 svc:value("no-ip.com")
29 svc:value("freedns.afraid.org")
31 s:option(Value, "domain", translate("hostname")).rmempty = true
32 s:option(Value, "username", translate("username")).rmempty = true
33 s:option(Value, "password", translate("password")).rmempty = true
35 src = s:option(ListValue, "ip_source")
36 src:value("network", translate("network"))
37 src:value("interface", translate("interface"))
38 src:value("web", "URL")
40 iface = s:option(ListValue, "ip_network", translate("network"))
41 iface:depends("ip_source", "network")
43 luci.model.uci.foreach("network", "interface",
45 if section[".name"] ~= "loopback" then
46 iface:value(section[".name"])
50 iface = s:option(ListValue, "ip_interface", translate("interface"))
51 iface:depends("ip_source", "interface")
53 for k, v in pairs(luci.sys.net.devices()) do
57 web = s:option(Value, "ip_url", "URL")
58 web:depends("ip_source", "web")
61 s:option(Value, "update_url").optional = true
63 s:option(Value, "check_interval").default = 10
64 unit = s:option(ListValue, "check_unit")
65 unit.default = "minutes"
66 unit:value("minutes", "min")
67 unit:value("hours", "h")
69 s:option(Value, "force_interval").default = 72
70 unit = s:option(ListValue, "force_unit")
71 unit.default = "hours"
72 unit:value("minutes", "min")
73 unit:value("hours", "h")