Added untested support for mDNS addition to grid

- This allows multiple hosts to be discovered from mDNS
- I don't have a GFE computer on my network, so I can't really test this...
This commit is contained in:
R. Aidan Campbell 2016-06-15 10:57:32 -04:00
parent af6caddc9f
commit d123ee3cec

View File

@ -554,11 +554,16 @@ function onWindowLoad(){
findNvService(function (finder, opt_error) {
if (finder.byService_['_nvstream._tcp']) {
var ip = Object.keys(finder.byService_['_nvstream._tcp'])[0];
if (finder.byService_['_nvstream._tcp'][ip]) {
$('#GFEHostIPField').val(ip);
$('#GFEHostIPField').parent().addClass('is-dirty'); // mark it as dirty to float the textfield label
updateHost();
var ips = Object.keys(finder.byService_['_nvstream._tcp']);
for (var ip in ips) {
if (finder.byService_['_nvstream._tcp'][ip]) {
var cell = document.createElement('div');
cell.className += 'mdl-cell mdl-cell--3-col';
cell.id = 'hostgrid-' + ip;
cell.innerHTML = ip;
$('#host-grid').append(cell);
cell.onclick = hostChosen;
}
}
}
});