summaryrefslogtreecommitdiffstats
path: root/ogcp/static
diff options
context:
space:
mode:
authorJavier Sánchez Parra <jsanchez@soleta.eu>2022-05-05 17:33:44 +0200
committerJavier Sánchez Parra <jsanchez@soleta.eu>2022-05-11 17:37:00 +0200
commit08cae4b6caf164f3e7fd5609fec5d37158ea6330 (patch)
treefaa2d8dfcfddc4e93c9b0c664ec08f34685b3b59 /ogcp/static
parentce651453c420527208d2c7a26a9634de59b09a1e (diff)
Add link speed to pills
If the clients API response include link speed information, show it in clients' pills.
Diffstat (limited to 'ogcp/static')
-rw-r--r--ogcp/static/js/ogcp.js10
1 files changed, 8 insertions, 2 deletions
diff --git a/ogcp/static/js/ogcp.js b/ogcp/static/js/ogcp.js
index ffddc58..9612370 100644
--- a/ogcp/static/js/ogcp.js
+++ b/ogcp/static/js/ogcp.js
@@ -141,7 +141,9 @@ function updateScopeState() {
}, Interval);
}
-function updatePillStatus(state, pill) {
+function updatePillStatus(scope, pill) {
+ const state = scope.state
+ const link = scope.link
const pillCls = ['badge-danger', 'badge-success', 'badge-warning',
'badge-wol', 'badge-light'];
pill.classList.remove(...pillCls);
@@ -156,6 +158,10 @@ function updatePillStatus(state, pill) {
} else {
pill.classList.add('badge-light');
}
+
+ $('[name="link"]', pill).remove()
+ if (link)
+ $(pill).append('<b name="link"><br>' + link + ' Mb/s'+ '</b>');
}
function updateScopes(scopes) {
@@ -183,7 +189,7 @@ function updateScopes(scopes) {
const pillScopeId = `pill-${scopeId}`;
const pillEl = document.querySelector(`#${pillScopeId}`);
if (pillEl)
- updatePillStatus(scope.state, pillEl);
+ updatePillStatus(scope, pillEl);
}
if (scope.scope) {
// This is a level so we should update all childs