gui: Disable device removal when we know it will be reintroduced
Skip-check: pr-build-windows GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3762
This commit is contained in:
parent
2fd1dca905
commit
99922feb3b
@ -1071,6 +1071,13 @@ angular.module('syncthing.core')
|
|||||||
$scope.editDevice = function (deviceCfg) {
|
$scope.editDevice = function (deviceCfg) {
|
||||||
$scope.currentDevice = $.extend({}, deviceCfg);
|
$scope.currentDevice = $.extend({}, deviceCfg);
|
||||||
$scope.editingExisting = true;
|
$scope.editingExisting = true;
|
||||||
|
$scope.willBeReintroducedBy = undefined;
|
||||||
|
if (deviceCfg.introducedBy) {
|
||||||
|
var introducerDevice = $scope.findDevice(deviceCfg.introducedBy);
|
||||||
|
if (introducerDevice && introducerDevice.introducer) {
|
||||||
|
$scope.willBeReintroducedBy = $scope.deviceName(introducerDevice);
|
||||||
|
}
|
||||||
|
}
|
||||||
$scope.currentDevice._addressesStr = deviceCfg.addresses.join(', ');
|
$scope.currentDevice._addressesStr = deviceCfg.addresses.join(', ');
|
||||||
$scope.currentDevice.selectedFolders = {};
|
$scope.currentDevice.selectedFolders = {};
|
||||||
$scope.deviceFolders($scope.currentDevice).forEach(function (folder) {
|
$scope.deviceFolders($scope.currentDevice).forEach(function (folder) {
|
||||||
|
|||||||
@ -75,8 +75,13 @@
|
|||||||
<button type="button" class="btn btn-default btn-sm" data-dismiss="modal">
|
<button type="button" class="btn btn-default btn-sm" data-dismiss="modal">
|
||||||
<span class="fa fa-times"></span> <span translate>Close</span>
|
<span class="fa fa-times"></span> <span translate>Close</span>
|
||||||
</button>
|
</button>
|
||||||
<button type="button" class="btn btn-warning pull-left btn-sm" ng-click="deleteDevice()" ng-if="editingExisting">
|
<div ng-if="editingExisting" class="pull-left">
|
||||||
|
<button type="button" class="btn btn-warning btn-sm disabled" ng-if="willBeReintroducedBy" tooltip data-original-title="This device will be reintroduced by {{ willBeReintroducedBy }}">
|
||||||
|
<span class="fa fa-minus-circle"></span> <span translate>Remove</span>
|
||||||
|
</button>
|
||||||
|
<button type="button" class="btn btn-warning btn-sm" ng-click="deleteDevice()" ng-if="!willBeReintroducedBy">
|
||||||
<span class="fa fa-minus-circle"></span> <span translate>Remove</span>
|
<span class="fa fa-minus-circle"></span> <span translate>Remove</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</modal>
|
</modal>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user