2022-05-25 20:26:10 +12:00
|
|
|
<script>
|
2022-09-10 07:06:29 +12:00
|
|
|
import { ModalContent, Toggle, Body } from "@budibase/bbui"
|
2022-05-25 20:26:10 +12:00
|
|
|
|
|
|
|
export let app
|
2022-09-10 07:06:29 +12:00
|
|
|
export let published
|
2022-06-07 02:17:14 +12:00
|
|
|
let excludeRows = false
|
2022-05-25 20:26:10 +12:00
|
|
|
|
2022-09-10 07:06:29 +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 = () => {
|
2022-09-10 07:06:29 +12:00
|
|
|
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>
|
|
|
|
|
2022-09-10 07:06:29 +12:00
|
|
|
<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>
|