Skip to content

Commit f21a62d

Browse files
committed
Merge branch 'feat-pink-v2' into 'svelte5-migration'.
2 parents 11a0912 + 3dd67d6 commit f21a62d

File tree

6 files changed

+69
-33
lines changed

6 files changed

+69
-33
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
"dependencies": {
2424
"@appwrite.io/console": "https://pkg.pr.new/appwrite/appwrite/@appwrite.io/console@9c6551f",
2525
"@appwrite.io/pink-icons": "0.25.0",
26-
"@appwrite.io/pink-icons-svelte": "https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-icons-svelte@87d91a9",
26+
"@appwrite.io/pink-icons-svelte": "https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-icons-svelte@207628e",
2727
"@appwrite.io/pink-legacy": "^1.0.3",
28-
"@appwrite.io/pink-svelte": "https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-svelte@87d91a9",
28+
"@appwrite.io/pink-svelte": "https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-svelte@207628e",
2929
"@popperjs/core": "^2.11.8",
3030
"@sentry/sveltekit": "^8.38.0",
3131
"@stripe/stripe-js": "^3.5.0",

pnpm-lock.yaml

Lines changed: 14 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/routes/(console)/project-[project]/functions/function-[function]/store.ts

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,32 @@ export const columns = writable<Column[]>([
5959
],
6060
filter: false
6161
},
62+
{
63+
id: 'totalSize',
64+
title: 'Total size',
65+
type: 'integer',
66+
width: { min: 140, max: 160 },
67+
elements: [
68+
{
69+
value: 2 * 1000 * 1000,
70+
label: 'more than 2MB'
71+
},
72+
{
73+
value: 10 * 1000 * 1000,
74+
label: 'more than 10MB'
75+
},
76+
{
77+
value: 50 * 1000 * 1000,
78+
label: 'more than 50MB'
79+
}
80+
]
81+
},
6282
{
6383
id: 'sourceSize',
6484
title: 'Source size',
6585
type: 'integer',
86+
hide: true,
6687
width: { min: 140, max: 160 },
67-
6888
elements: [
6989
{
7090
value: 2 * 1000 * 1000,
@@ -85,8 +105,21 @@ export const columns = writable<Column[]>([
85105
title: 'Build size',
86106
type: 'integer',
87107
hide: true,
88-
filter: false,
89-
width: { min: 110, max: 130 }
108+
width: { min: 110, max: 130 },
109+
elements: [
110+
{
111+
value: 2 * 1000 * 1000,
112+
label: 'more than 2MB'
113+
},
114+
{
115+
value: 10 * 1000 * 1000,
116+
label: 'more than 10MB'
117+
},
118+
{
119+
value: 50 * 1000 * 1000,
120+
label: 'more than 50MB'
121+
}
122+
]
90123
},
91124
{
92125
id: 'type',

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@
8787
{:else}
8888
{formatTimeDetailed(deployment.buildDuration)}
8989
{/if}
90+
{:else if column.id === 'totalSize'}
91+
{calculateSize(deployment.totalSize)}
9092
{:else if column.id === 'sourceSize'}
9193
{calculateSize(deployment.sourceSize)}
9294
{:else if column.id === 'buildSize'}

src/routes/(console)/project-[project]/sites/redeployModal.svelte

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@
2828
});
2929
trackEvent(Submit.SiteRedeploy);
3030
31+
await invalidate(Dependencies.SITE);
32+
await invalidate(Dependencies.DEPLOYMENTS);
33+
show = false;
3134
if (redirect) {
3235
await goto(
3336
`${base}/project-${page.params.project}/sites/site-${site.$id}/deployments/deployment-${deployment.$id}`
3437
);
3538
}
36-
await invalidate(Dependencies.SITE);
37-
await invalidate(Dependencies.DEPLOYMENTS);
38-
show = false;
3939
} catch (e) {
4040
error = e.message;
4141
trackError(e, Submit.SiteRedeploy);

src/routes/(console)/project-[project]/sites/site-[site]/deployments/deployment-[deployment]/+page.svelte

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,38 +16,39 @@
1616
import { Accordion } from '@appwrite.io/pink-svelte';
1717
import { capitalize } from '$lib/helpers/string';
1818
import LogsTimer from '../../../(components)/logsTimer.svelte';
19+
import { invalidate } from '$app/navigation';
20+
import { Dependencies } from '$lib/constants';
21+
import { page } from '$app/state';
1922
2023
let { data } = $props();
2124
22-
let deployment = $state(data.deployment);
25+
let deployment = $derived(data.deployment);
26+
2327
let showRedeploy = $state(false);
2428
let showActivate = $state(false);
2529
let showDelete = $state(false);
2630
let showCancel = $state(false);
2731
2832
onMount(async () => {
29-
if (data.deployment.status === 'ready') {
30-
return;
31-
}
3233
sdk.forConsole.client.subscribe(
3334
'console',
3435
async (response: RealtimeResponseEvent<Models.Deployment>) => {
3536
if (
3637
response.events.includes(
37-
`sites.${data.deployment.resourceId}.deployments.${data.deployment.$id}.update`
38+
`sites.${page.params.site}.deployments.${page.params.deployment}.update`
3839
)
3940
) {
40-
deployment = response.payload;
41+
invalidate(Dependencies.DEPLOYMENTS);
4142
}
4243
}
4344
);
4445
});
4546
</script>
4647

4748
<Container>
48-
<SiteCard deployment={data.deployment} proxyRuleList={data.proxyRuleList}>
49+
<SiteCard {deployment} proxyRuleList={data.proxyRuleList}>
4950
<svelte:fragment slot="footer">
50-
{#if data.deployment?.status === 'ready' && data.proxyRuleList?.total}
51+
{#if deployment?.status === 'ready' && data.proxyRuleList?.total}
5152
<Button href={`${$protocol}${data.proxyRuleList.rules[0]?.domain}`} external>
5253
Visit
5354
</Button>
@@ -56,8 +57,8 @@
5657
<Button secondary on:click={() => (showRedeploy = true)}>Redeploy</Button>
5758
<DeploymentActionMenu
5859
inCard
59-
deployment={data.deployment}
60-
selectedDeployment={data.deployment}
60+
{deployment}
61+
selectedDeployment={deployment}
6162
bind:showRedeploy
6263
bind:showActivate
6364
bind:showDelete
@@ -70,7 +71,7 @@
7071
title="Deployment logs"
7172
badge={capitalize(deployment.status)}
7273
open
73-
badgeType={badgeTypeDeployment(data.deployment.status)}
74+
badgeType={badgeTypeDeployment(deployment.status)}
7475
hideDivider>
7576
<Logs {deployment} hideTitle hideScrollButtons fullHeight />
7677
<svelte:fragment slot="end">

0 commit comments

Comments
 (0)