mirror of
https://github.com/discourse/discourse.git
synced 2024-12-22 21:34:05 +08:00
29 lines
736 B
JavaScript
29 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');
|
|
}
|
|
}
|
|
});
|