mirror of
https://github.com/krateng/maloja.git
synced 2023-08-10 21:12:55 +03:00
Added export to web interface
This commit is contained in:
parent
b7781d27c3
commit
e1ce80131a
@ -380,6 +380,17 @@ def get_backup(**keys):
|
|||||||
|
|
||||||
return static_file(os.path.basename(archivefile),root=tmpfolder)
|
return static_file(os.path.basename(archivefile),root=tmpfolder)
|
||||||
|
|
||||||
|
@api.get("export")
|
||||||
|
@authenticated_api
|
||||||
|
def get_export(**keys):
|
||||||
|
from ..proccontrol.tasks.export import export
|
||||||
|
import tempfile
|
||||||
|
|
||||||
|
tmpfolder = tempfile.gettempdir()
|
||||||
|
resultfile = export(tmpfolder)
|
||||||
|
|
||||||
|
return static_file(os.path.basename(resultfile),root=tmpfolder)
|
||||||
|
|
||||||
|
|
||||||
@api.post("delete_scrobble")
|
@api.post("delete_scrobble")
|
||||||
@authenticated_api
|
@authenticated_api
|
||||||
|
@ -77,10 +77,13 @@
|
|||||||
|
|
||||||
<h2>Download Data</h2>
|
<h2>Download Data</h2>
|
||||||
|
|
||||||
Download your data to have a backup.<br/><br/>
|
Backup your data.<br/><br/>
|
||||||
|
|
||||||
<a href="/apis/mlj_1/backup" download="maloja_backup.tar.gz">
|
<a href="/apis/mlj_1/backup" download="maloja_backup.tar.gz">
|
||||||
<button type="button">Download</button>
|
<button type="button">Backup</button>
|
||||||
|
</a>
|
||||||
|
<a href="/apis/mlj_1/export" download="maloja_export.json">
|
||||||
|
<button type="button">Export</button>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user