0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-27 22:49:56 -05:00
ghost/core/client/app/controllers/setup/one.js

28 lines
693 B
JavaScript
Raw Normal View History

import Ember from 'ember';
import ajax from 'ghost/utils/ajax';
var SetupOneController = Ember.Controller.extend({
count: 'many, many',
downloadCounter: function () {
var self = this,
interval = 3000;
Ember.run.later(this, function () {
ajax({
url: self.get('ghostPaths.count'),
type: 'GET'
}).then(function (data) {
self.set('count', data.count.toLocaleString());
}).catch(function () {
self.set('count', 'many, many');
});
this.downloadCounter();
}, interval);
}.on('init')
});
export default SetupOneController;