Jelajahi Sumber

Report all rates in bytes per second (fixes #934)

Jakob Borg 11 tahun lalu
induk
melakukan
34cb305755

+ 4 - 5
gui/index.html

@@ -199,11 +199,11 @@
                 <tbody>
                   <tr>
                     <th><span class="glyphicon glyphicon-cloud-download"></span>&emsp;<span translate>Download Rate</span></th>
-                    <td class="text-right">{{connections['total'].inbps | metric}}bps ({{connections['total'].InBytesTotal | binary}}B)</td>
+                    <td class="text-right">{{connections['total'].inbps | binary}}B/s ({{connections['total'].InBytesTotal | binary}}B)</td>
                   </tr>
                   <tr>
                     <th><span class="glyphicon glyphicon-cloud-upload"></span>&emsp;<span translate>Upload Rate</span></th>
-                    <td class="text-right">{{connections['total'].outbps | metric}}bps ({{connections['total'].OutBytesTotal | binary}}B)</td>
+                    <td class="text-right">{{connections['total'].outbps | binary}}B/s ({{connections['total'].OutBytesTotal | binary}}B)</td>
                   </tr>
                   <tr>
                     <th><span class="glyphicon glyphicon-th"></span>&emsp;<span translate>RAM Utilization</span></th>
@@ -254,11 +254,11 @@
                   <tbody>
                     <tr ng-if="connections[deviceCfg.DeviceID]">
                       <th><span class="glyphicon glyphicon-cloud-download"></span>&emsp;<span translate>Download Rate</span></th>
-                      <td class="text-right">{{connections[deviceCfg.DeviceID].inbps | metric}}bps ({{connections[deviceCfg.DeviceID].InBytesTotal | binary}}B)</td>
+                      <td class="text-right">{{connections[deviceCfg.DeviceID].inbps | binary}}B/s ({{connections[deviceCfg.DeviceID].InBytesTotal | binary}}B)</td>
                     </tr>
                     <tr ng-if="connections[deviceCfg.DeviceID]">
                       <th><span class="glyphicon glyphicon-cloud-upload"></span>&emsp;<span translate>Upload Rate</span></th>
-                      <td class="text-right">{{connections[deviceCfg.DeviceID].outbps | metric}}bps ({{connections[deviceCfg.DeviceID].OutBytesTotal | binary}}B)</td>
+                      <td class="text-right">{{connections[deviceCfg.DeviceID].outbps | binary}}B/s ({{connections[deviceCfg.DeviceID].OutBytesTotal | binary}}B)</td>
                     </tr>
                     <tr>
                       <th><span class="glyphicon glyphicon-link"></span>&emsp;<span translate>Address</span></th>
@@ -870,7 +870,6 @@
   <script src="scripts/syncthing/core/filters/alwaysNumberFilter.js"></script>
   <script src="scripts/syncthing/core/filters/basenameFilter.js"></script>
   <script src="scripts/syncthing/core/filters/binaryFilter.js"></script>
-  <script src="scripts/syncthing/core/filters/metricFilter.js"></script>
   <script src="scripts/syncthing/core/filters/naturalFilter.js"></script>
 
   <script src="assets/lang/valid-langs.js"></script>

+ 2 - 2
gui/scripts/syncthing/core/controllers/syncthingController.js

@@ -320,8 +320,8 @@ angular.module('syncthing.core')
                         continue;
                     }
                     try {
-                        data[id].inbps = Math.max(0, 8 * (data[id].InBytesTotal - $scope.connections[id].InBytesTotal) / td);
-                        data[id].outbps = Math.max(0, 8 * (data[id].OutBytesTotal - $scope.connections[id].OutBytesTotal) / td);
+                        data[id].inbps = Math.max(0, (data[id].InBytesTotal - $scope.connections[id].InBytesTotal) / td);
+                        data[id].outbps = Math.max(0, (data[id].OutBytesTotal - $scope.connections[id].OutBytesTotal) / td);
                     } catch (e) {
                         data[id].inbps = 0;
                         data[id].outbps = 0;

+ 0 - 21
gui/scripts/syncthing/core/filters/metricFilter.js

@@ -1,21 +0,0 @@
-angular.module('syncthing.core')
-    .filter('metric', function () {
-        return function (input) {
-            if (input === undefined) {
-                return '0 ';
-            }
-            if (input > 1000 * 1000 * 1000) {
-                input /= 1000 * 1000 * 1000;
-                return input.toFixed(decimals(input, 2)) + ' G';
-            }
-            if (input > 1000 * 1000) {
-                input /= 1000 * 1000;
-                return input.toFixed(decimals(input, 2)) + ' M';
-            }
-            if (input > 1000) {
-                input /= 1000;
-                return input.toFixed(decimals(input, 2)) + ' k';
-            }
-            return Math.round(input) + ' ';
-        };
-    });

File diff ditekan karena terlalu besar
+ 1 - 1
internal/auto/gui.files.go


Beberapa file tidak ditampilkan karena terlalu banyak file yang berubah dalam diff ini