From 7b7030629c4d55557b368a292d7f3e3d14b1923b Mon Sep 17 00:00:00 2001 From: Manuel Munz Date: Sat, 10 Nov 2012 20:55:50 +0000 Subject: Add some more datatype checks, patch by Eugene C., #499 --- applications/luci-ddns/luasrc/model/cbi/ddns/ddns.lua | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'applications/luci-ddns/luasrc/model/cbi') diff --git a/applications/luci-ddns/luasrc/model/cbi/ddns/ddns.lua b/applications/luci-ddns/luasrc/model/cbi/ddns/ddns.lua index 42fb4a61dc..e477a245ec 100644 --- a/applications/luci-ddns/luasrc/model/cbi/ddns/ddns.lua +++ b/applications/luci-ddns/luasrc/model/cbi/ddns/ddns.lua @@ -112,14 +112,19 @@ else end -s:option(Value, "check_interval", - translate("Check for changed IP every")).default = 10 +ci = s:option(Value, "check_interval", translate("Check for changed IP every")) +ci.datatype = "and(uinteger,min(1))" +ci.default = 10 + unit = s:option(ListValue, "check_unit", translate("Check-time unit")) unit.default = "minutes" unit:value("minutes", translate("min")) unit:value("hours", translate("h")) -s:option(Value, "force_interval", translate("Force update every")).default = 72 +fi = s:option(Value, "force_interval", translate("Force update every")) +fi.datatype = "and(uinteger,min(1))" +fi.default = 72 + unit = s:option(ListValue, "force_unit", translate("Force-time unit")) unit.default = "hours" unit:value("minutes", translate("min")) -- cgit v1.2.3