diff options
author | Devaev Maxim <[email protected]> | 2018-07-23 03:22:08 +0300 |
---|---|---|
committer | Devaev Maxim <[email protected]> | 2018-07-23 03:22:08 +0300 |
commit | c07f811c878f18c464002a36e804564a70c2d094 (patch) | |
tree | 286fb7805b4ebf18b82d0d3418d372673decee6c /kvmd/web/js/session.js | |
parent | 434d16d52372ce10eb09302b38049fbde5c50e0f (diff) |
platform info
Diffstat (limited to 'kvmd/web/js/session.js')
-rw-r--r-- | kvmd/web/js/session.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/kvmd/web/js/session.js b/kvmd/web/js/session.js index 33c8af60..de2bd2a9 100644 --- a/kvmd/web/js/session.js +++ b/kvmd/web/js/session.js @@ -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; |