From 0c5f2c5a3ca234cead4e50abf3c7850bc259d7dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Wed, 9 Aug 2023 18:58:56 +0200 Subject: [PATCH] Finish deployments detials --- package-lock.json | 8 +-- package.json | 2 +- .../function-[function]/+page.svelte | 50 ++++++++--------- .../deployment-[deployment]/+page.svelte | 16 ++---- .../deploymentCreatedBy.svelte | 15 ++++++ .../deploymentSource.svelte | 54 +++++++++++++++++++ 6 files changed, 102 insertions(+), 43 deletions(-) create mode 100644 src/routes/console/project-[project]/functions/function-[function]/deploymentCreatedBy.svelte create mode 100644 src/routes/console/project-[project]/functions/function-[function]/deploymentSource.svelte diff --git a/package-lock.json b/package-lock.json index 886f238f4..f15f8ca36 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,7 +7,7 @@ "name": "@appwrite/console", "dependencies": { "@analytics/google-analytics": "^1.0.5", - "@appwrite.io/console": "npm:matej-appwrite-console@7.1.122", + "@appwrite.io/console": "npm:matej-appwrite-console@7.1.123", "@appwrite.io/pink": "0.0.7-next.0", "@appwrite.io/pink-icons": "0.0.7-next.0", "@popperjs/core": "^2.11.6", @@ -159,9 +159,9 @@ }, "node_modules/@appwrite.io/console": { "name": "matej-appwrite-console", - "version": "7.1.122", - "resolved": "https://registry.npmjs.org/matej-appwrite-console/-/matej-appwrite-console-7.1.122.tgz", - "integrity": "sha512-r4Pkg8qX4wXZxXsLmS3xfJTIf0hKBKsdrhxWJYWCTD8uDdfx6YX03fR4Lnm9b25PespKV3KUYGTqWZvlRXTdbw==", + "version": "7.1.123", + "resolved": "https://registry.npmjs.org/matej-appwrite-console/-/matej-appwrite-console-7.1.123.tgz", + "integrity": "sha512-AASU1sd1kyW8KwwL88/hNcxENcC0DdZ3/EkpFSvVuqsq5dQGduQrvhakP2krdwetkeDUSGuTUsMCnT1GdCLZJw==", "dependencies": { "cross-fetch": "3.1.5", "isomorphic-form-data": "2.0.0" diff --git a/package.json b/package.json index 49094bd6c..40df41388 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ }, "dependencies": { "@analytics/google-analytics": "^1.0.5", - "@appwrite.io/console": "npm:matej-appwrite-console@7.1.122", + "@appwrite.io/console": "npm:matej-appwrite-console@7.1.123", "@appwrite.io/pink": "0.0.7-next.0", "@appwrite.io/pink-icons": "0.0.7-next.0", "@popperjs/core": "^2.11.6", diff --git a/src/routes/console/project-[project]/functions/function-[function]/+page.svelte b/src/routes/console/project-[project]/functions/function-[function]/+page.svelte index cbdd9d30c..12a8063ce 100644 --- a/src/routes/console/project-[project]/functions/function-[function]/+page.svelte +++ b/src/routes/console/project-[project]/functions/function-[function]/+page.svelte @@ -38,8 +38,9 @@ import DropListLink from '$lib/components/dropListLink.svelte'; import { page } from '$app/stores'; import { tooltip } from '$lib/actions/tooltip'; - import { tick } from 'svelte'; import RedeployModal from './redeployModal.svelte'; + import DeploymentSource from './deploymentSource.svelte'; + import DeploymentCreatedBy from './deploymentCreatedBy.svelte'; export let data: PageData; @@ -50,7 +51,6 @@ let showRedeploy = false; let selectedDeployment: Models.Deployment = null; - let tooltipContent: HTMLDivElement; function handleActivate() { invalidate(Dependencies.DEPLOYMENTS); @@ -102,7 +102,10 @@
- + {data.domain.rules[0].domain}
@@ -114,21 +117,14 @@

Build time: {calculateTime(activeDeployment.buildTime)}

-

Created: {timeFromNow(activeDeployment.$createdAt)}

+

+ Created: + +

Size: {fileSize.value + fileSize.unit}

Source: - { - instance.setContent(tooltipContent); - }); - } - }}>Git +

@@ -168,7 +164,7 @@ {/if}
- Inactive + All
{#if data.deployments.total > 0} @@ -194,12 +190,22 @@ warning={status === 'pending'} success={status === 'completed' || status === 'ready'} info={status === 'processing' || status === 'building'}> - {status} + + {#if deployment.$id === $func.deployment} + - Git + + - {timeFromNow(deployment.$createdAt)} + @@ -307,9 +313,3 @@ {/if} - -
-
-

test

-
-
diff --git a/src/routes/console/project-[project]/functions/function-[function]/deployment-[deployment]/+page.svelte b/src/routes/console/project-[project]/functions/function-[function]/deployment-[deployment]/+page.svelte index 3648f98fd..bdcfdb8a9 100644 --- a/src/routes/console/project-[project]/functions/function-[function]/deployment-[deployment]/+page.svelte +++ b/src/routes/console/project-[project]/functions/function-[function]/deployment-[deployment]/+page.svelte @@ -17,7 +17,7 @@ import { Dependencies } from '$lib/constants'; import { timer } from '$lib/actions/timer'; import { tooltip } from '$lib/actions/tooltip'; - import { tick } from 'svelte/types/runtime/internal/scheduler'; + import DeploymentSource from '../deploymentSource.svelte'; export let data; @@ -79,21 +79,11 @@ {calculateTime(data.deployment.buildTime)} {/if}

-

Created: {timeFromNow(data.deployment.$createdAt)}

+

Created:

Size: {fileSize.value + fileSize.unit}

Source: - { - instance.setContent(tooltipContent); - }); - } - }}>Git +

diff --git a/src/routes/console/project-[project]/functions/function-[function]/deploymentCreatedBy.svelte b/src/routes/console/project-[project]/functions/function-[function]/deploymentCreatedBy.svelte new file mode 100644 index 000000000..cdc93d96b --- /dev/null +++ b/src/routes/console/project-[project]/functions/function-[function]/deploymentCreatedBy.svelte @@ -0,0 +1,15 @@ + + +{timeFromNow(deployment.$createdAt)} +{#if deployment.providerCommitAuthor} + by {deployment.providerCommitAuthor} +{/if} diff --git a/src/routes/console/project-[project]/functions/function-[function]/deploymentSource.svelte b/src/routes/console/project-[project]/functions/function-[function]/deploymentSource.svelte new file mode 100644 index 000000000..986e973aa --- /dev/null +++ b/src/routes/console/project-[project]/functions/function-[function]/deploymentSource.svelte @@ -0,0 +1,54 @@ + + +{#if deployment.type === 'vcs'} + { + instance.setContent(tooltipContent); + }); + } + }}> +{:else if deployment.type === 'manual'} +