From 4ede70c0cebed30a479b37b34cc7a1a60bf0fc24 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Mon, 1 Nov 2010 19:39:57 +0000 Subject: [PATCH] libs/web: introduce firewall_zoneforwards widget --- .../luasrc/view/cbi/firewall_zoneforwards.htm | 78 +++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 libs/web/luasrc/view/cbi/firewall_zoneforwards.htm diff --git a/libs/web/luasrc/view/cbi/firewall_zoneforwards.htm b/libs/web/luasrc/view/cbi/firewall_zoneforwards.htm new file mode 100644 index 000000000..71679c536 --- /dev/null +++ b/libs/web/luasrc/view/cbi/firewall_zoneforwards.htm @@ -0,0 +1,78 @@ +<%# +LuCI - Lua Configuration Interface +Copyright 2009 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 + +$Id: firewall_zonelist.htm 5651 2009-12-26 00:09:47Z jow $ + +-%> + +<%+cbi/valueheader%> + +<%- + local utl = require "luci.util" + local fwm = require "luci.model.firewall".init() + local nwm = require "luci.model.network".init() + + local zone, fwd, fz + local value = self:formvalue(section) + if not value or value == "-" then + value = self:cfgvalue(section) or self.default + end + + local def = fwm:get_defaults() + local zone = fwm:get_zone(value) + local empty = true +-%> + +<% if zone then %> +
+ +  ⇒  + <% for _, fwd in ipairs(zone:get_forwardings_by("src")) do + fz = fwd:dest_zone() + empty = false %> +   + <% end %> + <% if empty then %> + + <% end %> +
+<% end %> + +<%+cbi/valuefooter%> -- 2.25.1