fix: execute modal

This commit is contained in:
Arman committed 2024-03-10 15:44:38 +01:00
1 parent 1eda251a4b
commit f3b0695015
3 files changed
+9 -19

No files matched your search

@@ -5,7 +5,7 @@
import { Dependencies } from '$lib/constants';
import { invalidate, goto } from '$app/navigation';
import { registerCommands } from '$lib/commandCenter';
import { execute, func, showCreateDeployment } from './store';
import { func, showCreateDeployment } from './store';
import { project } from '../../store';
import type { Models } from '@appwrite.io/console';
import Execute from './execute.svelte';
@@ -147,4 +147,4 @@
<slot />
<Execute selectedFunction={$execute} />
<Execute />
@@ -15,10 +15,7 @@
import Label from '$lib/elements/forms/label.svelte';
import { addNotification } from '$lib/stores/notifications';
import { sdk } from '$lib/stores/sdk';
import type { Models } from '@appwrite.io/console';
import { showFunctionExecute } from './store';
export let selectedFunction: Models.Function = null;
import { showFunctionExecute, execute } from './store';
let path = '/';
let method = 'GET';
@@ -47,7 +44,7 @@
}
await sdk.forProject.functions.createExecution(
selectedFunction.$id,
$execute.$id,
body,
true,
path,
@@ -56,7 +53,7 @@
);
if (!$page.url?.toString()?.includes('/executions')) {
await goto(
`${base}/console/project-${$page.params.project}/functions/function-${selectedFunction.$id}/executions`
`${base}/console/project-${$page.params.project}/functions/function-${$execute.$id}/executions`
);
}
invalidate(Dependencies.EXECUTIONS);
@@ -75,7 +72,7 @@
};
function close() {
selectedFunction = null;
$execute = null;
$showFunctionExecute = false;
}
@@ -100,7 +97,7 @@
</p>
<FormList>
{#if selectedFunction?.version !== 'v3'}
{#if $execute?.version !== 'v3'}
<Alert type="info">
<svelte:fragment slot="title">
Customizable execution data now available for functions v3.0
@@ -19,19 +19,16 @@
import { log } from '$lib/stores/logs';
import { sdk } from '$lib/stores/sdk';
import { onMount } from 'svelte';
import { func, showFunctionExecute } from '../store';
import { func, execute, showFunctionExecute } from '../store';
import type { Models } from '@appwrite.io/console';
import { organization } from '$lib/stores/organization';
import { getServiceLimit, showUsageRatesModal } from '$lib/stores/billing';
import { project } from '$routes/console/project-[project]/store';
import Create from '../create.svelte';
import Execute from '../execute.svelte';
import { abbreviateNumber } from '$lib/helpers/numbers';
export let data;
let selectedFunction: Models.Function = null;
onMount(() => {
return sdk.forConsole.client.subscribe('console', (response) => {
if (response.events.includes('functions.*.executions.*')) {
@@ -55,7 +52,7 @@
buttonText="Execute now"
buttonEvent="execute_function"
buttonMethod={() => {
selectedFunction = $func;
$execute = $func;
$showFunctionExecute = true;
}}>
<svelte:fragment slot="tooltip" let:tier let:limit let:upgradeMethod>
@@ -172,7 +169,3 @@
</EmptySearch>
{/if}
</Container>
<!-- <CreateDeployment bind:showCreate /> -->
<Execute {selectedFunction} />