Splash
4 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
8 additions and
2 deletions
-
src/static/scripts/admin_diagnostics.js
|
|
@ -349,7 +349,13 @@ async function checkHttpResponse() { |
|
|
|
async function fetchWsUrl(wsUrl) { |
|
|
|
return new Promise((resolve, reject) => { |
|
|
|
try { |
|
|
|
const ws = new WebSocket(wsUrl); |
|
|
|
const url = new URL(wsUrl); |
|
|
|
if (url.protocol == 'http:') { |
|
|
|
url.protocol = 'ws:'; |
|
|
|
} else if (url.protocol == 'https:') { |
|
|
|
url.protocol = 'wss:'; |
|
|
|
} |
|
|
|
const ws = new WebSocket(url.href); |
|
|
|
ws.onopen = () => { |
|
|
|
ws.close(); |
|
|
|
resolve(true); |
|
|
@ -424,4 +430,4 @@ document.addEventListener("DOMContentLoaded", (event) => { |
|
|
|
if (btnCopySupport) { |
|
|
|
btnCopySupport.addEventListener("click", copyToClipboard); |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|