1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-03-09 15:40:03 +00:00

Update to latest luci-base and luci-mod-admin-full

This commit is contained in:
Ycarus 2018-06-08 10:51:00 +02:00
parent 613042b0a0
commit b218a47995
17 changed files with 2882 additions and 221 deletions

View file

@ -11,6 +11,7 @@ LUCI_TITLE:=LuCI Administration - full-featured for full control
LUCI_DEPENDS:=+luci-base +luci-app-firewall
PKG_BUILD_DEPENDS:=iwinfo
PKG_LICENSE:=Apache-2.0
include ../luci/luci.mk

View file

@ -381,7 +381,6 @@ if has_firewall then
fwzone.template = "cbi/firewall_zonelist"
fwzone.network = arg[1]
fwzone.rmempty = false
function fwzone.cfgvalue(self, section)
self.iface = section
@ -390,22 +389,16 @@ if has_firewall then
end
function fwzone.write(self, section, value)
local zone = fw:get_zone(value)
if not zone and value == '-' then
value = m:formvalue(self:cbid(section) .. ".newzone")
if value and #value > 0 then
zone = fw:add_zone(value)
else
fw:del_network(section)
end
end
local zone = fw:get_zone(value) or fw:add_zone(value)
if zone then
fw:del_network(section)
zone:add_network(section)
end
end
function fwzone.remove(self, section)
fw:del_network(section)
end
end

View file

@ -390,22 +390,16 @@ network.novirtual = true
function network.write(self, section, value)
local i = nw:get_interface(section)
if i then
if value == '-' then
value = m:formvalue(self:cbid(section) .. ".newnet")
if value and #value > 0 then
local n = nw:add_network(value, {proto="none"})
if n then n:add_interface(i) end
else
local n = i:get_network()
if n then n:del_interface(i) end
end
else
local v
for _, v in ipairs(i:get_networks()) do
v:del_interface(i)
end
for v in ut.imatch(value) do
local n = nw:get_network(v)
local _, net, old, new = nil, nil, {}, {}
for _, net in ipairs(i:get_networks()) do
old[net:name()] = true
end
for net in ut.imatch(value) do
new[net] = true
if not old[net] then
local n = nw:get_network(net) or nw:add_network(net, { proto = "none" })
if n then
if not n:is_empty() then
n:set("type", "bridge")
@ -414,6 +408,15 @@ function network.write(self, section, value)
end
end
end
for net, _ in pairs(old) do
if not new[net] then
local n = nw:get_network(net)
if n then
n:del_interface(i)
end
end
end
end
end

View file

@ -94,14 +94,9 @@ function newnet.parse(self, section)
local net, zone
if has_firewall then
local zval = fwzone:formvalue(section)
zone = fw:get_zone(zval)
if not zone and zval == '-' then
zval = m:formvalue(fwzone:cbid(section) .. ".newzone")
if zval and #zval > 0 then
zone = fw:add_zone(zval)
end
local value = fwzone:formvalue(section)
if value and #value > 0 then
zone = fw:get_zone(value) or fw:add_zone(value)
end
end