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 86ef6c966..2d4d66858 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
@@ -1,22 +1,29 @@
import { Query } from '@appwrite.io/console';
import { sdk } from '$lib/stores/sdk';
-import { getLimit, getPage, pageToOffset } from '$lib/helpers/load';
+import { getLimit, getPage, getQuery, pageToOffset } from '$lib/helpers/load';
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 }) => {
depends(Dependencies.EXECUTIONS);
const page = getPage(url);
const limit = getLimit(url, route, PAGE_LIMIT);
const offset = pageToOffset(page, limit);
+ const query = getQuery(url);
+
+ const parsedQueries = queryParamToMap(query || '[]');
+ queries.set(parsedQueries);
return {
offset,
limit,
+ query,
executions: await sdk.forProject.functions.listExecutions(params.function, [
Query.limit(limit),
Query.offset(offset),
- Query.orderDesc('')
+ Query.orderDesc(''),
+ ...parsedQueries.values()
])
};
};
diff --git a/src/routes/console/project-[project]/functions/function-[function]/executions/delete.svelte b/src/routes/console/project-[project]/functions/function-[function]/executions/delete.svelte
new file mode 100644
index 000000000..b05f59fb7
--- /dev/null
+++ b/src/routes/console/project-[project]/functions/function-[function]/executions/delete.svelte
@@ -0,0 +1,47 @@
+
+
+
+ Are you sure you want to delete this execution?
+
+ (showDelete = false)}>Cancel
+ Delete
+
+
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
new file mode 100644
index 000000000..51f6e5b4b
--- /dev/null
+++ b/src/routes/console/project-[project]/functions/function-[function]/executions/execute-function/+page.svelte
@@ -0,0 +1,382 @@
+
+
+
+ Execute function - Appwrite
+
+
+
+ Execute function
+
+
+
+
+
+
Deployment ID
+
+
+ {func.deployment}
+
+
+
+
+ Status
+
+
+ active
+
+
+
+
+
+ Build time
+
+ {#if ['processing', 'building'].includes(deployment.status)}
+
+ {:else}
+ {calculateTime(deployment.buildTime)}
+ {/if}
+
+
+
+ Size
+
+ {humanFileSize(deployment.size).value +
+ humanFileSize(deployment.size).unit}
+
+
+
+
+
+
+
+
+
+
+
+ Cancel
+ formComponent.triggerSubmit()}
+ disabled={$isSubmitting}>
+ Execute
+
+
+
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
new file mode 100644
index 000000000..1d11c6734
--- /dev/null
+++ b/src/routes/console/project-[project]/functions/function-[function]/executions/execute-function/+page.ts
@@ -0,0 +1,18 @@
+import { sdk } from '$lib/stores/sdk';
+import { Dependencies } from '$lib/constants';
+import type { PageLoad } from './$types';
+
+export const load: PageLoad = async ({ params, depends, parent }) => {
+ const data = await parent();
+ depends(Dependencies.DEPLOYMENTS);
+
+ return {
+ func: data.function,
+ activeDeployment: data.function.deployment
+ ? await sdk.forProject.functions.getDeployment(
+ params.function,
+ data.function.deployment
+ )
+ : null
+ };
+};
diff --git a/src/routes/console/project-[project]/functions/function-[function]/executions/table.svelte b/src/routes/console/project-[project]/functions/function-[function]/executions/table.svelte
new file mode 100644
index 000000000..b440a8105
--- /dev/null
+++ b/src/routes/console/project-[project]/functions/function-[function]/executions/table.svelte
@@ -0,0 +1,152 @@
+
+
+
+
+ {#each columns as column}
+ {#if column.show}
+ {column.title}
+ {/if}
+ {/each}
+
+
+
+ {#each data.executions.executions as execution, index (execution.$id)}
+
+ {#each columns as column}
+ {#if column.show}
+ {#if column.id === '$id'}
+ {#key column.id}
+
+ {execution.$id}
+
+ {/key}
+ {:else if column.id === 'status'}
+
+ {@const status = execution.status}
+
+
+ {#if status === 'scheduled'}
+
+ {/if}
+ {status}
+
+
+
+ {:else if column.id === '$createdAt'}
+
+ {timeFromNow(execution.$createdAt)}
+
+ {:else if column.id === 'trigger'}
+
+
+ {execution.trigger}
+
+
+ {:else if column.id === 'requestMethod'}
+
+ {execution.requestMethod}
+
+ {:else if column.id === 'responseStatusCode'}
+
+ {execution.responseStatusCode}
+
+ {:else if column.id === 'requestPath'}
+
+ {execution.requestPath}
+
+ {:else if column.id === 'duration'}
+
+ {calculateTime(execution.duration)}
+
+ {/if}
+ {/if}
+ {/each}
+
+
+ {
+ showDropdown[index] = !showDropdown[index];
+ }}>
+
+
+
+ {
+ showDropdown = [];
+ showLogs(execution);
+ }}>
+ Logs
+
+ {
+ selectedExecution = execution;
+ showDropdown = [];
+ showDelete = true;
+ }}>
+ Delete
+
+
+
+
+
+ {/each}
+
+
+
+{#if selectedExecution}
+
+{/if}
diff --git a/src/routes/console/project-[project]/functions/function-[function]/settings/+page.svelte b/src/routes/console/project-[project]/functions/function-[function]/settings/+page.svelte
index db5149a6a..dd2e6e69e 100644
--- a/src/routes/console/project-[project]/functions/function-[function]/settings/+page.svelte
+++ b/src/routes/console/project-[project]/functions/function-[function]/settings/+page.svelte
@@ -1,23 +1,26 @@
@@ -28,9 +30,8 @@
{
- $execute = $func;
- $showFunctionExecute = true;
- }}>Execute now
+ href={`${base}/console/project-${$project.$id}/functions/function-${$func.$id}/executions/execute-function`}>
+ Execute now
+
diff --git a/src/routes/console/project-[project]/functions/function-[function]/settings/gitConfigurationModal.svelte b/src/routes/console/project-[project]/functions/function-[function]/settings/gitConfigurationModal.svelte
index 6a8dc10d4..cd43beb40 100644
--- a/src/routes/console/project-[project]/functions/function-[function]/settings/gitConfigurationModal.svelte
+++ b/src/routes/console/project-[project]/functions/function-[function]/settings/gitConfigurationModal.svelte
@@ -64,6 +64,7 @@
$func.logging || undefined,
$func.entrypoint,
$func.commands || undefined,
+ $func.scopes || undefined,
selectedInstallationId,
selectedRepoId,
selectedBranch,
diff --git a/src/routes/console/project-[project]/functions/function-[function]/settings/updateConfiguration.svelte b/src/routes/console/project-[project]/functions/function-[function]/settings/updateConfiguration.svelte
index df247fcc8..132520cf3 100644
--- a/src/routes/console/project-[project]/functions/function-[function]/settings/updateConfiguration.svelte
+++ b/src/routes/console/project-[project]/functions/function-[function]/settings/updateConfiguration.svelte
@@ -130,6 +130,7 @@
$func.logging || undefined,
entrypoint,
commands,
+ $func.scopes || undefined,
$func.installationId || undefined,
$func.providerRepositoryId || undefined,
selectedBranch,
diff --git a/src/routes/console/project-[project]/functions/function-[function]/settings/updateEvents.svelte b/src/routes/console/project-[project]/functions/function-[function]/settings/updateEvents.svelte
index c2c359bfd..fe63e7726 100644
--- a/src/routes/console/project-[project]/functions/function-[function]/settings/updateEvents.svelte
+++ b/src/routes/console/project-[project]/functions/function-[function]/settings/updateEvents.svelte
@@ -46,6 +46,7 @@
$func.logging || undefined,
$func.entrypoint || undefined,
$func.commands || undefined,
+ $func.scopes || undefined,
$func.installationId || undefined,
$func.providerRepositoryId || undefined,
$func.providerBranch || undefined,
diff --git a/src/routes/console/project-[project]/functions/function-[function]/settings/updateLogging.svelte b/src/routes/console/project-[project]/functions/function-[function]/settings/updateLogging.svelte
index 2f6e4afb8..59a722f0c 100644
--- a/src/routes/console/project-[project]/functions/function-[function]/settings/updateLogging.svelte
+++ b/src/routes/console/project-[project]/functions/function-[function]/settings/updateLogging.svelte
@@ -38,6 +38,7 @@
functionLogging,
$func.entrypoint || undefined,
$func.commands || undefined,
+ $func.scopes || undefined,
$func.installationId || undefined,
$func.providerRepositoryId || undefined,
$func.providerBranch || undefined,
diff --git a/src/routes/console/project-[project]/functions/function-[function]/settings/updateName.svelte b/src/routes/console/project-[project]/functions/function-[function]/settings/updateName.svelte
index 8f44fd549..3051debe4 100644
--- a/src/routes/console/project-[project]/functions/function-[function]/settings/updateName.svelte
+++ b/src/routes/console/project-[project]/functions/function-[function]/settings/updateName.svelte
@@ -36,6 +36,7 @@
$func.logging || undefined,
$func.entrypoint || undefined,
$func.commands || undefined,
+ $func.scopes || undefined,
$func.installationId || undefined,
$func.providerRepositoryId || undefined,
$func.providerBranch || undefined,
diff --git a/src/routes/console/project-[project]/functions/function-[function]/settings/updatePermissions.svelte b/src/routes/console/project-[project]/functions/function-[function]/settings/updatePermissions.svelte
index 8af6ef6e3..41a8ecbe3 100644
--- a/src/routes/console/project-[project]/functions/function-[function]/settings/updatePermissions.svelte
+++ b/src/routes/console/project-[project]/functions/function-[function]/settings/updatePermissions.svelte
@@ -40,6 +40,7 @@
$func.logging || undefined,
$func.entrypoint || undefined,
$func.commands || undefined,
+ $func.scopes || undefined,
$func.installationId || undefined,
$func.providerRepositoryId || undefined,
$func.providerBranch || undefined,
diff --git a/src/routes/console/project-[project]/functions/function-[function]/settings/updateRuntime.svelte b/src/routes/console/project-[project]/functions/function-[function]/settings/updateRuntime.svelte
index a4a2f806c..b88055ddf 100644
--- a/src/routes/console/project-[project]/functions/function-[function]/settings/updateRuntime.svelte
+++ b/src/routes/console/project-[project]/functions/function-[function]/settings/updateRuntime.svelte
@@ -10,23 +10,47 @@
import { onMount } from 'svelte';
import { func } from '../store';
import InputSelect from '$lib/elements/forms/inputSelect.svelte';
- import { runtimesList } from '../../store';
+ import { runtimesList, specs } from '../../store';
import { isValueOfStringEnum } from '$lib/helpers/types';
import { Runtime } from '@appwrite.io/console';
const functionId = $page.params.function;
let runtime: string = null;
+ let memory: number = null;
+ let cpus: number = null;
let options = [];
+ let cpuOptions = [];
+ let memoryOptions = [];
onMount(async () => {
runtime ??= $func.runtime;
+ memory ??= $func.memory;
+ cpus ??= $func.cpus;
let runtimes = await $runtimesList;
+ let allowedSpecs = await $specs;
options = runtimes.runtimes.map((runtime) => ({
label: `${runtime.name} - ${runtime.version}`,
value: runtime.$id
}));
+
+ memoryOptions = allowedSpecs.memory.map((memory) =>
+ memory > 1024
+ ? {
+ label: `${memory / 1024} GB`,
+ value: memory
+ }
+ : {
+ label: `${memory} MB`,
+ value: memory
+ }
+ );
+
+ cpuOptions = allowedSpecs.cpus.map((cpu) => ({
+ label: cpu === 1 ? `${cpu} CPU Cores` : `${cpu} CPU Core`,
+ value: cpu
+ }));
});
async function updateRuntime() {
@@ -34,7 +58,7 @@
if (!isValueOfStringEnum(Runtime, runtime)) {
throw new Error(`Invalid runtime: ${runtime}`);
}
- await sdk.forProject.functions.update(
+ await sdk.forProject.specsFunctions.update(
functionId,
$func.name,
runtime,
@@ -46,15 +70,18 @@
$func.logging || undefined,
$func.entrypoint || undefined,
$func.commands || undefined,
+ $func.scopes || undefined,
$func.installationId || undefined,
$func.providerRepositoryId || undefined,
$func.providerBranch || undefined,
$func.providerSilentMode || undefined,
- $func.providerRootDirectory || undefined
+ $func.providerRootDirectory || undefined,
+ cpus,
+ memory
);
await invalidate(Dependencies.FUNCTION);
addNotification({
- message: 'Runtime has been updated',
+ message: 'Runtime settings have been updated',
type: 'success'
});
trackEvent(Submit.FunctionUpdateName);
@@ -66,6 +93,9 @@
trackError(error, Submit.FunctionUpdateName);
}
}
+
+ $: isUpdateButtonEnabled =
+ runtime !== $func?.runtime || memory !== $func?.memory || cpus !== $func?.cpus;
diff --git a/src/routes/console/project-[project]/functions/function-[function]/settings/updateSchedule.svelte b/src/routes/console/project-[project]/functions/function-[function]/settings/updateSchedule.svelte
index ecd707039..d59ccecf8 100644
--- a/src/routes/console/project-[project]/functions/function-[function]/settings/updateSchedule.svelte
+++ b/src/routes/console/project-[project]/functions/function-[function]/settings/updateSchedule.svelte
@@ -36,6 +36,7 @@
$func.logging || undefined,
$func.entrypoint || undefined,
$func.commands || undefined,
+ $func.scopes || undefined,
$func.installationId || undefined,
$func.providerRepositoryId || undefined,
$func.providerBranch || undefined,
diff --git a/src/routes/console/project-[project]/functions/function-[function]/settings/updateScopes.svelte b/src/routes/console/project-[project]/functions/function-[function]/settings/updateScopes.svelte
new file mode 100644
index 000000000..4e1d49500
--- /dev/null
+++ b/src/routes/console/project-[project]/functions/function-[function]/settings/updateScopes.svelte
@@ -0,0 +1,92 @@
+
+
+
diff --git a/src/routes/console/project-[project]/functions/function-[function]/settings/updateTimeout.svelte b/src/routes/console/project-[project]/functions/function-[function]/settings/updateTimeout.svelte
index c36303279..9c4f07753 100644
--- a/src/routes/console/project-[project]/functions/function-[function]/settings/updateTimeout.svelte
+++ b/src/routes/console/project-[project]/functions/function-[function]/settings/updateTimeout.svelte
@@ -36,6 +36,7 @@
$func.logging || undefined,
$func.entrypoint || undefined,
$func.commands || undefined,
+ $func.scopes || undefined,
$func.installationId || undefined,
$func.providerRepositoryId || undefined,
$func.providerBranch || undefined,
diff --git a/src/routes/console/project-[project]/functions/function-[function]/store.ts b/src/routes/console/project-[project]/functions/function-[function]/store.ts
index 0bc01a1d4..18f03dd31 100644
--- a/src/routes/console/project-[project]/functions/function-[function]/store.ts
+++ b/src/routes/console/project-[project]/functions/function-[function]/store.ts
@@ -1,8 +1,9 @@
import { page } from '$app/stores';
import { derived, writable, type Writable } from 'svelte/store';
import type { Models } from '@appwrite.io/console';
+import type { Func } from '$lib/sdk/functionsSpec';
-export const func = derived(page, ($page) => $page.data.function as Models.Function);
+export const func = derived(page, ($page) => $page.data.function as Func);
export const deploymentList = derived(
page,
($page) => $page.data.deploymentList as Models.DeploymentList
@@ -11,8 +12,8 @@ export const proxyRuleList = derived(
page,
($page) => $page.data.proxyRuleList as Models.ProxyRuleList
);
-export const execute: Writable
= writable();
-export const showFunctionExecute: Writable = writable(false);
+export const execute: Writable = writable(); //TODO Remove
+export const showFunctionExecute: Writable = writable(false); //TODO Remove
export const repositories: Writable<{
search: string;
diff --git a/src/routes/console/project-[project]/functions/function-[function]/table.svelte b/src/routes/console/project-[project]/functions/function-[function]/table.svelte
new file mode 100644
index 000000000..941c09242
--- /dev/null
+++ b/src/routes/console/project-[project]/functions/function-[function]/table.svelte
@@ -0,0 +1,192 @@
+
+
+
+
+ {#each columns as column}
+ {#if column.show}
+ {column.title}
+ {/if}
+ {/each}
+
+
+
+ {#each data.deploymentList.deployments as deployment, index (deployment.$id)}
+
+ {#each columns as column}
+ {#if column.show}
+ {#if column.id === '$id'}
+ {#key column.id}
+
+ {deployment.$id}
+
+ {/key}
+ {:else if column.id === 'status'}
+
+ {@const status = deployment.status}
+ {#if data?.activeDeployment?.$id === deployment?.$id}
+
+
+ active
+
+ {:else}
+
+ {status}
+
+ {/if}
+
+ {:else if column.id === 'type'}
+
+
+
+ {:else if column.id === '$updatedAt'}
+
+
+
+ {:else if column.id === 'buildTime'}
+
+ {#if ['processing', 'building'].includes(deployment.status)}
+
+ {:else}
+ {calculateTime(deployment.buildTime)}
+ {/if}
+
+ {:else if column.id === 'size'}
+
+ {calculateSize(deployment.size)}
+
+ {/if}
+ {/if}
+ {/each}
+
+
+ {
+ showDropdown[index] = !showDropdown[index];
+ }}>
+
+
+
+ {
+ selectedDeployment = deployment;
+ showRedeploy = true;
+ showDropdown = [];
+ }}>
+ Redeploy
+
+ {#if deployment.status === 'ready' && deployment.$id !== $func.deployment}
+ {
+ selectedDeployment = deployment;
+ showActivate = true;
+ showDropdown = [];
+ }}>
+ Activate
+
+ {/if}
+
+ Logs
+
+ {#if deployment.status === 'ready'}
+ (showDropdown[index] = false)}>
+ Download
+
+ {/if}
+ {#if deployment.status === 'processing' || deployment.status === 'building'}
+ {
+ selectedDeployment = deployment;
+ showDropdown = [];
+ showCancel = true;
+ }}>
+ Cancel
+
+ {/if}
+ {
+ selectedDeployment = deployment;
+ showDropdown = [];
+ showDelete = true;
+ }}>
+ Delete
+
+
+
+
+
+ {/each}
+
+
+
+{#if selectedDeployment}
+
+
+
+
+{/if}
diff --git a/src/routes/console/project-[project]/functions/store.ts b/src/routes/console/project-[project]/functions/store.ts
index 3acf62136..396c5d584 100644
--- a/src/routes/console/project-[project]/functions/store.ts
+++ b/src/routes/console/project-[project]/functions/store.ts
@@ -1,12 +1,15 @@
import { page } from '$app/stores';
import { derived } from 'svelte/store';
import type { Models } from '@appwrite.io/console';
+import type { Specs } from '$lib/sdk/functionsSpec';
export const runtimesList = derived(
page,
async ($page) => (await $page.data.runtimesList) as Models.RuntimeList
);
+export const specs = derived(page, async ($page) => (await $page.data.specs) as Specs);
+
export const baseRuntimesList = derived(runtimesList, async ($runtimesList) => {
const baseRuntimes = new Map();
for (const runtime of (await $runtimesList).runtimes) {
diff --git a/static/icons/dark/color/go.svg b/static/icons/dark/color/go.svg
new file mode 100644
index 000000000..ec7ff2412
--- /dev/null
+++ b/static/icons/dark/color/go.svg
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/static/icons/dark/grayscale/go.svg b/static/icons/dark/grayscale/go.svg
new file mode 100644
index 000000000..245dc1c89
--- /dev/null
+++ b/static/icons/dark/grayscale/go.svg
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/static/icons/light/color/go.svg b/static/icons/light/color/go.svg
new file mode 100644
index 000000000..ec7ff2412
--- /dev/null
+++ b/static/icons/light/color/go.svg
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/static/icons/light/grayscale/go.svg b/static/icons/light/grayscale/go.svg
new file mode 100644
index 000000000..245dc1c89
--- /dev/null
+++ b/static/icons/light/grayscale/go.svg
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/static/images/campaigns/FusionVC/footer/dark.png b/static/images/campaigns/FusionVC/footer/dark.png
new file mode 100644
index 000000000..6fe0f03b0
Binary files /dev/null and b/static/images/campaigns/FusionVC/footer/dark.png differ
diff --git a/static/images/campaigns/FusionVC/footer/light.png b/static/images/campaigns/FusionVC/footer/light.png
new file mode 100644
index 000000000..a21263326
Binary files /dev/null and b/static/images/campaigns/FusionVC/footer/light.png differ
diff --git a/static/images/campaigns/FusionVC/reviewers/1.jpeg b/static/images/campaigns/FusionVC/reviewers/1.jpeg
new file mode 100644
index 000000000..db56c928c
Binary files /dev/null and b/static/images/campaigns/FusionVC/reviewers/1.jpeg differ
diff --git a/static/images/campaigns/JSMastery/reviewers/js_mastery_reviewer_1.png b/static/images/campaigns/JSMastery/reviewers/js_mastery_reviewer_1.png
new file mode 100644
index 000000000..ce5189b59
Binary files /dev/null and b/static/images/campaigns/JSMastery/reviewers/js_mastery_reviewer_1.png differ
diff --git a/static/images/campaigns/StartupsProgram/reviewers/1.jpeg b/static/images/campaigns/StartupsProgram/reviewers/1.jpeg
new file mode 100644
index 000000000..db56c928c
Binary files /dev/null and b/static/images/campaigns/StartupsProgram/reviewers/1.jpeg differ
diff --git a/static/images/campaigns/carbon/reviewers/1.jpeg b/static/images/campaigns/carbon/reviewers/1.jpeg
new file mode 100644
index 000000000..db56c928c
Binary files /dev/null and b/static/images/campaigns/carbon/reviewers/1.jpeg differ