summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorDaniel Dickinson <openwrt@daniel.thecshore.com>2015-12-02 00:52:37 -0500
committerDaniel Dickinson <openwrt@daniel.thecshore.com>2015-12-14 23:26:33 -0500
commit986baa5ccee13692e9c1ef5a23535e15b7fcb948 (patch)
tree0b2bcb4fe8d6465b5e0a72c65c55957138e380a7
parent6318f67fd46450b501879d9cf36c023fab7824d3 (diff)
applications: firewall: Add time and date for rules and redirects
UCI config for the firewall has the option of specifying time and date limitations; add these options the UI.
-rw-r--r--applications/luci-app-firewall/luasrc/model/cbi/firewall/rule-details.lua30
-rw-r--r--modules/luci-base/luasrc/view/cbi/mvalue.htm2
2 files changed, 31 insertions, 1 deletions
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 0cb30b5cd..60af531d5 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
@@ -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
diff --git a/modules/luci-base/luasrc/view/cbi/mvalue.htm b/modules/luci-base/luasrc/view/cbi/mvalue.htm
index 6a0b3881d..5d092610e 100644
--- a/modules/luci-base/luasrc/view/cbi/mvalue.htm
+++ b/modules/luci-base/luasrc/view/cbi/mvalue.htm
@@ -12,7 +12,7 @@
c = c + 1
%>
<input class="cbi-input-checkbox" type="checkbox" onclick="cbi_d_update(this.id)" onchange="cbi_d_update(this.id)"<%= attr("id", cbid..c) .. attr("name", cbid) .. attr("value", key) .. ifattr(luci.util.contains(v, key), "checked", "checked") %> />
- <label<%= attr("for", cbid..c) %>><%=self.vallist[i]%></label><br />
+ <label<%= attr("for", cbid..c) %>><%=self.vallist[i]%></label><% if not self.oneline then %><br /><% else %> <% end %>
<% if c == self.size then c = 0 %><br />
<% end end %>
<% end %>