|
70 | 70 | </Table.Header.Cell> |
71 | 71 | {/each} |
72 | 72 | <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)} |
97 | 117 | {/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> |
117 | 131 | </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> |
134 | 136 |
|
135 | 137 | {#if selectedDeployment} |
136 | 138 | <Delete {selectedDeployment} activeDeployment={data.site.deploymentId} bind:showDelete /> |
|
0 commit comments