diff --git a/lambdainst/views.py b/lambdainst/views.py index 37e9b31..9f24d41 100644 --- a/lambdainst/views.py +++ b/lambdainst/views.py @@ -1,3 +1,4 @@ +from math import ceil import base64 import hmac from datetime import datetime, timedelta @@ -41,7 +42,7 @@ def get_locations(): code = loc['country_code'].upper() loc['country_name'] = countries_d.get(code, code) - loc['load_percent'] = (loc['usage'].get('net', 0) / (loc['bandwidth'] / 1e6)) * 100 + loc['load_percent'] = ceil((loc['usage'].get('net', 0) / (loc['bandwidth'] / 1e6)) * 100) return locations diff --git a/static/css/style.css b/static/css/style.css index 5c27d66..7524c10 100644 --- a/static/css/style.css +++ b/static/css/style.css @@ -888,6 +888,29 @@ a.home-signup-button { text-align: right; } +.bandwidth { + display: block; + position: relative; + width: 100%; + border: 1px solid #666; + background: #eee; + text-align: center; +} +.bandwidth .inner { + position: absolute; + top: 0; left: 0; bottom: 0; + background-color: #BCC8D1; + z-index: 100; +} +.bandwidth .inner.high { + background-color: #D1B2B2; +} +.bandwidth .label { + position: relative; + z-index: 200; +} + + /***************************************************/ /********************* WireGuard */ diff --git a/templates/lambdainst/status.html b/templates/lambdainst/status.html index 0ad8b88..26b713e 100644 --- a/templates/lambdainst/status.html +++ b/templates/lambdainst/status.html @@ -12,7 +12,6 @@ {% trans 'Location' %} {% trans 'Hostname' %} - {% trans 'Servers' %} {% trans 'Load' %} @@ -22,11 +21,15 @@ {{ d.hostname }} - {{ d.servers|length }} - {{ d.load_percent|floatformat:1 }}% - of - {{ d.bandwidth|bwformat }} + + + + {{ d.load_percent }}% + of + {{ d.bandwidth|bwformat }} + + {% endfor %}