From 497946c38468f5e8124c85e9229defafd6a1c4ef Mon Sep 17 00:00:00 2001 From: Pavel Kvach Date: Mon, 8 Apr 2024 07:29:12 +0300 Subject: [PATCH] feat: Add 'app' and 'title' fields to CSV export in Reports Closes https://github.com/ActivityWatch/activitywatch/issues/1010 --- src/views/Report.vue | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/views/Report.vue b/src/views/Report.vue index b0b7b734..440339f6 100644 --- a/src/views/Report.vue +++ b/src/views/Report.vue @@ -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');