diff --git a/wdocs/last/functions.js b/wdocs/last/functions.js index ebd241e..1ae132a 100644 --- a/wdocs/last/functions.js +++ b/wdocs/last/functions.js @@ -52,6 +52,7 @@ function map_marker(loc) if (loc.addr && loc.topic) { d = loc.topic + " " + loc.addr; + d = "" + loc.topic.split('/')[2] + "
" + loc.addr; } else { d = 'unknown'; } diff --git a/wdocs/last/index.html b/wdocs/last/index.html index e3d233c..fd6aecd 100644 --- a/wdocs/last/index.html +++ b/wdocs/last/index.html @@ -21,7 +21,7 @@ - +
diff --git a/wdocs/last/ws.js b/wdocs/last/websock.js similarity index 79% rename from wdocs/last/ws.js rename to wdocs/last/websock.js index b911d8b..f73ae9b 100644 --- a/wdocs/last/ws.js +++ b/wdocs/last/websock.js @@ -55,9 +55,16 @@ function ws_connect() { } window.onload = function() { - var url = 'ws://' + location.host + '/ws/last'; + // var url = 'ws://' + location.host + '/ws/last'; + // console.log(JSON.stringify(location)); - console.log(JSON.stringify(location)); + var url = "ws://" + location.host + "/"; + var parts = location.pathname.split('/'); + for (var i = 1; i < parts.length - 2; i++) { + url = url + parts[i] + "/"; + } + url = url + "ws"; + console.log("Websocket URI: " + url); ws_url = url; ws_connect();