1
0
mirror of https://github.com/vector-im/hydrogen-web.git synced 2025-01-11 20:47:18 +01:00

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
src
domain/session/settings
platform/web/ui/session/settings

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

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