File tree Expand file tree Collapse file tree 8 files changed +37
-55
lines changed
src/routes/(console)/project-[region]-[project]
functions/function-[function] Expand file tree Collapse file tree 8 files changed +37
-55
lines changed Original file line number Diff line number Diff line change 22 import { page } from ' $app/state' ;
33 import { SubMenu } from ' $lib/components/menu' ;
44 import { type Models } from ' @appwrite.io/console' ;
5- import { IconDownload } from ' @appwrite.io/pink-icons-svelte' ;
5+ import { IconDownload , IconChevronRight } from ' @appwrite.io/pink-icons-svelte' ;
66 import { ActionMenu } from ' @appwrite.io/pink-svelte' ;
77 import { getOutputDownload , getSourceDownload } from ' ../store' ;
88
1313{#if deployment ?.status === ' ready' || deployment ?.status === ' failed' || deployment ?.status === ' building' }
1414 <SubMenu >
1515 <ActionMenu .Root noPadding >
16- <ActionMenu .Item .Button trailingIcon ={IconDownload }>Download</ActionMenu .Item .Button >
16+ <ActionMenu .Item .Button leadingIcon ={IconDownload } trailingIcon ={IconChevronRight }
17+ >Download</ActionMenu .Item .Button >
1718 </ActionMenu .Root >
1819 <svelte:fragment slot =" menu" >
1920 <ActionMenu .Root >
Original file line number Diff line number Diff line change 11<script lang =" ts" >
2- import { invalidate } from ' $app/navigation' ;
2+ import { goto , invalidate } from ' $app/navigation' ;
3+ import { base } from ' $app/paths' ;
34 import { Submit , trackEvent , trackError } from ' $lib/actions/analytics' ;
45 import Confirm from ' $lib/components/confirm.svelte' ;
56 import { Dependencies } from ' $lib/constants' ;
2021 functionId: selectedDeployment .resourceId ,
2122 deploymentId: selectedDeployment .$id
2223 });
24+ if (page .route .id ?.includes (' deployment-[deployment]' )) {
25+ goto (
26+ ` ${base }/project-${page .params .region }-${page .params .project }/functions/function-${page .params .function }/deployments `
27+ );
28+ return ;
29+ }
2330 await invalidate (Dependencies .FUNCTION );
2431 showDelete = false ;
2532 addNotification ({
Original file line number Diff line number Diff line change 113113 placement ={' bottom' }>
114114 <div >
115115 <ActionMenu .Item .Button
116- trailingIcon ={IconRefresh }
116+ leadingIcon ={IconRefresh }
117117 disabled ={activeDeployment .sourceSize === 0 }
118118 on:click ={() => {
119119 selectedDeployment = activeDeployment ;
134134 deployment ={activeDeployment }
135135 {toggle } />
136136 <ActionMenu .Item .Anchor
137- trailingIcon ={IconTerminal }
137+ leadingIcon ={IconTerminal }
138138 href ={` ${base }/project-${page .params .region }-${page .params .project }/functions/function-${page .params .function }/deployment-${activeDeployment .$id } ` }>
139139 Build logs
140140 </ActionMenu .Item .Anchor >
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 2626 import { formatTimeDetailed } from ' $lib/helpers/timeConversion' ;
2727 import { timer } from ' $lib/actions/timer' ;
2828 import { app } from ' $lib/stores/app' ;
29- import { IconDotsHorizontal , IconRefresh } from ' @appwrite.io/pink-icons-svelte' ;
29+ import { IconDotsHorizontal , IconRefresh , IconTrash } from ' @appwrite.io/pink-icons-svelte' ;
3030 import { Menu } from ' $lib/components/menu' ;
3131 import { canWriteFunctions } from ' $lib/stores/roles' ;
3232 import { Click , trackEvent } from ' $lib/actions/analytics' ;
9898 placement ={' bottom' }>
9999 <div >
100100 <ActionMenu .Item .Button
101- trailingIcon ={IconRefresh }
101+ leadingIcon ={IconRefresh }
102102 disabled ={data .deployment .sourceSize === 0 }
103103 on:click ={() => {
104104 showRedeploy = true ;
115115 {#if !! data .deployment ?.sourceSize || !! data .deployment ?.sourceSize }
116116 <DownloadActionMenuItem deployment ={data .deployment } {toggle } />
117117 {/if }
118+ {#if $canWriteFunctions && [' ready' , ' failed' ].includes (data .deployment .status )}
119+ <ActionMenu .Item .Button
120+ status =" danger"
121+ leadingIcon ={IconTrash }
122+ on:click ={() => {
123+ showDelete = true ;
124+ toggle ();
125+ }}
126+ style =" width: 100%" >
127+ Delete
128+ </ActionMenu .Item .Button >
129+ {/if }
118130 </ActionMenu .Root >
119131 </svelte:fragment >
120132 </Menu >
Original file line number Diff line number Diff line change 139139 placement ={' bottom' }>
140140 <div >
141141 <ActionMenu .Item .Button
142- trailingIcon ={IconRefresh }
142+ leadingIcon ={IconRefresh }
143143 disabled ={deployment .sourceSize === 0 }
144144 on:click ={() => {
145145 selectedDeployment = deployment ;
155155 </Tooltip >
156156 {#if deployment .status === ' ready' && deployment .$id !== $func .deploymentId }
157157 <ActionMenu .Item .Button
158- trailingIcon ={IconLightningBolt }
158+ leadingIcon ={IconLightningBolt }
159159 on:click ={() => {
160160 selectedDeployment = deployment ;
161161 showActivate = true ;
182182 {/if }
183183 {#if deployment .status !== ' building' && deployment .status !== ' processing' && deployment .status !== ' waiting' }
184184 <ActionMenu .Item .Button
185- trailingIcon ={IconTrash }
185+ leadingIcon ={IconTrash }
186186 status =" danger"
187187 on:click ={() => {
188188 selectedDeployment = deployment ;
Original file line number Diff line number Diff line change 124124 Cancel
125125 </ActionMenu .Item .Button >
126126 {/if }
127- {#if deployment . status !== ' building ' && deployment . status !== ' processing ' && deployment ? .status !== ' waiting ' }
127+ {#if [ ' ready ' , ' failed ' ]. includes ( deployment .status ) }
128128 <ActionMenu .Item .Button
129129 status =" danger"
130130 leadingIcon ={IconTrash }
Original file line number Diff line number Diff line change 2222 siteId: selectedDeployment .resourceId ,
2323 deploymentId: selectedDeployment .$id
2424 });
25+ if (page .route .id ?.includes (' deployment-[deployment]' )) {
26+ goto (
27+ ` ${base }/project-${page .params .region }-${page .params .project }/sites/site-${page .params .site }/deployments `
28+ );
29+ return ;
30+ }
2531 await Promise .all ([
2632 invalidate (Dependencies .DEPLOYMENTS ),
2733 invalidate (Dependencies .SITE )
2834 ]);
29- if (page .url .href .includes (` deployment-${selectedDeployment .$id } ` )) {
30- await goto (
31- ` ${base }/project-${page .params .region }-${page .params .project }/sites/site-${page .params .site }/deployments `
32- );
33- }
3435 showDelete = false ;
3536 addNotification ({
3637 type: ' success' ,
You can’t perform that action at this time.
0 commit comments