Skip to content

Commit

Permalink
feat: Add version to footer of UI
Browse files Browse the repository at this point in the history
Issue #539
  • Loading branch information
MatthewJohn committed Aug 29, 2024
1 parent 0ab040a commit d76a11a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
11 changes: 11 additions & 0 deletions terrareg/static/js/terrareg/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,4 +168,15 @@ function convertImportedHtml(element, forceHcl=false) {
}
}
}
}

/*
* Populates version content from data from version endpoint
*/
function populateVersionText() {
$.get('/v1/terrareg/version').then((data) => {
if (data.version) {
$('#terrareg-version').text(` (${data.version})`);
}
})
}
3 changes: 2 additions & 1 deletion terrareg/templates/template.html
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@

$(document).ready(() => {
setupPageLogin();
populateVersionText();
});
</script>

Expand Down Expand Up @@ -237,7 +238,7 @@
<footer class="footer">
<div class="content has-text-centered">
<p>
Made with <span class="icon"><i class="far fa-heart"></i></span> - <a href="https://gitlab.dockstudios.co.uk/pub/terrareg">Terrareg</a>
Made with <span class="icon"><i class="far fa-heart"></i></span> - <a href="https://gitlab.dockstudios.co.uk/pub/terrareg">Terrareg</a><span id="terrareg-version"></span>
</p>

<p id="provider-tos">
Expand Down

0 comments on commit d76a11a

Please sign in to comment.