gui: Add dropdown menu to choose discovered devices to device modal (fixes #4157)
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/4186 LGTM: AudriusButkevicius, calmh
This commit is contained in:
@@ -1185,7 +1185,15 @@ angular.module('syncthing.core')
|
||||
$scope.addDevice = function (deviceID, name) {
|
||||
return $http.get(urlbase + '/system/discovery')
|
||||
.success(function (registry) {
|
||||
$scope.discovery = registry;
|
||||
$scope.discovery = [];
|
||||
for (var id in registry) {
|
||||
if ($scope.discovery.length === 5) {
|
||||
break;
|
||||
}
|
||||
if (!(id in $scope.devices)) {
|
||||
$scope.discovery.push(id);
|
||||
}
|
||||
}
|
||||
})
|
||||
.then(function () {
|
||||
$scope.currentDevice = {
|
||||
|
||||
Reference in New Issue
Block a user