Show version string in header

This commit is contained in:
Alan Bernstein 2017-04-26 14:16:39 -05:00
parent 69b17dfca8
commit 183d78b027
2 changed files with 14 additions and 1 deletions

View file

@ -218,6 +218,18 @@ class REPL {
}
function populate_version() {
var xhr = new XMLHttpRequest();
xhr.open('GET', '/version')
var node = document.getElementById('server-version')
xhr.onload = function() {
version = JSON.parse(xhr.responseText)['version']
node.innerHTML = version
}
xhr.send(null)
}
function setNav(e) {
// toggle the nav buttons
document.getElementsByClassName("nav-active")[0].classList.remove("nav-active")
@ -258,6 +270,7 @@ Date.prototype.timeNow = function () {
return ((this.getHours() < 10)?"0":"") + this.getHours() +":"+ ((this.getMinutes() < 10)?"0":"") + this.getMinutes() +":"+ ((this.getSeconds() < 10)?"0":"") + this.getSeconds();
}
populate_version()
const input = document.getElementById('query')
const output = document.getElementById('outputs')

View file

@ -11,7 +11,7 @@
<body>
<div class="header">
<img src="https://dc3kpxyuw05cb.cloudfront.net/img/logo.svg" width="110" alt="">
<a href='/' >Support</a>
<div id="server-version" class=""></div>
</div>
<div class="container">
<div class="nav">