Skip to content

Commit be66663

Browse files
authored
Add version information into UI (#35)
This commit adds the tool version into the UI in the top bar.
1 parent 91df939 commit be66663

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

pkg/dashboard/static/index.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ <h1><a href="/">Helm Dashboard</a></h1>
4444
</div>
4545
</div>
4646

47+
<div id="toolVersion">
48+
</div>
49+
4750
<div class="separator-vertical mx-3"><span></span></div>
4851

4952
<ul class="navbar-nav me-auto mb-2 mb-lg-0">

pkg/dashboard/static/scripts.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ $(function () {
2121
$("#upgradeModal .btn-scan").hide()
2222
}
2323
})
24+
25+
$.get("/status").fail(function (xhr) {
26+
reportError("Failed to get tool version", xhr)
27+
}).done(function (data) {
28+
fillToolVersion(data)
29+
})
2430
})
2531

2632
function initView() {
@@ -195,4 +201,8 @@ function isNewerVersion(oldVer, newVer) {
195201
if (a < b) return false
196202
}
197203
return false
204+
}
205+
206+
function fillToolVersion(data) {
207+
$("#toolVersion").append($('<a>' + data + '</a>'))
198208
}

0 commit comments

Comments
 (0)