luci-app-firewall: only show portforward template if there are more then one zone

Only show portforward template if there are more then one zone.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
This commit is contained in:
Florian Eckert 2018-02-08 13:07:24 +01:00
parent fa756d1fbb
commit 846fb1f8bc

View file

@ -2,6 +2,7 @@
local fw = require "luci.model.firewall".init() local fw = require "luci.model.firewall".init()
local wz = fw:get_zone("wan") local wz = fw:get_zone("wan")
local lz = fw:get_zone("lan") local lz = fw:get_zone("lan")
local zones = fw:get_zones()
%> %>
<div class="cbi-section-create cbi-tblsection-create"> <div class="cbi-section-create cbi-tblsection-create">
@ -38,7 +39,7 @@
</tr> </tr>
</table> </table>
<% end %> <% end %>
<% if wz and lz then %> <% if #zones > 1 then %>
<table class="cbi-section-table" style="margin-left:5px"> <table class="cbi-section-table" style="margin-left:5px">
<tr class="cbi-section-table-titles"> <tr class="cbi-section-table-titles">
<th class="cbi-section-table-cell left" colspan="6"><br /><%:New forward rule%>:</th> <th class="cbi-section-table-cell left" colspan="6"><br /><%:New forward rule%>:</th>