mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
New version function
This commit is contained in:
@@ -80,43 +80,21 @@ $(document).ready( function() {
|
||||
$('#dash_ports').html(window.serverConfig.flatbufServer.port+' | '+window.serverConfig.protoServer.port);
|
||||
$('#dash_versionbranch').html(window.serverConfig.general.versionBranch);
|
||||
|
||||
$.get( window.gitHubReleaseApiUrl, function( releases ) {
|
||||
window.gitHubVersionList = releases;
|
||||
getReleases(function(){
|
||||
var cleanLatestVersion = window.latestVersion.tag_name.replace(/\./g, '');
|
||||
var cleanCurrentVersion = window.currentVersion.replace(/\./g, '');
|
||||
|
||||
for(var i in releases)
|
||||
{
|
||||
if(releases[i].prerelease == true)
|
||||
{
|
||||
window.latestBetaVersion = releases[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
$('#dash_latev').html(window.currentVersion);
|
||||
$('#dash_latev').html(window.latestVersion.tag_name + ' (' + (window.latestVersion.prerelease == true ? "Beta" : "Stable") + ')');
|
||||
|
||||
$.get( window.gitHubReleaseApiUrl + "/latest", function( latest ) {
|
||||
window.latestStableVersion = latest;
|
||||
|
||||
if(window.serverConfig.general.versionBranch == "Beta" && window.latestStableVersion.tag_name.replace(/\./g, '') <= window.latestBetaVersion.tag_name.replace(/\./g, ''))
|
||||
{
|
||||
window.latestVersion = window.latestBetaVersion;
|
||||
}
|
||||
else
|
||||
{
|
||||
window.latestVersion = window.latestStableVersion;
|
||||
}
|
||||
|
||||
var cleanLatestVersion = window.latestVersion.tag_name.replace(/\./g, '');
|
||||
var cleanCurrentVersion = window.currentVersion.replace(/\./g, '');
|
||||
|
||||
$('#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>');
|
||||
else
|
||||
$('#versioninforesult').html('<div class="bs-callout bs-callout-success" style="margin:0px">'+$.i18n('dashboard_infobox_message_updatesuccess')+'</div>');
|
||||
});
|
||||
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>');
|
||||
else
|
||||
$('#versioninforesult').html('<div class="bs-callout bs-callout-success" style="margin:0px">'+$.i18n('dashboard_infobox_message_updatesuccess')+'</div>');
|
||||
});
|
||||
|
||||
|
||||
|
||||
//determine platform
|
||||
var grabbers = window.serverInfo.grabbers.available;
|
||||
var html = "";
|
||||
|
Reference in New Issue
Block a user