Skip to content

Commit

Permalink
Display last commit in nightly
Browse files Browse the repository at this point in the history
  • Loading branch information
benderl committed May 5, 2020
1 parent f4d9707 commit 753af9d
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 8 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ ramdisk/
.DS_Store
web/settings/.htaccess
web/settings/.passwd
web/lastcommit
1 change: 1 addition & 0 deletions runs/atreboot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2656,6 +2656,7 @@ ip route get 1 | awk '{print $NF;exit}' > /var/www/html/openWB/ramdisk/ipaddress
curl -s https://raw.githubusercontent.com/snaptec/openWB/master/web/version > /var/www/html/openWB/ramdisk/vnightly
curl -s https://raw.githubusercontent.com/snaptec/openWB/beta/web/version > /var/www/html/openWB/ramdisk/vbeta
curl -s https://raw.githubusercontent.com/snaptec/openWB/stable/web/version > /var/www/html/openWB/ramdisk/vstable
sudo git -C /var/www/html/openWB show --pretty='format:%ci [%h]' | head -n1 > /var/www/html/openWB/web/lastcommit
for i in $(seq 1 9);
do
configured=$(timeout 2 mosquitto_sub -C 1 -t openWB/config/get/SmartHome/Devices/$i/device_configured)
Expand Down
37 changes: 29 additions & 8 deletions web/settings/update.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,10 @@
<h2>Beta</h2>
<p>Die Beta-Version beinhaltet neue Features für zukünftige Stable-Versionen, befindet sich aber noch in der Testphase. Fehlverhalten ist nicht ausgeschlossen.</p>
<h2>Nightly</h2>
<p>Die Nightly-Version beinhaltet Neuentwicklungen, die teils nur eingeschränkt getestet sind. Fehlverhalten ist wahrscheinlich.</p>
<p>
Die Nightly-Version beinhaltet Neuentwicklungen, die teils nur eingeschränkt getestet sind. Fehlverhalten ist wahrscheinlich.<br>
Alle Änderungen können auf <a href="https://github.com/snaptec/openWB/commits/master">GitHub</a> eingesehen werden.
</p>
</div>
</div>

Expand Down Expand Up @@ -192,15 +195,17 @@

function getVersion(dataURL) {
// read dataURL filecontent = releasetrain version and return it
return $.get(dataURL);
return $.get({
url: dataURL,
cache: false
});
}

function displayVersion(releasetrain, url) {
var elemSpan = "#avail"+releasetrain+"VersionSpan";
var elemSpinner = "#avail"+releasetrain+"VersionSpinner";
var elemRadioBtn = "#radioBtn"+releasetrain;
var getURL = url + "?" + $.now(); // add timestamp to request to avoid cache
getVersion(getURL, function() {
getVersion(url, function() {
$(elemSpan).text("rufe ab...");
})
.done(function(result) {
Expand All @@ -223,12 +228,28 @@ function displayVersion(releasetrain, url) {
displayVersion("Nightly", 'https://raw.githubusercontent.com/snaptec/openWB/master/web/version');
});

$.get("/openWB/web/version")
$.get({
url: "/openWB/web/version",
cache: false
})
.done(function(result) {
$("#installedVersionSpan").text(result);
$("#installedVersionSpan").data("version", result);
$("#modalInstalledVersionSpan").text(result);
});

if("<?php echo $releasetrain ?>" == "master") {
$.get({
url: "/openWB/web/lastcommit",
cache: false
})
.done(function(result) {
$("#installedVersionSpan").text(result);
$("#installedVersionSpan").data("version", result);
$("#modalInstalledVersionSpan").text(result);
$("#installedVersionSpan").append(" ("+result+")");
//$("#installedVersionSpan").data("version", result);
$("#modalInstalledVersionSpan").append(" ("+result+")");
});
}


$(document).ajaxStop(function(){
// after all ajax requests are finished, set checkbox and enable update button
Expand Down

0 comments on commit 753af9d

Please sign in to comment.