Skip to content

Commit

Permalink
feat: Add 'app' and 'title' fields to CSV export in Reports (#552)
Browse files Browse the repository at this point in the history
  • Loading branch information
pkvach committed May 1, 2024
1 parent abec92a commit 7c0761d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/views/Report.vue
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,11 @@ export default {
export_csv() {
const data = this.events.map(e => {
return [e.timestamp, e.duration, e.data['$category']];
return [e.timestamp, e.duration, e.data['$category'], e.data['app'], e.data['title']];
});
const csv = Papa.unparse(data, {
columns: ['timestamp', 'duration', 'category', 'app', 'title'],
});
const csv = Papa.unparse(data, { columns: ['timestamp', 'duration', 'category'] });
const blob = new Blob([csv], { type: 'text/csv' });
const url = URL.createObjectURL(blob);
const link = document.createElement('a');
Expand Down

0 comments on commit 7c0761d

Please sign in to comment.