luci-app-firewall: only show portforward template if there are more then one zone
authorFlorian Eckert <fe@dev.tdt.de>
Thu, 8 Feb 2018 12:07:24 +0000 (13:07 +0100)
committerFlorian Eckert <fe@dev.tdt.de>
Thu, 1 Mar 2018 11:33:43 +0000 (12:33 +0100)
Only show portforward template if there are more then one zone.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
applications/luci-app-firewall/luasrc/view/firewall/cbi_addrule.htm

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