mirror of
https://github.com/discourse/discourse.git
synced 2025-09-07 12:02:53 +08:00
FEATURE: export dashboard reports to csv file
This commit is contained in:
parent
b12ace5f9d
commit
b4a724e80a
5 changed files with 40 additions and 9 deletions
|
@ -1,3 +1,6 @@
|
|||
import { exportEntity } from 'discourse/lib/export-csv';
|
||||
import { outputExportResult } from 'discourse/lib/export-result';
|
||||
|
||||
export default Ember.Controller.extend({
|
||||
viewMode: 'table',
|
||||
viewingTable: Em.computed.equal('viewMode', 'table'),
|
||||
|
@ -30,6 +33,15 @@ export default Ember.Controller.extend({
|
|||
|
||||
viewAsBarChart() {
|
||||
this.set('viewMode', 'barChart');
|
||||
},
|
||||
|
||||
exportCsv() {
|
||||
exportEntity('report', {
|
||||
name: this.get("model.type"),
|
||||
start_date: this.get('startDate'),
|
||||
end_date: this.get('endDate'),
|
||||
category_id: this.get('categoryId') == 'all' ? undefined : this.get('categoryId')
|
||||
}).then(outputExportResult);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue