From 61302c467c2e3c99aca999edf198052e9102e051 Mon Sep 17 00:00:00 2001 From: Nicolas Perraut Date: Sun, 22 Mar 2020 19:30:18 +0100 Subject: [PATCH] gui: Improve unused device status (fixes #6416) (#6445) --- gui/default/index.html | 4 +++- gui/default/syncthing/core/syncthingController.js | 15 ++++++--------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/gui/default/index.html b/gui/default/index.html index 33a207fb9..29458b410 100644 --- a/gui/default/index.html +++ b/gui/default/index.html @@ -656,12 +656,14 @@ + ({{completion[deviceCfg.deviceID]._total | percent}}, {{completion[deviceCfg.deviceID]._needBytes | binary}}B) + - + {{deviceName(deviceCfg)}} diff --git a/gui/default/syncthing/core/syncthingController.js b/gui/default/syncthing/core/syncthingController.js index 2a0310684..59d257bee 100755 --- a/gui/default/syncthing/core/syncthingController.js +++ b/gui/default/syncthing/core/syncthingController.js @@ -938,8 +938,10 @@ angular.module('syncthing.core') }; $scope.deviceStatus = function (deviceCfg) { + var status = ''; + if ($scope.deviceFolders(deviceCfg).length === 0) { - return 'unused'; + status = 'unused-'; } if (typeof $scope.connections[deviceCfg.deviceID] === 'undefined') { @@ -947,27 +949,22 @@ angular.module('syncthing.core') } if (deviceCfg.paused) { - return 'paused'; + return status + 'paused'; } if ($scope.connections[deviceCfg.deviceID].connected) { if ($scope.completion[deviceCfg.deviceID] && $scope.completion[deviceCfg.deviceID]._total === 100) { - return 'insync'; + return status + 'insync'; } else { return 'syncing'; } } // Disconnected - return 'disconnected'; + return status + 'disconnected'; }; $scope.deviceClass = function (deviceCfg) { - if ($scope.deviceFolders(deviceCfg).length === 0) { - // Unused - return 'warning'; - } - if (typeof $scope.connections[deviceCfg.deviceID] === 'undefined') { return 'info'; }