fix some bugs in web monitor

This commit is contained in:
UpstreamData
2022-05-18 11:06:21 -06:00
parent 9f19b42de5
commit c3e285a9ee
3 changed files with 10 additions and 4 deletions

View File

@@ -56,7 +56,7 @@
window.post = function(url, data) {
return fetch(url, {method: "POST", headers: {'Content-Type': 'application/json'}, body: JSON.stringify(data)});
}
var ws = new WebSocket("ws://{{request.url.hostname}}:{{request.url.port}}/scan/ws");
var ws = new WebSocket("ws://{{request.url.hostname}}:{% if request.port %}{{request.url.port}}{% else %}80{% endif %}/scan/ws");
ws.onmessage = function(event) {
if (event.data == "Done") {
document.getElementById("scanButton").innerHTML = "Scan"