1
0
Fork 0
mirror of synced 2024-09-21 20:01:32 +12:00
budibase/packages/builder/src/components/start/ExportAppModal.svelte

25 lines
776 B
Svelte
Raw Normal View History

2022-05-25 20:26:10 +12:00
<script>
import { ModalContent, Toggle, Body } from "@budibase/bbui"
2022-05-25 20:26:10 +12:00
export let app
export let published
2022-06-07 02:17:14 +12:00
let excludeRows = false
2022-05-25 20:26:10 +12:00
$: title = published ? "Export published app" : "Export latest app"
$: confirmText = published ? "Export published" : "Export latest"
2022-05-25 20:26:10 +12:00
const exportApp = () => {
const id = published ? app.prodId : app.devId
2022-05-25 20:26:10 +12:00
const appName = encodeURIComponent(app.name)
2022-06-07 02:17:14 +12:00
window.location = `/api/backups/export?appId=${id}&appname=${appName}&excludeRows=${excludeRows}`
2022-05-25 20:26:10 +12:00
}
</script>
<ModalContent {title} {confirmText} onConfirm={exportApp}>
<Body
>Apps can be exported with or without data that is within internal tables -
select this below.</Body
>
2022-06-07 02:17:14 +12:00
<Toggle text="Exclude Rows" bind:value={excludeRows} />
2022-05-25 20:26:10 +12:00
</ModalContent>