mirror of
https://github.com/discourse/discourse.git
synced 2025-05-23 12:51:24 +08:00
Admin controls to select a date range for reports
This commit is contained in:
@ -2,17 +2,27 @@ 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: {
|
||||
// Changes the current view mode to 'table'
|
||||
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');
|
||||
},
|
||||
|
||||
// Changes the current view mode to 'barChart'
|
||||
viewAsBarChart: function() {
|
||||
this.set('viewMode', 'barChart');
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
Reference in New Issue
Block a user