Skip to content

Commit

Permalink
tweak: lowered intensity of patch update notices
Browse files Browse the repository at this point in the history
  • Loading branch information
tabarra committed Sep 14, 2022
1 parent 61e5610 commit b395390
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 18 deletions.
28 changes: 20 additions & 8 deletions core/extras/updateChecker.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,27 @@ export default async () => {
try {
const isOutdated = semver.lt(txEnv.txAdminVersion, apiResponse.latest_txadmin);
if (isOutdated) {
logError('This version of txAdmin is outdated.');
logError('Please update as soon as possible.');
logError('For more information: https://discord.gg/uAmsGa2');
const semverDiff = semver.diff(txEnv.txAdminVersion, apiResponse.latest_txadmin);
txOutput = {
semverDiff,
latest: apiResponse.latest_txadmin,
color: (semverDiff === 'patch') ? 'warning' : 'danger',
};
if (semverDiff === 'patch') {
logWarn('This version of txAdmin is outdated.');
logWarn('A patch (bug fix) update is available for txAdmin.');
logWarn('If you are experiencing any kind of issue, please update now.');
logWarn('For more information: https://discord.gg/uAmsGa2');
txOutput = {
semverDiff,
latest: apiResponse.latest_txadmin,
color: 'secondary',
};
} else {
logError('This version of txAdmin is outdated.');
logError('Please update as soon as possible.');
logError('For more information: https://discord.gg/uAmsGa2');
txOutput = {
semverDiff,
latest: apiResponse.latest_txadmin,
color: 'danger',
};
}
}
} catch (error) {
logWarn('Error checking for txAdmin updates. Enable verbosity for more information.');
Expand Down
28 changes: 18 additions & 10 deletions web/main/dashboard.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -116,21 +116,29 @@
<% if (txaOutdated) { %>
<div class="row justify-content-md-center">
<div class="col-md-6 text-center">
<div class="alert alert-<%= txaOutdated.color %> border-<%= txaOutdated.color %>" role="alert">
<div class="alert alert-<%= txaOutdated.color %>" role="alert">
<h5 style="margin-bottom: 0px;">
<svg class="alert-title-icon" width="22" height="22">
<use href="img/coreui_icons.svg#cil-cloud-download"></use>
</svg>
This version of txAdmin is outdated.
<% if (txaOutdated.semverDiff === 'patch') { %>
A patch (bug fix) update is available for txAdmin.
<% } else{ %>
This version of txAdmin is outdated.
<% } %>
</h5>
txAdmin v<%= txaOutdated.latest %> has been released.
Please update now, it is <i>very</i> easy!
<div class="event-footer">
Support Discord:
<a href="https://discord.gg/uAmsGa2" target="_blank" >
<img src="https://discordapp.com/api/guilds/577993482761928734/widget.png?style=shield"></img>
</a>
</div>
<% if (txaOutdated.semverDiff === 'patch') { %>
If you are experiencing any kind of issue, please update now.
<% } else{ %>
Version <%= txaOutdated.latest %> has been released bringing new features, bug fixes and improvements. <br>
<div class="event-footer">
Please update now. Support Discord:
<a href="https://discord.gg/uAmsGa2" target="_blank" >
<img src="https://discordapp.com/api/guilds/577993482761928734/widget.png?style=shield"></img>
</a>
</div>
<% } %>
</div>
</div>
</div>
Expand Down

0 comments on commit b395390

Please sign in to comment.