mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-01-31 01:51:53 +08:00
platform info
This commit is contained in:
@@ -258,3 +258,27 @@ div#msd-progress span#msd-progress-value {
|
||||
display: inline-block;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
ul#bottom {
|
||||
list-style-type: none;
|
||||
bottom: 0;
|
||||
position: fixed;
|
||||
width: 100%;
|
||||
padding: 0;
|
||||
font-size: 0.7em;
|
||||
color: var(--fg-color-inactive);
|
||||
z-index: -1;
|
||||
}
|
||||
ul#bottom li {
|
||||
padding: 0 10px;
|
||||
}
|
||||
ul#bottom li.bottom-left {
|
||||
float: left;
|
||||
}
|
||||
ul#bottom li.bottom-right {
|
||||
float: right;
|
||||
}
|
||||
ul#bottom li a {
|
||||
text-decoration: underline dotted;
|
||||
color: var(--fg-color-inactive);
|
||||
}
|
||||
|
||||
@@ -160,5 +160,10 @@
|
||||
<img src="/streamer/?action=stream" id="stream-image" class="stream-image-inactive" alt="Loading..." />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<ul id="bottom">
|
||||
<li id="kvmd-version" class="bottom-left"></li>
|
||||
<li class="bottom-right"><a target="_blank" href="https://github.com/mdevaev/pi-kvm">Pi-KVM Project</a></li>
|
||||
</ul>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
function main () {
|
||||
window.onclick = ui.windowClickHandler;
|
||||
session.loadKvmdVersion();
|
||||
session.startPoller();
|
||||
stream.startPoller();
|
||||
}
|
||||
|
||||
@@ -3,6 +3,18 @@ var session = new function() {
|
||||
var __ping_timer = null;
|
||||
var __missed_heartbeats = 0;
|
||||
|
||||
this.loadKvmdVersion = function() {
|
||||
var http = tools.makeRequest("GET", "/kvmd/info", function() {
|
||||
if (http.readyState === 4) {
|
||||
if (http.status === 200) {
|
||||
$("kvmd-version").innerHTML = "kvmd " + JSON.parse(http.responseText).result.version.kvmd;
|
||||
} else {
|
||||
setTimeout(session.loadKvmdVersion, 1000);
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
this.startPoller = function() {
|
||||
__ws = new WebSocket("ws://" + location.host + "/kvmd/ws");
|
||||
__ws.onopen = __wsOpenHandler;
|
||||
|
||||
Reference in New Issue
Block a user