luci-app-firewall: redirect to overview page on zone details save
[project/luci.git] / applications / luci-app-firewall / luasrc / model / cbi / firewall / rule-details.lua
index 2dcc4e9..1c83888 100644 (file)
@@ -1,5 +1,5 @@
 -- Copyright 2008 Steven Barth <steven@midlink.org>
--- Copyright 2010-2012 Jo-Philipp Wich <xm@subsignal.org>
+-- Copyright 2010-2012 Jo-Philipp Wich <jow@openwrt.org>
 -- Licensed to the public under the Apache License 2.0.
 
 local sys = require "luci.sys"
@@ -99,7 +99,7 @@ elseif rule_type == "redirect" then
 
        o = s:option(Value, "src_ip", translate("Source IP address"))
        o.rmempty = true
-       o.datatype = "neg(ipaddr)"
+       o.datatype = "neg(ipmask4)"
        o.placeholder = translate("any")
 
        luci.sys.net.ipv4_hints(function(ip, name)
@@ -123,7 +123,7 @@ elseif rule_type == "redirect" then
 
 
        o = s:option(Value, "dest_ip", translate("Destination IP address"))
-       o.datatype = "neg(ip4addr)"
+       o.datatype = "neg(ipmask4)"
 
        luci.sys.net.ipv4_hints(function(ip, name)
                o:value(ip, "%s (%s)" %{ ip, name })
@@ -269,7 +269,7 @@ else
 
 
        o = s:option(Value, "src_ip", translate("Source address"))
-       o.datatype = "neg(ipaddr)"
+       o.datatype = "neg(ipmask)"
        o.placeholder = translate("any")
 
        luci.sys.net.ipv4_hints(function(ip, name)
@@ -290,7 +290,7 @@ else
 
 
        o = s:option(Value, "dest_ip", translate("Destination address"))
-       o.datatype = "neg(ipaddr)"
+       o.datatype = "neg(ipmask)"
        o.placeholder = translate("any")
 
        luci.sys.net.ipv4_hints(function(ip, name)
@@ -316,4 +316,34 @@ else
                translate("Passes additional arguments to iptables. Use with care!"))
 end
 
+o = s:option(MultiValue, "weekdays", translate("Week Days"))
+o.oneline = true
+o.widget = "checkbox"
+o:value("Sun", translate("Sunday"))
+o:value("Mon", translate("Monday"))
+o:value("Tue", translate("Tuesday"))
+o:value("Wed", translate("Wednesday"))
+o:value("Thu", translate("Thursday"))
+o:value("Fri", translate("Friday"))
+o:value("Sat", translate("Saturday"))
+
+o = s:option(MultiValue, "monthdays", translate("Month Days"))
+o.oneline = true
+o.widget = "checkbox"
+for i = 1,31 do
+       o:value(translate(i))
+end
+
+o = s:option(Value, "start_time", translate("Start Time (hh:mm:ss)"))
+o.datatype = "timehhmmss"
+o = s:option(Value, "stop_time", translate("Stop Time (hh:mm:ss)"))
+o.datatype = "timehhmmss"
+o = s:option(Value, "start_date", translate("Start Date (yyyy-mm-dd)"))
+o.datatype = "dateyyyymmdd"
+o = s:option(Value, "stop_date", translate("Stop Date (yyyy-mm-dd)"))
+o.datatype = "dateyyyymmdd"
+
+o = s:option(Flag, "utc_time", translate("Time in UTC"))
+o.default = o.disabled
+
 return m