gui: Keep short deviceID length consistent + xrefs (fixes #9313) (#9314)

Making short deviceID length consistent and referencing to protocol file
for future-proof edits. Closes #9313.
This commit is contained in:
Peter Badida
2024-01-02 17:31:57 +01:00
committed by GitHub
parent 86a08eb87d
commit 2abfefc18c
6 changed files with 12 additions and 6 deletions
@@ -1460,7 +1460,7 @@ angular.module('syncthing.core')
$scope.friendlyNameFromShort = function (shortID) {
var matches = Object.keys($scope.devices).filter(function (id) {
return id.substr(0, 7) === shortID;
return id.substr(0, shortIDStringLength) === shortID;
});
if (matches.length !== 1) {
return shortID;
@@ -1473,7 +1473,7 @@ angular.module('syncthing.core')
if (match) {
return $scope.deviceName(match);
}
return deviceID.substr(0, 6);
return deviceID.substr(0, shortIDStringLength);
};
$scope.deviceName = function (deviceCfg) {
@@ -1490,7 +1490,7 @@ angular.module('syncthing.core')
if (typeof deviceID === 'undefined') {
return "";
}
return deviceID.substr(0, 6);
return deviceID.substr(0, shortIDStringLength);
};
$scope.thisDeviceName = function () {
@@ -1501,7 +1501,7 @@ angular.module('syncthing.core')
if (device.name) {
return device.name;
}
return device.deviceID.substr(0, 6);
return device.deviceID.substr(0, shortIDStringLength);
};
$scope.showDeviceIdentification = function (deviceCfg) {