luci-app-qos_gargoyle: fix get_wan
This commit is contained in:
parent
d50a3495c8
commit
939cdafcf1
@ -104,8 +104,9 @@ o = s:option(Value, "ptarget_ip", translate("Use Non-standard Ping Target"),
|
||||
.. "link will occur in a different segment then you can enter an alternate ping target. Leave "
|
||||
.. "empty to use the default settings."))
|
||||
o:depends("qos_monenabled", "true")
|
||||
local wan = qos.get_wan()
|
||||
if wan then o:value(wan:gwaddr()) end
|
||||
-- local wan = qos.get_wan()
|
||||
-- if wan then o:value(wan:gwaddr()) end
|
||||
-- TODO: get wan address
|
||||
o.datatype = "ipaddr"
|
||||
|
||||
o = s:option(Value, "pinglimit", translate("Manual Ping Limit"),
|
||||
|
||||
@ -26,6 +26,13 @@ function cbi_add_dpi_protocols(field)
|
||||
end
|
||||
|
||||
function get_wan()
|
||||
local net = require "luci.model.network".init()
|
||||
return net:get_wannet()
|
||||
local network = require "luci.model.network".init()
|
||||
local bundle = network:get_status_by_route("0.0.0.0", 0)
|
||||
local net, stat
|
||||
for k, v in pairs(bundle) do
|
||||
net = k
|
||||
stat = v
|
||||
break
|
||||
end
|
||||
return net and network:network(net, stat.proto)
|
||||
end
|
||||
|
||||
Loading…
Reference in New Issue
Block a user