From f33695d456fa92d71fc7fc6483af1a45ee906d62 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Wed, 10 Feb 2016 18:13:53 +0100 Subject: luci-app-firewall: align custom cbi teplates with new code Signed-off-by: Jo-Philipp Wich --- .../luasrc/view/firewall/cbi_addforward.htm | 26 +++++++++------------- .../luasrc/view/firewall/cbi_addsnat.htm | 25 ++++++++++----------- 2 files changed, 23 insertions(+), 28 deletions(-) (limited to 'applications/luci-app-firewall/luasrc') diff --git a/applications/luci-app-firewall/luasrc/view/firewall/cbi_addforward.htm b/applications/luci-app-firewall/luasrc/view/firewall/cbi_addforward.htm index 3c46e228f7..4a5bcfd6fa 100644 --- a/applications/luci-app-firewall/luasrc/view/firewall/cbi_addforward.htm +++ b/applications/luci-app-firewall/luasrc/view/firewall/cbi_addforward.htm @@ -11,6 +11,12 @@ ezl[#ezl+1] = z end end + + local keys, vals = { }, { } + luci.sys.net.ipv4_hints(function(ip, name) + keys[#keys+1] = ip + vals[#vals+1] = '%s (%s)' %{ ip, name } + end) -%>

@@ -46,7 +52,7 @@ - + - + 0, "data-choices", luci.util.serialize_json({keys, vals})) + %>/> - + @@ -66,15 +74,6 @@
diff --git a/applications/luci-app-firewall/luasrc/view/firewall/cbi_addsnat.htm b/applications/luci-app-firewall/luasrc/view/firewall/cbi_addsnat.htm index 4e1681c11d..817c046c8c 100644 --- a/applications/luci-app-firewall/luasrc/view/firewall/cbi_addsnat.htm +++ b/applications/luci-app-firewall/luasrc/view/firewall/cbi_addsnat.htm @@ -3,6 +3,14 @@ local nw = require "luci.model.network".init() local wz = fw:get_zone("wan") local lz = fw:get_zone("lan") + + local keys, vals, a, k, v = {}, {} + for k, v in ipairs(nw:get_interfaces()) do + for k, a in ipairs(v:ipaddrs()) do + keys[#keys+1] = a:host():string() + vals[#vals+1] = '%s (%s)' %{ a:host(), v:shortname() } + end + end %>
@@ -39,27 +47,18 @@ - + 0, "data-choices", luci.util.serialize_json({ keys, vals })) + %> /> - + - - <% else %> <% end %> -- cgit v1.2.3