Bläddra i källkod

gui: Add device sync status (fixes #7981) (#8401)

Evan Spensley 3 år sedan
förälder
incheckning
c6a319d98b
2 ändrade filer med 7 tillägg och 4 borttagningar
  1. 7 0
      gui/default/index.html
  2. 0 4
      lib/model/folder_summary.go

+ 7 - 0
gui/default/index.html

@@ -760,6 +760,13 @@
                         <td translate ng-if="!deviceStats[deviceCfg.deviceID].lastSeenDays || deviceStats[deviceCfg.deviceID].lastSeenDays >= 365" class="text-right">Never</td>
                         <td ng-if="deviceStats[deviceCfg.deviceID].lastSeenDays < 365" class="text-right">{{deviceStats[deviceCfg.deviceID].lastSeen | date:"yyyy-MM-dd HH:mm:ss"}}</td>
                       </tr>
+                      <tr ng-if="!connections[deviceCfg.deviceID].connected && deviceFolders(deviceCfg).length > 0">
+                        <th><span class="fas fa-fw fa-cloud"></span>&nbsp;<span translate>Sync Status</span></th>
+                        <td translate ng-if="completion[deviceCfg.deviceID]._total == 100" class="text-right">Up to Date</td>
+                        <td ng-if="completion[deviceCfg.deviceID]._total < 100" class="text-right">
+                            <span class="hidden-xs" translate>Out of Sync</span> ({{completion[deviceCfg.deviceID]._total | percent}}, {{completion[deviceCfg.deviceID]._needBytes | binary}}B)
+                        </td>
+                      </tr>
                       <tr ng-if="connections[deviceCfg.deviceID].connected">
                         <th><span class="fas fa-fw fa-cloud-download-alt"></span>&nbsp;<span translate>Download Rate</span></th>
                         <td class="text-right">

+ 0 - 4
lib/model/folder_summary.go

@@ -407,10 +407,6 @@ func (c *folderSummaryService) sendSummary(ctx context.Context, folder string) {
 			// We already know about ourselves.
 			continue
 		}
-		if _, ok := c.model.Connection(devCfg.DeviceID); !ok {
-			// We're not interested in disconnected devices.
-			continue
-		}
 
 		// Get completion percentage of this folder for the
 		// remote device.