gui: Show ID under each device section (local / remote), clickable for QR code (#7728)

This commit is contained in:
André Colomb
2021-06-01 18:04:11 +02:00
committed by GitHub
parent 08f6a91441
commit de6fe4dc6f
3 changed files with 33 additions and 3 deletions
@@ -1202,13 +1202,20 @@ angular.module('syncthing.core')
};
$scope.deviceName = function (deviceCfg) {
if (typeof deviceCfg === 'undefined' || typeof deviceCfg.deviceID === 'undefined') {
if (typeof deviceCfg === 'undefined') {
return "";
}
if (deviceCfg.name) {
return deviceCfg.name;
}
return deviceCfg.deviceID.substr(0, 6);
return $scope.deviceShortID(deviceCfg.deviceID);
};
$scope.deviceShortID = function (deviceID) {
if (typeof deviceID === 'undefined') {
return "";
}
return deviceID.substr(0, 6);
};
$scope.thisDeviceName = function () {
@@ -1222,6 +1229,11 @@ angular.module('syncthing.core')
return device.deviceID.substr(0, 6);
};
$scope.showDeviceIdentification = function (deviceCfg) {
$scope.currentDevice = deviceCfg;
$('#idqr').modal();
};
$scope.setDevicePause = function (device, pause) {
$scope.devices[device].paused = pause;
$scope.config.devices = $scope.deviceList();