2013-02-21 02:15:50 +08:00
|
|
|
(function() {
|
|
|
|
|
|
|
|
window.Discourse.AdminDashboardController = Ember.Controller.extend({
|
|
|
|
loading: true,
|
|
|
|
versionCheck: null,
|
2013-02-22 01:54:40 +08:00
|
|
|
|
2013-02-21 02:15:50 +08:00
|
|
|
upToDate: (function() {
|
|
|
|
if (this.versionCheck) {
|
|
|
|
return this.versionCheck.latest_version === this.versionCheck.installed_version;
|
|
|
|
} else {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}).property('versionCheck'),
|
2013-02-22 01:54:40 +08:00
|
|
|
|
2013-02-21 02:15:50 +08:00
|
|
|
updateIconClasses: (function() {
|
|
|
|
var classes;
|
|
|
|
classes = "icon icon-warning-sign ";
|
|
|
|
if (this.get('versionCheck.critical_updates')) {
|
|
|
|
classes += "critical-updates-available";
|
|
|
|
} else {
|
|
|
|
classes += "updates-available";
|
|
|
|
}
|
|
|
|
return classes;
|
|
|
|
}).property('versionCheck'),
|
2013-02-22 01:54:40 +08:00
|
|
|
|
2013-02-21 02:15:50 +08:00
|
|
|
priorityClass: (function() {
|
|
|
|
if (this.get('versionCheck.critical_updates')) {
|
|
|
|
return 'version-check critical';
|
|
|
|
} else {
|
|
|
|
return 'version-check normal';
|
|
|
|
}
|
|
|
|
}).property('versionCheck')
|
2013-02-22 01:54:40 +08:00
|
|
|
|
2013-02-21 02:15:50 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
}).call(this);
|