Skip to content

Commit 99effa5

Browse files
DAcodedBEATwillnorris
authored andcommitted
feat: show version on dashboard
Display release version in dashboard footer via a new ui-footer.html template and a GetAppVersion func map entry that resolves to server.GetVersion. Also strip the leading "v" from GITHUB_REF_NAME in the release workflow's --version check so the expected value matches the CLI output. Signed-off-by: Arun Philip <arun@corkinc.com>
1 parent be6dbed commit 99effa5

5 files changed

Lines changed: 32 additions & 2 deletions

File tree

.github/workflows/release.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,6 @@ jobs:
6060
echo "Version: $VERSION"
6161
[ -n "$VERSION" ] || { echo "ERROR: --version produced empty output"; exit 1; }
6262
if [ "${GITHUB_EVENT_NAME}" != "pull_request" ]; then
63-
EXPECTED="${GITHUB_REF_NAME}"
63+
EXPECTED="${GITHUB_REF_NAME#v}"
6464
[ "$VERSION" = "$EXPECTED" ] || { echo "ERROR: expected $EXPECTED got $VERSION"; exit 1; }
6565
fi

server/ui-base.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@
1111

1212
{{block "content" .}}{{end}}
1313

14+
{{template "footer" .}}
1415
</body>
1516
</html>

server/ui-footer.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<footer class="app-footer">
2+
<div class="footer-content">
3+
<span class="version-info">tsidp {{GetAppVersion}}</span>
4+
</div>
5+
</footer>

server/ui-style.css

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,4 +450,23 @@ tbody tr:hover {
450450
.client-id {
451451
font-size: 10px;
452452
}
453-
}
453+
}
454+
455+
/* Footer */
456+
.app-footer {
457+
margin-top: 60px;
458+
padding: 24px 0;
459+
border-top: 1px solid rgb(var(--color-gray-800));
460+
}
461+
462+
.footer-content {
463+
max-width: 1120px;
464+
margin: 0 auto;
465+
padding: 0 20px;
466+
text-align: center;
467+
}
468+
469+
.version-info {
470+
color: rgb(var(--color-gray-500));
471+
font-size: 14px;
472+
}

server/ui.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,15 @@ var listHTML string
3030
//go:embed ui-edit.html
3131
var editHTML string
3232

33+
//go:embed ui-footer.html
34+
var footerHTML string
35+
3336
//go:embed ui-style.css
3437
var styleCSS string
3538

3639
var tmplFuncs = template.FuncMap{
3740
"joinRedirectURIs": joinRedirectURIs,
41+
"GetAppVersion": GetVersion,
3842
}
3943

4044
var (
@@ -48,6 +52,7 @@ func init() {
4852
newBase := func() *template.Template {
4953
t := template.Must(template.New("base").Funcs(tmplFuncs).Parse(baseHTML))
5054
template.Must(t.New("header").Parse(headerHTML))
55+
template.Must(t.New("footer").Parse(footerHTML))
5156
return t
5257
}
5358
l := newBase()

0 commit comments

Comments
 (0)