Show link speed in Gb/s

If link speed is greater than 1000 Mb/s, show it in Gb/s to improve
readability.
multi-ogserver
Javier Sánchez Parra 2022-05-27 12:02:28 +02:00
parent 85be1258e1
commit 1d133dd53f
1 changed files with 9 additions and 3 deletions

View File

@ -143,7 +143,8 @@ function updateScopeState() {
function updatePillStatus(scope, pill) {
const state = scope.state
const link = scope.link
let link = scope.link
let units = 'Mb/s'
const pillCls = ['badge-danger', 'badge-success', 'badge-warning',
'badge-wol', 'badge-light'];
pill.classList.remove(...pillCls);
@ -160,8 +161,13 @@ function updatePillStatus(scope, pill) {
}
$('[name="link"]', pill).remove()
if (link)
$(pill).append('<b name="link"><br>' + link + ' Mb/s'+ '</b>');
if (link) {
if (link >= 1000) {
link = link / 1000
units = 'Gb/s'
}
$(pill).append('<b name="link"><br>' + link + ' ' + units + '</b>');
}
}
function updateScopes(scopes) {