From 0bf39f56e26268b68bb598ae06f6f91cc3bdc0f4 Mon Sep 17 00:00:00 2001 From: Devaev Maxim Date: Fri, 16 Nov 2018 23:23:54 +0300 Subject: metadata in web --- web/css/kvm/about.css | 24 ++++++++++++++++++++++++ web/js/kvm/session.js | 14 +++++++++++++- web/kvm.html | 16 +++------------- 3 files changed, 40 insertions(+), 14 deletions(-) (limited to 'web') 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 @@ - Pi-KVM / Session + Pi-KVM Session @@ -581,17 +581,7 @@
- This is a web interface for KVMD. For better experience
- we recommend you to use a fresh version of one
- of the following browsers:
- +
Please visit our site https://github.com/pi-kvm to get documentation,
source codes, hardware schematics and legal information.
@@ -599,7 +589,7 @@ -- cgit v1.2.3