Simpler entry of locally discovered nodes

This involved 3 commits, but each is dependent on the one before so I thought it worth combining them into a single pull request.

Worth mentioning a change to "discovery.All()" function. A grep showed it was only used by the rest API, which always failed because the return value could not be converted to JSON. It emitted some types exclusively made up of private members (cacheEntry). I thought there was more downside in exposing the internally used bytes compared with re-packinging the data as strings, which would have resulted in a second stage of convertion in the web API function anyway.

Use of a datalist in the GUI was chosen as it doesn't alter the design of the interface, although there is no support for a datalist in Windows Mobile or Safari, so this might need improving at some point, nevertheless I hope it's worth including as it stands for now.

PS: This is my first commit pull request on github ever.
Good idea, and in-keeping with other code in that file. I'll sort it out.

On 14/10/14 16:14, Audrius Butkevicius wrote:
>
> In gui/app.js:
>
> > @@ -666,15 +666,19 @@ syncthing.controller('SyncthingCtrl', function ($scope, $http, $translate, $loca
> >      };
> >
> >      $scope.addDevice = function () {
> > -        $scope.currentDevice = {
> > -            AddressesStr: 'dynamic',
> > -            Compression: true,
> > -            Introducer: false
> > -        };
> > -        $scope.editingExisting = false;
> > -        $scope.editingSelf = false;
> > -        $scope.deviceEditor.$setPristine();
> > -        $('#editDevice').modal();
> > +        $http.get(urlbase + '/discovery')
>
> I guess showing the modal should be done on |.then| or whatever 
> angular's callback is for both success and error.
> And just assign the |registry| on success.
>
> —
> Reply to this email directly or view it on GitHub 
> <https://github.com/syncthing/syncthing/pull/848/files#r18835164>.
>