Skip to content

Commit 6a4c4ed

Browse files
committed
fix: errors
1 parent fc83486 commit 6a4c4ed

3 files changed

Lines changed: 115 additions & 111 deletions

File tree

src/routes/(console)/project-[region]-[project]/functions/function-[function]/deployment-[deployment]/+page.svelte

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script lang="ts">
22
import { Button } from '$lib/elements/forms';
33
import { Container } from '$lib/layout';
4-
import { realtime } from '$lib/stores/sdk';
4+
import { sdk } from '$lib/stores/sdk';
55
import { onMount } from 'svelte';
66
import { type Models } from '@appwrite.io/console';
77
import { page } from '$app/state';
@@ -66,7 +66,8 @@
6666
}
6767
}
6868
}
69-
});
69+
);
70+
return unsubscribe;
7071
});
7172
7273
export function badgeTypeDeployment(status: string) {

src/routes/(console)/project-[region]-[project]/functions/function-[function]/table.svelte

Lines changed: 51 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -83,57 +83,58 @@
8383
</Table.Header.Cell>
8484
{/each}
8585
<Table.Header.Cell column="actions" {root} />
86-
</svelte:fragment>
87-
{#each data.deploymentList.deployments as deployment (deployment.$id)}
88-
{@const effectiveStatus = getEffectiveBuildStatus(
89-
deployment.status,
90-
deployment.$createdAt,
91-
$regionalConsoleVariables
92-
)}
93-
<Table.Row.Link
94-
{root}
95-
id={deployment.$id}
96-
href={`${base}/project-${page.params.region}-${page.params.project}/functions/function-${page.params.function}/deployment-${deployment.$id}`}>
97-
{#each columns as column}
98-
<Table.Cell column={column.id} {root}>
99-
{#if column.id === '$id'}
100-
{#key column.id}
101-
<Id value={deployment.$id}>{deployment.$id}</Id>
102-
{/key}
103-
{:else if column.id === 'status'}
104-
{#if data?.activeDeployment?.$id === deployment?.$id}
105-
<Status status="complete" label="Active" />
106-
{:else}
107-
<Status
108-
status={deploymentStatusConverter(effectiveStatus)}
109-
label={capitalize(effectiveStatus)} />
110-
{/if}
111-
{:else if column.id === 'type'}
112-
<DeploymentSource {deployment} />
113-
{:else if column.id === '$updatedAt'}
114-
<DeploymentCreatedBy {deployment} />
115-
{:else if column.id === 'buildDuration'}
116-
{#if ['waiting'].includes(effectiveStatus)}
117-
-
118-
{:else if ['processing', 'building'].includes(effectiveStatus)}
119-
<span use:timer={{ start: deployment.$createdAt }}></span>
120-
{:else}
121-
{formatTimeDetailed(deployment.buildDuration)}
86+
{/snippet}
87+
{#snippet children(root)}
88+
{#each data.deploymentList.deployments as deployment (deployment.$id)}
89+
{@const effectiveStatus = getEffectiveBuildStatus(
90+
deployment.status,
91+
deployment.$createdAt,
92+
$regionalConsoleVariables
93+
)}
94+
<Table.Row.Link
95+
{root}
96+
id={deployment.$id}
97+
href={`${base}/project-${page.params.region}-${page.params.project}/functions/function-${page.params.function}/deployment-${deployment.$id}`}>
98+
{#each columns as column}
99+
<Table.Cell column={column.id} {root}>
100+
{#if column.id === '$id'}
101+
{#key column.id}
102+
<Id value={deployment.$id}>{deployment.$id}</Id>
103+
{/key}
104+
{:else if column.id === 'status'}
105+
{#if data?.activeDeployment?.$id === deployment?.$id}
106+
<Status status="complete" label="Active" />
107+
{:else}
108+
<Status
109+
status={deploymentStatusConverter(effectiveStatus)}
110+
label={capitalize(effectiveStatus)} />
111+
{/if}
112+
{:else if column.id === 'type'}
113+
<DeploymentSource {deployment} />
114+
{:else if column.id === '$updatedAt'}
115+
<DeploymentCreatedBy {deployment} />
116+
{:else if column.id === 'buildDuration'}
117+
{#if ['waiting'].includes(effectiveStatus)}
118+
-
119+
{:else if ['processing', 'building'].includes(effectiveStatus)}
120+
<span use:timer={{ start: deployment.$createdAt }}></span>
121+
{:else}
122+
{formatTimeDetailed(deployment.buildDuration)}
123+
{/if}
124+
{:else if column.id === 'totalSize'}
125+
{calculateSize(deployment.totalSize)}
126+
{:else if column.id === 'sourceSize'}
127+
{calculateSize(deployment.sourceSize)}
128+
{:else if column.id === 'buildSize'}
129+
{calculateSize(deployment.buildSize)}
122130
{/if}
123-
{:else if column.id === 'totalSize'}
124-
{calculateSize(deployment.totalSize)}
125-
{:else if column.id === 'sourceSize'}
126-
{calculateSize(deployment.sourceSize)}
127-
{:else if column.id === 'buildSize'}
128-
{calculateSize(deployment.buildSize)}
129-
{/if}
130-
</Table.Cell>
131-
{/each}
132-
<Table.Cell column="actions" {root}>
133-
<Menu>
134-
<Button text icon size="s">
135-
<Icon size="s" icon={IconDotsHorizontal} />
136-
</Button>
131+
</Table.Cell>
132+
{/each}
133+
<Table.Cell column="actions" {root}>
134+
<Menu>
135+
<Button text icon size="s">
136+
<Icon size="s" icon={IconDotsHorizontal} />
137+
</Button>
137138

138139
<svelte:fragment slot="menu" let:toggle>
139140
<ActionMenu.Root>

src/routes/(console)/project-[region]-[project]/sites/site-[site]/deployments/table.svelte

Lines changed: 61 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -70,67 +70,69 @@
7070
</Table.Header.Cell>
7171
{/each}
7272
<Table.Header.Cell column="actions" {root} />
73-
</svelte:fragment>
74-
{#each data.deploymentList.deployments as deployment (deployment.$id)}
75-
{@const effectiveStatus = getEffectiveBuildStatus(
76-
deployment.status,
77-
deployment.$createdAt,
78-
$regionalConsoleVariables
79-
)}
80-
<Table.Row.Link
81-
{root}
82-
id={deployment.$id}
83-
href={`${base}/project-${page.params.region}-${page.params.project}/sites/site-${page.params.site}/deployments/deployment-${deployment.$id}`}>
84-
{#each $columns as column}
85-
<Table.Cell column={column.id} {root}>
86-
{#if column.id === '$id'}
87-
{#key column.id}
88-
<Id value={deployment.$id}>{deployment.$id}</Id>
89-
{/key}
90-
{:else if column.id === 'status'}
91-
{#if data?.activeDeployment?.$id === deployment?.$id}
92-
<Status status="complete" label="Active" />
93-
{:else}
94-
<Status
95-
status={deploymentStatusConverter(effectiveStatus)}
96-
label={capitalize(effectiveStatus)} />
73+
{/snippet}
74+
{#snippet children(root)}
75+
{#each data.deploymentList.deployments as deployment (deployment.$id)}
76+
{@const effectiveStatus = getEffectiveBuildStatus(
77+
deployment.status,
78+
deployment.$createdAt,
79+
$regionalConsoleVariables
80+
)}
81+
<Table.Row.Link
82+
{root}
83+
id={deployment.$id}
84+
href={`${base}/project-${page.params.region}-${page.params.project}/sites/site-${page.params.site}/deployments/deployment-${deployment.$id}`}>
85+
{#each $columns as column}
86+
<Table.Cell column={column.id} {root}>
87+
{#if column.id === '$id'}
88+
{#key column.id}
89+
<Id value={deployment.$id}>{deployment.$id}</Id>
90+
{/key}
91+
{:else if column.id === 'status'}
92+
{#if data?.activeDeployment?.$id === deployment?.$id}
93+
<Status status="complete" label="Active" />
94+
{:else}
95+
<Status
96+
status={deploymentStatusConverter(effectiveStatus)}
97+
label={capitalize(effectiveStatus)} />
98+
{/if}
99+
{:else if column.id === 'type'}
100+
<DeploymentSource {deployment} />
101+
{:else if column.id === '$updatedAt'}
102+
<DeploymentCreatedBy {deployment} />
103+
{:else if column.id === 'buildDuration'}
104+
{#if ['waiting'].includes(effectiveStatus)}
105+
-
106+
{:else if ['processing', 'building'].includes(effectiveStatus)}
107+
<span use:timer={{ start: deployment.$createdAt }}></span>
108+
{:else}
109+
{formatTimeDetailed(deployment.buildDuration)}
110+
{/if}
111+
{:else if column.id === 'totalSize'}
112+
{calculateSize(deployment?.totalSize ?? 0)}
113+
{:else if column.id === 'sourceSize'}
114+
{calculateSize(deployment.sourceSize)}
115+
{:else if column.id === 'buildSize'}
116+
{calculateSize(deployment.buildSize)}
97117
{/if}
98-
{:else if column.id === 'type'}
99-
<DeploymentSource {deployment} />
100-
{:else if column.id === '$updatedAt'}
101-
<DeploymentCreatedBy {deployment} />
102-
{:else if column.id === 'buildDuration'}
103-
{#if ['waiting'].includes(effectiveStatus)}
104-
-
105-
{:else if ['processing', 'building'].includes(effectiveStatus)}
106-
<span use:timer={{ start: deployment.$createdAt }}></span>
107-
{:else}
108-
{formatTimeDetailed(deployment.buildDuration)}
109-
{/if}
110-
{:else if column.id === 'totalSize'}
111-
{calculateSize(deployment?.totalSize ?? 0)}
112-
{:else if column.id === 'sourceSize'}
113-
{calculateSize(deployment.sourceSize)}
114-
{:else if column.id === 'buildSize'}
115-
{calculateSize(deployment.buildSize)}
116-
{/if}
118+
</Table.Cell>
119+
{/each}
120+
<Table.Cell column="actions" {root}>
121+
<Layout.Stack alignItems="flex-end">
122+
<DeploymentActionMenu
123+
{deployment}
124+
bind:selectedDeployment
125+
bind:showRedeploy
126+
bind:showActivate
127+
bind:showDelete
128+
bind:showCancel
129+
activeDeployment={data.site.deploymentId} />
130+
</Layout.Stack>
117131
</Table.Cell>
118-
{/each}
119-
<Table.Cell column="actions" {root}>
120-
<Layout.Stack alignItems="flex-end">
121-
<DeploymentActionMenu
122-
{deployment}
123-
bind:selectedDeployment
124-
bind:showRedeploy
125-
bind:showActivate
126-
bind:showDelete
127-
bind:showCancel
128-
activeDeployment={data.site.deploymentId} />
129-
</Layout.Stack>
130-
</Table.Cell>
131-
</Table.Row.Link>
132-
{/each}
133-
</Table.Root>
132+
</Table.Row.Link>
133+
{/each}
134+
{/snippet}
135+
</MultiSelectionTable>
134136

135137
{#if selectedDeployment}
136138
<Delete {selectedDeployment} activeDeployment={data.site.deploymentId} bind:showDelete />

0 commit comments

Comments
 (0)