router.html: Improve interface highlighting

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
This commit is contained in:
Adrian Schmutzler 2018-02-10 12:46:07 +01:00
parent 8df6699171
commit 977ae4f2f4
1 changed files with 7 additions and 7 deletions

View File

@ -162,21 +162,21 @@ def router_info(dbid):
desc = "Config @ 5 GHz"
color = chidden
elif netif == "fffVPN":
desc = "Fastd tunnel"
desc = "Fastd VPN Tunnel"
color = cvpn
elif netif.startswith("l2tp"):
desc = "L2TP tunnel"
desc = "L2TP VPN Tunnel"
color = cvpn
elif netif.startswith("bat"):
desc = "Batman interface"
elif netif.startswith("eth") and "{}.1".format(netif) in netifs:
desc = "Batman Interface"
elif netif.startswith("eth") and any(item.startswith("{}.".format(netif)) for item in netifs):
desc = "Switch"
elif netif == "eth0" and not "eth1" in netifs:
desc = "One-Port"
elif netif == "eth1" and "eth0.1" in netifs:
desc = "Ethernet Multi-Port"
elif netif == "eth1": # already known from above: no switch; no one-port, as there must be eth0
desc = "WAN"
color = cwan
elif netif == "eth0" and "eth1.1" in netifs:
elif netif == "eth0": # already known from above: no switch, eth1 present
desc = "WAN"
color = cwan
n["description"] = desc