mirror of https://github.com/Budibase/budibase.git
committed by
GitHub
5 changed files with 51 additions and 13 deletions
@ -0,0 +1,16 @@ |
|||
<script> |
|||
import { ModalContent, Toggle } from "@budibase/bbui" |
|||
|
|||
export let app |
|||
let excludeRows = false |
|||
|
|||
const exportApp = () => { |
|||
const id = app.deployed ? app.prodId : app.devId |
|||
const appName = encodeURIComponent(app.name) |
|||
window.location = `/api/backups/export?appId=${id}&appname=${appName}&excludeRows=${excludeRows}` |
|||
} |
|||
</script> |
|||
|
|||
<ModalContent title={"Export"} confirmText={"Export"} onConfirm={exportApp}> |
|||
<Toggle text="Exclude Rows" bind:value={excludeRows} /> |
|||
</ModalContent> |
|||
@ -1,9 +1,11 @@ |
|||
const { streamBackup } = require("../../utilities/fileSystem") |
|||
|
|||
exports.exportAppDump = async function (ctx) { |
|||
const { appId } = ctx.query |
|||
let { appId, excludeRows } = ctx.query |
|||
const appName = decodeURI(ctx.query.appname) |
|||
excludeRows = excludeRows === "true" |
|||
const backupIdentifier = `${appName}-export-${new Date().getTime()}.txt` |
|||
ctx.attachment(backupIdentifier) |
|||
ctx.body = await streamBackup(appId) |
|||
|
|||
ctx.body = await streamBackup(appId, excludeRows) |
|||
} |
|||
|
|||
Loading…
Reference in new issue