Changed WebUI Version Check to SemVer. Also addes "Alpha" Channel (#692)

This commit is contained in:
b1rdhous3
2020-02-19 17:29:11 +01:00
committed by GitHub
parent 2db3f0c835
commit 065634076b
11 changed files with 660 additions and 42 deletions

View File

@@ -75,7 +75,7 @@ $(document).ready( function() {
// add more info
$('#dash_leddevice').html(window.serverConfig.device.type);
$('#dash_currv').html(window.currentChannel+' '+window.currentVersion);
$('#dash_currv').html(window.currentVersion);
$('#dash_instance').html(window.currentHyperionInstanceName);
$('#dash_ports').html(window.serverConfig.flatbufServer.port+' | '+window.serverConfig.protoServer.port);
$('#dash_watchedversionbranch').html(window.serverConfig.general.watchedVersionBranch);
@@ -83,17 +83,15 @@ $(document).ready( function() {
getReleases(function(callback){
if(callback)
{
var cleanLatestVersion = window.latestVersion.tag_name.replace(/\./g, '');
var cleanCurrentVersion = window.currentVersion.replace(/\./g, '');
debugger;
$('#dash_latev').html(window.latestVersion.tag_name);
$('#dash_latev').html(window.currentVersion);
$('#dash_latev').html(window.latestVersion.tag_name + ' (' + (window.latestVersion.prerelease == true ? "Beta" : "Stable") + ')');
if ( cleanCurrentVersion < cleanLatestVersion )
$('#versioninforesult').html('<div class="bs-callout bs-callout-warning" style="margin:0px">'+$.i18n('dashboard_infobox_message_updatewarning', window.latestVersion.tag_name) + ' (' + (window.latestVersion.prerelease == true ? "Beta" : "Stable") + ')</div>');
if (semverLite.gt(window.latestVersion.tag_name, window.currentVersion))
$('#versioninforesult').html('<div class="bs-callout bs-callout-warning" style="margin:0px"><a target="_blank" href="' + window.latestVersion.html_url + '">'+$.i18n('dashboard_infobox_message_updatewarning', window.latestVersion.tag_name) + '</a></div>');
else
$('#versioninforesult').html('<div class="bs-callout bs-callout-success" style="margin:0px">'+$.i18n('dashboard_infobox_message_updatesuccess')+'</div>');
}
}
});