Explorar el Código

gui: Add new folder state "Failed Items" (fixes #5456) (#5614)

Simon Frei hace 7 años
padre
commit
675f289aef
Se han modificado 2 ficheros con 5 adiciones y 1 borrados
  1. 1 0
      gui/default/index.html
  2. 4 1
      gui/default/syncthing/core/syncthingController.js

+ 1 - 0
gui/default/index.html

@@ -328,6 +328,7 @@
                     <span ng-show="syncRemaining(folder.id)">({{syncPercentage(folder.id) | percent}}, {{syncRemaining(folder.id) | binary}}B)</span>
                   </span>
                   <span ng-switch-when="outofsync"><span class="hidden-xs" translate>Out of Sync</span><span class="visible-xs" aria-label="{{'Out of Sync' | translate}}"><i class="fas fa-fw fa-exclamation-circle"></i></span></span>
+                  <span ng-switch-when="faileditems"><span class="hidden-xs" translate>Failed Items</span><span class="visible-xs" aria-label="{{'Failed Items' | translate}}"><i class="fas fa-fw fa-exclamation-circle"></i></span></span>
                 </div>
                 <div class="panel-title-text">
                   <span tooltip data-original-title="{{folder.label.length != 0 ? folder.id : ''}}">{{folder.label.length != 0 ? folder.label : folder.id}}</span>

+ 4 - 1
gui/default/syncthing/core/syncthingController.js

@@ -751,6 +751,9 @@ angular.module('syncthing.core')
             if (state === 'idle' && $scope.model[folderCfg.id].needTotalItems > 0) {
                 return 'outofsync';
             }
+            if ($scope.hasFailedFiles(folderCfg.id)) {
+                return 'faileditems';
+            }
             if (state === 'scanning') {
                 return state;
             }
@@ -777,7 +780,7 @@ angular.module('syncthing.core')
             if (status === 'unknown') {
                 return 'info';
             }
-            if (status === 'stopped' || status === 'outofsync' || status === 'error') {
+            if (status === 'stopped' || status === 'outofsync' || status === 'error' || status === 'faileditems') {
                 return 'danger';
             }
             if (status === 'unshared' || status === 'scan-waiting') {