Compare commits

..

No commits in common. "cdbd4c3c1042ff3acf08b81fdf92cce61b3ce474" and "16da321177a2313b0bf261a113ed703c094ae057" have entirely different histories.

3 changed files with 3 additions and 26 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" 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="alert alert-success" role="alert">A new version is available. <a href="#" 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,16 +30,5 @@
</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") %>

View File

@ -67,16 +67,9 @@ Sentry.init({
environment: config.global.debug ? 'development' : 'production'
});
app.locals.versionRevLong = require('child_process')
.execSync('git rev-parse HEAD')
.toString().trim()
app.locals.versionRev = require('child_process')
.execSync('git rev-parse --short HEAD')
.toString().trim()
app.locals.versionRevLatest = require('child_process')
.execSync('git ls-remote --refs -q')
.toString().trim().split("\t")[0]
log.core.info(`Running revision ${app.locals.versionRevLong} (${app.locals.versionRevLatest} latest)`);
// RequestHandler creates a separate execution context using domains, so that every
// transaction/span/breadcrumb is attached to its own Hub instance

View File

@ -2,12 +2,7 @@ import express, { Request, Response } from 'express';
function get(req: Request, res: Response) {
const revision = req.app.locals.versionRev;
let updateAvailable = false;
if(req.app.locals.versionRevLong !== req.app.locals.versionRevLatest) {
updateAvailable = true;
}
res.status(200).send({ version: '1.0.0', commit: revision, updateAvailable: updateAvailable });
res.status(200).send({ version: '1.0.0', commit: revision });
};
export default { get };