luci-app-firewall: allow "open ports" when no wan zone exists
Arguably this makes little if no wan zone exists but prefer consistency over heuristics and always render the "open port" shortcut. Fixes #2056 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
parent
849d153851
commit
bf123fb7c4
1 changed files with 2 additions and 4 deletions
|
@ -1,11 +1,9 @@
|
||||||
<%
|
<%
|
||||||
local fw = require "luci.model.firewall".init()
|
local fw = require "luci.model.firewall".init()
|
||||||
local wz = fw:get_zone("wan")
|
|
||||||
local lz = fw:get_zone("lan")
|
|
||||||
local zones = fw:get_zones()
|
local zones = fw:get_zones()
|
||||||
%>
|
%>
|
||||||
|
|
||||||
<% if wz then %>
|
<% if #zones > 0 then %>
|
||||||
<h4><%:Open ports on router%></h4>
|
<h4><%:Open ports on router%></h4>
|
||||||
<div class="table">
|
<div class="table">
|
||||||
<div class="tr cbi-section-table-titles">
|
<div class="tr cbi-section-table-titles">
|
||||||
|
@ -71,7 +69,7 @@
|
||||||
<input type="submit" class="cbi-button cbi-button-add" name="cbi.cts.<%=self.config%>.<%=self.sectiontype%>.<%=section%>" value="<%:Add%>" />
|
<input type="submit" class="cbi-button cbi-button-add" name="cbi.cts.<%=self.config%>.<%=self.sectiontype%>.<%=section%>" value="<%:Add%>" />
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<% if wz then %>
|
<% if #zones > 0 then %>
|
||||||
<script type="text/javascript">//<![CDATA[
|
<script type="text/javascript">//<![CDATA[
|
||||||
cbi_validate_field('_newopen.extport', true, 'list(neg(portrange))');
|
cbi_validate_field('_newopen.extport', true, 'list(neg(portrange))');
|
||||||
cbi_bind(document.getElementById('_newopen.extport'), 'blur',
|
cbi_bind(document.getElementById('_newopen.extport'), 'blur',
|
||||||
|
|
Loading…
Reference in a new issue