X-Git-Url: http://www.average.org/gitweb/?a=blobdiff_plain;f=webdemo%2Findex.html;h=20beb34c86f0c9a1239ecf993252b0b0ea7ec080;hb=aeb5721c171af9996ede4b5904d552170b4fe16c;hp=d0af1ac9f940d067148ea5c940520fdcb56dbd96;hpb=af6691efc04cf2fb6aaa22be606b6468cceaffb6;p=loctrkd.git diff --git a/webdemo/index.html b/webdemo/index.html index d0af1ac..20beb34 100644 --- a/webdemo/index.html +++ b/webdemo/index.html @@ -10,10 +10,11 @@ const urlParams = new URLSearchParams(window.location.search); const qimei = urlParams.get("imei"); - const ourl = new URL(window.location); - const wsproto = ourl.protocol === "https" ? "wss" : "ws"; - const wshost = ourl.hostname ? ourl.hostname : "localhost"; - const wsport = ourl.port ? ourl.port : 5049; + const wsproto = window.location.protocol === "https" ? "wss" : "ws"; + const wshost = window.location.hostname ? window.location.hostname + : "localhost"; + const wsport = window.location.port ? window.location.port : 5049; + const limei = window.location.pathname.substring(1) const imeis = new Set(); const locations = new Array(); @@ -47,6 +48,8 @@ tstamp = document.getElementById("tstamp"); if (qimei) { imei.value = qimei; + } else if (limei) { + imei.value = limei; } open_ws(); } @@ -158,6 +161,7 @@ imei.disabled = false; send.disabled = false; clear.disabled = false; + locations.splice(0); sendIMEI(); } function ws_onmessage(event) { @@ -215,8 +219,9 @@ - -
+ +
@@ -225,18 +230,15 @@ - - | - | -
-
-
- - - - http://www.average.org/gps303/ - +
+
+
+ |
+ |
+ |