mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
Changes to version update logic
Now the last stable will be used when the latest stable version have a higher version number than the last beta version. This only triggers when Beta Branch is used. If the user chooses Stable only stable versions will be considered.
This commit is contained in:
parent
a67bfaf7b3
commit
5953ae3b21
@ -84,21 +84,39 @@ $(document).ready( function() {
|
|||||||
window.parsedUpdateJSON = JSON.parse(data);
|
window.parsedUpdateJSON = JSON.parse(data);
|
||||||
|
|
||||||
for(let i=0; i<window.parsedUpdateJSON.length; i++) {
|
for(let i=0; i<window.parsedUpdateJSON.length; i++) {
|
||||||
if(window.parsedUpdateJSON[i].channel == window.serverConfig.general.versionBranch) {
|
if(window.parsedUpdateJSON[i].channel == "Stable") {
|
||||||
window.latestVersion = window.parsedUpdateJSON[i].versionnr;
|
window.latestStableVersion = window.parsedUpdateJSON[i];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else window.latestVersion = window.currentVersion;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var cleanLatestVersion = window.latestVersion.replace(/\./g, '');
|
for(let i=0; i<window.parsedUpdateJSON.length; i++) {
|
||||||
|
if(window.parsedUpdateJSON[i].channel == "Beta") {
|
||||||
|
window.latestBetaVersion = window.parsedUpdateJSON[i];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log("Stable"+ window.latestStableVersion.versionnr.replace(/\./g, ''))
|
||||||
|
console.log("Beta"+ window.latestBetaVersion.versionnr.replace(/\./g, ''))
|
||||||
|
|
||||||
|
if(window.serverConfig.general.versionBranch == "Beta" && window.latestStableVersion.versionnr.replace(/\./g, '') <= window.latestBetaVersion.versionnr.replace(/\./g, '')) {
|
||||||
|
window.latestVersion = window.latestBetaVersion;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
window.latestVersion = window.latestStableVersion;
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log(latestVersion)
|
||||||
|
|
||||||
|
var cleanLatestVersion = window.latestVersion.versionnr.replace(/\./g, '');
|
||||||
var cleanCurrentVersion = window.currentVersion.replace(/\./g, '');
|
var cleanCurrentVersion = window.currentVersion.replace(/\./g, '');
|
||||||
|
|
||||||
$('#dash_latev').html(window.currentVersion);
|
$('#dash_latev').html(window.currentVersion);
|
||||||
$('#dash_latev').html(window.latestVersion);
|
$('#dash_latev').html(window.latestVersion.versionnr + ' (' + window.latestVersion.channel + ')');
|
||||||
|
|
||||||
if ( cleanCurrentVersion < cleanLatestVersion )
|
if ( cleanCurrentVersion < cleanLatestVersion )
|
||||||
$('#versioninforesult').html('<div class="bs-callout bs-callout-warning" style="margin:0px">'+$.i18n('dashboard_infobox_message_updatewarning', window.latestVersion)+'</div>');
|
$('#versioninforesult').html('<div class="bs-callout bs-callout-warning" style="margin:0px">'+$.i18n('dashboard_infobox_message_updatewarning', window.latestVersion.versionnr) + ' (' + window.latestVersion.channel + ')</div>');
|
||||||
else
|
else
|
||||||
$('#versioninforesult').html('<div class="bs-callout bs-callout-success" style="margin:0px">'+$.i18n('dashboard_infobox_message_updatesuccess')+'</div>');
|
$('#versioninforesult').html('<div class="bs-callout bs-callout-success" style="margin:0px">'+$.i18n('dashboard_infobox_message_updatesuccess')+'</div>');
|
||||||
});
|
});
|
||||||
|
@ -4,6 +4,8 @@ window.webOrigin = "Web Configuration";
|
|||||||
window.showOptHelp = true;
|
window.showOptHelp = true;
|
||||||
window.currentVersion = null;
|
window.currentVersion = null;
|
||||||
window.latestVersion = null;
|
window.latestVersion = null;
|
||||||
|
window.latestStableVersion = null;
|
||||||
|
window.latestBetaVersion = null;
|
||||||
window.serverInfo = {};
|
window.serverInfo = {};
|
||||||
window.parsedUpdateJSON = {};
|
window.parsedUpdateJSON = {};
|
||||||
window.serverSchema = {};
|
window.serverSchema = {};
|
||||||
|
Loading…
Reference in New Issue
Block a user