mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-24 16:18:42 -05:00
28 lines
736 B
JavaScript
28 lines
736 B
JavaScript
export default Ember.ObjectController.extend({
|
|
viewMode: 'table',
|
|
viewingTable: Em.computed.equal('viewMode', 'table'),
|
|
viewingBarChart: Em.computed.equal('viewMode', 'barChart'),
|
|
startDate: null,
|
|
endDate: null,
|
|
refreshing: false,
|
|
|
|
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);
|
|
});
|
|
},
|
|
|
|
viewAsTable: function() {
|
|
this.set('viewMode', 'table');
|
|
},
|
|
|
|
viewAsBarChart: function() {
|
|
this.set('viewMode', 'barChart');
|
|
}
|
|
}
|
|
});
|