Add version information into UI (#35)

This commit adds the tool version into the UI in the top bar.
This commit is contained in:
Lior Noy
2022-10-25 16:08:28 +03:00
committed by GitHub
parent 91df9392c0
commit be6666373b
2 changed files with 13 additions and 0 deletions

View File

@@ -44,6 +44,9 @@
</div> </div>
</div> </div>
<div id="toolVersion">
</div>
<div class="separator-vertical mx-3"><span></span></div> <div class="separator-vertical mx-3"><span></span></div>
<ul class="navbar-nav me-auto mb-2 mb-lg-0"> <ul class="navbar-nav me-auto mb-2 mb-lg-0">

View File

@@ -21,6 +21,12 @@ $(function () {
$("#upgradeModal .btn-scan").hide() $("#upgradeModal .btn-scan").hide()
} }
}) })
$.get("/status").fail(function (xhr) {
reportError("Failed to get tool version", xhr)
}).done(function (data) {
fillToolVersion(data)
})
}) })
function initView() { function initView() {
@@ -195,4 +201,8 @@ function isNewerVersion(oldVer, newVer) {
if (a < b) return false if (a < b) return false
} }
return false return false
}
function fillToolVersion(data) {
$("#toolVersion").append($('<a>' + data + '</a>'))
} }