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:
@@ -533,7 +533,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<th><span class="fas fa-fw fa-share-alt"></span> <span translate>Shared With</span></th>
|
<th><span class="fas fa-fw fa-share-alt"></span> <span translate>Shared With</span></th>
|
||||||
<td class="text-right">
|
<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>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr ng-if="folderStats[folder.id].lastScan">
|
<tr ng-if="folderStats[folder.id].lastScan">
|
||||||
@@ -835,7 +835,7 @@
|
|||||||
<tr ng-if="deviceFolders(deviceCfg).length > 0">
|
<tr ng-if="deviceFolders(deviceCfg).length > 0">
|
||||||
<th><span class="fas fa-fw fa-folder"></span> <span translate>Folders</span></th>
|
<th><span class="fas fa-fw fa-folder"></span> <span translate>Folders</span></th>
|
||||||
<td class="text-right">
|
<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>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr ng-if="deviceCfg.remoteGUIPort > 0">
|
<tr ng-if="deviceCfg.remoteGUIPort > 0">
|
||||||
|
|||||||
@@ -2366,11 +2366,15 @@ angular.module('syncthing.core')
|
|||||||
+ '&device=' + encodeURIComponent(deviceID));
|
+ '&device=' + encodeURIComponent(deviceID));
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.deviceNameMarkUnaccepted = function (deviceID, folderID) {
|
$scope.deviceNameMarkRemoteState = function (deviceID, folderID) {
|
||||||
var name = $scope.deviceName($scope.devices[deviceID]);
|
var name = $scope.deviceName($scope.devices[deviceID]);
|
||||||
// Add footnote if sharing was not accepted on the remote device
|
// 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') {
|
if (deviceID in $scope.completion && folderID in $scope.completion[deviceID]) {
|
||||||
name += '<sup>1</sup>';
|
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;
|
return name;
|
||||||
};
|
};
|
||||||
@@ -2379,7 +2383,7 @@ angular.module('syncthing.core')
|
|||||||
var names = [];
|
var names = [];
|
||||||
folderCfg.devices.forEach(function (device) {
|
folderCfg.devices.forEach(function (device) {
|
||||||
if (device.deviceID !== $scope.myID) {
|
if (device.deviceID !== $scope.myID) {
|
||||||
names.push($scope.deviceNameMarkUnaccepted(device.deviceID, folderCfg.id));
|
names.push($scope.deviceNameMarkRemoteState(device.deviceID, folderCfg.id));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
names.sort();
|
names.sort();
|
||||||
@@ -2397,6 +2401,17 @@ angular.module('syncthing.core')
|
|||||||
return false;
|
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) {
|
$scope.deviceFolders = function (deviceCfg) {
|
||||||
var folders = [];
|
var folders = [];
|
||||||
$scope.folderList().forEach(function (folder) {
|
$scope.folderList().forEach(function (folder) {
|
||||||
@@ -2418,11 +2433,15 @@ angular.module('syncthing.core')
|
|||||||
return label && label.length > 0 ? label : folderID;
|
return label && label.length > 0 ? label : folderID;
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.folderLabelMarkUnaccepted = function (folderID, deviceID) {
|
$scope.folderLabelMarkRemoteState = function (folderID, deviceID) {
|
||||||
var label = $scope.folderLabel(folderID);
|
var label = $scope.folderLabel(folderID);
|
||||||
// Add footnote if sharing was not accepted on the remote device
|
// 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') {
|
if (deviceID in $scope.completion && folderID in $scope.completion[deviceID]) {
|
||||||
label += '<sup>1</sup>';
|
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;
|
return label;
|
||||||
};
|
};
|
||||||
@@ -2430,7 +2449,7 @@ angular.module('syncthing.core')
|
|||||||
$scope.sharedFolders = function (deviceCfg) {
|
$scope.sharedFolders = function (deviceCfg) {
|
||||||
var labels = [];
|
var labels = [];
|
||||||
$scope.deviceFolders(deviceCfg).forEach(function (folderID) {
|
$scope.deviceFolders(deviceCfg).forEach(function (folderID) {
|
||||||
labels.push($scope.folderLabelMarkUnaccepted(folderID, deviceCfg.deviceID));
|
labels.push($scope.folderLabelMarkRemoteState(folderID, deviceCfg.deviceID));
|
||||||
});
|
});
|
||||||
return labels.join(', ');
|
return labels.join(', ');
|
||||||
};
|
};
|
||||||
@@ -2448,6 +2467,19 @@ angular.module('syncthing.core')
|
|||||||
return false;
|
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) {
|
$scope.deleteFolder = function (id) {
|
||||||
hideFolderModal();
|
hideFolderModal();
|
||||||
if ($scope.currentFolder._editing != "existing") {
|
if ($scope.currentFolder._editing != "existing") {
|
||||||
|
|||||||
@@ -88,6 +88,9 @@
|
|||||||
<p class="help-block" ng-if="deviceHasUnacceptedFolders(currentDevice)">
|
<p class="help-block" ng-if="deviceHasUnacceptedFolders(currentDevice)">
|
||||||
<sup>1</sup> <span translate>The remote device has not accepted sharing this folder.</span>
|
<sup>1</sup> <span translate>The remote device has not accepted sharing this folder.</span>
|
||||||
</p>
|
</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>
|
||||||
<div class="form-horizontal" ng-if="currentSharing.unrelated.length">
|
<div class="form-horizontal" ng-if="currentSharing.unrelated.length">
|
||||||
<label translate for="folders">Unshared Folders</label>
|
<label translate for="folders">Unshared Folders</label>
|
||||||
|
|||||||
@@ -61,6 +61,9 @@
|
|||||||
<p class="help-block" ng-if="folderHasUnacceptedDevices(currentFolder)">
|
<p class="help-block" ng-if="folderHasUnacceptedDevices(currentFolder)">
|
||||||
<sup>1</sup> <span translate>The remote device has not accepted sharing this folder.</span>
|
<sup>1</sup> <span translate>The remote device has not accepted sharing this folder.</span>
|
||||||
</p>
|
</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>
|
||||||
<div class="form-horizontal" ng-if="currentSharing.unrelated.length || otherDevices().length <= 0">
|
<div class="form-horizontal" ng-if="currentSharing.unrelated.length || otherDevices().length <= 0">
|
||||||
<label translate>Unshared Devices</label>
|
<label translate>Unshared Devices</label>
|
||||||
|
|||||||
Reference in New Issue
Block a user