From 550ee34f0041238d449af85ef33474b9308748ee Mon Sep 17 00:00:00 2001 From: Simon Smith Date: Fri, 2 Feb 2024 10:22:25 +0000 Subject: [PATCH] fix latency bouncing monitors (#5756) Signed-off-by: si458 --- views/default.handlebars | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/views/default.handlebars b/views/default.handlebars index 46c60e30..a84c9780 100644 --- a/views/default.handlebars +++ b/views/default.handlebars @@ -730,7 +730,7 @@
- +   @@ -9014,6 +9014,8 @@ QV('deskkeys', inputAllowed); QE('deskkeys', desktop != null); QV('DeskTimer', deskState == 3); + QV('DeskLatency', deskState == 3); + QS('DeskLatency').display = (deskState == 3 ? 'inline-block' : 'none'); // Enable browser clipboard read if supported var autoclipboard = ((desktop) && (desktop.contype == 4)) ? desktopsettings.rdpautoclipboard : desktopsettings.autoclipboard; @@ -9420,9 +9422,10 @@ // Desktop var latencyStr = '', seconds = 0; if (desktop && desktop.startTime) { - if (desktop.latency && (desktop.latency.current >= 0)) { latencyStr = format('{0} ms, ', desktop.latency.current); } + if (desktop.latency && (desktop.latency.current >= 0)) { latencyStr = format('{0} ms', desktop.latency.current); } seconds = Math.floor((new Date() - desktop.startTime) / 1000); - QH('DeskTimer', latencyStr + zeroPad(Math.floor(seconds / 3600), 2) + ':' + zeroPad((Math.floor(seconds / 60) % 60), 2) + ':' + zeroPad((seconds % 60), 2)); + QH('DeskTimer', zeroPad(Math.floor(seconds / 3600), 2) + ':' + zeroPad((Math.floor(seconds / 60) % 60), 2) + ':' + zeroPad((seconds % 60), 2)); + QH('DeskLatency', latencyStr); // Auto-clipboard if ((((desktop.contype != 4) && (desktopsettings.autoclipboard === true)) || ((desktop.contype == 4) && (desktopsettings.rdpautoclipboard === true))) && (navigator.clipboard != null) && (navigator.clipboard.readText != null)) { try { @@ -9437,6 +9440,7 @@ } } else { QH('DeskTimer', ''); + QH('DeskLatency', ''); } // Terminal