summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorDirk Brenken <dev@brenken.org>2018-12-27 07:24:09 +0100
committerGitHub <noreply@github.com>2018-12-27 07:24:09 +0100
commit0fb3bb61df8ca4cdda9d98c3c814000d6b106a35 (patch)
treef694798c017f532d2c461c30869e26aa93c82828
parente87951d86f485fe67270d0bca821c28fb891ade5 (diff)
parent01322c26f4a26d7c80248e5be052bc09144e7978 (diff)
Merge pull request #2400 from dibdot/banip
luci-app-banip: sync with release 0.0.7
-rw-r--r--applications/luci-app-banip/luasrc/model/cbi/banip/overview_tab.lua32
-rw-r--r--applications/luci-app-banip/luasrc/view/banip/banip_css.htm10
2 files changed, 17 insertions, 25 deletions
diff --git a/applications/luci-app-banip/luasrc/model/cbi/banip/overview_tab.lua b/applications/luci-app-banip/luasrc/model/cbi/banip/overview_tab.lua
index 8b5bedc089..53353175ef 100644
--- a/applications/luci-app-banip/luasrc/model/cbi/banip/overview_tab.lua
+++ b/applications/luci-app-banip/luasrc/model/cbi/banip/overview_tab.lua
@@ -1,17 +1,15 @@
-- Copyright 2018 Dirk Brenken (dev@brenken.org)
-- This is free software, licensed under the Apache License, Version 2.0
-local fs = require("nixio.fs")
-local uci = require("luci.model.uci").cursor()
-local sys = require("luci.sys")
-local net = require "luci.model.network".init()
-local util = require("luci.util")
-local dump = util.ubus("network.interface", "dump", {})
-local devices = sys.net:devices()
+local fs = require("nixio.fs")
+local uci = require("luci.model.uci").cursor()
+local net = require "luci.model.network".init()
+local util = require("luci.util")
+local dump = util.ubus("network.interface", "dump", {})
m = Map("banip", translate("banIP"),
translate("Configuration of the banIP package to block ip adresses/subnets via IPSet. ")
- .. translatef("For further information "
+ ..translatef("For further information "
.. "<a href=\"%s\" target=\"_blank\">"
.. "check the online documentation</a>", "https://github.com/openwrt/packages/blob/master/net/banip/files/README.md"))
@@ -29,22 +27,16 @@ o2.rmempty = false
o3 = s:option(MultiValue, "ban_iface", translate("Interface Selection"),
translate("Disable the automatic WAN detection and select your preferred interface(s) manually."))
-for _, dev in ipairs(devices) do
- if dev ~= "lo" and dev ~= "br-lan" then
- local iface = net:get_interface(dev)
- if iface then
- iface = iface:get_networks() or {}
- for k, v in pairs(iface) do
- iface[k] = iface[k].sid
- if iface[k] ~= "lan" then
- o3:value(iface[k], iface[k].. " (" ..dev.. ")")
- end
- end
+if dump then
+ local i, v
+ for i, v in ipairs(dump.interface) do
+ if v.interface ~= "loopback" and v.interface ~= "lan" then
+ local device = v.l3_device or v.device or "-"
+ o3:value(v.interface, v.interface.. " (" ..device.. ")")
end
end
end
o3.widget = "checkbox"
-o3.default = ban_iface
o3.rmempty = false
o4 = s:option(ListValue, "ban_fetchutil", translate("Download Utility"),
diff --git a/applications/luci-app-banip/luasrc/view/banip/banip_css.htm b/applications/luci-app-banip/luasrc/view/banip/banip_css.htm
index b1b9707f04..2fd4109e90 100644
--- a/applications/luci-app-banip/luasrc/view/banip/banip_css.htm
+++ b/applications/luci-app-banip/luasrc/view/banip/banip_css.htm
@@ -1,8 +1,8 @@
<style type="text/css">
textarea
{
- width: 100%;
- height: 450px;
+ width: 100% !important;
+ height: 450px !important;
border: 1px solid #cccccc;
padding: 5px;
font-size: 12px;
@@ -16,8 +16,8 @@
select[readonly],
textarea[readonly]
{
- width: 100%;
- height: 450px;
+ width: 100% !important;
+ height: 450px !important;
border: 1px solid #cccccc;
padding: 5px;
font-size: 12px;
@@ -33,7 +33,7 @@
.cbi-section-table-row,
.tr[data-title]::before
{
- text-align: left;
+ text-align: left !important;
vertical-align: top;
margin-left: 0px;
padding-left: 2px;