feat: save application data before deploying
This commit is contained in:
@@ -70,8 +70,8 @@
|
||||
selectedBuildId
|
||||
} from '$lib/store';
|
||||
import { errorNotification, handlerNotFoundLoad } from '$lib/common';
|
||||
import Tooltip from '$lib/components/Tooltip.svelte';
|
||||
import Menu from './_Menu.svelte';
|
||||
import { saveForm } from './utils';
|
||||
|
||||
let statusInterval: any;
|
||||
let forceDelete = false;
|
||||
@@ -114,6 +114,7 @@
|
||||
}, 2000);
|
||||
}
|
||||
try {
|
||||
await saveForm(id, application);
|
||||
const { buildId } = await post(`/applications/${id}/deploy`, {
|
||||
...application,
|
||||
forceRebuild
|
||||
|
||||
@@ -50,6 +50,7 @@
|
||||
import Explainer from '$lib/components/Explainer.svelte';
|
||||
import { goto } from '$app/navigation';
|
||||
import Beta from '$lib/components/Beta.svelte';
|
||||
import { saveForm } from './utils';
|
||||
|
||||
const { id } = $page.params;
|
||||
|
||||
@@ -267,11 +268,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
await post(`/applications/${id}`, {
|
||||
...application,
|
||||
baseDatabaseBranch,
|
||||
dockerComposeConfiguration: JSON.stringify(dockerComposeConfiguration)
|
||||
});
|
||||
await saveForm(id, application,baseDatabaseBranch, dockerComposeConfiguration);
|
||||
setLocation(application, settings);
|
||||
$isDeploymentEnabled = checkIfDeploymentEnabledApplications($appSession.isAdmin, application);
|
||||
|
||||
@@ -519,6 +516,8 @@
|
||||
<label for="repository">Git commit</label>
|
||||
<div class="flex gap-2">
|
||||
<input
|
||||
id="commit"
|
||||
name="commit"
|
||||
class="w-full"
|
||||
disabled={isDisabled}
|
||||
placeholder="default: latest commit"
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
branch: preview.sourceBranch
|
||||
});
|
||||
addToast({
|
||||
message: 'Deployment queued',
|
||||
message: 'Deployment queued.',
|
||||
type: 'success'
|
||||
});
|
||||
if ($page.url.pathname.startsWith(`/applications/${id}/logs/build`)) {
|
||||
@@ -183,9 +183,7 @@
|
||||
<div class="flex justify-center py-4 text-center text-xl font-bold">Loading...</div>
|
||||
</div>
|
||||
{:else if application.previewApplication.length > 0}
|
||||
<div
|
||||
class="grid grid-col gap-4 auto-cols-max grid-cols-1 md:grid-cols-2 lg:grid-cols-2 px-6"
|
||||
>
|
||||
<div class="grid grid-col gap-4 auto-cols-max grid-cols-1 md:grid-cols-2 lg:grid-cols-2 px-6">
|
||||
{#each application.previewApplication as preview}
|
||||
<div class="no-underline mb-5 w-full">
|
||||
<div class="w-full rounded p-5 bg-coolgray-200 indicator">
|
||||
@@ -216,7 +214,12 @@
|
||||
|
||||
<div class="flex justify-end items-end space-x-2 h-10">
|
||||
{#if preview.customDomain}
|
||||
<a id="openpreview" href={preview.customDomain} target="_blank noreferrer" class="icons">
|
||||
<a
|
||||
id="openpreview"
|
||||
href={preview.customDomain}
|
||||
target="_blank noreferrer"
|
||||
class="icons"
|
||||
>
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
class="h-6 w-6"
|
||||
|
||||
9
apps/ui/src/routes/applications/[id]/utils.ts
Normal file
9
apps/ui/src/routes/applications/[id]/utils.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { post } from "$lib/api";
|
||||
|
||||
export async function saveForm(id: string, application: any, baseDatabaseBranch?: any, dockerComposeConfiguration?: any) {
|
||||
return await post(`/applications/${id}`, {
|
||||
...application,
|
||||
baseDatabaseBranch,
|
||||
dockerComposeConfiguration: JSON.stringify(dockerComposeConfiguration)
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user