Repository: syncthing/syncthing (language: go)

Issue:
Show likely status of disconnected devices
Feature request suggested first in the [forum](https://forum.syncthing.net/t/likely-status-of-offline-devices/17412/4).

Currently there’s a “Last Seen” status line for each device in the GUI. Would it be possible to implement a “Sync Status” line too? It would be ‘up to date’ just after the device disconnects, and as shared files are changed and the device stays offline, it would gradually get more out of sync. Obviously it’s not necessarily accurate (since the device I’m on may also go offline) but it would help see how up-to-date each device is even when they’re disconnected. If implemented, this could even be used as the status (i.e. not just ‘Disconnected’ but ‘Offline / 95% synced’ or something).




Discussion / hints:
Maybe when any file is changed in any sync folder, the "Disconnected" status on any devices which that device is shared with should show "Disconnected (Out of Sync)" or some equivalent.

I don't know the internal working of syncthing, but this seems like it wouldn't be too painful to implement.

Fix patch:
diff --git a/gui/default/index.html b/gui/default/index.html
index a9fd9ee6dda..cd58d3619c5 100644
--- a/gui/default/index.html
+++ b/gui/default/index.html
@@ -759,6 +759,13 @@ <h4 class="panel-title">
                         <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">
diff --git a/lib/model/folder_summary.go b/lib/model/folder_summary.go
index b3c92447614..3fed5c55cc5 100644
--- a/lib/model/folder_summary.go
+++ b/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.


Test patch: