Cleaning up files after import is finished (with large files this saves on tmp space) as well as fixing an issue where menu would appear next to a restore despite having no options.
This commit is contained in:
parent
85f7d66a99
commit
010f160fa5
|
@ -13,6 +13,7 @@
|
||||||
import CreateRestoreModal from "./CreateRestoreModal.svelte"
|
import CreateRestoreModal from "./CreateRestoreModal.svelte"
|
||||||
import { createEventDispatcher } from "svelte"
|
import { createEventDispatcher } from "svelte"
|
||||||
import { isOnlyUser } from "builderStore"
|
import { isOnlyUser } from "builderStore"
|
||||||
|
import { BackupType } from "constants/backend/backups"
|
||||||
|
|
||||||
export let row
|
export let row
|
||||||
|
|
||||||
|
@ -42,12 +43,11 @@
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="cell">
|
<div class="cell">
|
||||||
<ActionMenu align="right">
|
{#if row.type !== BackupType.RESTORE}
|
||||||
<div slot="control">
|
<ActionMenu align="right">
|
||||||
<Icon size="M" hoverable name="MoreSmallList" />
|
<div slot="control">
|
||||||
</div>
|
<Icon size="M" hoverable name="MoreSmallList" />
|
||||||
|
</div>
|
||||||
{#if row.type !== "restore"}
|
|
||||||
<AbsTooltip
|
<AbsTooltip
|
||||||
position={TooltipPosition.Left}
|
position={TooltipPosition.Left}
|
||||||
text="Unavailable - another user is editing this app"
|
text="Unavailable - another user is editing this app"
|
||||||
|
@ -62,8 +62,8 @@
|
||||||
</AbsTooltip>
|
</AbsTooltip>
|
||||||
<MenuItem on:click={deleteDialog.show} icon="Delete">Delete</MenuItem>
|
<MenuItem on:click={deleteDialog.show} icon="Delete">Delete</MenuItem>
|
||||||
<MenuItem on:click={downloadExport} icon="Download">Download</MenuItem>
|
<MenuItem on:click={downloadExport} icon="Download">Download</MenuItem>
|
||||||
{/if}
|
</ActionMenu>
|
||||||
</ActionMenu>
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Modal bind:this={restoreBackupModal}>
|
<Modal bind:this={restoreBackupModal}>
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit e4dab7e4ccb4a1e2864a35dd2a851ca1a898e6c6
|
Subproject commit f8ebf7e3e14c894cf7ab831fabd2706e94cfb830
|
|
@ -165,8 +165,9 @@ export async function importApp(
|
||||||
const isTar = template.file && template?.file?.type?.endsWith("gzip")
|
const isTar = template.file && template?.file?.type?.endsWith("gzip")
|
||||||
const isDirectory =
|
const isDirectory =
|
||||||
template.file && fs.lstatSync(template.file.path).isDirectory()
|
template.file && fs.lstatSync(template.file.path).isDirectory()
|
||||||
|
let tmpPath: string | undefined = undefined
|
||||||
if (template.file && (isTar || isDirectory)) {
|
if (template.file && (isTar || isDirectory)) {
|
||||||
const tmpPath = isTar ? await untarFile(template.file) : template.file.path
|
tmpPath = isTar ? await untarFile(template.file) : template.file.path
|
||||||
if (isTar && template.file.password) {
|
if (isTar && template.file.password) {
|
||||||
await decryptFiles(tmpPath, template.file.password)
|
await decryptFiles(tmpPath, template.file.password)
|
||||||
}
|
}
|
||||||
|
@ -208,5 +209,9 @@ export async function importApp(
|
||||||
}
|
}
|
||||||
await updateAttachmentColumns(prodAppId, db)
|
await updateAttachmentColumns(prodAppId, db)
|
||||||
await updateAutomations(prodAppId, db)
|
await updateAutomations(prodAppId, db)
|
||||||
|
// clear up afterward
|
||||||
|
if (tmpPath) {
|
||||||
|
fs.rmSync(tmpPath, { recursive: true, force: true })
|
||||||
|
}
|
||||||
return ok
|
return ok
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue