diff --git a/backend/wsgi.py b/backend/wsgi.py index 88fab84..d63e028 100644 --- a/backend/wsgi.py +++ b/backend/wsgi.py @@ -172,7 +172,7 @@ def getMaps(): # Example input: "10gbase-x-sfpp" # Example output: 10 # -# Possible inputs: +# Example inputs: # 100base-tx # 1000base-t # 1000base-x-sfp @@ -196,8 +196,9 @@ def getLinkSpeedOutOfFormFactor(formFactor): if (speed): speedInShortFormat = re.search("\d+", speed.group(0)) return float(speedInShortFormat.group(0)) - - return None + else: + return float(LINK_SPEED_UNKNOWN) + # Takes two adjacent interfaces speed (float) and returns link speed (float) diff --git a/www/css/style.css b/www/css/style.css index c08e121..75b1223 100644 --- a/www/css/style.css +++ b/www/css/style.css @@ -96,90 +96,126 @@ g#links { fill: white; } -.link0gb { - stroke: black; - stroke-dasharray: 5,5; -} - -.link0gb-info { - background: black; -} - -.link0gb-label-circle { - fill: black; +/* Colors to distinguish links of different speeds */ +:root { + --color0: #000000; + --color1: #777777; + --color2: #e1a800; + --color3: #00DCB4; + --color4: #8600FF; + --color5: #bc104b; } +/* Links with unknown speed */ .link-1gb { stroke: red; + stroke-width: 1px; } - .link-1gb-info { background: red; } - .link-1gb-label-circle { fill: red; } -.link1gb { - stroke: #e1a800; +/* Virtual links (circuits) */ +.link0gb { + stroke: var(--color0); + stroke-width: 1px; + stroke-dasharray: 5,5; +} +.link0gb-info { + background: var(--color0); +} +.link0gb-label-circle { + fill: var(--color0); } -.link1gb-info { - background: #e1a800; +/* Links with speed 10/100 Mbit/sec */ +.link0_1gb { + stroke: var(--color1); + stroke-width: 1px; } +.link0_1gb-info { + background: var(--color1); +} +.link0_1gb-label-circle { + fill: var(--color1); +} + -.link1gb-label-circle { - fill: #e1a800; +.link1gb, .link2gb, .link5gb { + stroke: var(--color2); + stroke-width: 1px; +} +.link1gb { + stroke-width: 1px; } +.link2gb { + stroke-width: 1.5px; +} +.link5gb { + stroke-width: 2px; +} +.link1gb-info, .link2gb-info, .link5gb-info { + background: var(--color2); +} +.link1gb-label-circle, .link2gb-label-circle, .link5gb-label-circle { + fill: var(--color2); +} + .link10gb { - stroke: #00DCB4; + stroke: var(--color3); + stroke-width: 2px; } - .link10gb-info { - background: #00DCB4; + background: var(--color3); } - .link10gb-label-circle { - fill: #00DCB4; + fill: var(--color3); } -.link25gb { - stroke: #75939c; -} -.link25gb-info { - background: #75939c; +.link25gb, .link40gb, .link50gb { + stroke: var(--color4); } - -.link25gb-label-circle { - fill: #75939c; +.link25gb { + stroke-width: 2px; } - .link40gb { - stroke: #8600FF; + stroke-width: 3px; } - -.link40gb-info { - background: #8600FF; +.link50gb { + stroke-width: 4px; } - -.link40gb-label-circle { - fill: #8600FF; +.link25gb-info, .link40gb-info, .link50gb-info { + background: var(--color4); } +.link25gb-label-circle, .link40gb-label-circle, .link50gb-label-circle { + fill: var(--color4); +} + +.link100gb, .link200gb, .link400gb { + stroke: var(--color5); +} .link100gb { - stroke: #bc104b; + stroke-width: 4px; } - -.link100gb-info { - background: #bc104b; +.link200gb { + stroke-width: 6px; } - -.link100gb-label-circle { - fill: #bc104b; +.link400gb { + stroke-width: 8px; +} +.link100gb-info, .link200gb-info, .link400gb-info { + background: var(--color5); } +.link100gb-label-circle, .link200gb-label-circle, .link400gb-label-circle { + fill: var(--color5); +} + .clusters rect, .clusters path, rect.clusters { stroke: #666666; diff --git a/www/index.html b/www/index.html index d59c54d..ee36537 100644 --- a/www/index.html +++ b/www/index.html @@ -79,7 +79,7 @@
v0.7.0 | +v0.7.1 | Docs |