mirror of
https://github.com/octoleo/syncthing.git
synced 2025-01-03 07:12:27 +00:00
gui: Mark folders paused on remote device. (#8286)
Similar to the "remote has not accepted sharing" message, add a footnote number 2 to indicate a folder which will not sync with a certain device because the remote has paused it. Applies to the edit folder / device modals' sharing tab, as well as the "shared with" listing and tooltips under device and folder details.
This commit is contained in:
parent
334a78f185
commit
31a78592e8
@ -533,7 +533,7 @@
|
||||
<tr>
|
||||
<th><span class="fas fa-fw fa-share-alt"></span> <span translate>Shared With</span></th>
|
||||
<td class="text-right">
|
||||
<span tooltip data-original-title="{{sharesFolder(folder)}} {{folderHasUnacceptedDevices(folder) ? '<br/>(<sup>1</sup>' + ('The remote device has not accepted sharing this folder.' | translate) + ')' : ''}}" ng-bind-html="sharesFolder(folder)"></span>
|
||||
<span tooltip data-original-title="{{sharesFolder(folder)}} {{folderHasUnacceptedDevices(folder) ? '<br/>(<sup>1</sup>' + ('The remote device has not accepted sharing this folder.' | translate) + ')' : ''}} {{folderHasPausedDevices(folder) ? '<br/>(<sup>2</sup>' + ('The remote device has paused this folder.' | translate) + ')' : ''}}" ng-bind-html="sharesFolder(folder)"></span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr ng-if="folderStats[folder.id].lastScan">
|
||||
@ -835,7 +835,7 @@
|
||||
<tr ng-if="deviceFolders(deviceCfg).length > 0">
|
||||
<th><span class="fas fa-fw fa-folder"></span> <span translate>Folders</span></th>
|
||||
<td class="text-right">
|
||||
<span tooltip data-original-title="{{sharedFolders(deviceCfg)}} {{deviceHasUnacceptedFolders(deviceCfg) ? '<br/>(<sup>1</sup>' + ('The remote device has not accepted sharing this folder.' | translate) + ')' : '' }}" ng-bind-html="sharedFolders(deviceCfg)"></span>
|
||||
<span tooltip data-original-title="{{sharedFolders(deviceCfg)}} {{deviceHasUnacceptedFolders(deviceCfg) ? '<br/>(<sup>1</sup>' + ('The remote device has not accepted sharing this folder.' | translate) + ')' : '' }} {{deviceHasPausedFolders(deviceCfg) ? '<br/>(<sup>2</sup>' + ('The remote device has paused this folder.' | translate) + ')' : '' }}" ng-bind-html="sharedFolders(deviceCfg)"></span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr ng-if="deviceCfg.remoteGUIPort > 0">
|
||||
|
@ -2366,11 +2366,15 @@ angular.module('syncthing.core')
|
||||
+ '&device=' + encodeURIComponent(deviceID));
|
||||
};
|
||||
|
||||
$scope.deviceNameMarkUnaccepted = function (deviceID, folderID) {
|
||||
$scope.deviceNameMarkRemoteState = function (deviceID, folderID) {
|
||||
var name = $scope.deviceName($scope.devices[deviceID]);
|
||||
// Add footnote if sharing was not accepted on the remote device
|
||||
if (deviceID in $scope.completion && folderID in $scope.completion[deviceID] && $scope.completion[deviceID][folderID].remoteState == 'notSharing') {
|
||||
name += '<sup>1</sup>';
|
||||
if (deviceID in $scope.completion && folderID in $scope.completion[deviceID]) {
|
||||
if ($scope.completion[deviceID][folderID].remoteState == 'notSharing') {
|
||||
name += '<sup>1</sup>';
|
||||
} else if ($scope.completion[deviceID][folderID].remoteState == 'paused') {
|
||||
name += '<sup>2</sup>';
|
||||
}
|
||||
}
|
||||
return name;
|
||||
};
|
||||
@ -2379,7 +2383,7 @@ angular.module('syncthing.core')
|
||||
var names = [];
|
||||
folderCfg.devices.forEach(function (device) {
|
||||
if (device.deviceID !== $scope.myID) {
|
||||
names.push($scope.deviceNameMarkUnaccepted(device.deviceID, folderCfg.id));
|
||||
names.push($scope.deviceNameMarkRemoteState(device.deviceID, folderCfg.id));
|
||||
}
|
||||
});
|
||||
names.sort();
|
||||
@ -2397,6 +2401,17 @@ angular.module('syncthing.core')
|
||||
return false;
|
||||
};
|
||||
|
||||
$scope.folderHasPausedDevices = function (folderCfg) {
|
||||
for (var deviceID in $scope.completion) {
|
||||
if (deviceID in $scope.devices
|
||||
&& folderCfg.id in $scope.completion[deviceID]
|
||||
&& $scope.completion[deviceID][folderCfg.id].remoteState == 'paused') {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
$scope.deviceFolders = function (deviceCfg) {
|
||||
var folders = [];
|
||||
$scope.folderList().forEach(function (folder) {
|
||||
@ -2418,11 +2433,15 @@ angular.module('syncthing.core')
|
||||
return label && label.length > 0 ? label : folderID;
|
||||
};
|
||||
|
||||
$scope.folderLabelMarkUnaccepted = function (folderID, deviceID) {
|
||||
$scope.folderLabelMarkRemoteState = function (folderID, deviceID) {
|
||||
var label = $scope.folderLabel(folderID);
|
||||
// Add footnote if sharing was not accepted on the remote device
|
||||
if (deviceID in $scope.completion && folderID in $scope.completion[deviceID] && $scope.completion[deviceID][folderID].remoteState == 'notSharing') {
|
||||
label += '<sup>1</sup>';
|
||||
if (deviceID in $scope.completion && folderID in $scope.completion[deviceID]) {
|
||||
if ($scope.completion[deviceID][folderID].remoteState == 'notSharing') {
|
||||
label += '<sup>1</sup>';
|
||||
} else if ($scope.completion[deviceID][folderID].remoteState == 'paused') {
|
||||
label += '<sup>2</sup>';
|
||||
}
|
||||
}
|
||||
return label;
|
||||
};
|
||||
@ -2430,7 +2449,7 @@ angular.module('syncthing.core')
|
||||
$scope.sharedFolders = function (deviceCfg) {
|
||||
var labels = [];
|
||||
$scope.deviceFolders(deviceCfg).forEach(function (folderID) {
|
||||
labels.push($scope.folderLabelMarkUnaccepted(folderID, deviceCfg.deviceID));
|
||||
labels.push($scope.folderLabelMarkRemoteState(folderID, deviceCfg.deviceID));
|
||||
});
|
||||
return labels.join(', ');
|
||||
};
|
||||
@ -2448,6 +2467,19 @@ angular.module('syncthing.core')
|
||||
return false;
|
||||
};
|
||||
|
||||
$scope.deviceHasPausedFolders = function (deviceCfg) {
|
||||
if (!(deviceCfg.deviceID in $scope.completion)) {
|
||||
return false;
|
||||
}
|
||||
for (var folderID in $scope.completion[deviceCfg.deviceID]) {
|
||||
if (folderID in $scope.folders
|
||||
&& $scope.completion[deviceCfg.deviceID][folderID].remoteState == 'paused') {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
$scope.deleteFolder = function (id) {
|
||||
hideFolderModal();
|
||||
if ($scope.currentFolder._editing != "existing") {
|
||||
|
@ -88,6 +88,9 @@
|
||||
<p class="help-block" ng-if="deviceHasUnacceptedFolders(currentDevice)">
|
||||
<sup>1</sup> <span translate>The remote device has not accepted sharing this folder.</span>
|
||||
</p>
|
||||
<p class="help-block" ng-if="deviceHasPausedFolders(currentDevice)">
|
||||
<sup>2</sup> <span translate>The remote device has paused this folder.</span>
|
||||
</p>
|
||||
</div>
|
||||
<div class="form-horizontal" ng-if="currentSharing.unrelated.length">
|
||||
<label translate for="folders">Unshared Folders</label>
|
||||
|
@ -61,6 +61,9 @@
|
||||
<p class="help-block" ng-if="folderHasUnacceptedDevices(currentFolder)">
|
||||
<sup>1</sup> <span translate>The remote device has not accepted sharing this folder.</span>
|
||||
</p>
|
||||
<p class="help-block" ng-if="folderHasPausedDevices(currentFolder)">
|
||||
<sup>2</sup> <span translate>The remote device has paused this folder.</span>
|
||||
</p>
|
||||
</div>
|
||||
<div class="form-horizontal" ng-if="currentSharing.unrelated.length || otherDevices().length <= 0">
|
||||
<label translate>Unshared Devices</label>
|
||||
|
Loading…
Reference in New Issue
Block a user