Show different text when able to switch from beta to stable release.

This commit is contained in:
Wouter R 2014-02-24 17:26:34 +01:00
parent afb279fbc7
commit 0b52f928ca
1 changed files with 10 additions and 2 deletions

View File

@ -31,7 +31,7 @@ function UpdatePanel() {
UpdatePanel.NONE = 1; // default state UpdatePanel.NONE = 1; // default state
UpdatePanel.DOWNLOADING = 2; UpdatePanel.DOWNLOADING = 2;
UpdatePanel.DOWNLOAD_FAILED = 3; UpdatePanel.DOWNLOAD_FAILED = 3;
UpdatePanel.IMAGE_READY = 4; // download successfull and checked UpdatePanel.IMAGE_READY = 4; // download successful and checked
UpdatePanel.INSTALLING = 5; UpdatePanel.INSTALLING = 5;
UpdatePanel.INSTALLED = 6; UpdatePanel.INSTALLED = 6;
UpdatePanel.INSTALL_FAILED = 7; UpdatePanel.INSTALL_FAILED = 7;
@ -148,6 +148,8 @@ function UpdatePanel() {
if(response.status != "error") { if(response.status != "error") {
var data = response.data; var data = response.data;
self.handleStatusData(data); self.handleStatusData(data);
} else {
console.log("API update/status call returned an error: '" + response.msg + "'");
} }
} }
}).fail(function() { }).fail(function() {
@ -225,7 +227,9 @@ function UpdatePanel() {
switch(this.state){ switch(this.state){
case UpdatePanel.NONE: case UpdatePanel.NONE:
if(self.canUpdate) { if(self.canUpdate) {
text = "Update(s) available."; var settings = _form.readForm();
if (self.versionIsBeta(self.currentVersion) && !settings.includeBetas) text = "You can switch back to the latest stable release.";
else text = "Update(s) available.";
} else { } else {
text = "You're up to date."; text = "You're up to date.";
} }
@ -273,4 +277,8 @@ function UpdatePanel() {
_inAccessPointMode = inAccessPointMode; _inAccessPointMode = inAccessPointMode;
self.updateStatusDisplay(); self.updateStatusDisplay();
} }
this.versionIsBeta = function(version) {
return version.match(/.*-.*/g) != null;
}
} }