diff options
author | Devaev Maxim <[email protected]> | 2018-11-16 23:23:54 +0300 |
---|---|---|
committer | Devaev Maxim <[email protected]> | 2018-11-16 23:23:54 +0300 |
commit | 0bf39f56e26268b68bb598ae06f6f91cc3bdc0f4 (patch) | |
tree | c38ea1120de1ec364d0a0d2b77dd8650646176be | |
parent | 127b22b4be62ea94d45f3782d7de2444b0d10ce1 (diff) |
metadata in web
-rw-r--r-- | web/css/kvm/about.css | 24 | ||||
-rw-r--r-- | web/js/kvm/session.js | 14 | ||||
-rw-r--r-- | web/kvm.html | 16 |
3 files changed, 40 insertions, 14 deletions
diff --git a/web/css/kvm/about.css b/web/css/kvm/about.css index 46cf382a..291af04d 100644 --- a/web/css/kvm/about.css +++ b/web/css/kvm/about.css @@ -20,3 +20,27 @@ div#about td.copyright { div#about tr.version { font-family: monospace; } + +div#about textarea { + display: block; + resize: none; + width: 100%; + height: 150px; + padding: 0; + color: var(--fg-color-normal); + background-color: var(--bg-color-menu); + border: none; + outline: 0 !important; + box-sizing: border-box; + padding: 5px; + font-family: monospace; + -webkit-appearance:none; +} +div#about textarea::-moz-placeholder { + line-height: 150px; + text-align: center; +} +div#about textarea::-webkit-input-placeholder { + line-height: 150px; + text-align: center; +} diff --git a/web/js/kvm/session.js b/web/js/kvm/session.js index 386c781c..f2906110 100644 --- a/web/js/kvm/session.js +++ b/web/js/kvm/session.js @@ -26,7 +26,19 @@ function Session() { if (http.readyState === 4) { if (http.status === 200) { var info = JSON.parse(http.responseText).result; - $("kvmd-version").innerHTML = "kvmd v" + info.version.kvmd; + if (info.meta) { + $("about-meta").innerHTML = ( + "// The server metadata.\n" + + "// You can get this json using handle /kvmd/info.\n" + + "// In the standard configuration this data\n" + + "// is specified in the file /etc/kvmd/meta.yaml.\n\n" + + JSON.stringify(info.meta, undefined, 4) + ); + if (info.meta.server && info.meta.server.host) { + document.title = "Pi-KVM Session - " + info.meta.server.host; + $("kvmd-meta-server-host").innerHTML = "Server: " + info.meta.server.host; + } + } $("about-version-kvmd").innerHTML = info.version.kvmd; $("about-version-streamer").innerHTML = info.version.streamer + " (" + info.streamer + ")"; } else { diff --git a/web/kvm.html b/web/kvm.html index d8de279f..8df1b83d 100644 --- a/web/kvm.html +++ b/web/kvm.html @@ -2,7 +2,7 @@ <html lang="en"> <head> <meta charset="utf-8" /> - <title>Pi-KVM / Session</title> + <title>Pi-KVM Session</title> <link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png"> <link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"> @@ -581,17 +581,7 @@ </tr> </table> <hr> - This is a web interface for KVMD. For better experience<br> - we recommend you to use a fresh version of one<br> - of the following browsers:<br> - <ul> - <li><a target="_blank" href="https://google.com/chrome">Google Chrome</a> <sup><i>recommended</i></sup></li> - <li><a target="_blank" href="https://chromium.org/Home">Chromium</a> <sup><i>recommended</i></sup></li> - <li><a target="_blank" href="https://mozilla.org/firefox">Mozilla Firefox</a></li> - <li><a target="_blank" href="https://apple.com/safari">Apple Safari</a></li> - <li><a target="_blank" href="https://opera.com">Opera</a></li> - <li><a target="_blank" href="https://vivaldi.com">Vivaldi</a></li> - </ul> + <textarea readonly placeholder="No data" id="about-meta"></textarea> <hr> Please visit our site <a target="_blank" href="https://github.com/pi-kvm">https://github.com/pi-kvm</a> to get documentation,<br> source codes, hardware schematics and legal information.<br> @@ -599,7 +589,7 @@ </div> <ul class="footer"> - <li id="kvmd-version" class="footer-left"></li> + <li id="kvmd-meta-server-host" class="footer-left"></li> <li class="footer-right"><a target="_blank" href="https://github.com/pi-kvm">Pi-KVM Project</a></li> </ul> </body> |