discourse/app/assets/javascripts/admin/controllers/admin-reports.js.es6

29 lines
736 B
Plaintext
Raw Normal View History

export default Ember.ObjectController.extend({
viewMode: 'table',
2013-05-29 13:33:54 -04:00
viewingTable: Em.computed.equal('viewMode', 'table'),
viewingBarChart: Em.computed.equal('viewMode', 'barChart'),
startDate: null,
endDate: null,
refreshing: false,
2013-09-16 14:08:55 -04:00
actions: {
refreshReport: function() {
var self = this;
this.set('refreshing', true);
Discourse.Report.find(this.get('type'), this.get('startDate'), this.get('endDate')).then(function(r) {
self.set('model', r);
}).finally(function() {
self.set('refreshing', false);
});
},
2013-09-16 14:08:55 -04:00
viewAsTable: function() {
this.set('viewMode', 'table');
},
2013-09-16 14:08:55 -04:00
viewAsBarChart: function() {
this.set('viewMode', 'barChart');
}
}
});