X-Git-Url: http://git.archive.openwrt.org/?a=blobdiff_plain;f=applications%2Fluci-app-firewall%2Fluasrc%2Fmodel%2Fcbi%2Ffirewall%2Frule-details.lua;h=1c838888f10e282da9c99191b99b61f74f686233;hb=fecf6e1d11d466efa7b1bbf05633931a3081517e;hp=d29879c2473e359890e96e813c1e28125edc71e9;hpb=1bb4822dca6113f73e3bc89e2acf15935e6f8e92;p=project%2Fluci.git diff --git a/applications/luci-app-firewall/luasrc/model/cbi/firewall/rule-details.lua b/applications/luci-app-firewall/luasrc/model/cbi/firewall/rule-details.lua index d29879c24..1c838888f 100644 --- a/applications/luci-app-firewall/luasrc/model/cbi/firewall/rule-details.lua +++ b/applications/luci-app-firewall/luasrc/model/cbi/firewall/rule-details.lua @@ -1,16 +1,6 @@ ---[[ -LuCI - Lua Configuration Interface - -Copyright 2008 Steven Barth -Copyright 2010-2012 Jo-Philipp Wich - -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 +-- Copyright 2010-2012 Jo-Philipp Wich +-- 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