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