diff --git a/src/lib/components/filters/index.ts b/src/lib/components/filters/index.ts index 2aeeebec2..eb4bd0f3d 100644 --- a/src/lib/components/filters/index.ts +++ b/src/lib/components/filters/index.ts @@ -1,7 +1,6 @@ export { default as Filters } from './filters.svelte'; export { default as TagList } from './tagList.svelte'; -export { default as FilterMenu } from './menu.svelte'; -export { default as FilterSubMenu } from './subMenu.svelte'; export { default as CustomFilters } from './customFilters.svelte'; export { default as QuickFilters } from './quickFilters.svelte'; +export { default as ParsedTagList } from './parsedTagList.svelte'; export { hasPageQueries, queryParamToMap, queries } from '$lib/components/filters/store'; diff --git a/src/lib/components/filters/appliedFilter.svelte b/src/lib/components/filters/parsedTagList.svelte similarity index 77% rename from src/lib/components/filters/appliedFilter.svelte rename to src/lib/components/filters/parsedTagList.svelte index 86ae82694..4b1faa05d 100644 --- a/src/lib/components/filters/appliedFilter.svelte +++ b/src/lib/components/filters/parsedTagList.svelte @@ -1,22 +1,23 @@ {#if $parsedTags?.length} {#each $parsedTags as tag} - + { - queries.removeFilter(tag); + const t = $tags.filter((t) => t.tag.includes(tag.tag.split(' ')[0])); + t.forEach((t) => (t ? queries.removeFilter(t) : null)); queries.apply(); parsedTags.update((tags) => tags.filter((t) => t.tag !== tag.tag)); }}> diff --git a/src/lib/components/filters/quickFilters.svelte b/src/lib/components/filters/quickFilters.svelte index 7cdff80a7..d57939731 100644 --- a/src/lib/components/filters/quickFilters.svelte +++ b/src/lib/components/filters/quickFilters.svelte @@ -1,13 +1,16 @@ - {#each filterCols as filter} - {#if filter.options} - { - addFilterAndApply( - filter.id, - filter.title, - filter.operator, - e.detail.value, - filter?.array - ? (filter.options - .filter((opt) => opt.checked) - .map((opt) => opt.value) ?? []) - : [], - $columns, - analyticsSource - ); - }} - on:clear={() => { - filter.tag = null; - addFilterAndApply( - filter.id, - filter.title, - filter.operator, - null, - [], - $columns, - analyticsSource - ); - }} /> - {/if} - {/each} + {#if $parsedTags?.length} + + + Filters + + {:else} + + + Filters + + {/if} + + {#each filterCols as filter} + {#if filter.options} + { + addFilterAndApply( + filter.id, + filter.title, + filter.operator, + e.detail.value, + filter?.array + ? (filter.options + .filter((opt) => opt.checked) + .map((opt) => opt.value) ?? []) + : [], + $columns, + analyticsSource + ); + }} + on:clear={() => { + addFilterAndApply( + filter.id, + filter.title, + filter.operator, + null, + [], + $columns, + analyticsSource + ); + }} /> + {/if} + {/each} + diff --git a/src/lib/components/filters/quickFilters.ts b/src/lib/components/filters/quickFilters.ts index 0bbe84fe3..fc09619b0 100644 --- a/src/lib/components/filters/quickFilters.ts +++ b/src/lib/components/filters/quickFilters.ts @@ -61,12 +61,6 @@ export function addFilterAndApply( }); } -export function resetOptions(filter: FilterData) { - filter.options.forEach((option) => { - option.checked = false; - }); -} - export function addStatusCodeFilter(value: string, colId: string, columns: Column[]) { addFilter(columns, colId, ValidOperators.LessThanOrEqual, parseInt(value)); addFilter(columns, colId, ValidOperators.GreaterThanOrEqual, parseInt(value) - 99); diff --git a/src/lib/components/filters/subMenu.svelte b/src/lib/components/filters/quickfiltersSubMenu.svelte similarity index 77% rename from src/lib/components/filters/subMenu.svelte rename to src/lib/components/filters/quickfiltersSubMenu.svelte index 0063578ef..23159f67e 100644 --- a/src/lib/components/filters/subMenu.svelte +++ b/src/lib/components/filters/quickfiltersSubMenu.svelte @@ -4,17 +4,7 @@ import { ActionMenu, Card, Layout, Selector } from '@appwrite.io/pink-svelte'; import { createMenubar, melt } from '@melt-ui/svelte'; import { createEventDispatcher } from 'svelte'; - import type { ValidOperators } from './store'; - - type FilterData = { - title: string; - id: string; - array: boolean; - show: boolean; - tag: string; - operator: ValidOperators; - options: { value: string; label: string; checked: boolean }[]; - }; + import type { FilterData } from './quickFilters'; export let filter: FilterData; export let variant: 'checkbox' | 'radio' = 'checkbox'; @@ -44,7 +34,7 @@ - + {filter.title} @@ -61,11 +51,7 @@ on:click={() => { option.checked = !option.checked; dispatch('add', { - value: filter?.array - ? null - : option.checked - ? option.value - : null + value: option.value }); }}> {capitalize(option.label)} @@ -79,15 +65,11 @@ on:click={() => { option.checked = !option.checked; dispatch('add', { - value: filter?.array - ? null - : option.checked - ? option.value - : null + value: option.checked }); }}> - + {capitalize(option.label)} diff --git a/src/lib/components/filters/setFilters.ts b/src/lib/components/filters/setFilters.ts index fe8aa4ad3..cea0ba2ba 100644 --- a/src/lib/components/filters/setFilters.ts +++ b/src/lib/components/filters/setFilters.ts @@ -1,24 +1,25 @@ import type { Column } from '$lib/helpers/types'; import { get, writable } from 'svelte/store'; -import { resetOptions, type FilterData } from './quickFilters'; +import { type FilterData } from './quickFilters'; import { tags, type TagValue } from './store'; export const parsedTags = writable([]); export function setFiltersOnNavigate( - tags: TagValue[], + localTags: TagValue[], filterCols: FilterData[], $columns: Column[] ) { - if (!tags?.length) { + if (!localTags?.length) { filterCols.forEach((filter) => { resetOptions(filter); + cleanOldTags(filter.title); }); } else { filterCols.forEach((filter) => { if (filter.id === 'buildDuration') { setTimeFilter(filter, $columns); - } else if (filter.id.includes('size')) { + } else if (filter.id.toLocaleLowerCase().includes('size')) { setSizeFilter(filter, $columns); } else if (filter.id === 'statusCode') { setStatusCodeFilter(filter, $columns); @@ -37,26 +38,25 @@ export function setFiltersOnNavigate( export function setFilterData(filter: FilterData) { const tagData = get(tags).find((tag) => tag.tag.includes(`**${filter.title}**`)); if (tagData) { - cleanOldTags(filter.title); - - filter.tag = tagData.tag; if (Array.isArray(tagData.value) && tagData.value?.length) { const values = tagData.value as string[]; filter.options.forEach((option) => { option.checked = values.includes(option.value); }); } + cleanOldTags(filter.title); const newTag = { tag: tagData.tag.replace(',', ' or '), value: tagData.value }; + parsedTags.update((tags) => { tags.push(newTag); return tags; }); } else { - filter.tag = null; resetOptions(filter); + cleanOldTags(filter.title); } } @@ -64,7 +64,6 @@ export function setTimeFilter(filter: FilterData, columns: Column[]) { const col = columns.find((c) => c.id === filter.id); const timeTag = get(tags).find((tag) => tag.tag.includes(`**${filter.title}**`)); if (timeTag) { - cleanOldTags(filter.title); const now = new Date(); const diff = now.getTime() - new Date(timeTag.value as string).getTime(); @@ -80,15 +79,16 @@ export function setTimeFilter(filter: FilterData, columns: Column[]) { tag: `**${filter.title}** is **${dateRange.label}**`, value: timeTag.value }; - filter.tag = `**${filter.title}** is **${dateRange.label}**`; - filter = filter; + + cleanOldTags(filter.title); + parsedTags.update((tags) => { tags.push(newTag); return tags; }); } } else { - filter.tag = null; + cleanOldTags(filter.title); } } @@ -106,11 +106,19 @@ export function setSizeFilter(filter: FilterData, columns: Column[]) { return prev; }); if (sizeRange) { - filter.tag = `**${filter.title}** is **${sizeRange.label}**`; - filter = filter; + cleanOldTags(filter.title); + + const newTag = { + tag: `**${filter.title}** is **${sizeRange.label}**`, + value: sizeTag.value + }; + parsedTags.update((tags) => { + tags.push(newTag); + return tags; + }); } } else { - filter.tag = null; + cleanOldTags(filter.title); } } @@ -123,11 +131,18 @@ export function setStatusCodeFilter(filter: FilterData, columns: Column[]) { const codeRange = ranges.find((c) => c?.value && c.value === statusCodeTag.value); if (codeRange) { - filter.tag = `**${filter.title}** is **${codeRange.label}**`; - filter = filter; + cleanOldTags(filter.title); + const newTag = { + tag: `**${filter.title}** is **${codeRange.label}**`, + value: statusCodeTag.value + }; + parsedTags.update((tags) => { + tags.push(newTag); + return tags; + }); } } else { - filter.tag = null; + cleanOldTags(filter.title); } } @@ -135,7 +150,6 @@ export function setDateFilter(filter: FilterData, columns: Column[]) { const dateTag = get(tags).find((tag) => tag.tag.includes(`**${filter.title}**`)); const col = columns.find((c) => c.id === filter.id); if (dateTag) { - cleanOldTags(filter.title); const now = new Date(); const diff = now.getTime() - new Date(dateTag.value as string).getTime(); @@ -147,6 +161,7 @@ export function setDateFilter(filter: FilterData, columns: Column[]) { return prev; }); if (dateRange) { + cleanOldTags(filter.title); const newTag = { tag: `**${filter.title}** is **${dateRange.label}**`, value: dateTag.value @@ -157,7 +172,7 @@ export function setDateFilter(filter: FilterData, columns: Column[]) { }); } } else { - filter.tag = null; + cleanOldTags(filter.title); } } @@ -167,3 +182,9 @@ function cleanOldTags(title: string) { return tags; }); } + +export function resetOptions(filter: FilterData) { + filter.options.forEach((option) => { + option.checked = false; + }); +} diff --git a/src/lib/components/git/connectGit.svelte b/src/lib/components/git/connectGit.svelte index f2d4f5250..9dbca0fc7 100644 --- a/src/lib/components/git/connectGit.svelte +++ b/src/lib/components/git/connectGit.svelte @@ -20,7 +20,11 @@ environment variables are configured. - Learn more + Learn more diff --git a/src/lib/components/git/repositories.svelte b/src/lib/components/git/repositories.svelte index bc7d43b55..a75ec80cd 100644 --- a/src/lib/components/git/repositories.svelte +++ b/src/lib/components/git/repositories.svelte @@ -30,11 +30,13 @@ export let installationList = $installations; export let product: 'functions' | 'sites' = 'functions'; + let search = ''; + let selectedInstallation = null; + $: { hasInstallations = installationList?.total > 0; } - let selectedInstallation = null; async function loadInstallations() { if (installationList) { if (installationList.installations.length) { @@ -56,7 +58,6 @@ } } - let search = ''; async function loadRepositories(installationId: string, search: string) { if ( !$repositories || @@ -91,7 +92,7 @@ $repository = $repositories.repositories[0]; } - return $repositories.repositories.slice(0, 4); + return $repositories.repositories; } diff --git a/src/lib/components/menu/index.ts b/src/lib/components/menu/index.ts new file mode 100644 index 000000000..1ba6002f9 --- /dev/null +++ b/src/lib/components/menu/index.ts @@ -0,0 +1,2 @@ +export { default as Menu } from './menu.svelte'; +export { default as SubMenu } from './subMenu.svelte'; diff --git a/src/lib/components/filters/menu.svelte b/src/lib/components/menu/menu.svelte similarity index 52% rename from src/lib/components/filters/menu.svelte rename to src/lib/components/menu/menu.svelte index b0dd7fcd5..28e674e9e 100644 --- a/src/lib/components/filters/menu.svelte +++ b/src/lib/components/menu/menu.svelte @@ -1,8 +1,5 @@ - {#if $tags.length} - - - Filters - - {:else} - - - Filters - - {/if} + - - - + {#if $$slots.start} + + + {/if} + + {#if $$slots.end} + + + {/if} @@ -42,6 +40,7 @@ diff --git a/src/lib/components/usageCard.svelte b/src/lib/components/usageCard.svelte index 1fd9a03aa..e37fdf073 100644 --- a/src/lib/components/usageCard.svelte +++ b/src/lib/components/usageCard.svelte @@ -16,7 +16,7 @@ {value} {:else} - + {/if} diff --git a/src/lib/helpers/flag.ts b/src/lib/helpers/flag.ts new file mode 100644 index 000000000..a2e8e9d86 --- /dev/null +++ b/src/lib/helpers/flag.ts @@ -0,0 +1,8 @@ +import { isValueOfStringEnum } from '$lib/helpers/types'; +import { Flag } from '@appwrite.io/console'; +import { sdk } from '$lib/stores/sdk'; + +export function getFlagUrl(countryCode: string) { + if (!isValueOfStringEnum(Flag, countryCode)) return ''; + return sdk.forProject.avatars.getFlag(countryCode, 22, 15, 100)?.toString(); +} diff --git a/src/lib/layout/createProject.svelte b/src/lib/layout/createProject.svelte new file mode 100644 index 000000000..8e5eeb0cb --- /dev/null +++ b/src/lib/layout/createProject.svelte @@ -0,0 +1,89 @@ + + + + {#each regions as region} + + {/each} + + + + {#if showTitle} + Create your project + {/if} + + + + + {#if !showCustomId} + + { + showCustomId = true; + }}> Project ID + + {/if} + + + {#if isCloud && regions.length > 0} + + Region cannot be changed after creation + + {/if} + + + + Create + + + diff --git a/src/routes/(console)/onboarding/create-project/+page.svelte b/src/routes/(console)/onboarding/create-project/+page.svelte index 3490f6d65..7e2fe4904 100644 --- a/src/routes/(console)/onboarding/create-project/+page.svelte +++ b/src/routes/(console)/onboarding/create-project/+page.svelte @@ -1,12 +1,8 @@ @@ -144,57 +106,13 @@ height="22" class="u-only-dark" alt="Appwrite Logo" /> - - - Create your project - - - - - - {#if !showCustomId} - - { - showCustomId = true; - }}> Project ID - - {/if} - - - {#if data.regions} - - Region cannot be changed after creation - - {/if} - - - - Create - - - + + {/if} diff --git a/src/routes/(console)/organization-[organization]/+page.svelte b/src/routes/(console)/organization-[organization]/+page.svelte index 4a5753db7..2044eb82b 100644 --- a/src/routes/(console)/organization-[organization]/+page.svelte +++ b/src/routes/(console)/organization-[organization]/+page.svelte @@ -41,11 +41,13 @@ IconUnity } from '@appwrite.io/pink-icons-svelte'; import { getPlatformInfo } from '$lib/helpers/platform'; + import CreateProjectCloud from './createProjectCloud.svelte'; export let data; let addOrganization = false; let showCreate = false; + let showCreateProjectCloud = false; function allServiceDisabled(project: Models.Project): boolean { let disabled = true; @@ -66,7 +68,7 @@ function handleCreateProject() { if (!$canWriteProjects) return; - if (isCloud) wizard.start(Create); + if (isCloud) showCreateProjectCloud = true; else showCreate = true; } @@ -234,3 +236,6 @@ +{#if showCreateProjectCloud} + +{/if} diff --git a/src/routes/(console)/organization-[organization]/createProjectCloud.svelte b/src/routes/(console)/organization-[organization]/createProjectCloud.svelte index c42d662c6..8d2faf2a0 100644 --- a/src/routes/(console)/organization-[organization]/createProjectCloud.svelte +++ b/src/routes/(console)/organization-[organization]/createProjectCloud.svelte @@ -1,21 +1,22 @@ - + diff --git a/src/routes/(console)/organization-[organization]/wizard/step1.svelte b/src/routes/(console)/organization-[organization]/wizard/step1.svelte deleted file mode 100644 index 331a27fc3..000000000 --- a/src/routes/(console)/organization-[organization]/wizard/step1.svelte +++ /dev/null @@ -1,42 +0,0 @@ - - - - Details - - - - {#if !showCustomId} - - (showCustomId = !showCustomId)}> - - Project ID - - - {:else} - - {/if} - - diff --git a/src/routes/(console)/organization-[organization]/wizard/step2.svelte b/src/routes/(console)/organization-[organization]/wizard/step2.svelte deleted file mode 100644 index c28a43875..000000000 --- a/src/routes/(console)/organization-[organization]/wizard/step2.svelte +++ /dev/null @@ -1,133 +0,0 @@ - - - - Regions - - Choose a deployment region for your project. This region cannot be changed. - - {#if $regions} - - {#each $regions.regions - .filter((r) => r.$id !== 'default') - .sort((regionA, regionB) => { - if (regionA.disabled >= regionB.disabled) { - return 1; - } - return -1; - }) as region} - - - - {#if region.disabled} - - {region.name} - {#if !notifications.includes(region.$id)} - { - notifyRegion(region); - }}> - - Notify me - - {:else} - { - unNotifyRegion(region); - }}> - - Notify me - - {/if} - {:else} - - {region.name} - {/if} - - - - {/each} - - {/if} - diff --git a/src/routes/(console)/project-[project]/functions/create-function/+page.svelte b/src/routes/(console)/project-[project]/functions/create-function/+page.svelte index 3357ce168..8068d9edd 100644 --- a/src/routes/(console)/project-[project]/functions/create-function/+page.svelte +++ b/src/routes/(console)/project-[project]/functions/create-function/+page.svelte @@ -10,6 +10,7 @@ import { installation, repository } from '$lib/stores/vcs'; import { Repositories } from '$lib/components/git'; import { + Alert, Avatar, Badge, Card, @@ -21,6 +22,7 @@ import { IconArrowSmRight } from '@appwrite.io/pink-icons-svelte'; import Wizard from '$lib/layout/wizard.svelte'; import { Link } from '$lib/elements'; + import { Button } from '$lib/elements/forms'; export let data; @@ -62,16 +64,35 @@ `${wizardBase}/create-function/repository-${e.detail.id}?installation=${$installation.$id}` ); } - - $: console.log(data); - - - - - + + + + {#if isSelfHosted && !isVcsEnabled} + + Connect Git repository + + + + + Configure your self-hosted instance to connect your function to + a Git repository. + + + Learn more + + + + + {:else} {/if} - + {/if} + - - - Quick start - - {#each starterTemplateRuntimes.slice(0, 6) as template} - {@const iconName = template.name.split('-')[0]} - {@const runtimeDetail = baseRuntimesList.find( - (runtime) => runtime.$id === template.name - )} - { - trackEvent('click_connect_template', { - from: 'cover', - template: starterTemplate.id, - runtime: template.name - }); - }} - href={`${wizardBase}/create-function/template-${starterTemplate.id}?runtime=${runtimeDetail.$id}`}> - - - - - - - {runtimeDetail?.name} - {#if runtimeDetail?.name?.toLowerCase() === 'deno'} - - {/if} - - - - - {/each} - - - - - - {#each featuredTemplatesList as template} - { - trackEvent('click_connect_template', { - from: 'cover', - template: template.name - }); - }}> - - - - {template.name} - - + + + Quick start + + {#each starterTemplateRuntimes.slice(0, 6) as template} + {@const iconName = template.name.split('-')[0]} + {@const runtimeDetail = baseRuntimesList.find( + (runtime) => runtime.$id === template.name + )} + { + trackEvent('click_connect_template', { + from: 'cover', + template: starterTemplate.id, + runtime: template.name + }); + }} + href={`${wizardBase}/create-function/template-${starterTemplate.id}?runtime=${runtimeDetail.$id}`}> + + + + + + + {runtimeDetail?.name} + {#if runtimeDetail?.name?.toLowerCase() === 'deno'} + + {/if} - - {template.tagline} + + + + {/each} + + + + + + {#each featuredTemplatesList as template} + { + trackEvent('click_connect_template', { + from: 'cover', + template: template.name + }); + }}> + + + + {template.name} + - - {/each} - + + {template.tagline} + + + + {/each} + - - - Browse all templates - - - - - + + + Browse all templates + + + + + - - You can also create a function { - trackEvent('click_create_function_manual', { from: 'cover' }); - }} - href={`${wizardBase}/create-function/manual`}>manually - or using the CLI. - Learn more. - - - {#if isSelfHosted && !isVcsEnabled} - - - - Connect your self-hosted instance to Git - - - Configure your self-hosted instance to connect your function to a Git - repository. - Learn more. - - - - {/if} - + + You can also create a function { + trackEvent('click_create_function_manual', { from: 'cover' }); + }} + href={`${wizardBase}/create-function/manual`}>manually + or using the CLI. + Learn more. + + - - diff --git a/src/routes/(console)/project-[project]/functions/function-[function]/+layout.ts b/src/routes/(console)/project-[project]/functions/function-[function]/+layout.ts index 4ae0fd71d..e57eeef3b 100644 --- a/src/routes/(console)/project-[project]/functions/function-[function]/+layout.ts +++ b/src/routes/(console)/project-[project]/functions/function-[function]/+layout.ts @@ -19,7 +19,7 @@ export const load: LayoutLoad = async ({ params, depends }) => { Query.equal('type', RuleType.DEPLOYMENT), Query.equal('deploymentResourceType', DeploymentResourceType.FUNCTION), Query.equal('deploymentResourceId', params.function), - Query.equal('deploymentId', func.deployment), + Query.equal('deploymentId', func.deploymentId), Query.limit(1) ]); 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 a2fa3d94e..3213a86ee 100644 --- a/src/routes/(console)/project-[project]/functions/function-[function]/+page.svelte +++ b/src/routes/(console)/project-[project]/functions/function-[function]/+page.svelte @@ -31,7 +31,7 @@ } from '@appwrite.io/pink-icons-svelte'; import { app } from '$lib/stores/app'; import CreateActionMenu from './(components)/createActionMenu.svelte'; - import { QuickFilters } from '$lib/components/filters'; + import { ParsedTagList, QuickFilters } from '$lib/components/filters'; export let data; @@ -171,23 +171,26 @@ {/if} - - - {#if data.deploymentList.total} - - {/if} - - - {#if data.deploymentList.total} - - {/if} - - - - Create deployment - - + + + + {#if data.deploymentList.total} + + {/if} + + + {#if data.deploymentList.total} + + {/if} + + + + Create deployment + + + + {#if data.deploymentList.total} 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 ba34bddea..e6d26d0a9 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 @@ -96,7 +96,7 @@ Download {/if} - {#if data.func.deployment !== data.deployment.$id && data.deployment.status === 'ready'} + {#if data.func.deploymentId !== data.deployment.$id && data.deployment.status === 'ready'} { diff --git a/src/routes/(console)/project-[project]/functions/function-[function]/deployment-[deployment]/+page.ts b/src/routes/(console)/project-[project]/functions/function-[function]/deployment-[deployment]/+page.ts index 4fcab109f..374b96fd6 100644 --- a/src/routes/(console)/project-[project]/functions/function-[function]/deployment-[deployment]/+page.ts +++ b/src/routes/(console)/project-[project]/functions/function-[function]/deployment-[deployment]/+page.ts @@ -14,6 +14,6 @@ export const load: PageLoad = async ({ params, depends, parent }) => { return { func, deployment, - activeDeployment: func.deployment === params.deployment + activeDeployment: func.deploymentId === params.deployment }; }; diff --git a/src/routes/(console)/project-[project]/functions/function-[function]/executions/+page.svelte b/src/routes/(console)/project-[project]/functions/function-[function]/executions/+page.svelte index e5048f30b..03197f12c 100644 --- a/src/routes/(console)/project-[project]/functions/function-[function]/executions/+page.svelte +++ b/src/routes/(console)/project-[project]/functions/function-[function]/executions/+page.svelte @@ -13,7 +13,7 @@ import { IconPlus } from '@appwrite.io/pink-icons-svelte'; import Table from './table.svelte'; import { columns } from './store'; - import { QuickFilters } from '$lib/components/filters'; + import { ParsedTagList, QuickFilters } from '$lib/components/filters'; export let data; @@ -29,21 +29,24 @@ - - + + + - - {#if data?.executions?.total} - - {/if} - - - Create execution - + + {#if data?.executions?.total} + + {/if} + + + Create execution + + + {#if !data.func.logging} diff --git a/src/routes/(console)/project-[project]/functions/function-[function]/executions/execute-function/+page.ts b/src/routes/(console)/project-[project]/functions/function-[function]/executions/execute-function/+page.ts index 1839e3613..7ee66a5a4 100644 --- a/src/routes/(console)/project-[project]/functions/function-[function]/executions/execute-function/+page.ts +++ b/src/routes/(console)/project-[project]/functions/function-[function]/executions/execute-function/+page.ts @@ -1,7 +1,6 @@ import { sdk } from '$lib/stores/sdk'; import { Dependencies } from '$lib/constants'; import type { PageLoad } from './$types'; -import { proxyRuleList } from '../../store'; export const load: PageLoad = async ({ params, depends, parent }) => { const data = await parent(); diff --git a/src/routes/(console)/project-[project]/functions/function-[function]/table.svelte b/src/routes/(console)/project-[project]/functions/function-[function]/table.svelte index 7cfd4499f..85a9b616e 100644 --- a/src/routes/(console)/project-[project]/functions/function-[function]/table.svelte +++ b/src/routes/(console)/project-[project]/functions/function-[function]/table.svelte @@ -136,7 +136,7 @@ }}> Redeploy - {#if deployment.status === 'ready' && deployment.$id !== $func.deployment} + {#if deployment.status === 'ready' && deployment.$id !== $func.deploymentId} { diff --git a/src/routes/(console)/project-[project]/sites/(components)/addCollaboratorModal.svelte b/src/routes/(console)/project-[project]/sites/(components)/addCollaboratorModal.svelte index 37b23cea7..e4e7d1c5f 100644 --- a/src/routes/(console)/project-[project]/sites/(components)/addCollaboratorModal.svelte +++ b/src/routes/(console)/project-[project]/sites/(components)/addCollaboratorModal.svelte @@ -12,8 +12,8 @@ import { Submit, trackEvent, trackError } from '$lib/actions/analytics'; import { roles } from '$lib/stores/billing'; import InputSelect from '$lib/elements/forms/inputSelect.svelte'; - import Roles from '$lib/components/roles/roles.svelte'; import { Layout } from '@appwrite.io/pink-svelte'; + import { isCloud, isSelfHosted } from '$lib/system'; export let show = false; @@ -24,7 +24,7 @@ let email: string, name: string, error: string, - role: string = 'viewer'; + role: string = isSelfHosted ? 'owner' : 'viewer'; async function create() { try { @@ -59,8 +59,6 @@ email = null; name = null; } - - //TODO: fix popover @@ -75,14 +73,15 @@ placeholder="Enter email" autofocus={true} bind:value={email} /> - + {#if isCloud} + + {/if} (show = false)}>Cancel diff --git a/src/routes/(console)/project-[project]/sites/(components)/deploymentActionMenu.svelte b/src/routes/(console)/project-[project]/sites/(components)/deploymentActionMenu.svelte index 36dac9741..706cf76e8 100644 --- a/src/routes/(console)/project-[project]/sites/(components)/deploymentActionMenu.svelte +++ b/src/routes/(console)/project-[project]/sites/(components)/deploymentActionMenu.svelte @@ -1,5 +1,7 @@ - - { - e.preventDefault(); - toggle(e); - }}> + + - + {#if !inCard} Redeploy @@ -64,21 +69,35 @@ e.preventDefault(); selectedDeployment = deployment; showActivate = true; - toggle(e); + toggle(); }}> Activate {/if} {#if deployment?.status === 'ready' || deployment?.status === 'failed'} - { - toggle(e); - }}> - Download - + + + + Download + + + + + + Download source + + + Download output + + + + {/if} {#if deployment?.status === 'processing' || deployment?.status === 'building' || deployment.status === 'waiting'} @@ -89,7 +108,6 @@ e.preventDefault(); selectedDeployment = deployment; showCancel = true; - toggle(e); }}> Cancel @@ -102,11 +120,10 @@ e.preventDefault(); selectedDeployment = deployment; showDelete = true; - toggle(e); }}> Delete {/if} - + 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 50fb2025f..e2a82b9a4 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 @@ -18,7 +18,7 @@ import { invalidate } from '$app/navigation'; import { Dependencies } from '$lib/constants'; import CreateCliModal from './createCliModal.svelte'; - import { QuickFilters } from '$lib/components/filters'; + import { ParsedTagList, QuickFilters } from '$lib/components/filters'; export let data; @@ -45,54 +45,57 @@ - - - {#if data.deploymentList.total || data?.query} - - {/if} - + + + + {#if data.deploymentList.total || data?.query} + + {/if} + - - {#if data.deploymentList.total} - - {/if} - - - - Create deployment - - - - { - toggle(e); - if (!hasInstallation) { - showConnectRepo = true; - } else { - showCreateDeployment = true; - } - }}> - Git - - { - toggle(e); - showConnectCLI = true; - }}> - CLI - - { - toggle(e); - showConnectManual = true; - }}> - Manual - - - - + + {#if data.deploymentList.total} + + {/if} + + + + Create deployment + + + + { + toggle(e); + if (!hasInstallation) { + showConnectRepo = true; + } else { + showCreateDeployment = true; + } + }}> + Git + + { + toggle(e); + showConnectCLI = true; + }}> + CLI + + { + toggle(e); + showConnectManual = true; + }}> + Manual + + + + + + {#if data.deploymentList.total} diff --git a/src/routes/(console)/project-[project]/sites/site-[site]/logs/+page.svelte b/src/routes/(console)/project-[project]/sites/site-[site]/logs/+page.svelte index 3b8fc9d94..ec1935eaf 100644 --- a/src/routes/(console)/project-[project]/sites/site-[site]/logs/+page.svelte +++ b/src/routes/(console)/project-[project]/sites/site-[site]/logs/+page.svelte @@ -7,11 +7,10 @@ import { sdk } from '$lib/stores/sdk'; import { onMount } from 'svelte'; import Table from './table.svelte'; - import { QuickFilters } from '$lib/components/filters'; + import { ParsedTagList, QuickFilters } from '$lib/components/filters'; import { Card, Empty, Layout } from '@appwrite.io/pink-svelte'; import { View } from '$lib/helpers/load'; import { columns } from './store'; - import AppliedFilter from '$lib/components/filters/appliedFilter.svelte'; export let data; @@ -35,7 +34,7 @@ {/if} - + {#if data?.logs?.total} diff --git a/src/routes/(console)/project-[project]/sites/site-[site]/settings/disconnectRepo.svelte b/src/routes/(console)/project-[project]/sites/site-[site]/settings/disconnectRepo.svelte index 9f83b36c3..5029895a5 100644 --- a/src/routes/(console)/project-[project]/sites/site-[site]/settings/disconnectRepo.svelte +++ b/src/routes/(console)/project-[project]/sites/site-[site]/settings/disconnectRepo.svelte @@ -27,7 +27,7 @@ site.buildCommand || undefined, site.outputDirectory || undefined, (site?.buildRuntime as BuildRuntime) || undefined, - site.adapter as Adapter, + (site?.adapter as Adapter) || undefined, site.fallbackFile || undefined, '', '',
{region.name}
+ Configure your self-hosted instance to connect your function to + a Git repository. +
- Configure your self-hosted instance to connect your function to a Git - repository. - Learn more. -