mirror of
https://github.com/discourse/discourse.git
synced 2025-04-29 04:34:34 +08:00
Dashboard JS checks version every 12 hours
This commit is contained in:
parent
ea861ebb57
commit
0321643636
@ -10,16 +10,23 @@
|
|||||||
**/
|
**/
|
||||||
Discourse.AdminDashboardRoute = Discourse.Route.extend({
|
Discourse.AdminDashboardRoute = Discourse.Route.extend({
|
||||||
setupController: function(c) {
|
setupController: function(c) {
|
||||||
if( Discourse.SiteSettings.version_checks ) {
|
if( !c.get('versionCheckedAt') || Date.create('12 hours ago') > c.get('versionCheckedAt') ) {
|
||||||
Discourse.VersionCheck.find().then(function(vc) {
|
this.checkVersion(c);
|
||||||
c.set('versionCheck', vc);
|
|
||||||
c.set('loading', false);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
renderTemplate: function() {
|
renderTemplate: function() {
|
||||||
this.render({into: 'admin/templates/admin'});
|
this.render({into: 'admin/templates/admin'});
|
||||||
|
},
|
||||||
|
|
||||||
|
checkVersion: function(c) {
|
||||||
|
if( Discourse.SiteSettings.version_checks ) {
|
||||||
|
Discourse.VersionCheck.find().then(function(vc) {
|
||||||
|
c.set('versionCheck', vc);
|
||||||
|
c.set('versionCheckedAt', new Date());
|
||||||
|
c.set('loading', false);
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user