mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-02-14 19:41:51 +00:00
Fix mptcp graph
This commit is contained in:
parent
e10f778c34
commit
a15336068d
2 changed files with 26 additions and 24 deletions
|
@ -32,14 +32,15 @@ function multipath_bandwidth()
|
||||||
local result = { };
|
local result = { };
|
||||||
local uci = luci.model.uci.cursor()
|
local uci = luci.model.uci.cursor()
|
||||||
|
|
||||||
for _, dev in luci.util.vspairs(luci.sys.net.devices()) do
|
uci:foreach("network", "interface", function(s)
|
||||||
if dev ~= "lo" then
|
local dev = s["ifname"]
|
||||||
local multipath = uci:get("network", dev, "multipath")
|
if dev ~= "lo" and dev ~= "" then
|
||||||
|
local multipath = s["multipath"] or "off"
|
||||||
if multipath == "on" or multipath == "master" or multipath == "backup" or multipath == "handover" then
|
if multipath == "on" or multipath == "master" or multipath == "backup" or multipath == "handover" then
|
||||||
result[dev] = "[" .. string.gsub((luci.sys.exec("luci-bwc -i %q 2>/dev/null" % dev)), '[\r\n]', '') .. "]"
|
result[dev] = "[" .. string.gsub((luci.sys.exec("luci-bwc -i %q 2>/dev/null" % dev)), '[\r\n]', '') .. "]"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end)
|
||||||
|
|
||||||
luci.http.prepare_content("application/json")
|
luci.http.prepare_content("application/json")
|
||||||
luci.http.write_json(result)
|
luci.http.write_json(result)
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
-- Copyright 2015 OVH (OverTheBox@ovh.net)
|
-- Copyright 2015 OVH (OverTheBox@ovh.net)
|
||||||
-- Simon Lelievre (simon.lelievre@corp.ovh.com)
|
-- Simon Lelievre (simon.lelievre@corp.ovh.com)
|
||||||
-- Sebastien Duponcheel (sebastien.duponcheel@ovh.net)
|
-- Sebastien Duponcheel (sebastien.duponcheel@ovh.net)
|
||||||
|
-- Copyright 2018 Ycarus - Yannick Chabanois (ycarus@zugaina.org)
|
||||||
--
|
--
|
||||||
-- This file is part of OverTheBox for OpenWrt.
|
-- This file is part of OverTheBox for OpenWrt.
|
||||||
--
|
--
|
||||||
|
@ -48,21 +49,21 @@
|
||||||
<script type="text/javascript">//<![CDATA[
|
<script type="text/javascript">//<![CDATA[
|
||||||
|
|
||||||
function stringToColour(str) {
|
function stringToColour(str) {
|
||||||
if(str == "free1")
|
if(str == "wan")
|
||||||
return "FireBrick";
|
return "FireBrick";
|
||||||
if(str == "ovh1")
|
if(str == "wan1")
|
||||||
return "DeepSkyBlue";
|
return "DeepSkyBlue";
|
||||||
if(str == "ovh2")
|
if(str == "wan2")
|
||||||
return "LightGreen";
|
return "LightGreen";
|
||||||
if(str == "if1")
|
if(str == "wan3")
|
||||||
return "PaleGreen";
|
return "PaleGreen";
|
||||||
if(str == "if2")
|
if(str == "wan4")
|
||||||
return "PowderBlue";
|
return "PowderBlue";
|
||||||
if(str == "if3")
|
if(str == "wan5")
|
||||||
return "Salmon";
|
return "Salmon";
|
||||||
if(str == "if4")
|
if(str == "wan6")
|
||||||
return "SeaGreen";
|
return "SeaGreen";
|
||||||
if(str == "if5")
|
if(str == "wan7")
|
||||||
return "PaleTurquoise";
|
return "PaleTurquoise";
|
||||||
// Generate a color folowing the name
|
// Generate a color folowing the name
|
||||||
Math.seedrandom(str);
|
Math.seedrandom(str);
|
||||||
|
@ -313,7 +314,7 @@
|
||||||
tr.setAttribute('id', itf + '_upload');
|
tr.setAttribute('id', itf + '_upload');
|
||||||
// Create cells of the table
|
// Create cells of the table
|
||||||
var itflabel = tr.insertCell(0);
|
var itflabel = tr.insertCell(0);
|
||||||
// Crete itf legend
|
// Create itf legend
|
||||||
var strong = document.createElement('strong')
|
var strong = document.createElement('strong')
|
||||||
strong.appendChild(document.createTextNode(itf));
|
strong.appendChild(document.createTextNode(itf));
|
||||||
strong.setAttribute('style', 'border-bottom:2px solid ' + color);
|
strong.setAttribute('style', 'border-bottom:2px solid ' + color);
|
||||||
|
|
Loading…
Reference in a new issue