summaryrefslogtreecommitdiff
path: root/web
diff options
context:
space:
mode:
authorDevaev Maxim <[email protected]>2019-04-27 01:58:21 +0300
committerDevaev Maxim <[email protected]>2019-04-27 01:58:21 +0300
commitc40f13e2d79c2ed23502e3c49f9b1e8c7d23f1c2 (patch)
tree0f0e006ebbb8eb0ea7b1e25dab82af908727096f /web
parenta89612e5ac6ae03089500768bed9ef049ce75c4b (diff)
url refactoring
Diffstat (limited to 'web')
-rw-r--r--web/index.html2
-rw-r--r--web/share/js/index/main.js4
-rw-r--r--web/share/js/kvm/atx.js2
-rw-r--r--web/share/js/kvm/hid.js2
-rw-r--r--web/share/js/kvm/main.js2
-rw-r--r--web/share/js/kvm/msd.js6
-rw-r--r--web/share/js/kvm/session.js6
-rw-r--r--web/share/js/kvm/stream.js4
-rw-r--r--web/share/js/login/main.js2
9 files changed, 15 insertions, 15 deletions
diff --git a/web/index.html b/web/index.html
index e7ab8f3d..755880c1 100644
--- a/web/index.html
+++ b/web/index.html
@@ -72,7 +72,7 @@
<table>
<tr class="server">
<td>Server:</td>
- <td><a id="kvmd-meta-server-host" target="_blank" href="/kvmd/info"></a></td>
+ <td><a id="kvmd-meta-server-host" target="_blank" href="/api/info"></a></td>
</tr>
</table>
<hr>
diff --git a/web/share/js/index/main.js b/web/share/js/index/main.js
index beb6fbd9..9b3780aa 100644
--- a/web/share/js/index/main.js
+++ b/web/share/js/index/main.js
@@ -45,7 +45,7 @@ function __setAppText() {
}
function __loadKvmdInfo() {
- let http = tools.makeRequest("GET", "/kvmd/info", function() {
+ let http = tools.makeRequest("GET", "/api/info", function() {
if (http.readyState === 4) {
if (http.status === 200) {
let info = JSON.parse(http.responseText).result;
@@ -101,7 +101,7 @@ function __makeApp(id, path, icon, name) {
}
function __logout() {
- let http = tools.makeRequest("POST", "/kvmd/auth/logout", function() {
+ let http = tools.makeRequest("POST", "/api/auth/logout", function() {
if (http.readyState === 4) {
if (http.status === 200 || http.status === 401 || http.status === 403) {
document.location.href = "/login";
diff --git a/web/share/js/kvm/atx.js b/web/share/js/kvm/atx.js
index b0da761e..b718b99c 100644
--- a/web/share/js/kvm/atx.js
+++ b/web/share/js/kvm/atx.js
@@ -56,7 +56,7 @@ function Atx() {
var __clickButton = function(button, confirm_msg) {
wm.confirm(confirm_msg).then(function(ok) {
if (ok) {
- let http = tools.makeRequest("POST", "/kvmd/atx/click?button=" + button, function() {
+ let http = tools.makeRequest("POST", "/api/atx/click?button=" + button, function() {
if (http.readyState === 4) {
if (http.status === 409) {
wm.error("Performing another ATX operation for other client.<br>Please try again later");
diff --git a/web/share/js/kvm/hid.js b/web/share/js/kvm/hid.js
index 17b21ca9..345b28eb 100644
--- a/web/share/js/kvm/hid.js
+++ b/web/share/js/kvm/hid.js
@@ -215,7 +215,7 @@ function Hid() {
var __clickResetButton = function() {
wm.confirm("Are you sure you want to reset HID (keyboard & mouse)?").then(function(ok) {
if (ok) {
- let http = tools.makeRequest("POST", "/kvmd/hid/reset", function() {
+ let http = tools.makeRequest("POST", "/api/hid/reset", function() {
if (http.readyState === 4) {
if (http.status !== 200) {
wm.error("HID reset error:<br>", http.responseText);
diff --git a/web/share/js/kvm/main.js b/web/share/js/kvm/main.js
index 308b34c0..dcbb1eeb 100644
--- a/web/share/js/kvm/main.js
+++ b/web/share/js/kvm/main.js
@@ -35,7 +35,7 @@ function main() {
tools.setOnClick($("show-about-button"), () => wm.showWindow($("about-window")));
tools.setOnClick($("show-keyboard-button"), () => wm.showWindow($("keyboard-window")));
tools.setOnClick($("show-stream-button"), () => wm.showWindow($("stream-window")));
- tools.setOnClick($("open-log-button"), () => window.open("/kvmd/log?seek=3600&follow=1", "_blank"));
+ tools.setOnClick($("open-log-button"), () => window.open("/api/log?seek=3600&follow=1", "_blank"));
wm.showWindow($("stream-window"));
diff --git a/web/share/js/kvm/msd.js b/web/share/js/kvm/msd.js
index 09dfd7bf..d8059cab 100644
--- a/web/share/js/kvm/msd.js
+++ b/web/share/js/kvm/msd.js
@@ -57,7 +57,7 @@ function Msd() {
form_data.append("image_data", __image_file);
__upload_http = new XMLHttpRequest();
- __upload_http.open("POST", "/kvmd/msd/write", true);
+ __upload_http.open("POST", "/api/msd/write", true);
__upload_http.upload.timeout = 5000;
__upload_http.onreadystatechange = __uploadStateChange;
__upload_http.upload.onprogress = __uploadProgress;
@@ -74,7 +74,7 @@ function Msd() {
};
var __clickSwitchButton = function(to) {
- let http = tools.makeRequest("POST", "/kvmd/msd/connect?to=" + to, function() {
+ let http = tools.makeRequest("POST", "/api/msd/connect?to=" + to, function() {
if (http.readyState === 4) {
if (http.status !== 200) {
wm.error("Switch error:<br>", http.responseText);
@@ -101,7 +101,7 @@ function Msd() {
var __clickResetButton = function() {
wm.confirm("Are you sure you want to reset Mass Storage Device?").then(function(ok) {
if (ok) {
- let http = tools.makeRequest("POST", "/kvmd/msd/reset", function() {
+ let http = tools.makeRequest("POST", "/api/msd/reset", function() {
if (http.readyState === 4) {
if (http.status !== 200) {
wm.error("MSD reset error:<br>", http.responseText);
diff --git a/web/share/js/kvm/session.js b/web/share/js/kvm/session.js
index adeb330e..b01fbe34 100644
--- a/web/share/js/kvm/session.js
+++ b/web/share/js/kvm/session.js
@@ -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;
diff --git a/web/share/js/kvm/stream.js b/web/share/js/kvm/stream.js
index e34fc7dc..0a0de313 100644
--- a/web/share/js/kvm/stream.js
+++ b/web/share/js/kvm/stream.js
@@ -187,7 +187,7 @@ function Streamer() {
var __clickResetButton = function() {
wm.confirm("Are you sure you want to reset stream?").then(function (ok) {
if (ok) {
- let http = tools.makeRequest("POST", "/kvmd/streamer/reset", function() {
+ let http = tools.makeRequest("POST", "/api/streamer/reset", function() {
if (http.readyState === 4) {
if (http.status !== 200) {
wm.error("Can't reset stream:<br>", http.responseText);
@@ -199,7 +199,7 @@ function Streamer() {
};
var __sendParam = function(name, value) {
- let http = tools.makeRequest("POST", `/kvmd/streamer/set_params?${name}=${value}`, function() {
+ let http = tools.makeRequest("POST", `/api/streamer/set_params?${name}=${value}`, function() {
if (http.readyState === 4) {
if (http.status !== 200) {
wm.error("Can't configure stream:<br>", http.responseText);
diff --git a/web/share/js/login/main.js b/web/share/js/login/main.js
index bf185bf0..cd0746fc 100644
--- a/web/share/js/login/main.js
+++ b/web/share/js/login/main.js
@@ -45,7 +45,7 @@ function __login() {
} else {
let passwd = $("passwd-input").value;
let body = `user=${encodeURIComponent(user)}&passwd=${encodeURIComponent(passwd)}`;
- let http = tools.makeRequest("POST", "/kvmd/auth/login", function() {
+ let http = tools.makeRequest("POST", "/api/auth/login", function() {
if (http.readyState === 4) {
if (http.status === 200) {
document.location.href = "/";