diff options
Diffstat (limited to 'web/share/js/vnc/main.js')
-rw-r--r-- | web/share/js/vnc/main.js | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/web/share/js/vnc/main.js b/web/share/js/vnc/main.js index 440e51d4..965c7e9e 100644 --- a/web/share/js/vnc/main.js +++ b/web/share/js/vnc/main.js @@ -31,19 +31,17 @@ export function main() { } function __loadKvmdInfo() { - let http = tools.makeRequest("GET", "/api/info", function() { - if (http.readyState === 4) { - if (http.status === 200) { - let vnc_port = JSON.parse(http.responseText).result.extras.vnc.port; - $("vnc-text").innerHTML = ` - <span class="code-comment"># How to connect using the Linux terminal:<br> - $</span> vncviewer ${window.location.hostname}::${vnc_port} - `; - } else if (http.status === 401 || http.status === 403) { - document.location.href = "/login"; - } else { - setTimeout(__loadKvmdInfo, 1000); - } + tools.httpGet("/api/info", function(http) { + if (http.status === 200) { + let vnc_port = JSON.parse(http.responseText).result.extras.vnc.port; + $("vnc-text").innerHTML = ` + <span class="code-comment"># How to connect using the Linux terminal:<br> + $</span> vncviewer ${window.location.hostname}::${vnc_port} + `; + } else if (http.status === 401 || http.status === 403) { + document.location.href = "/login"; + } else { + setTimeout(__loadKvmdInfo, 1000); } }); } |