mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
Merge branch 'feat-pink-v2' into 'svelte5-migration'.
This commit is contained in:
@@ -59,12 +59,32 @@ export const columns = writable<Column[]>([
|
||||
],
|
||||
filter: false
|
||||
},
|
||||
{
|
||||
id: 'totalSize',
|
||||
title: 'Total size',
|
||||
type: 'integer',
|
||||
width: { min: 140, max: 160 },
|
||||
elements: [
|
||||
{
|
||||
value: 2 * 1000 * 1000,
|
||||
label: 'more than 2MB'
|
||||
},
|
||||
{
|
||||
value: 10 * 1000 * 1000,
|
||||
label: 'more than 10MB'
|
||||
},
|
||||
{
|
||||
value: 50 * 1000 * 1000,
|
||||
label: 'more than 50MB'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'sourceSize',
|
||||
title: 'Source size',
|
||||
type: 'integer',
|
||||
hide: true,
|
||||
width: { min: 140, max: 160 },
|
||||
|
||||
elements: [
|
||||
{
|
||||
value: 2 * 1000 * 1000,
|
||||
@@ -85,8 +105,21 @@ export const columns = writable<Column[]>([
|
||||
title: 'Build size',
|
||||
type: 'integer',
|
||||
hide: true,
|
||||
filter: false,
|
||||
width: { min: 110, max: 130 }
|
||||
width: { min: 110, max: 130 },
|
||||
elements: [
|
||||
{
|
||||
value: 2 * 1000 * 1000,
|
||||
label: 'more than 2MB'
|
||||
},
|
||||
{
|
||||
value: 10 * 1000 * 1000,
|
||||
label: 'more than 10MB'
|
||||
},
|
||||
{
|
||||
value: 50 * 1000 * 1000,
|
||||
label: 'more than 50MB'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'type',
|
||||
|
||||
@@ -87,6 +87,8 @@
|
||||
{:else}
|
||||
{formatTimeDetailed(deployment.buildDuration)}
|
||||
{/if}
|
||||
{:else if column.id === 'totalSize'}
|
||||
{calculateSize(deployment.totalSize)}
|
||||
{:else if column.id === 'sourceSize'}
|
||||
{calculateSize(deployment.sourceSize)}
|
||||
{:else if column.id === 'buildSize'}
|
||||
|
||||
@@ -28,14 +28,14 @@
|
||||
});
|
||||
trackEvent(Submit.SiteRedeploy);
|
||||
|
||||
await invalidate(Dependencies.SITE);
|
||||
await invalidate(Dependencies.DEPLOYMENTS);
|
||||
show = false;
|
||||
if (redirect) {
|
||||
await goto(
|
||||
`${base}/project-${page.params.project}/sites/site-${site.$id}/deployments/deployment-${deployment.$id}`
|
||||
);
|
||||
}
|
||||
await invalidate(Dependencies.SITE);
|
||||
await invalidate(Dependencies.DEPLOYMENTS);
|
||||
show = false;
|
||||
} catch (e) {
|
||||
error = e.message;
|
||||
trackError(e, Submit.SiteRedeploy);
|
||||
|
||||
+12
-11
@@ -16,28 +16,29 @@
|
||||
import { Accordion } from '@appwrite.io/pink-svelte';
|
||||
import { capitalize } from '$lib/helpers/string';
|
||||
import LogsTimer from '../../../(components)/logsTimer.svelte';
|
||||
import { invalidate } from '$app/navigation';
|
||||
import { Dependencies } from '$lib/constants';
|
||||
import { page } from '$app/state';
|
||||
|
||||
let { data } = $props();
|
||||
|
||||
let deployment = $state(data.deployment);
|
||||
let deployment = $derived(data.deployment);
|
||||
|
||||
let showRedeploy = $state(false);
|
||||
let showActivate = $state(false);
|
||||
let showDelete = $state(false);
|
||||
let showCancel = $state(false);
|
||||
|
||||
onMount(async () => {
|
||||
if (data.deployment.status === 'ready') {
|
||||
return;
|
||||
}
|
||||
sdk.forConsole.client.subscribe(
|
||||
'console',
|
||||
async (response: RealtimeResponseEvent<Models.Deployment>) => {
|
||||
if (
|
||||
response.events.includes(
|
||||
`sites.${data.deployment.resourceId}.deployments.${data.deployment.$id}.update`
|
||||
`sites.${page.params.site}.deployments.${page.params.deployment}.update`
|
||||
)
|
||||
) {
|
||||
deployment = response.payload;
|
||||
invalidate(Dependencies.DEPLOYMENTS);
|
||||
}
|
||||
}
|
||||
);
|
||||
@@ -45,9 +46,9 @@
|
||||
</script>
|
||||
|
||||
<Container>
|
||||
<SiteCard deployment={data.deployment} proxyRuleList={data.proxyRuleList}>
|
||||
<SiteCard {deployment} proxyRuleList={data.proxyRuleList}>
|
||||
<svelte:fragment slot="footer">
|
||||
{#if data.deployment?.status === 'ready' && data.proxyRuleList?.total}
|
||||
{#if deployment?.status === 'ready' && data.proxyRuleList?.total}
|
||||
<Button href={`${$protocol}${data.proxyRuleList.rules[0]?.domain}`} external>
|
||||
Visit
|
||||
</Button>
|
||||
@@ -56,8 +57,8 @@
|
||||
<Button secondary on:click={() => (showRedeploy = true)}>Redeploy</Button>
|
||||
<DeploymentActionMenu
|
||||
inCard
|
||||
deployment={data.deployment}
|
||||
selectedDeployment={data.deployment}
|
||||
{deployment}
|
||||
selectedDeployment={deployment}
|
||||
bind:showRedeploy
|
||||
bind:showActivate
|
||||
bind:showDelete
|
||||
@@ -70,7 +71,7 @@
|
||||
title="Deployment logs"
|
||||
badge={capitalize(deployment.status)}
|
||||
open
|
||||
badgeType={badgeTypeDeployment(data.deployment.status)}
|
||||
badgeType={badgeTypeDeployment(deployment.status)}
|
||||
hideDivider>
|
||||
<Logs {deployment} hideTitle hideScrollButtons fullHeight />
|
||||
<svelte:fragment slot="end">
|
||||
|
||||
Reference in New Issue
Block a user