refactoring

This commit is contained in:
Devaev Maxim
2020-07-21 15:02:57 +03:00
parent b5ba546481
commit 360ff00903
9 changed files with 91 additions and 98 deletions

View File

@@ -34,11 +34,10 @@ function __loadKvmdInfo() {
let http = tools.makeRequest("GET", "/api/info", function() {
if (http.readyState === 4) {
if (http.status === 200) {
let port = JSON.parse(http.responseText).result.extras.vnc.port;
let host = window.location.hostname;
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 ${host}::${port}
$</span> vncviewer ${window.location.hostname}::${vnc_port}
`;
} else if (http.status === 401 || http.status === 403) {
document.location.href = "/login";