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

@ -59,21 +59,21 @@
function stringToColour(str) {
if(str == "total")
return "OrangeRed";
if(str == "wan")
if(str.substring(0, 4) == "wan")
return "FireBrick";
if(str == "wan1")
if(str.substring(0, 4) == "wan1")
return "DeepSkyBlue";
if(str == "wan2")
if(str.substring(0, 4) == "wan2")
return "SeaGreen";
if(str == "wan3")
if(str.substring(0, 4) == "wan3")
return "PaleGreen";
if(str == "wan4")
if(str.substring(0, 4) == "wan4")
return "PowderBlue";
if(str == "wan5")
if(str.substring(0, 4) == "wan5")
return "Salmon";
if(str == "wan6")
if(str.substring(0, 4) == "wan6")
return "LightGreen";
if(str == "wan7")
if(str.substring(0, 4) == "wan7")
return "PaleTurquoise";
// Generate a color folowing the name
Math.seedrandom(str);
@ -893,9 +893,13 @@ window.setTimeout(function()
<ul class="cbi-tabmenu">
<% for _, dev in ipairs(devices) do
local ifname = get_device(dev)
%>
<li class="cbi-tab<%= ifname == curifname and "" or "-disabled" %>"><a href="?dev=<%=pcdata(get_device(dev))%>"><%=pcdata(dev)%></a></li>
local label = uci:get("network",dev,"label")
if label ~= nil then
%>
<li class="cbi-tab<%= ifname == curifname and "" or "-disabled" %>"><a href="?dev=<%=pcdata(get_device(dev))%>"><%=label%></a></li>
<% else %>
<li class="cbi-tab<%= ifname == curifname and "" or "-disabled" %>"><a href="?dev=<%=pcdata(get_device(dev))%>"><%=pcdata(dev)%></a></li>
<% end %>
<% end %>
</ul>