url refactoring

This commit is contained in:
Devaev Maxim
2019-04-27 01:58:21 +03:00
parent a89612e5ac
commit c40f13e2d7
10 changed files with 29 additions and 29 deletions

View File

@@ -46,7 +46,7 @@ function Session() {
let text = JSON.stringify(state.meta, undefined, 4).replace(/ /g, "&nbsp;").replace(/\n/g, "<br>");
$("about-meta").innerHTML = `
<span class="code-comment">// The Pi-KVM metadata.<br>
// You can get this json using handle <a target="_blank" href="/kvmd/info">/kvmd/info</a>.<br>
// You can get this json using handle <a target="_blank" href="/api/info">/api/info</a>.<br>
// In the standard configuration this data<br>
// is specified in the file /etc/kvmd/meta.yaml.</span><br>
<br>
@@ -69,11 +69,11 @@ function Session() {
$("link-led").className = "led-yellow";
$("link-led").title = "Connecting...";
let http = tools.makeRequest("GET", "/kvmd/auth/check", function() {
let http = tools.makeRequest("GET", "/api/auth/check", function() {
if (http.readyState === 4) {
if (http.status === 200) {
let proto = (location.protocol === "https:" ? "wss" : "ws");
__ws = new WebSocket(`${proto}://${location.host}/kvmd/ws`);
__ws = new WebSocket(`${proto}://${location.host}/api/ws`);
__ws.onopen = __wsOpenHandler;
__ws.onmessage = __wsMessageHandler;
__ws.onerror = __wsErrorHandler;