mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
Version determination now with github api
This commit is contained in:
parent
ab3f803060
commit
e37abbb62d
@ -4,6 +4,7 @@
|
|||||||
<h3 class="page-header"><i class="fa fa-download fa-fw"></i><span data-i18n="main_menu_update_token">Update</span></h3>
|
<h3 class="page-header"><i class="fa fa-download fa-fw"></i><span data-i18n="main_menu_update_token">Update</span></h3>
|
||||||
<div class="introd">
|
<div class="introd">
|
||||||
<h4 data-i18n="update_label_intro">Overview about all available Hyperion versions. On top you could update or downgrade your version of Hyperion whenever you want. Sorted from newest to oldest</h4>
|
<h4 data-i18n="update_label_intro">Overview about all available Hyperion versions. On top you could update or downgrade your version of Hyperion whenever you want. Sorted from newest to oldest</h4>
|
||||||
|
<h4> At the moment the install buttons are not working. Development is still ongoing here. </h4>
|
||||||
<hr />
|
<hr />
|
||||||
</div>
|
</div>
|
||||||
<h4 id="update_currver"></h4>
|
<h4 id="update_currver"></h4>
|
||||||
@ -17,10 +18,23 @@
|
|||||||
<script>
|
<script>
|
||||||
// performTranslation('trans_update');
|
// performTranslation('trans_update');
|
||||||
performTranslation();
|
performTranslation();
|
||||||
|
if(window.gitHubVersionList != null)
|
||||||
for (key in parsedUpdateJSON)
|
|
||||||
{
|
{
|
||||||
$('#versionlist').append('<div class="col-lg-6"><div class="panel panel-default"><div class="panel-heading"><i class="fa fa-television fa-fw"></i>Hyperion V'+parsedUpdateJSON[key].versionnr+'</div><div class="panel-body"><p><span style="font-weight:bold;">'+$.i18n('update_label_type')+'</span> '+ parsedUpdateJSON[key].channel +'</p><p><span style="font-weight:bold;">'+$.i18n('update_label_description')+'</span> '+parsedUpdateJSON[key].versiondesc+'</p><hr><a class="btn btn-primary" href="'+ parsedUpdateJSON[key].versionchangelog +'" target="_blank"><i class="fa fa-list fa-fw"></i><span style="font-weight:bold;">'+$.i18n('update_button_changelog')+'</span></a><button type="button" class="btn btn-warning pull-right"><i class="fa fa-download fa-fw"></i>'+$.i18n('update_button_install')+'</button></div></div></div>');
|
for (key in window.gitHubVersionList)
|
||||||
|
{
|
||||||
|
|
||||||
|
if(window.gitHubVersionList[key].name == null || (window.serverConfig.general.versionBranch == "Stable" && window.gitHubVersionList[key].prerelease == true))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$('#versionlist').append('<div class="col-lg-6"><div class="panel panel-'+ (window.gitHubVersionList[key].prerelease == true ? "danger" : "default") +'"><div class="panel-heading"><i class="fa fa-television fa-fw"></i>Hyperion V'+window.gitHubVersionList[key].tag_name+'</div><div class="panel-body"><p><span style="font-weight:bold;">'+$.i18n('update_label_type') + '</span> ' + (window.gitHubVersionList[key].prerelease == true ? "Beta" : "Stable") + '</p><p><span style="font-weight:bold;">'+$.i18n('update_label_description')+'</span> '+window.gitHubVersionList[key].body+'</p><hr><a class="btn btn-primary" href="'+ window.gitHubVersionList[key].html_url +'" target="_blank"><i class="fa fa-list fa-fw"></i><span style="font-weight:bold;">'+$.i18n('update_button_changelog')+'</span></a><button type="button" class="btn btn-warning pull-right" ' + (window.gitHubVersionList[key].tag_name == window.currentVersion ? "disabled":"") + '><i class="fa fa-download fa-fw"></i>'+$.i18n('update_button_install')+'</button></div></div></div>');
|
||||||
}
|
}
|
||||||
$('#update_currver').append($.i18n('update_versreminder', currentVersion));
|
$('#update_currver').append($.i18n('update_versreminder', currentVersion));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$('#versionlist').append($.i18n('update_error_getting_versions'));
|
||||||
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
@ -256,6 +256,7 @@
|
|||||||
"update_button_changelog" : "Zeige Änderungsprotokoll",
|
"update_button_changelog" : "Zeige Änderungsprotokoll",
|
||||||
"update_label_type" : "Art:",
|
"update_label_type" : "Art:",
|
||||||
"update_versreminder" : "Deine Version: $1",
|
"update_versreminder" : "Deine Version: $1",
|
||||||
|
"update_error_getting_versions" : "Wir hatten Probleme die verfügbaren Versionen zu ermitteln.",
|
||||||
"about_version" : "Version",
|
"about_version" : "Version",
|
||||||
"about_build" : "Build",
|
"about_build" : "Build",
|
||||||
"about_builddate" : "Build Datum",
|
"about_builddate" : "Build Datum",
|
||||||
|
@ -256,6 +256,7 @@
|
|||||||
"update_button_changelog" : "Full changelog",
|
"update_button_changelog" : "Full changelog",
|
||||||
"update_label_type" : "Type:",
|
"update_label_type" : "Type:",
|
||||||
"update_versreminder" : "Your version: $1",
|
"update_versreminder" : "Your version: $1",
|
||||||
|
"update_error_getting_versions" : "We had trouble to determinate the available Versions.",
|
||||||
"about_version" : "Version",
|
"about_version" : "Version",
|
||||||
"about_build" : "Build",
|
"about_build" : "Build",
|
||||||
"about_builddate" : "Build date",
|
"about_builddate" : "Build date",
|
||||||
|
@ -179,11 +179,8 @@
|
|||||||
<ul class="nav nav-second-level">
|
<ul class="nav nav-second-level">
|
||||||
<li> <a class="inactive mnava" href="#conf_webconfig" id="load_webconfig"><i class="fa fa-wrench fa-fw"></i><span data-i18n="main_menu_webconfig_token">Webconfiguration</span></a> </li>
|
<li> <a class="inactive mnava" href="#conf_webconfig" id="load_webconfig"><i class="fa fa-wrench fa-fw"></i><span data-i18n="main_menu_webconfig_token">Webconfiguration</span></a> </li>
|
||||||
<li> <a class="inactive mnava" href="#conf_logging"><i class="fa fa-reorder fa-fw"></i><span data-i18n="main_menu_logging_token">Log</span></a> </li>
|
<li> <a class="inactive mnava" href="#conf_logging"><i class="fa fa-reorder fa-fw"></i><span data-i18n="main_menu_logging_token">Log</span></a> </li>
|
||||||
|
|
||||||
<!-- Update is disabled
|
|
||||||
<li> <a class="inactive mnava" href="#update"><i class="fa fa-download fa-fw"></i><span data-i18n="main_menu_update_token">Update</span></a> </li>
|
<li> <a class="inactive mnava" href="#update"><i class="fa fa-download fa-fw"></i><span data-i18n="main_menu_update_token">Update</span></a> </li>
|
||||||
-->
|
<li> <a class="inactive mnava" href="#about"><i class="fa fa-info-circle fa-fw"></i><span data-i18n="main_menu_about_token">About</span></a> </li>
|
||||||
<li> <a class="inactive mnava" href="#about"><i class="fa fa-info-circle fa-fw"></i><span data-i18n="main_menu_about_token">Update</span></a> </li>
|
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -80,41 +80,58 @@ $(document).ready( function() {
|
|||||||
$('#dash_ports').html(window.serverConfig.flatbufServer.port+' | '+window.serverConfig.protoServer.port);
|
$('#dash_ports').html(window.serverConfig.flatbufServer.port+' | '+window.serverConfig.protoServer.port);
|
||||||
$('#dash_versionbranch').html(window.serverConfig.general.versionBranch);
|
$('#dash_versionbranch').html(window.serverConfig.general.versionBranch);
|
||||||
|
|
||||||
$.get( "https://raw.githubusercontent.com/hyperion-project/hyperion.ng/master/version.json", function( data ) {
|
$.get( window.gitHubReleaseApiUrl, function( releases ) {
|
||||||
window.parsedUpdateJSON = JSON.parse(data);
|
window.gitHubVersionList = releases;
|
||||||
|
|
||||||
for(let i=0; i<window.parsedUpdateJSON.length; i++) {
|
for(i in releases)
|
||||||
if(window.parsedUpdateJSON[i].channel == "Stable") {
|
{
|
||||||
window.latestStableVersion = window.parsedUpdateJSON[i];
|
console.log(releases[i].prerelease)
|
||||||
|
if(releases[i].prerelease == true)
|
||||||
|
{
|
||||||
|
//for(j in releases[i].assets)
|
||||||
|
//{
|
||||||
|
//console.log(releases[i].assets[j])
|
||||||
|
//if(releases[i].assets[j].name.indexOf('Beta') > -1)
|
||||||
|
//{
|
||||||
|
window.latestBetaVersion = releases[i];
|
||||||
|
//break;
|
||||||
|
//}
|
||||||
|
//}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for(let i=0; i<window.parsedUpdateJSON.length; i++) {
|
$.get( window.gitHubReleaseApiUrl + "/latest", function( latest ) {
|
||||||
if(window.parsedUpdateJSON[i].channel == "Beta") {
|
window.latestStableVersion = latest;
|
||||||
window.latestBetaVersion = window.parsedUpdateJSON[i];
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(window.serverConfig.general.versionBranch == "Beta" && window.latestStableVersion.versionnr.replace(/\./g, '') <= window.latestBetaVersion.versionnr.replace(/\./g, '')) {
|
console.log(window.latestBetaVersion)
|
||||||
|
console.log(window.latestStableVersion)
|
||||||
|
//debugger;
|
||||||
|
console.log("Stable"+ window.latestStableVersion.tag_name.replace(/\./g, ''))
|
||||||
|
console.log("Beta"+ window.latestBetaVersion.tag_name.replace(/\./g, ''))
|
||||||
|
|
||||||
|
|
||||||
|
if(window.serverConfig.general.versionBranch == "Beta" && window.latestStableVersion.tag_name.replace(/\./g, '') <= window.latestBetaVersion.tag_name.replace(/\./g, '')) {
|
||||||
window.latestVersion = window.latestBetaVersion;
|
window.latestVersion = window.latestBetaVersion;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
window.latestVersion = window.latestStableVersion;
|
window.latestVersion = window.latestStableVersion;
|
||||||
}
|
}
|
||||||
|
|
||||||
var cleanLatestVersion = window.latestVersion.versionnr.replace(/\./g, '');
|
console.log(latestVersion)
|
||||||
|
|
||||||
|
var cleanLatestVersion = window.latestVersion.tag_name.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.versionnr + ' (' + window.latestVersion.channel + ')');
|
$('#dash_latev').html(window.latestVersion.tag_name + ' (' + (window.latestVersion.prerelease == true ? "Beta" : "Stable") + ')');
|
||||||
|
|
||||||
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.versionnr) + ' (' + window.latestVersion.channel + ')</div>');
|
$('#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
|
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>');
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
|
||||||
//determine platform
|
//determine platform
|
||||||
var grabbers = window.serverInfo.grabbers.available;
|
var grabbers = window.serverInfo.grabbers.available;
|
||||||
|
@ -2,12 +2,13 @@
|
|||||||
window.webPrio = 1;
|
window.webPrio = 1;
|
||||||
window.webOrigin = "Web Configuration";
|
window.webOrigin = "Web Configuration";
|
||||||
window.showOptHelp = true;
|
window.showOptHelp = true;
|
||||||
|
window.gitHubReleaseApiUrl = "https://api.github.com/repos/b1rdhous3/hyperion.ng/releases";
|
||||||
window.currentVersion = null;
|
window.currentVersion = null;
|
||||||
window.latestVersion = null;
|
window.latestVersion = null;
|
||||||
window.latestStableVersion = null;
|
window.latestStableVersion = null;
|
||||||
window.latestBetaVersion = null;
|
window.latestBetaVersion = null;
|
||||||
|
window.gitHubVersionList = null;
|
||||||
window.serverInfo = {};
|
window.serverInfo = {};
|
||||||
window.parsedUpdateJSON = {};
|
|
||||||
window.serverSchema = {};
|
window.serverSchema = {};
|
||||||
window.serverConfig = {};
|
window.serverConfig = {};
|
||||||
window.schema = {};
|
window.schema = {};
|
||||||
|
Loading…
Reference in New Issue
Block a user