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:
Simon Frei
2017-06-16 15:27:09 +00:00
committed by Jakob Borg
parent d0061c172c
commit 98cfc204ca
3 changed files with 17 additions and 2 deletions

View File

@@ -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 = {