Merge pull request #965 from cshore-firmware/pull-request-odhcpd-mac
[project/luci.git] / applications / luci-app-firewall / luasrc / model / cbi / firewall / rule-details.lua
index d29879c..1c83888 100644 (file)
@@ -1,16 +1,6 @@
---[[
-LuCI - Lua Configuration Interface
-
-Copyright 2008 Steven Barth <steven@midlink.org>
-Copyright 2010-2012 Jo-Philipp Wich <xm@subsignal.org>
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-]]--
+-- Copyright 2008 Steven Barth <steven@midlink.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"
 local utl = require "luci.util"
@@ -109,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)
@@ -133,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 })
@@ -279,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)
@@ -300,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)
@@ -326,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