|
1 | 1 | <script lang="ts">
|
2 | 2 | import { Submit, trackError, trackEvent } from '$lib/actions/analytics';
|
3 |
| - import { Alert, CustomId, Modal } from '$lib/components'; |
| 3 | + import { CustomId, Modal } from '$lib/components'; |
4 | 4 | import { Button, InputText } from '$lib/elements/forms';
|
5 | 5 | import { addNotification } from '$lib/stores/notifications';
|
6 | 6 | import { sdk } from '$lib/stores/sdk';
|
|
12 | 12 | import { upgradeURL } from '$lib/stores/billing';
|
13 | 13 | import CreatePolicy from './database-[database]/backups/createPolicy.svelte';
|
14 | 14 | import { cronExpression, type UserBackupPolicy } from '$lib/helpers/backups';
|
15 |
| - import { Icon, Tag } from '@appwrite.io/pink-svelte'; |
| 15 | + import { Alert, Icon, Tag } from '@appwrite.io/pink-svelte'; |
16 | 16 | import { IconPencil } from '@appwrite.io/pink-icons-svelte';
|
17 | 17 |
|
18 | 18 | export let showCreate = false;
|
|
122 | 122 | }}><Icon icon={IconPencil} /> Database ID</Tag>
|
123 | 123 | </div>
|
124 | 124 | {/if}
|
| 125 | + |
125 | 126 | <CustomId bind:show={showCustomId} name="Database" bind:id autofocus={false} />
|
126 | 127 |
|
127 | 128 | {#if isCloud}
|
128 |
| - <div class="u-flex-vertical u-gap-24 u-padding-block-start-24"> |
129 |
| - {#if $organization?.billingPlan === BillingPlan.FREE} |
130 |
| - {#if showPlanUpgradeAlert} |
131 |
| - <Alert |
132 |
| - type="warning" |
133 |
| - dismissible |
134 |
| - on:dismiss={() => (showPlanUpgradeAlert = false)}> |
135 |
| - <svelte:fragment slot="title"> |
136 |
| - This database won't be backed up |
137 |
| - </svelte:fragment> |
138 |
| - Upgrade your plan to ensure your data stays safe and backed up. |
139 |
| - <svelte:fragment slot="buttons"> |
140 |
| - <Button href={$upgradeURL} text>Upgrade plan</Button> |
141 |
| - </svelte:fragment> |
142 |
| - </Alert> |
143 |
| - {/if} |
144 |
| - {:else} |
145 |
| - <CreatePolicy |
146 |
| - bind:totalPolicies |
147 |
| - bind:isShowing={showCreate} |
148 |
| - title="Backup policies" |
149 |
| - subtitle="Protect your data and ensure quick recovery by adding backup policies." /> |
| 129 | + {#if $organization?.billingPlan === BillingPlan.FREE} |
| 130 | + {#if showPlanUpgradeAlert} |
| 131 | + <Alert.Inline |
| 132 | + dismissible |
| 133 | + title="This database won't be backed up" |
| 134 | + status="warning" |
| 135 | + on:dismiss={() => (showPlanUpgradeAlert = false)}> |
| 136 | + Upgrade your plan to ensure your data stays safe and backed up. |
| 137 | + <svelte:fragment slot="actions"> |
| 138 | + <Button compact href={$upgradeURL}>Upgrade plan</Button> |
| 139 | + </svelte:fragment> |
| 140 | + </Alert.Inline> |
150 | 141 | {/if}
|
151 |
| - </div> |
| 142 | + {:else} |
| 143 | + <CreatePolicy |
| 144 | + bind:totalPolicies |
| 145 | + bind:isShowing={showCreate} |
| 146 | + title="Backup policies" |
| 147 | + subtitle="Protect your data and ensure quick recovery by adding backup policies." /> |
| 148 | + {/if} |
152 | 149 | {/if}
|
153 | 150 | <svelte:fragment slot="footer">
|
154 | 151 | <Button secondary on:click={() => (showCreate = false)}>Cancel</Button>
|
|
0 commit comments