Add backup listing

This commit is contained in:
Johannes Zellner
2025-02-05 15:47:46 +01:00
parent 42f493b2c3
commit 86c4045073
6 changed files with 173 additions and 15 deletions

24
dashboard/src/utils.js Normal file
View File

@@ -0,0 +1,24 @@
// https://stackoverflow.com/questions/3665115/how-to-create-a-file-in-memory-for-user-to-download-but-not-through-server#18197341
function download(filename, text) {
var element = document.createElement('a');
element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text));
element.setAttribute('download', filename);
element.style.display = 'none';
document.body.appendChild(element);
element.click();
document.body.removeChild(element);
}
// named exports
export {
download,
};
// default export
export default {
download,
};