diff --git a/src/lib/components/viewSelector.svelte b/src/lib/components/viewSelector.svelte index 564f2bff4..04afafc9b 100644 --- a/src/lib/components/viewSelector.svelte +++ b/src/lib/components/viewSelector.svelte @@ -75,12 +75,14 @@ }); } - $: selectedColumnsNumber = $columns.reduce((acc, column) => { - if (column.show) { - acc++; - } - return acc; - }, 0); + $: selectedColumnsNumber = $columns + .filter((c) => !c.hide) + .reduce((acc, column) => { + if (column.show) { + acc++; + } + return acc; + }, 0); {#if !hideColumns && view === View.Table} @@ -96,7 +98,7 @@ - {#each $columns as column} + {#each $columns.filter((c) => !c.hide) as column} >( 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 980a3cf4b..f44dccf92 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 @@ -1,141 +1,22 @@ @@ -181,23 +57,26 @@ --> - + {#if data?.executions?.total} + + {/if} - {#if !$func.logging} + {#if !data.func.logging}
Your execution logs are disabled To view execution logs and errors, enable them in your Function settings. @@ -205,7 +84,7 @@
{/if} {#if data?.executions?.total} - +
{:else if data?.query} - -
-
- Sorry we couldn't find any executions -

There are no executions that match your filters.

-
-
- -
-
-
+ {:else} goto( - `${base}/project-${$project.$id}/functions/function-${$func.$id}/executions/execute-function` + `${base}/project-${$project.$id}/functions/function-${data.func.$id}/executions/execute-function` )}> {/if} diff --git a/src/routes/(console)/project-[project]/functions/function-[function]/executions/+page.ts b/src/routes/(console)/project-[project]/functions/function-[function]/executions/+page.ts index 2d4d66858..6f2190057 100644 --- a/src/routes/(console)/project-[project]/functions/function-[function]/executions/+page.ts +++ b/src/routes/(console)/project-[project]/functions/function-[function]/executions/+page.ts @@ -5,7 +5,9 @@ import { Dependencies, PAGE_LIMIT } from '$lib/constants'; import type { PageLoad } from './$types'; import { queries, queryParamToMap } from '$lib/components/filters'; -export const load: PageLoad = async ({ params, depends, url, route }) => { +export const load: PageLoad = async ({ params, depends, url, route, parent }) => { + const { function: func } = await parent(); + depends(Dependencies.EXECUTIONS); const page = getPage(url); const limit = getLimit(url, route, PAGE_LIMIT); @@ -19,6 +21,7 @@ export const load: PageLoad = async ({ params, depends, url, route }) => { offset, limit, query, + func, executions: await sdk.forProject.functions.listExecutions(params.function, [ Query.limit(limit), Query.offset(offset), diff --git a/src/routes/(console)/project-[project]/functions/function-[function]/executions/execute-function/+page.svelte b/src/routes/(console)/project-[project]/functions/function-[function]/executions/execute-function/+page.svelte index c2f4fb73d..f63e4302d 100644 --- a/src/routes/(console)/project-[project]/functions/function-[function]/executions/execute-function/+page.svelte +++ b/src/routes/(console)/project-[project]/functions/function-[function]/executions/execute-function/+page.svelte @@ -3,31 +3,21 @@ import { base } from '$app/paths'; import { page } from '$app/stores'; import { Submit, trackError, trackEvent } from '$lib/actions/analytics'; - import { timer } from '$lib/actions/timer'; - import { Alert, Card, Id } from '$lib/components'; - import { Dependencies } from '$lib/constants'; - import { Pill } from '$lib/elements'; import { Button, Form, - FormList, Helper, InputDate, InputSelect, - InputSelectSearch, InputText, InputTextarea, InputTime } from '$lib/elements/forms'; - import { humanFileSize } from '$lib/helpers/sizeConvertion'; - import { calculateTime } from '$lib/helpers/timeConversion'; - import { WizardSecondaryContent, WizardSecondaryFooter } from '$lib/layout'; import { addNotification } from '$lib/stores/notifications'; import { sdk } from '$lib/stores/sdk'; import { ExecutionMethod, type Models } from '@appwrite.io/console'; import { writable } from 'svelte/store'; - import { proxyRuleList } from '../../store'; import { isSameDay, toLocaleDateISO, @@ -35,10 +25,19 @@ toLocaleTimeISO } from '$lib/helpers/date'; import { last } from '$lib/helpers/array'; - import { Icon, Tooltip } from '@appwrite.io/pink-svelte'; - import { IconPlus } from '@appwrite.io/pink-icons-svelte'; + import { + Accordion, + Alert, + Fieldset, + Icon, + Input, + Layout, + Tooltip, + Typography + } from '@appwrite.io/pink-svelte'; + import { IconInfo, IconPlus, IconX } from '@appwrite.io/pink-icons-svelte'; import Wizard from '$lib/layout/wizard.svelte'; - import { DeploymentCreatedBy, DeploymentDomains, DeploymentSource } from '$lib/components/git'; + import Aside from './aside.svelte'; let previousPage: string = `${base}/project-${$page.params.project}/functions/function-${$page.params.function}/executions`; @@ -140,258 +139,221 @@ - Execute function - Appwrite + Create execution - Appwrite - - Execute function - -
- - {#if func?.version === 'v2'} - - - Customizable execution data now available for functions v3.0 - - Update your function version to make use of new features including customizable - HTTP data in your executions. - - - - - - {:else} - - -
-

- Headers - (optional) - -
- Headers should contain alphanumeric characters (a-z, A-Z, and - 0-9) and hyphens only (- and _). -
-
-

+ + Create execution + + + {#if func?.version === 'v2'} + + - - {#if headers} - {#each headers as [name, value], index} - - - - - {/each} - {/if} - + Update your function version to make use of new features including customizable + HTTP data in your executions. + -
+ + +
+ + + + Provide the request body to include the main data you want to send + to the server. + + + + +
+ {:else} +
+ + + + + - + + + + + Provide essential metadata to define the content type, + authentication details, and the expected response format. + -
  • - - {#if isScheduled} - - - {/if} - - {isScheduled - ? `Your function will be executed on ${toLocaleDateTime(dateTime?.toString())}` - : 'Your function will be executed immediately'} - -
  • - {/if} - - - - -
    -

    Deployment ID

    + + {#if headers} + {#each headers as [name, value], index} + + + + + + + + + + + Values should contain + alphanumeric characters (a-z, + A-Z, and 0-9) and hyphens only + (- and _). + + + + + + + {/each} + {/if} +
    + +
    +
    + + - - {func.deployment} - -
    -
      -
    • -

      Status

      -

      - - active - - -

      -
    • -
    • -

      Build duration

      -

      - {#if ['processing', 'building'].includes(deployment.status)} - - {:else} - {calculateTime(deployment.buildDuration)} + + + + Provide the request body to include the main data you want + to send to the server. + + + + + + +

    + +
    + + + + {#if !isScheduled} + + Your function will be executed immediately + {/if} -

    - -
  • -

    Total size

    -

    - {humanFileSize(deployment.sourceSize + deployment.buildSize).value + - humanFileSize(deployment.sourceSize + deployment.buildSize).unit} - - -

    -

    - Deployment size: - {humanFileSize(deployment.sourceSize).value + - humanFileSize(deployment.sourceSize).unit} -

    -

    - Build size: - {humanFileSize(deployment.buildSize).value + - humanFileSize(deployment.buildSize).unit} -

    -
    - -

    -
  • - -
    -

    Source

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

    Domains

    - - - -
    - {/if} -
    -

    Updated

    - - - -
    - - - +
    + {#if isScheduled} + + + + + + + Your function will be executed on {toLocaleDateTime( + dateTime?.toString() + )} + + + {/if} +
    +
    + {/if} + + + +