From d123ee3cec47f35830bce021953cf7f429fdecd4 Mon Sep 17 00:00:00 2001 From: "R. Aidan Campbell" Date: Wed, 15 Jun 2016 10:57:32 -0400 Subject: [PATCH] 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... --- static/js/index.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/static/js/index.js b/static/js/index.js index 509dc20..af0a6e1 100644 --- a/static/js/index.js +++ b/static/js/index.js @@ -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; + } } } });