Browse Source

Display Local State Summary (All Folders)

Frank Isemann 10 năm trước cách đây
mục cha
commit
510d309b8a

+ 4 - 0
gui/index.html

@@ -327,6 +327,10 @@
                     <th><span class="glyphicon glyphicon-cloud-upload"></span>&nbsp;<span translate>Upload Rate</span></th>
                     <td class="text-right">{{connectionsTotal.outbps | binary}}B/s ({{connectionsTotal.outBytesTotal | binary}}B)</td>
                   </tr>
+                  <tr>
+                    <th><span class="glyphicon glyphicon-home"></span>&nbsp;<span translate>Local State (Total)</span> </th>
+                    <td class="text-right">{{foldersTotalLocalFiles | alwaysNumber}} <span translate>items</span>, ~{{ foldersTotalLocalBytes | binary}}B</td>
+                  </tr>
                   <tr>
                     <th><span class="glyphicon glyphicon-th"></span>&nbsp;<span translate>RAM Utilization</span></th>
                     <td class="text-right">{{system.sys | binary}}B</td>

+ 11 - 0
gui/scripts/syncthing/core/controllers/syncthingController.js

@@ -45,6 +45,8 @@ angular.module('syncthing.core')
         $scope.neededTotal = 0;
         $scope.neededCurrentPage = 1;
         $scope.neededPageSize = 10;
+        $scope.foldersTotalLocalBytes = 0;
+        $scope.foldersTotalLocalFiles = 0;
 
         $(window).bind('beforeunload', function () {
             navigatingAway = true;
@@ -340,6 +342,15 @@ angular.module('syncthing.core')
                     }
                 }
                 $scope.announceServersFailed = failed;
+
+                $scope.foldersTotalLocalBytes = 0;
+                $scope.foldersTotalLocalFiles = 0;
+
+                for (var f in $scope.model) {
+                   $scope.foldersTotalLocalBytes += $scope.model[f].localBytes;
+                   $scope.foldersTotalLocalFiles += $scope.model[f].localFiles;
+                };
+
                 console.log("refreshSystem", data);
             }).error($scope.emitHTTPError);
         }