add button to export logs

This commit is contained in:
Bruno Windels 2021-02-16 15:27:24 +01:00
parent 48569c28bc
commit 7dc3707871
2 changed files with 6 additions and 0 deletions

View File

@ -110,5 +110,10 @@ export class SettingsViewModel extends ViewModel {
return this.i18n`unknown`;
}
}
async exportLogs() {
const logExport = await this.logger.export();
this.platform.saveFileAs(logExport.asBlob(), "logs.json");
}
}

View File

@ -51,6 +51,7 @@ export class SettingsView extends TemplateView {
t.h3("Application"),
row(vm.i18n`Version`, version),
row(vm.i18n`Storage usage`, vm => `${vm.storageUsage} / ${vm.storageQuota}`),
row(vm.i18n`Export logs`, t.button({onClick: () => vm.exportLogs()}, "Export")),
])
]);
}