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

Display label in MPTCP bandwidth graph

This commit is contained in:
Ycarus (Yannick Chabanois) 2020-10-22 14:33:02 +02:00
parent f01302b6f8
commit cc501a5e0a
2 changed files with 26 additions and 13 deletions

View file

@ -58,6 +58,7 @@ function multipath_bandwidth()
uci:foreach("network", "interface", function(s)
local intname = s[".name"]
local label = s["label"]
local dev = get_device(intname)
if dev == "" then
dev = get_device(s["ifname"])
@ -75,9 +76,17 @@ function multipath_bandwidth()
local bwc = luci.sys.exec("luci-bwc -i %q 2>/dev/null" % dev) or ""
if bwc ~= nil then
--result[dev] = "[" .. string.gsub(bwc, '[\r\n]', '') .. "]"
result[intname] = "[" .. string.gsub(bwc, '[\r\n]', '') .. "]"
if label ~= nil then
result[intname .. " (" .. label .. ")" ] = "[" .. string.gsub(bwc, '[\r\n]', '') .. "]"
else
result[intname] = "[" .. string.gsub(bwc, '[\r\n]', '') .. "]"
end
else
result[intname] = "[]"
if label ~= nil then
result[intname .. " (" .. label .. ")" ] = "[]"
else
result[intname] = "[]"
end
end
end
end