improved /version route to include git info

This commit is contained in:
2023-07-10 15:51:52 +02:00
parent 6f7f65fa36
commit bc9d395e77
3 changed files with 26 additions and 3 deletions

View File

@ -1,7 +1,7 @@
<%~ E.includeFile("../partials/head.eta.html", {"title": "Settings"}) %> <%~ E.includeFile("../partials/controls.eta.html", {"active": "SETT"}) %>
<h1>Manage your AssetFlow instance</h1>
<div class="alert alert-success" role="alert">A new version is available. <a href="#" class="alert-link">Click here to update</a></div>
<div class="alert alert-success" role="alert" id="updateNotifier">A new version is available. <a href="https://git.project-name-here.de/Project-Name-Here/assetflow/releases" class="alert-link">Click here to update</a></div>
<div class="container text-center">
<div class="row">
<a class="card col m-2" href="/manage/categories">
@ -30,5 +30,16 @@
</a>
</div>
</div>
<script>
$(document).ready(function () {
$.getJSON("/api/v1/version", function (data) {
if (data.updateAvailable) {
$("#updateNotifier").show();
// $("#updateNotifier").find(".alert-link").attr("href", data.url);
}else {
$("#updateNotifier").hide();
}
});
});
</script>
<%~ E.includeFile("../partials/controlsFoot.eta.html") %> <%~ E.includeFile("../partials/foot.eta.html") %>