diff --git a/src/lib/components/repositories.svelte b/src/lib/components/repositories.svelte index 46152bc57..329e3a629 100644 --- a/src/lib/components/repositories.svelte +++ b/src/lib/components/repositories.svelte @@ -18,19 +18,32 @@ export let selectedRepository: string = null; export let hasInstallations = false; export let action: 'button' | 'select' = 'select'; + export let installationList = $installations; $: { - hasInstallations = $installations?.total > 0; + hasInstallations = installationList?.total > 0; } let selectedInstallation = null; async function loadInstallations() { - const { installations } = await sdk.forProject.vcs.listInstallations(); - if (installations.length) { - selectedInstallation = installations[0].$id; - installation.set(installations.find((entry) => entry.$id === selectedInstallation)); + if (installationList) { + if (installationList.installations.length) { + selectedInstallation = installationList.installations[0].$id; + installation.set( + installationList.installations.find( + (entry) => entry.$id === selectedInstallation + ) + ); + } + return installationList.installations; + } else { + const { installations } = await sdk.forProject.vcs.listInstallations(); + if (installations.length) { + selectedInstallation = installations[0].$id; + installation.set(installations.find((entry) => entry.$id === selectedInstallation)); + } + return installations; } - return installations; } let search = ''; diff --git a/src/routes/(console)/project-[project]/sites/site-[site]/deployments/+page.svelte b/src/routes/(console)/project-[project]/sites/site-[site]/deployments/+page.svelte index 7001737f0..372c25f42 100644 --- a/src/routes/(console)/project-[project]/sites/site-[site]/deployments/+page.svelte +++ b/src/routes/(console)/project-[project]/sites/site-[site]/deployments/+page.svelte @@ -1,9 +1,9 @@ - - - - - - - - {#if $tags?.length} - -
-
- - {/if} + + + + + Metrics for {range !== SiteUsageRange.TwentyFourHours + ? `${toLocaleDate( + new Date( + now.getTime() - + parseInt(range.split('d')[0]) * 24 * 60 * 60 * 1000 + ).toString() + )} to` + : ''} + {toLocaleDate(now.toString())} + +
+ +
+
+ + {#each metrics as metric} + + {/each} + +
+ + + + + + + + {#if $tags?.length} + +
+
+ + {/if} +
+
-
+ + +
+
+ + + + + +
+ + + + + + More filters + + + + +
+
+ {#if $deploymentList.total} + + + + {:else if data?.query} + + {/if} - - -
- - - - - -
- - - - - - More filters - - - - -
-
- {#if $deploymentList.total} -
- {:else if data?.query} - - {/if} - - - {#if selectedDeployment} {/if} diff --git a/src/routes/(console)/project-[project]/sites/site-[site]/deployments/createGitDeploymentModal.svelte b/src/routes/(console)/project-[project]/sites/site-[site]/deployments/createGitDeploymentModal.svelte index 1af9e9fca..78136cbd3 100644 --- a/src/routes/(console)/project-[project]/sites/site-[site]/deployments/createGitDeploymentModal.svelte +++ b/src/routes/(console)/project-[project]/sites/site-[site]/deployments/createGitDeploymentModal.svelte @@ -1,10 +1,23 @@ @@ -12,7 +25,25 @@ Enter a valid commit reference to create a new deployment from or use the CLI to deploy. Learn more - + + + + + + name + + + + + console.log('test')} /> diff --git a/src/routes/(console)/project-[project]/sites/site-[site]/deployments/deploymentCard.svelte b/src/routes/(console)/project-[project]/sites/site-[site]/deployments/deploymentCard.svelte deleted file mode 100644 index e304a32ce..000000000 --- a/src/routes/(console)/project-[project]/sites/site-[site]/deployments/deploymentCard.svelte +++ /dev/null @@ -1,121 +0,0 @@ - - - -
- -
-

Deployment ID

- - - {deployment.$id} - -
-
- - {@const status = deployment.status} - {@const deploymentSize = humanFileSize(deployment.size)} - {@const buildSize = humanFileSize(deployment.buildSize)} - {@const totalSize = humanFileSize(deployment.buildSize + deployment.size)} -
    -
  • -

    Status

    - - - - -
  • -
  • -

    Build time

    -

    - {calculateTime(deployment.buildTime)} -

    -
  • -
  • -

    Total size

    -

    - {totalSize.value + totalSize.unit} - -

    -
  • -
  • -

    Updated

    -

    - -

    -
  • -
- -
-

Source

-
- -
-
- - {#if $proxyRuleList?.rules?.length} -
-

Domains

- -
- {/if} -
- - - - -
- - diff --git a/src/routes/(console)/project-[project]/sites/site-[site]/deployments/usageCard.svelte b/src/routes/(console)/project-[project]/sites/site-[site]/deployments/usageCard.svelte new file mode 100644 index 000000000..700c37dd5 --- /dev/null +++ b/src/routes/(console)/project-[project]/sites/site-[site]/deployments/usageCard.svelte @@ -0,0 +1,19 @@ + + + + + {#if value !== null && value !== undefined} + {value} + {:else} + + {/if} + + {description} + + +