summaryrefslogtreecommitdiff
path: root/web/js/index
diff options
context:
space:
mode:
Diffstat (limited to 'web/js/index')
-rw-r--r--web/js/index/main.js65
1 files changed, 0 insertions, 65 deletions
diff --git a/web/js/index/main.js b/web/js/index/main.js
deleted file mode 100644
index 8f5c74a6..00000000
--- a/web/js/index/main.js
+++ /dev/null
@@ -1,65 +0,0 @@
-function main() {
- if (checkBrowser()) {
- __setAppText();
- __loadKvmdInfo();
- }
-}
-
-function __setAppText() {
- $("app-text").innerHTML = `
- <span class="code-comment"># On Linux using Chromium/Chrome via any terminal:<br>
- $</span> \`which chromium 2>/dev/null || which chrome 2>/dev/null\` --app="${window.location.href}"<br>
- <br>
- <span class="code-comment"># On MacOS using Terminal application:<br>
- $</span> /Applications/Google&bsol; Chrome.app/Contents/MacOS/Google&bsol; Chrome --app="${window.location.href}"<br>
- <br>
- <span class="code-comment"># On Windows via cmd.exe:<br>
- C:&bsol;&gt;</span> start chrome --app="${window.location.href}"
- `;
-}
-
-function __loadKvmdInfo() {
- var http = tools.makeRequest("GET", "/kvmd/info", function() {
- if (http.readyState === 4) {
- if (http.status === 200) {
- var info = JSON.parse(http.responseText).result;
-
- var apps = Object.values(info.extras).sort(function(a, b) {
- if (a["place"] < b["place"]) {
- return -1;
- } else if (a["place"] > b["place"]) {
- return 1;
- } else {
- return 0;
- }
- });
-
- $("apps-box").innerHTML = "<ul id=\"apps\"></ul>";
- apps.forEach(function(app) {
- $("apps").innerHTML += `
- <li>
- <div class="app">
- <a href="${app.path}">
- <div>
- <img class="svg-gray" src="${app.icon}">
- ${app.name}
- </div>
- </a>
- </div>
- </li>
- `;
- });
-
- if (info.meta && info.meta.server && info.meta.server.host) {
- $("kvmd-meta-server-host").innerHTML = info.meta.server.host;
- document.title = "Pi-KVM Index: " + info.meta.server.host;
- } else {
- $("kvmd-meta-server-host").innerHTML = "";
- document.title = "Pi-KVM Index";
- }
- } else {
- setTimeout(__loadKvmdInfo, 1000);
- }
- }
- });
-}