File tree Expand file tree Collapse file tree
src/routes/(console)/project-[region]-[project]
functions/function-[function]
sites/site-[site]/deployments Expand file tree Collapse file tree 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 .url .href .includes (` deployment-${selectedDeployment .$id } ` )) {
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 >
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 .url .href .includes (` deployment-${selectedDeployment .$id } ` )) {
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 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' ;
104104 placement ={' bottom' }>
105105 <div >
106106 <ActionMenu .Item .Button
107- trailingIcon ={IconRefresh }
107+ leadingIcon ={IconRefresh }
108108 disabled ={data .deployment .sourceSize === 0 }
109109 on:click ={() => {
110110 showRedeploy = true ;
121121 {#if !! data .deployment ?.sourceSize || !! data .deployment ?.sourceSize }
122122 <DownloadActionMenuItem deployment ={data .deployment } {toggle } />
123123 {/if }
124+ {#if $canWriteFunctions && data .deployment .status !== ' building' && data .deployment .status !== ' processing' && data .deployment ?.status !== ' waiting' }
125+ <ActionMenu .Item .Button
126+ status =" danger"
127+ leadingIcon ={IconTrash }
128+ on:click ={() => {
129+ showDelete = true ;
130+ toggle ();
131+ }}
132+ style =" width: 100%" >
133+ Delete
134+ </ActionMenu .Item .Button >
135+ {/if }
124136 </ActionMenu .Root >
125137 </svelte:fragment >
126138 </Menu >
Original file line number Diff line number Diff line change 2222 siteId: selectedDeployment .resourceId ,
2323 deploymentId: selectedDeployment .$id
2424 });
25- await Promise .all ([
26- invalidate (Dependencies .DEPLOYMENTS ),
27- invalidate (Dependencies .SITE )
28- ]);
2925 if (page .url .href .includes (` deployment-${selectedDeployment .$id } ` )) {
30- await goto (
26+ goto (
3127 ` ${base }/project-${page .params .region }-${page .params .project }/sites/site-${page .params .site }/deployments `
3228 );
29+ return ;
3330 }
31+ await Promise .all ([
32+ invalidate (Dependencies .DEPLOYMENTS ),
33+ invalidate (Dependencies .SITE )
34+ ]);
3435 showDelete = false ;
3536 addNotification ({
3637 type: ' success' ,
You can’t perform that action at this time.
0 commit comments