mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
feat: add more events
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
export let offset = 0;
|
||||
export let limit = $cardLimit;
|
||||
export let total = 0;
|
||||
export let event: string = null;
|
||||
</script>
|
||||
|
||||
<ul
|
||||
@@ -13,7 +14,7 @@
|
||||
<slot />
|
||||
|
||||
{#if total > 3 ? total < limit + offset : total % 2 !== 0}
|
||||
<Empty on:click>
|
||||
<Empty on:click target={event}>
|
||||
<slot name="empty" />
|
||||
</Empty>
|
||||
{/if}
|
||||
|
||||
@@ -11,9 +11,11 @@
|
||||
export let href: string = null;
|
||||
|
||||
function track() {
|
||||
trackEvent(`click_create_${target}`, {
|
||||
from: 'empty'
|
||||
});
|
||||
if (target) {
|
||||
trackEvent(`click_create_${target}`, {
|
||||
from: 'empty'
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -35,7 +37,7 @@
|
||||
</p>
|
||||
</div>
|
||||
<div class="u-flex u-gap-16 u-main-center">
|
||||
<Button external {href} text>Documentation</Button>
|
||||
<Button external {href} text event="empty_documentation">Documentation</Button>
|
||||
<Button secondary on:click on:click={track}>
|
||||
Create {target}
|
||||
</Button>
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
import SystemMode from '$lib/images/mode/system-mode.svg';
|
||||
import { slide } from 'svelte/transition';
|
||||
import { page } from '$app/stores';
|
||||
import { trackEvent } from '$lib/actions/analytics';
|
||||
|
||||
let showDropdown = false;
|
||||
let droplistElement: HTMLDivElement;
|
||||
@@ -22,6 +23,10 @@
|
||||
showDropdown = false;
|
||||
}
|
||||
};
|
||||
|
||||
$: if (showDropdown) {
|
||||
trackEvent('click_menu_dropdown');
|
||||
}
|
||||
</script>
|
||||
|
||||
<svelte:window on:click={onBlur} />
|
||||
@@ -107,6 +112,10 @@
|
||||
type="radio"
|
||||
class="is-small"
|
||||
name="mode"
|
||||
on:click={() =>
|
||||
trackEvent('select_theme', {
|
||||
value: 'light'
|
||||
})}
|
||||
bind:group={$app.theme}
|
||||
value="light" />
|
||||
</label>
|
||||
@@ -118,6 +127,10 @@
|
||||
type="radio"
|
||||
class="is-small"
|
||||
name="mode"
|
||||
on:click={() =>
|
||||
trackEvent('select_theme', {
|
||||
value: 'dark'
|
||||
})}
|
||||
bind:group={$app.theme}
|
||||
value="dark" />
|
||||
</label>
|
||||
@@ -129,6 +142,10 @@
|
||||
type="radio"
|
||||
class="is-small"
|
||||
name="mode"
|
||||
on:click={() =>
|
||||
trackEvent('select_theme', {
|
||||
value: 'system'
|
||||
})}
|
||||
bind:group={$app.theme}
|
||||
value="auto" />
|
||||
</label>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<script lang="ts">
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/stores';
|
||||
import { trackEvent } from '$lib/actions/analytics';
|
||||
|
||||
$: project = $page.params.project;
|
||||
$: path = `${base}/console/project-${project}`;
|
||||
@@ -15,6 +16,7 @@
|
||||
<a
|
||||
class="drop-button"
|
||||
class:is-selected={$page.url.pathname.startsWith(`${path}/overview`)}
|
||||
on:click={() => trackEvent('click_menu_overview')}
|
||||
href={path}>
|
||||
<span class="icon-chart-bar" aria-hidden="true" />
|
||||
<span class="text">Overview</span>
|
||||
@@ -24,6 +26,7 @@
|
||||
<a
|
||||
class="drop-button"
|
||||
class:is-selected={$page.url.pathname.startsWith(`${path}/auth`)}
|
||||
on:click={() => trackEvent('click_menu_auth')}
|
||||
href={`${path}/auth`}>
|
||||
<span class="icon-user-group" aria-hidden="true" />
|
||||
<span class="text">Auth</span>
|
||||
@@ -33,6 +36,7 @@
|
||||
<a
|
||||
class="drop-button"
|
||||
class:is-selected={$page.url.pathname.startsWith(`${path}/databases`)}
|
||||
on:click={() => trackEvent('click_menu_databases')}
|
||||
href={`${path}/databases`}>
|
||||
<span class="icon-database" aria-hidden="true" />
|
||||
<span class="text">Databases</span>
|
||||
@@ -42,6 +46,7 @@
|
||||
<a
|
||||
class="drop-button"
|
||||
class:is-selected={$page.url.pathname.startsWith(`${path}/functions`)}
|
||||
on:click={() => trackEvent('click_menu_functions')}
|
||||
href={`${path}/functions`}>
|
||||
<span class="icon-lightning-bolt" aria-hidden="true" />
|
||||
<span class="text">Functions</span>
|
||||
@@ -51,6 +56,7 @@
|
||||
<a
|
||||
class="drop-button"
|
||||
class:is-selected={$page.url.pathname.startsWith(`${path}/storage`)}
|
||||
on:click={() => trackEvent('click_menu_storage')}
|
||||
href={`${path}/storage`}>
|
||||
<span class="icon-folder" aria-hidden="true" />
|
||||
<span class="text">Storage</span>
|
||||
@@ -65,6 +71,7 @@
|
||||
<a
|
||||
class="drop-button"
|
||||
href={`${path}/settings`}
|
||||
on:click={() => trackEvent('click_menu_settings')}
|
||||
class:is-selected={$page.url.pathname.startsWith(`${path}/settings`)}>
|
||||
<span class="icon-cog" aria-hidden="true" />
|
||||
<span class="text">Settings</span>
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
import Delete from './delete.svelte';
|
||||
import { invalidate } from '$app/navigation';
|
||||
import { Dependencies } from '$lib/constants';
|
||||
import { trackEvent } from '$lib/actions/analytics';
|
||||
|
||||
let name: string = null,
|
||||
email: string = null,
|
||||
@@ -31,6 +32,7 @@
|
||||
message: 'Name has been updated',
|
||||
type: 'success'
|
||||
});
|
||||
trackEvent('submit_account_update_name');
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
message: error.message,
|
||||
@@ -46,6 +48,7 @@
|
||||
message: 'Email has been updated',
|
||||
type: 'success'
|
||||
});
|
||||
trackEvent('submit_account_update_email');
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
message: error.message,
|
||||
@@ -62,6 +65,7 @@
|
||||
message: 'Password has been updated',
|
||||
type: 'success'
|
||||
});
|
||||
trackEvent('submit_account_update_password');
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
message: error.message,
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
import { goto } from '$app/navigation';
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/stores';
|
||||
import { trackEvent } from '$lib/actions/analytics';
|
||||
import { Tab, Tabs } from '$lib/components';
|
||||
import { Button } from '$lib/elements/forms';
|
||||
import { isTabSelected } from '$lib/helpers/load';
|
||||
@@ -14,26 +15,31 @@
|
||||
$: tabs = [
|
||||
{
|
||||
href: path,
|
||||
title: 'Overview'
|
||||
title: 'Overview',
|
||||
event: 'overview'
|
||||
},
|
||||
{
|
||||
href: `${path}/sessions`,
|
||||
title: 'Sessions'
|
||||
title: 'Sessions',
|
||||
event: 'sessions'
|
||||
},
|
||||
{
|
||||
href: `${path}/activity`,
|
||||
title: 'Activity',
|
||||
event: 'activity',
|
||||
hasChildren: true
|
||||
},
|
||||
{
|
||||
href: `${path}/organizations`,
|
||||
title: 'Organizations',
|
||||
event: 'organizations',
|
||||
hasChildren: true
|
||||
}
|
||||
];
|
||||
|
||||
async function logout() {
|
||||
await sdkForConsole.account.deleteSession('current');
|
||||
trackEvent('submit_account_logout');
|
||||
await goto(`${base}/login`);
|
||||
}
|
||||
</script>
|
||||
@@ -49,7 +55,10 @@
|
||||
</svelte:fragment>
|
||||
<Tabs>
|
||||
{#each tabs as tab}
|
||||
<Tab href={tab.href} selected={isTabSelected(tab, $page.url.pathname, path, tabs)}>
|
||||
<Tab
|
||||
href={tab.href}
|
||||
selected={isTabSelected(tab, $page.url.pathname, path, tabs)}
|
||||
event={tab.event}>
|
||||
{tab.title}
|
||||
</Tab>
|
||||
{/each}
|
||||
|
||||
@@ -29,10 +29,7 @@
|
||||
<div class="u-flex u-gap-12 common-section u-main-space-between">
|
||||
<Heading tag="h2" size="5">Organizations</Heading>
|
||||
|
||||
<Button
|
||||
on:click={() => {
|
||||
addOrganization = true;
|
||||
}}>
|
||||
<Button on:click={() => (addOrganization = true)} event="create_organization">
|
||||
<span class="icon-plus" aria-hidden="true" />
|
||||
<span class="text">Create organization</span>
|
||||
</Button>
|
||||
@@ -42,6 +39,7 @@
|
||||
<CardContainer
|
||||
total={data.organizations.total}
|
||||
offset={data.offset}
|
||||
event="organization"
|
||||
on:click={() => (addOrganization = true)}>
|
||||
{#each data.organizations.teams as organization, index}
|
||||
{@const avatarList = getMemberships(organization.$id)}
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
import { Dependencies } from '$lib/constants';
|
||||
import type { Models } from '@aw-labs/appwrite-console';
|
||||
import type { PageData } from './$types';
|
||||
import { trackEvent } from '$lib/actions/analytics';
|
||||
|
||||
export let data: PageData;
|
||||
|
||||
@@ -26,10 +27,12 @@
|
||||
|
||||
const logout = async (session: Models.Session) => {
|
||||
await sdkForConsole.account.deleteSession(session.$id);
|
||||
trackEvent('submit_account_delete_session');
|
||||
invalidate(Dependencies.ACCOUNT_SESSIONS);
|
||||
};
|
||||
const logoutAll = async () => {
|
||||
await sdkForConsole.account.deleteSessions();
|
||||
trackEvent('submit_account_delete_all_sessions');
|
||||
invalidate(Dependencies.ACCOUNT_SESSIONS);
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { goto, invalidate } from '$app/navigation';
|
||||
import { trackEvent } from '$lib/actions/analytics';
|
||||
import { Card } from '$lib/components';
|
||||
import CustomId from '$lib/components/customId.svelte';
|
||||
import { Dependencies } from '$lib/constants';
|
||||
@@ -28,6 +29,7 @@
|
||||
);
|
||||
await invalidate(Dependencies.ACCOUNT);
|
||||
goto(`/console/project-${project.$id}`);
|
||||
trackEvent('submit_project_create');
|
||||
} catch ({ message }) {
|
||||
loading = false;
|
||||
addNotification({
|
||||
@@ -63,7 +65,9 @@
|
||||
{:else}
|
||||
<CustomId bind:show={showCustomId} name="Project" bind:id />
|
||||
{/if}
|
||||
<Button fullWidth submit disabled={loading}>Create project</Button>
|
||||
<Button fullWidth submit disabled={loading} event="create_project">
|
||||
Create project
|
||||
</Button>
|
||||
</FormList>
|
||||
</Form>
|
||||
</Card>
|
||||
|
||||
@@ -49,10 +49,7 @@
|
||||
<Container>
|
||||
<div class="u-flex u-gap-12 common-section u-main-space-between">
|
||||
<Heading tag="h2" size="5">Projects</Heading>
|
||||
<Button
|
||||
on:click={() => {
|
||||
showCreate = true;
|
||||
}}>
|
||||
<Button on:click={() => (showCreate = true)} event="create_project">
|
||||
<span class="icon-plus" aria-hidden="true" /> <span class="text">Create project</span>
|
||||
</Button>
|
||||
</div>
|
||||
@@ -61,6 +58,7 @@
|
||||
<CardContainer
|
||||
total={data.projects.total}
|
||||
offset={data.offset}
|
||||
event="project"
|
||||
on:click={() => (showCreate = true)}>
|
||||
{#each data.projects.projects as project, index}
|
||||
{#if index >= data.offset && index < CARD_LIMIT + data.offset}
|
||||
@@ -110,5 +108,4 @@
|
||||
</Container>
|
||||
|
||||
<CreateOrganization bind:show={addOrganization} />
|
||||
|
||||
<CreateProject bind:show={showCreate} teamId={$page.params.organization} />
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
type: 'success',
|
||||
message: `Invite has been sent to ${email}`
|
||||
});
|
||||
trackEvent('submit_organization_member_create');
|
||||
trackEvent('submit_member_create');
|
||||
dispatch('created', team);
|
||||
} catch ({ message }) {
|
||||
error = message;
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
type: 'success',
|
||||
message: `${selectedMember.userName} was deleted from ${selectedMember.teamName}`
|
||||
});
|
||||
trackEvent('submit_organization_member_delete');
|
||||
trackEvent('submit_member_delete');
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
type: 'error',
|
||||
|
||||
@@ -22,15 +22,18 @@
|
||||
{
|
||||
href: path,
|
||||
title: 'Projects',
|
||||
event: 'projects',
|
||||
hasChildren: true
|
||||
},
|
||||
{
|
||||
href: `${path}/members`,
|
||||
title: 'Members',
|
||||
event: 'members',
|
||||
hasChildren: true
|
||||
},
|
||||
{
|
||||
href: `${path}/settings`,
|
||||
event: 'settings',
|
||||
title: 'Settings'
|
||||
}
|
||||
];
|
||||
@@ -78,7 +81,10 @@
|
||||
</svelte:fragment>
|
||||
<Tabs>
|
||||
{#each tabs as tab}
|
||||
<Tab href={tab.href} selected={isTabSelected(tab, $page.url.pathname, path, tabs)}>
|
||||
<Tab
|
||||
href={tab.href}
|
||||
selected={isTabSelected(tab, $page.url.pathname, path, tabs)}
|
||||
event={tab.event}>
|
||||
{tab.title}
|
||||
</Tab>
|
||||
{/each}
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
import Delete from '../../deleteMember.svelte';
|
||||
import type { Models } from '@aw-labs/appwrite-console';
|
||||
import type { PageData } from './$types';
|
||||
import { trackEvent } from '$lib/actions/analytics';
|
||||
|
||||
export let data: PageData;
|
||||
|
||||
@@ -42,6 +43,7 @@
|
||||
type: 'success',
|
||||
message: `Invite has been sent to ${member.userEmail}`
|
||||
});
|
||||
trackEvent('submit_member_create');
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
type: 'error',
|
||||
@@ -56,7 +58,7 @@
|
||||
<div class="u-flex u-gap-12 common-section u-main-space-between">
|
||||
<Heading tag="h2" size="5">Members</Heading>
|
||||
|
||||
<Button on:click={() => newMemberModal.set(true)}>
|
||||
<Button on:click={() => newMemberModal.set(true)} event="invite">
|
||||
<span class="icon-plus" aria-hidden="true" />
|
||||
<span class="text">Invite</span>
|
||||
</Button>
|
||||
@@ -86,7 +88,10 @@
|
||||
<TableCellText title="Email">{member.userEmail}</TableCellText>
|
||||
<TableCell title="Roles">
|
||||
{#if member.invited && !member.joined}
|
||||
<Button secondary on:click={() => resend(member)}>Resend</Button>
|
||||
<Button
|
||||
secondary
|
||||
event="invite_resend"
|
||||
on:click={() => resend(member)}>Resend</Button>
|
||||
{:else}
|
||||
{member.roles}
|
||||
{/if}
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
import { Dependencies } from '$lib/constants';
|
||||
import { onMount } from 'svelte';
|
||||
import Delete from '../deleteOrganization.svelte';
|
||||
import { trackEvent } from '$lib/actions/analytics';
|
||||
|
||||
let name: string;
|
||||
let showDelete = false;
|
||||
@@ -25,6 +26,7 @@
|
||||
message: 'Name has been updated',
|
||||
type: 'success'
|
||||
});
|
||||
trackEvent('submit_organization_update_name');
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
message: error.message,
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
provider.enabled ? 'enabled' : 'disabled'
|
||||
}`
|
||||
});
|
||||
trackEvent('submit_auth_provider_update', {
|
||||
trackEvent('submit_provider_update', {
|
||||
provider,
|
||||
enabled
|
||||
});
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
provider.enabled ? 'enabled' : 'disabled'
|
||||
}`
|
||||
});
|
||||
trackEvent('submit_auth_provider_update', {
|
||||
trackEvent('submit_provider_update', {
|
||||
provider,
|
||||
enabled
|
||||
});
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
type: 'success',
|
||||
message: `${team.name} has been created`
|
||||
});
|
||||
trackEvent('submit_auth_team_create');
|
||||
trackEvent('submit_team_create');
|
||||
dispatch('created', team);
|
||||
} catch ({ message }) {
|
||||
error = message;
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
type: 'success',
|
||||
message: `${user.name ? user.name : 'User'} has been created`
|
||||
});
|
||||
trackEvent('submit_auth_user_create');
|
||||
trackEvent('submit_user_create');
|
||||
dispatch('created', user);
|
||||
} catch ({ message }) {
|
||||
error = message;
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
provider.enabled ? 'enabled' : 'disabled'
|
||||
}`
|
||||
});
|
||||
trackEvent('submit_auth_provider_update', {
|
||||
trackEvent('submit_provider_update', {
|
||||
provider,
|
||||
enabled
|
||||
});
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
provider.enabled ? 'enabled' : 'disabled'
|
||||
}`
|
||||
});
|
||||
trackEvent('submit_auth_provider_update', {
|
||||
trackEvent('submit_provider_update', {
|
||||
provider,
|
||||
enabled
|
||||
});
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
provider.enabled ? 'enabled' : 'disabled'
|
||||
}`
|
||||
});
|
||||
trackEvent('submit_auth_provider_update', {
|
||||
trackEvent('submit_provider_update', {
|
||||
provider,
|
||||
enabled
|
||||
});
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
type: 'success',
|
||||
message: 'Updated project users limit successfully'
|
||||
});
|
||||
trackEvent('submit_auth_session_length_update');
|
||||
trackEvent('submit_session_length_update');
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
type: 'error',
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
box.value ? 'enabled' : 'disabled'
|
||||
}`
|
||||
});
|
||||
trackEvent('submit_auth_limit_update', {
|
||||
trackEvent('submit_auth_status_update', {
|
||||
method: box.method,
|
||||
value: box.value
|
||||
});
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
message: 'Name has been updated',
|
||||
type: 'success'
|
||||
});
|
||||
trackEvent('submit_auth_team_update_name');
|
||||
trackEvent('submit_team_update_name');
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
message: error.message,
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
type: 'success',
|
||||
message: `${name ? name : email} created successfully`
|
||||
});
|
||||
trackEvent('submit_auth_member_create');
|
||||
trackEvent('submit_member_create');
|
||||
email = name = '';
|
||||
roles = [];
|
||||
showCreate = false;
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
);
|
||||
showDelete = false;
|
||||
dispatch('deleted');
|
||||
trackEvent('submit_auth_member_delete');
|
||||
trackEvent('submit_member_delete');
|
||||
await goto(
|
||||
`${base}/console/project-${$page.params.project}/auth/teams/team-${selectedMembership.teamId}/members`
|
||||
);
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
try {
|
||||
await sdkForProject.teams.delete(team.$id);
|
||||
showDelete = false;
|
||||
trackEvent('submit_auth_team_delete');
|
||||
trackEvent('submit_team_delete');
|
||||
await goto(`${base}/console/project-${$page.params.project}/auth/teams`);
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
|
||||
@@ -12,16 +12,19 @@
|
||||
const tabs = [
|
||||
{
|
||||
href: path,
|
||||
title: 'Overview'
|
||||
title: 'Overview',
|
||||
event: 'overview'
|
||||
},
|
||||
{
|
||||
href: `${path}/members`,
|
||||
title: 'Members',
|
||||
event: 'members',
|
||||
hasChildren: true
|
||||
},
|
||||
{
|
||||
href: `${path}/activity`,
|
||||
title: 'Activity',
|
||||
event: 'activity',
|
||||
hasChildren: true
|
||||
}
|
||||
];
|
||||
@@ -42,7 +45,10 @@
|
||||
|
||||
<Tabs>
|
||||
{#each tabs as tab}
|
||||
<Tab href={tab.href} selected={isTabSelected(tab, $page.url.pathname, path, tabs)}>
|
||||
<Tab
|
||||
href={tab.href}
|
||||
selected={isTabSelected(tab, $page.url.pathname, path, tabs)}
|
||||
event={tab.event}>
|
||||
{tab.title}
|
||||
</Tab>
|
||||
{/each}
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
}`,
|
||||
type: 'success'
|
||||
});
|
||||
trackEvent('submit_auth_user_update_verification_email');
|
||||
trackEvent('submit_user_update_verification_email');
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
message: error.message,
|
||||
@@ -88,7 +88,7 @@
|
||||
}`,
|
||||
type: 'success'
|
||||
});
|
||||
trackEvent('submit_auth_user_update_verification_phone');
|
||||
trackEvent('submit_user_update_verification_phone');
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
message: error.message,
|
||||
@@ -106,7 +106,7 @@
|
||||
}`,
|
||||
type: 'success'
|
||||
});
|
||||
trackEvent('submit_auth_user_update_status');
|
||||
trackEvent('submit_user_update_status');
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
message: error.message,
|
||||
@@ -122,7 +122,7 @@
|
||||
message: 'Name has been updated',
|
||||
type: 'success'
|
||||
});
|
||||
trackEvent('submit_auth_user_update_name');
|
||||
trackEvent('submit_user_update_name');
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
message: error.message,
|
||||
@@ -138,7 +138,7 @@
|
||||
message: 'Email has been updated',
|
||||
type: 'success'
|
||||
});
|
||||
trackEvent('submit_auth_user_update_email');
|
||||
trackEvent('submit_user_update_email');
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
message: error.message,
|
||||
@@ -154,7 +154,7 @@
|
||||
message: 'Phone has been updated',
|
||||
type: 'success'
|
||||
});
|
||||
trackEvent('submit_auth_user_update_phone');
|
||||
trackEvent('submit_user_update_phone');
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
message: error.message,
|
||||
@@ -170,7 +170,7 @@
|
||||
message: 'Password has been updated',
|
||||
type: 'success'
|
||||
});
|
||||
trackEvent('submit_auth_user_update_password');
|
||||
trackEvent('submit_user_update_password');
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
message: error.message,
|
||||
@@ -191,7 +191,7 @@
|
||||
message: 'Preferences have been updated',
|
||||
type: 'success'
|
||||
});
|
||||
trackEvent('submit_auth_user_update_preferences');
|
||||
trackEvent('submit_user_update_preferences');
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
message: error.message,
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
type: 'success',
|
||||
message: 'All sessions have been deleted'
|
||||
});
|
||||
trackEvent('submit_auth_session_delete_all');
|
||||
trackEvent('submit_session_delete_all');
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
type: 'error',
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
type: 'success',
|
||||
message: `Membership has been deleted`
|
||||
});
|
||||
trackEvent('submit_auth_member_delete');
|
||||
trackEvent('submit_member_delete');
|
||||
await goto(
|
||||
`${base}/console/project-${$page.params.project}/auth/user-${selectedMembership.userId}/memberships`
|
||||
);
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
type: 'success',
|
||||
message: 'Session has been deleted'
|
||||
});
|
||||
trackEvent('submit_auth_session_delete');
|
||||
trackEvent('submit_session_delete');
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
type: 'error',
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
type: 'success',
|
||||
message: `${$user.name ? $user.name : 'User'} has been deleted`
|
||||
});
|
||||
trackEvent('submit_auth_user_delete');
|
||||
trackEvent('submit_user_delete');
|
||||
await goto(`${base}/console/project-${$page.params.project}/auth`);
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
|
||||
@@ -12,19 +12,23 @@
|
||||
const tabs = [
|
||||
{
|
||||
href: path,
|
||||
title: 'Overview'
|
||||
title: 'Overview',
|
||||
event: 'overview'
|
||||
},
|
||||
{
|
||||
href: `${path}/memberships`,
|
||||
title: 'Memberships'
|
||||
title: 'Memberships',
|
||||
event: 'memberships'
|
||||
},
|
||||
{
|
||||
href: `${path}/sessions`,
|
||||
title: 'Sessions'
|
||||
title: 'Sessions',
|
||||
event: 'sessions'
|
||||
},
|
||||
{
|
||||
href: `${path}/activity`,
|
||||
title: 'Activity',
|
||||
event: 'activity',
|
||||
hasChildren: true
|
||||
}
|
||||
];
|
||||
@@ -45,7 +49,10 @@
|
||||
|
||||
<Tabs>
|
||||
{#each tabs as tab}
|
||||
<Tab href={tab.href} selected={isTabSelected(tab, $page.url.pathname, path, tabs)}>
|
||||
<Tab
|
||||
href={tab.href}
|
||||
selected={isTabSelected(tab, $page.url.pathname, path, tabs)}
|
||||
event={tab.event}>
|
||||
{tab.title}
|
||||
</Tab>
|
||||
{/each}
|
||||
|
||||
@@ -26,13 +26,16 @@
|
||||
<div class="u-flex u-gap-12 common-section u-main-space-between">
|
||||
<Heading tag="h2" size="5">Databases</Heading>
|
||||
|
||||
<Button on:click={() => (showCreate = true)}>
|
||||
<Button on:click={() => (showCreate = true)} event="create_database">
|
||||
<span class="icon-plus" aria-hidden="true" /> <span class="text">Create database</span>
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
{#if data.databases.total}
|
||||
<CardContainer total={data.databases.total} on:click={() => (showCreate = true)}>
|
||||
<CardContainer
|
||||
total={data.databases.total}
|
||||
on:click={() => (showCreate = true)}
|
||||
event="database">
|
||||
{#each data.databases.databases as database}
|
||||
<GridItem1
|
||||
href={`${base}/console/project-${project}/databases/database-${database.$id}`}>
|
||||
|
||||
+2
-7
@@ -32,7 +32,7 @@
|
||||
<div class="u-flex u-gap-12 common-section u-main-space-between">
|
||||
<Heading tag="h2" size="5">Collections</Heading>
|
||||
|
||||
<Button on:click={() => (showCreate = true)}>
|
||||
<Button on:click={() => (showCreate = true)} event="create_collection">
|
||||
<span class="icon-plus" aria-hidden="true" />
|
||||
<span class="text">Create collection</span>
|
||||
</Button>
|
||||
@@ -40,18 +40,13 @@
|
||||
|
||||
{#if data.collections.total}
|
||||
<CardContainer
|
||||
event="collection"
|
||||
total={data.collections.total}
|
||||
offset={$offset}
|
||||
on:click={() => (showCreate = true)}>
|
||||
{#each data.collections.collections as collection}
|
||||
<GridItem1
|
||||
href={`${base}/console/project-${project}/databases/database-${databaseId}/collection-${collection.$id}`}>
|
||||
<!-- <svelte:fragment slot="eyebrow">
|
||||
{#await collections.total(databaseId, collection.$id)}
|
||||
N Documents
|
||||
{:then n}
|
||||
{n[collection.$id] ? n[collection.$id] : 'NO'} Documents
|
||||
{/await}</svelte:fragment> -->
|
||||
<svelte:fragment slot="title">{collection.name}</svelte:fragment>
|
||||
<svelte:fragment slot="status">
|
||||
{#if !collection.enabled}
|
||||
|
||||
+4
-1
@@ -39,7 +39,10 @@
|
||||
<div class="u-flex u-gap-12 common-section u-main-space-between">
|
||||
<Heading tag="h2" size="5">Documents</Heading>
|
||||
|
||||
<Button disabled={!$collection?.attributes?.length} on:click={openWizard}>
|
||||
<Button
|
||||
disabled={!$collection?.attributes?.length}
|
||||
on:click={openWizard}
|
||||
event="create_document">
|
||||
<span class="icon-plus" aria-hidden="true" />
|
||||
<span class="text">Create document</span>
|
||||
</Button>
|
||||
|
||||
+1
@@ -4,6 +4,7 @@
|
||||
import type { PageData } from './$types';
|
||||
|
||||
export let data: PageData;
|
||||
|
||||
const path = `/console/project-${$page.params.project}/databases/database-${$page.params.database}/collection-${$page.params.collection}/activity`;
|
||||
</script>
|
||||
|
||||
|
||||
+1
-1
@@ -30,7 +30,7 @@
|
||||
<div class="u-flex u-gap-12 common-section u-main-space-between">
|
||||
<Heading tag="h2" size="5">Attributes</Heading>
|
||||
|
||||
<Button on:click={() => (showCreate = true)}>
|
||||
<Button on:click={() => (showCreate = true)} event="create_attribute">
|
||||
<span class="icon-plus" aria-hidden="true" />
|
||||
<span class="text">Create attribute</span>
|
||||
</Button>
|
||||
|
||||
+2
@@ -9,6 +9,7 @@
|
||||
import type { Attributes } from '../store';
|
||||
import { sdkForProject } from '$lib/stores/sdk';
|
||||
import { Dependencies } from '$lib/constants';
|
||||
import { trackEvent } from '$lib/actions/analytics';
|
||||
|
||||
export let showDelete = false;
|
||||
export let selectedAttribute: Attributes;
|
||||
@@ -27,6 +28,7 @@
|
||||
type: 'success',
|
||||
message: `Attribute has been deleted`
|
||||
});
|
||||
trackEvent('submit_attribute_delete');
|
||||
await goto(
|
||||
`${base}/console/project-${$page.params.project}/databases/database-${databaseId}/collection-${$page.params.collection}/attributes`
|
||||
);
|
||||
|
||||
+2
@@ -8,6 +8,7 @@
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { base } from '$app/paths';
|
||||
import type { Attributes } from './store';
|
||||
import { trackEvent } from '$lib/actions/analytics';
|
||||
|
||||
export let showCreate = false;
|
||||
|
||||
@@ -35,6 +36,7 @@
|
||||
message: `Attribute ${key} has been created`
|
||||
});
|
||||
showCreate = false;
|
||||
trackEvent('submit_attribute_create');
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
type: 'error',
|
||||
|
||||
+2
@@ -12,6 +12,7 @@
|
||||
import { Permissions } from '$lib/components/permissions';
|
||||
import { invalidate } from '$app/navigation';
|
||||
import { Dependencies } from '$lib/constants';
|
||||
import { trackEvent } from '$lib/actions/analytics';
|
||||
|
||||
let showDelete = false;
|
||||
let permissions = $doc?.$permissions;
|
||||
@@ -32,6 +33,7 @@
|
||||
message: 'Permissions have been updated',
|
||||
type: 'success'
|
||||
});
|
||||
trackEvent('submit_document_update_permission');
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
message: error.message,
|
||||
|
||||
+2
@@ -2,6 +2,7 @@
|
||||
import { goto } from '$app/navigation';
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/stores';
|
||||
import { trackEvent } from '$lib/actions/analytics';
|
||||
import { Modal } from '$lib/components';
|
||||
import { Button } from '$lib/elements/forms';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
@@ -24,6 +25,7 @@
|
||||
type: 'success',
|
||||
message: `Document has been deleted`
|
||||
});
|
||||
trackEvent('submit_document_delete');
|
||||
await goto(
|
||||
`${base}/console/project-${$page.params.project}/databases/database-${$page.params.database}/collection-${$page.params.collection}`
|
||||
);
|
||||
|
||||
+8
-3
@@ -14,11 +14,13 @@
|
||||
const tabs = [
|
||||
{
|
||||
href: path,
|
||||
title: 'Overview'
|
||||
title: 'Overview',
|
||||
event: 'overview'
|
||||
},
|
||||
{
|
||||
href: `${path}/activity`,
|
||||
title: 'Activity',
|
||||
event: 'activity',
|
||||
hasChildren: true
|
||||
}
|
||||
];
|
||||
@@ -30,7 +32,7 @@
|
||||
href={`/console/project-${projectId}/databases/database-${databaseId}/collection-${collectionId}`}>
|
||||
{$doc?.$id}
|
||||
</CoverTitle>
|
||||
<Copy value={$doc.$id}>
|
||||
<Copy value={$doc.$id} event="document">
|
||||
<Pill button>
|
||||
<span class="icon-duplicate" aria-hidden="true" />
|
||||
Document ID
|
||||
@@ -40,7 +42,10 @@
|
||||
|
||||
<Tabs>
|
||||
{#each tabs as tab}
|
||||
<Tab href={tab.href} selected={isTabSelected(tab, $page.url.pathname, path, tabs)}>
|
||||
<Tab
|
||||
href={tab.href}
|
||||
selected={isTabSelected(tab, $page.url.pathname, path, tabs)}
|
||||
event={tab.event}>
|
||||
{tab.title}
|
||||
</Tab>
|
||||
{/each}
|
||||
|
||||
+15
-5
@@ -14,28 +14,35 @@
|
||||
{
|
||||
href: path,
|
||||
title: 'Documents',
|
||||
event: 'documents',
|
||||
hasChildren: true
|
||||
},
|
||||
{
|
||||
href: `${path}/attributes`,
|
||||
title: 'Attributes'
|
||||
title: 'Attributes',
|
||||
event: 'attributes'
|
||||
},
|
||||
{
|
||||
href: `${path}/indexes`,
|
||||
title: 'Indexes'
|
||||
title: 'Indexes',
|
||||
event: 'indexes'
|
||||
},
|
||||
{
|
||||
href: `${path}/activity`,
|
||||
title: 'Activity',
|
||||
event: 'activity',
|
||||
hasChildren: true
|
||||
},
|
||||
{
|
||||
href: `${path}/usage`,
|
||||
title: 'Usage'
|
||||
title: 'Usage',
|
||||
event: 'usage',
|
||||
hasChildren: true
|
||||
},
|
||||
{
|
||||
href: `${path}/settings`,
|
||||
title: 'Settings'
|
||||
title: 'Settings',
|
||||
event: 'settings'
|
||||
}
|
||||
];
|
||||
</script>
|
||||
@@ -55,7 +62,10 @@
|
||||
|
||||
<Tabs>
|
||||
{#each tabs as tab}
|
||||
<Tab href={tab.href} selected={isTabSelected(tab, $page.url.pathname, path, tabs)}>
|
||||
<Tab
|
||||
href={tab.href}
|
||||
selected={isTabSelected(tab, $page.url.pathname, path, tabs)}
|
||||
event={tab.event}>
|
||||
{tab.title}
|
||||
</Tab>
|
||||
{/each}
|
||||
|
||||
+1
@@ -38,6 +38,7 @@
|
||||
<Heading tag="h2" size="5">Indexes</Heading>
|
||||
|
||||
<Button
|
||||
event="create_index"
|
||||
disabled={!$collection?.attributes?.length}
|
||||
on:click={() => (showCreateIndex = true)}>
|
||||
<span class="icon-plus" aria-hidden="true" />
|
||||
|
||||
+2
@@ -10,6 +10,7 @@
|
||||
import { invalidate } from '$app/navigation';
|
||||
import { Dependencies } from '$lib/constants';
|
||||
import Select from './select.svelte';
|
||||
import { trackEvent } from '$lib/actions/analytics';
|
||||
|
||||
export let showCreateIndex = false;
|
||||
export let externalAttribute: Attributes = null;
|
||||
@@ -66,6 +67,7 @@
|
||||
message: 'Index has been created',
|
||||
type: 'success'
|
||||
});
|
||||
trackEvent('submit_index_create');
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
message: error.message,
|
||||
|
||||
+2
@@ -7,6 +7,7 @@
|
||||
import type { Models } from '@aw-labs/appwrite-console';
|
||||
import { createEventDispatcher } from 'svelte';
|
||||
import { page } from '$app/stores';
|
||||
import { trackEvent } from '$lib/actions/analytics';
|
||||
|
||||
export let showDelete = false;
|
||||
export let selectedIndex: Models.Index;
|
||||
@@ -27,6 +28,7 @@
|
||||
message: `Index has been deleted`
|
||||
});
|
||||
dispatch('deleted');
|
||||
trackEvent('submit_index_delete');
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
type: 'error',
|
||||
|
||||
+7
-2
@@ -14,6 +14,7 @@
|
||||
import { invalidate } from '$app/navigation';
|
||||
import { Dependencies } from '$lib/constants';
|
||||
import FormList from '$lib/elements/forms/formList.svelte';
|
||||
import { trackEvent } from '$lib/actions/analytics';
|
||||
|
||||
const databaseId = $page.params.database;
|
||||
|
||||
@@ -47,7 +48,7 @@
|
||||
errorType = type;
|
||||
}
|
||||
|
||||
async function togglecollection() {
|
||||
async function toggleCollection() {
|
||||
try {
|
||||
await sdkForProject.databases.updateCollection(
|
||||
databaseId,
|
||||
@@ -62,6 +63,7 @@
|
||||
message: `${$collection.name} has been updated`,
|
||||
type: 'success'
|
||||
});
|
||||
trackEvent('submit_collection_update_enabled');
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
message: error.message,
|
||||
@@ -83,6 +85,7 @@
|
||||
message: 'Name has been updated',
|
||||
type: 'success'
|
||||
});
|
||||
trackEvent('submit_collection_update_name');
|
||||
} catch (error) {
|
||||
addError('name', error.message, 'error');
|
||||
}
|
||||
@@ -101,6 +104,7 @@
|
||||
message: 'Permissions have been updated',
|
||||
type: 'success'
|
||||
});
|
||||
trackEvent('submit_collection_update_permissions');
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
message: error.message,
|
||||
@@ -124,6 +128,7 @@
|
||||
message: 'Security has been updated',
|
||||
type: 'success'
|
||||
});
|
||||
trackEvent('submit_collection_update_security');
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
message: error.message,
|
||||
@@ -152,7 +157,7 @@
|
||||
</svelte:fragment>
|
||||
|
||||
<svelte:fragment slot="actions">
|
||||
<Button disabled={enabled === $collection.enabled} on:click={togglecollection}>
|
||||
<Button disabled={enabled === $collection.enabled} on:click={toggleCollection}>
|
||||
Update
|
||||
</Button>
|
||||
</svelte:fragment>
|
||||
|
||||
+2
@@ -2,6 +2,7 @@
|
||||
import { goto } from '$app/navigation';
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/stores';
|
||||
import { trackEvent } from '$lib/actions/analytics';
|
||||
import { Modal } from '$lib/components';
|
||||
import { Button } from '$lib/elements/forms';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
@@ -20,6 +21,7 @@
|
||||
type: 'success',
|
||||
message: `${$collection.name} has been deleted`
|
||||
});
|
||||
trackEvent('submit_collection_delete');
|
||||
await goto(
|
||||
`${base}/console/project-${$page.params.project}/databases/database/${$page.params.database}`
|
||||
);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { page } from '$app/stores';
|
||||
import { trackEvent } from '$lib/actions/analytics';
|
||||
|
||||
import { Modal, CustomId } from '$lib/components';
|
||||
import { Pill } from '$lib/elements';
|
||||
@@ -31,6 +32,7 @@
|
||||
message: `${name} has been created`
|
||||
});
|
||||
name = id = null;
|
||||
trackEvent('submit_database_create');
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
type: 'error',
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
import { goto } from '$app/navigation';
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/stores';
|
||||
import { trackEvent } from '$lib/actions/analytics';
|
||||
import { Modal } from '$lib/components';
|
||||
import { Button } from '$lib/elements/forms';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
@@ -20,6 +21,7 @@
|
||||
message: `${$database.name} has been deleted`
|
||||
});
|
||||
await goto(`${base}/console/project-${$page.params.project}/databases`);
|
||||
trackEvent('submit_database_delete');
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
type: 'error',
|
||||
@@ -31,8 +33,7 @@
|
||||
|
||||
<Modal warning={true} bind:show={showDelete} on:submit={handleDelete}>
|
||||
<svelte:fragment slot="header">Delete Database</svelte:fragment>
|
||||
|
||||
<p>
|
||||
<p class="text">
|
||||
Are you sure you want to delete <b>{$database.name}</b>?
|
||||
</p>
|
||||
<svelte:fragment slot="footer">
|
||||
|
||||
@@ -13,14 +13,18 @@
|
||||
{
|
||||
href: path,
|
||||
title: 'Collections',
|
||||
event: 'collections',
|
||||
hasChildren: true
|
||||
},
|
||||
{
|
||||
href: `${path}/usage`,
|
||||
title: 'Usage'
|
||||
title: 'Usage',
|
||||
event: 'usage',
|
||||
hasChildren: true
|
||||
},
|
||||
{
|
||||
href: `${path}/settings`,
|
||||
event: 'settings',
|
||||
title: 'Settings'
|
||||
}
|
||||
];
|
||||
@@ -41,7 +45,10 @@
|
||||
|
||||
<Tabs>
|
||||
{#each tabs as tab}
|
||||
<Tab href={tab.href} selected={isTabSelected(tab, $page.url.pathname, path, tabs)}>
|
||||
<Tab
|
||||
href={tab.href}
|
||||
selected={isTabSelected(tab, $page.url.pathname, path, tabs)}
|
||||
event={tab.event}>
|
||||
{tab.title}
|
||||
</Tab>
|
||||
{/each}
|
||||
|
||||
+2
@@ -11,6 +11,7 @@
|
||||
import { invalidate } from '$app/navigation';
|
||||
import { Dependencies } from '$lib/constants';
|
||||
import Delete from '../delete.svelte';
|
||||
import { trackEvent } from '$lib/actions/analytics';
|
||||
|
||||
let showDelete = false;
|
||||
let showError: false | 'name' | 'email' | 'password' = false;
|
||||
@@ -36,6 +37,7 @@
|
||||
message: 'Name has been updated',
|
||||
type: 'success'
|
||||
});
|
||||
trackEvent('submit_database_update_name');
|
||||
} catch (error) {
|
||||
addError('name', error.message, 'error');
|
||||
}
|
||||
|
||||
@@ -10,11 +10,14 @@
|
||||
{
|
||||
href: path,
|
||||
title: 'Databases',
|
||||
event: 'databases',
|
||||
hasChildren: true
|
||||
},
|
||||
{
|
||||
href: `${path}/usage`,
|
||||
title: 'Usage'
|
||||
title: 'Usage',
|
||||
event: 'usage',
|
||||
hasChildren: true
|
||||
}
|
||||
];
|
||||
</script>
|
||||
@@ -25,7 +28,10 @@
|
||||
</svelte:fragment>
|
||||
<Tabs>
|
||||
{#each tabs as tab}
|
||||
<Tab href={tab.href} selected={isTabSelected(tab, $page.url.pathname, path, tabs)}>
|
||||
<Tab
|
||||
href={tab.href}
|
||||
selected={isTabSelected(tab, $page.url.pathname, path, tabs)}
|
||||
event={tab.event}>
|
||||
{tab.title}
|
||||
</Tab>
|
||||
{/each}
|
||||
|
||||
@@ -32,13 +32,17 @@
|
||||
<Container>
|
||||
<div class="u-flex u-gap-12 common-section u-main-space-between">
|
||||
<Heading tag="h2" size="5">Functions</Heading>
|
||||
<Button on:click={openWizard}>
|
||||
<Button on:click={openWizard} event="create_function">
|
||||
<span class="icon-plus" aria-hidden="true" /> <span class="text">Create function</span>
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
{#if data.functions.total}
|
||||
<CardContainer total={data.functions.total} {offset} on:click={openWizard}>
|
||||
<CardContainer
|
||||
{offset}
|
||||
event="functions"
|
||||
total={data.functions.total}
|
||||
on:click={openWizard}>
|
||||
{#each data.functions.functions as func}
|
||||
<GridItem1
|
||||
href={`${base}/console/project-${project}/functions/function-${func.$id}`}>
|
||||
@@ -68,7 +72,7 @@
|
||||
{/if}
|
||||
</svelte:fragment>
|
||||
|
||||
<Copy value={func.$id}>
|
||||
<Copy value={func.$id} event="function">
|
||||
<Pill button><i class="icon-duplicate" />Function ID</Pill>
|
||||
</Copy>
|
||||
</GridItem1>
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
import { Dependencies } from '$lib/constants';
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/stores';
|
||||
import { trackEvent } from '$lib/actions/analytics';
|
||||
|
||||
const projectId = $page.params.project;
|
||||
|
||||
@@ -38,11 +39,11 @@
|
||||
);
|
||||
await invalidate(Dependencies.FUNCTIONS);
|
||||
goto(`${base}/console/project-${projectId}/functions/function-${response.$id}`);
|
||||
|
||||
addNotification({
|
||||
message: `${$createFunction.name} has been created`,
|
||||
type: 'success'
|
||||
});
|
||||
trackEvent('submit_function_create');
|
||||
wizard.hide();
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
|
||||
+1
-1
@@ -79,7 +79,7 @@
|
||||
<Container>
|
||||
<div class="u-flex u-gap-12 common-section u-main-space-between">
|
||||
<Heading tag="h2" size="5">Deployments</Heading>
|
||||
<Button on:click={() => (showCreate = true)}>
|
||||
<Button on:click={() => (showCreate = true)} event="create_deployment">
|
||||
<span class="icon-plus" aria-hidden="true" />
|
||||
<span class="text">Create deployment</span>
|
||||
</Button>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { trackEvent } from '$lib/actions/analytics';
|
||||
import { Modal } from '$lib/components';
|
||||
import { Button } from '$lib/elements/forms';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
@@ -23,6 +24,7 @@
|
||||
message: `Deployment has been activated`
|
||||
});
|
||||
dispatch('activated');
|
||||
trackEvent('submit_deployment_update');
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
type: 'error',
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
import { invalidate } from '$app/navigation';
|
||||
import { Dependencies } from '$lib/constants';
|
||||
import { func } from './store';
|
||||
import { trackEvent } from '$lib/actions/analytics';
|
||||
|
||||
export let showCreate = false;
|
||||
|
||||
@@ -96,6 +97,7 @@
|
||||
files = entrypoint = active = null;
|
||||
showCreate = false;
|
||||
dispatch('created');
|
||||
trackEvent('submit_function_create');
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
type: 'error',
|
||||
@@ -108,11 +110,19 @@
|
||||
<Modal size="big" bind:show={showCreate} on:submit={create}>
|
||||
<svelte:fragment slot="header">Create Deployment</svelte:fragment>
|
||||
<Tabs>
|
||||
<Tab on:click={() => (mode = Mode.CLI)} selected={mode === Mode.CLI}>CLI</Tab>
|
||||
<Tab on:click={() => (mode = Mode.Github)} selected={mode === Mode.Github}>
|
||||
<Tab on:click={() => (mode = Mode.CLI)} selected={mode === Mode.CLI} event="deploy_cli">
|
||||
CLI
|
||||
</Tab>
|
||||
<Tab
|
||||
on:click={() => (mode = Mode.Github)}
|
||||
selected={mode === Mode.Github}
|
||||
event="deploy_github">
|
||||
GitHub - Soon!
|
||||
</Tab>
|
||||
<Tab on:click={() => (mode = Mode.Manual)} selected={mode === Mode.Manual}>Manual</Tab>
|
||||
<Tab
|
||||
on:click={() => (mode = Mode.Manual)}
|
||||
selected={mode === Mode.Manual}
|
||||
event="deploy_manual">Manual</Tab>
|
||||
</Tabs>
|
||||
{#if mode === Mode.CLI}
|
||||
<p class="text">
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { invalidate } from '$app/navigation';
|
||||
import { trackEvent } from '$lib/actions/analytics';
|
||||
import { Modal } from '$lib/components';
|
||||
import { Dependencies } from '$lib/constants';
|
||||
import { Button } from '$lib/elements/forms';
|
||||
@@ -22,6 +23,7 @@
|
||||
type: 'success',
|
||||
message: `Deployment has been deleted`
|
||||
});
|
||||
trackEvent('submit_deployment_delete');
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
type: 'error',
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { afterNavigate } from '$app/navigation';
|
||||
import { trackEvent } from '$lib/actions/analytics';
|
||||
import { Code, Modal } from '$lib/components';
|
||||
import { Button } from '$lib/elements/forms';
|
||||
import { InputTextarea, FormList, InputChoice } from '$lib/elements/forms';
|
||||
@@ -37,6 +38,7 @@
|
||||
type: 'success',
|
||||
message: `Function has been executed`
|
||||
});
|
||||
trackEvent('submit_execution_create');
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
type: 'error',
|
||||
|
||||
@@ -13,19 +13,24 @@
|
||||
{
|
||||
href: path,
|
||||
title: 'Deployments',
|
||||
event: 'deployments',
|
||||
hasChildren: true
|
||||
},
|
||||
{
|
||||
href: `${path}/usage`,
|
||||
title: 'Usage'
|
||||
title: 'Usage',
|
||||
event: 'sage',
|
||||
hasChildren: true
|
||||
},
|
||||
{
|
||||
href: `${path}/executions`,
|
||||
title: 'Executions',
|
||||
event: 'executions',
|
||||
hasChildren: true
|
||||
},
|
||||
{
|
||||
href: `${path}/settings`,
|
||||
event: 'settings',
|
||||
title: 'Settings'
|
||||
}
|
||||
];
|
||||
@@ -36,7 +41,7 @@
|
||||
<CoverTitle href={`/console/project-${projectId}/functions`}>
|
||||
{$func?.name}
|
||||
</CoverTitle>
|
||||
<Copy value={$func?.$id}>
|
||||
<Copy value={$func?.$id} event="function">
|
||||
<Pill button>
|
||||
<span class="icon-duplicate" aria-hidden="true" />
|
||||
ID Details
|
||||
@@ -46,7 +51,10 @@
|
||||
|
||||
<Tabs>
|
||||
{#each tabs as tab}
|
||||
<Tab href={tab.href} selected={isTabSelected(tab, $page.url.pathname, path, tabs)}>
|
||||
<Tab
|
||||
href={tab.href}
|
||||
selected={isTabSelected(tab, $page.url.pathname, path, tabs)}
|
||||
event={tab.event}>
|
||||
{tab.title}
|
||||
</Tab>
|
||||
{/each}
|
||||
|
||||
+9
@@ -31,6 +31,7 @@
|
||||
import { invalidate } from '$app/navigation';
|
||||
import { Dependencies } from '$lib/constants';
|
||||
import type { PageData } from './$types';
|
||||
import { trackEvent } from '$lib/actions/analytics';
|
||||
|
||||
export let data: PageData;
|
||||
|
||||
@@ -67,6 +68,7 @@
|
||||
message: 'Name has been updated',
|
||||
type: 'success'
|
||||
});
|
||||
trackEvent('submit_function_update_name');
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
message: error.message,
|
||||
@@ -83,6 +85,7 @@
|
||||
message: 'Permissions have been updated',
|
||||
type: 'success'
|
||||
});
|
||||
trackEvent('submit_function_update_permissions');
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
message: error.message,
|
||||
@@ -104,6 +107,7 @@
|
||||
message: 'Permissions have been updated',
|
||||
type: 'success'
|
||||
});
|
||||
trackEvent('submit_function_update_events');
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
message: error.message,
|
||||
@@ -128,6 +132,7 @@
|
||||
type: 'success',
|
||||
message: 'CRON Schedule has been updated'
|
||||
});
|
||||
trackEvent('submit_function_update_schedule');
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
type: 'error',
|
||||
@@ -151,6 +156,7 @@
|
||||
type: 'success',
|
||||
message: 'Timeout has been updated'
|
||||
});
|
||||
trackEvent('submit_function_update_timeout');
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
type: 'error',
|
||||
@@ -170,6 +176,7 @@
|
||||
type: 'success',
|
||||
message: `${$func.name} variables have been updated`
|
||||
});
|
||||
trackEvent('submit_variable_create');
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
type: 'error',
|
||||
@@ -194,6 +201,7 @@
|
||||
type: 'success',
|
||||
message: `${$func.name} variables have been updated`
|
||||
});
|
||||
trackEvent('submit_variable_update');
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
type: 'error',
|
||||
@@ -209,6 +217,7 @@
|
||||
type: 'success',
|
||||
message: `Variable has been deleted`
|
||||
});
|
||||
trackEvent('submit_variable_delete');
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
type: 'error',
|
||||
|
||||
+2
@@ -2,6 +2,7 @@
|
||||
import { goto } from '$app/navigation';
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/stores';
|
||||
import { trackEvent } from '$lib/actions/analytics';
|
||||
import { Modal } from '$lib/components';
|
||||
import { Button } from '$lib/elements/forms';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
@@ -19,6 +20,7 @@
|
||||
message: `Function has been deleted`
|
||||
});
|
||||
await goto(`${base}/console/project-${$page.params.project}/functions`);
|
||||
trackEvent('submit_function_delete');
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
type: 'error',
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
import Delete from './deleteProject.svelte';
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/stores';
|
||||
import { trackEvent } from '$lib/actions/analytics';
|
||||
|
||||
let name: string = null;
|
||||
let showDelete = false;
|
||||
@@ -31,6 +32,7 @@
|
||||
type: 'success',
|
||||
message: 'Project name has been updated'
|
||||
});
|
||||
trackEvent('submit_project_update_name');
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
type: 'error',
|
||||
@@ -53,6 +55,10 @@
|
||||
service.value ? 'enabled' : 'disabled'
|
||||
}`
|
||||
});
|
||||
trackEvent('submit_project_service', {
|
||||
method: service.method,
|
||||
value: service.value
|
||||
});
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
type: 'error',
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<script lang="ts">
|
||||
import { goto } from '$app/navigation';
|
||||
import { base } from '$app/paths';
|
||||
import { trackEvent } from '$lib/actions/analytics';
|
||||
import { Modal } from '$lib/components';
|
||||
import { Button, FormList, InputPassword, InputText } from '$lib/elements/forms';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
@@ -20,6 +21,7 @@
|
||||
type: 'success',
|
||||
message: `${$project.name} has been deleted`
|
||||
});
|
||||
trackEvent('submit_project_delete');
|
||||
await goto(`${base}/console`);
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
import type { PageData } from './$types';
|
||||
import Create from '../create.svelte';
|
||||
import Delete from '../delete.svelte';
|
||||
import { trackEvent } from '$lib/actions/analytics';
|
||||
|
||||
export let data: PageData;
|
||||
|
||||
@@ -46,6 +47,7 @@
|
||||
}
|
||||
await sdkForConsole.projects.updateDomainVerification(projectId, domainId);
|
||||
invalidate(Dependencies.DOMAINS);
|
||||
trackEvent('submit_domain_update_verification');
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
message: error.message,
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
import { invalidate } from '$app/navigation';
|
||||
import { Dependencies } from '$lib/constants';
|
||||
import type { Models } from '@aw-labs/appwrite-console';
|
||||
import { trackEvent } from '$lib/actions/analytics';
|
||||
|
||||
export let showDelete = false;
|
||||
export let selectedDomain: Models.Domain;
|
||||
@@ -20,6 +21,7 @@
|
||||
type: 'success',
|
||||
message: `${selectedDomain.domain} has been deleted`
|
||||
});
|
||||
trackEvent('submit_domain_delete');
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
type: 'error',
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { trackEvent } from '$lib/actions/analytics';
|
||||
import { FormList, InputDomain } from '$lib/elements/forms';
|
||||
import { WizardStep } from '$lib/layout';
|
||||
import { sdkForConsole } from '$lib/stores/sdk';
|
||||
@@ -13,6 +14,7 @@
|
||||
|
||||
const { $id } = await sdkForConsole.projects.createDomain(projectId, $domain.domain);
|
||||
$domain.$id = $id;
|
||||
trackEvent('submit_domain_create');
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
@@ -9,15 +9,18 @@
|
||||
const tabs = [
|
||||
{
|
||||
href: path,
|
||||
title: 'Overview'
|
||||
title: 'Overview',
|
||||
event: 'overview'
|
||||
},
|
||||
{
|
||||
href: `${path}/domains`,
|
||||
title: 'Custom Domains'
|
||||
title: 'Custom Domains',
|
||||
event: 'domains'
|
||||
},
|
||||
{
|
||||
href: `${path}/webhooks`,
|
||||
title: 'Webhooks'
|
||||
title: 'Webhooks',
|
||||
event: 'webhooks'
|
||||
}
|
||||
];
|
||||
</script>
|
||||
@@ -29,7 +32,10 @@
|
||||
|
||||
<Tabs>
|
||||
{#each tabs as tab}
|
||||
<Tab href={tab.href} selected={isTabSelected(tab, $page.url.pathname, path, tabs)}>
|
||||
<Tab
|
||||
href={tab.href}
|
||||
selected={isTabSelected(tab, $page.url.pathname, path, tabs)}
|
||||
event={tab.event}>
|
||||
{tab.title}
|
||||
</Tab>
|
||||
{/each}
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
<Container>
|
||||
<div class="u-flex u-gap-12 common-section u-main-space-between">
|
||||
<Heading tag="h2" size="5">Webhooks</Heading>
|
||||
<Button on:click={openWizard}>
|
||||
<Button on:click={openWizard} event="create_webhook">
|
||||
<span class="icon-plus" aria-hidden="true" /> <span class="text">Create webhook</span>
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
import { invalidate } from '$app/navigation';
|
||||
import { Dependencies } from '$lib/constants';
|
||||
import { writable, type Writable } from 'svelte/store';
|
||||
import { trackEvent } from '$lib/actions/analytics';
|
||||
|
||||
const projectId = $page.params.project;
|
||||
let name: string = null;
|
||||
@@ -61,6 +62,7 @@
|
||||
type: 'success',
|
||||
message: 'Webhook name has been updated'
|
||||
});
|
||||
trackEvent('submit_webhook_update_name');
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
type: 'error',
|
||||
@@ -83,6 +85,7 @@
|
||||
type: 'success',
|
||||
message: 'Webhook url has been updated'
|
||||
});
|
||||
trackEvent('submit_webhook_update_url');
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
type: 'error',
|
||||
@@ -106,6 +109,7 @@
|
||||
type: 'success',
|
||||
message: 'Webhook events have been updated'
|
||||
});
|
||||
trackEvent('submit_webhook_update_events');
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
type: 'error',
|
||||
@@ -131,6 +135,7 @@
|
||||
type: 'success',
|
||||
message: 'Webhook security has been updated'
|
||||
});
|
||||
trackEvent('submit_webhook_update_security');
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
type: 'error',
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<script lang="ts">
|
||||
import { goto, invalidate } from '$app/navigation';
|
||||
import { base } from '$app/paths';
|
||||
import { trackEvent } from '$lib/actions/analytics';
|
||||
import { Modal } from '$lib/components';
|
||||
import { Dependencies } from '$lib/constants';
|
||||
import { Button } from '$lib/elements/forms';
|
||||
@@ -20,6 +21,7 @@
|
||||
type: 'success',
|
||||
message: `${$webhook.name} has been deleted`
|
||||
});
|
||||
trackEvent('submit_webhook_delete');
|
||||
await goto(`${base}/console/project-${$project.$id}/settings/webhooks`);
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<CoverTitle href={`/console/project-${projectId}/settings/webhooks`}>
|
||||
{$webhook?.name}
|
||||
</CoverTitle>
|
||||
<Copy value={$webhook?.$id}>
|
||||
<Copy value={$webhook?.$id} event="webhook">
|
||||
<Pill button>
|
||||
<span class="icon-duplicate" aria-hidden="true" />
|
||||
Webhook ID
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<script lang="ts">
|
||||
import { invalidate } from '$app/navigation';
|
||||
import { page } from '$app/stores';
|
||||
import { trackEvent } from '$lib/actions/analytics';
|
||||
import { Modal } from '$lib/components';
|
||||
import { Dependencies } from '$lib/constants';
|
||||
import { Button } from '$lib/elements/forms';
|
||||
@@ -20,6 +21,7 @@
|
||||
type: 'success',
|
||||
message: 'Key has been regenerated'
|
||||
});
|
||||
trackEvent('submit_webhook_update_signature');
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
type: 'error',
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
import type { WizardStepsType } from '$lib/layout/wizard.svelte';
|
||||
import { invalidate } from '$app/navigation';
|
||||
import { Dependencies } from '$lib/constants';
|
||||
import { trackEvent } from '$lib/actions/analytics';
|
||||
|
||||
const projectId = $page.params.project;
|
||||
const create = async () => {
|
||||
@@ -31,6 +32,7 @@
|
||||
type: 'success'
|
||||
});
|
||||
wizard.hide();
|
||||
trackEvent('submit_webhook_create');
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
message: error.message,
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
<div class="u-flex u-gap-12 common-section u-main-space-between">
|
||||
<Heading tag="h2" size="5">Buckets</Heading>
|
||||
|
||||
<Button on:click={() => (showCreate = true)}>
|
||||
<Button on:click={() => (showCreate = true)} event="create_bucket">
|
||||
<span class="icon-plus" aria-hidden="true" /> <span class="text">Create bucket</span>
|
||||
</Button>
|
||||
</div>
|
||||
@@ -36,6 +36,7 @@
|
||||
<CardContainer
|
||||
total={data.buckets.total}
|
||||
offset={data.offset}
|
||||
event="bucket"
|
||||
on:click={() => (showCreate = true)}>
|
||||
{#each data.buckets.buckets as bucket}
|
||||
<GridItem1 href={`${base}/console/project-${project}/storage/bucket-${bucket.$id}`}>
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
import type { PageData } from './$types';
|
||||
import { invalidate } from '$app/navigation';
|
||||
import { Dependencies, PAGE_LIMIT } from '$lib/constants';
|
||||
import { trackEvent } from '$lib/actions/analytics';
|
||||
|
||||
export let data: PageData;
|
||||
|
||||
@@ -64,6 +65,7 @@
|
||||
await sdkForProject.storage.deleteFile(file.bucketId, file.$id);
|
||||
uploader.removeFile(file);
|
||||
invalidate(Dependencies.FILES);
|
||||
trackEvent('submit_file_delete');
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
type: 'error',
|
||||
@@ -75,7 +77,7 @@
|
||||
|
||||
<Container>
|
||||
<SearchQuery search={data.search} placeholder="Search by filename">
|
||||
<Button on:click={() => (showCreate = true)}>
|
||||
<Button on:click={() => (showCreate = true)} event="create_file">
|
||||
<span class="icon-plus" aria-hidden="true" /> <span class="text">Create file</span>
|
||||
</Button>
|
||||
</SearchQuery>
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
import { goto } from '$app/navigation';
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/stores';
|
||||
import { trackEvent } from '$lib/actions/analytics';
|
||||
import { Modal } from '$lib/components';
|
||||
import { Button } from '$lib/elements/forms';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
@@ -19,6 +20,7 @@
|
||||
message: `${$bucket.name} has been deleted`
|
||||
});
|
||||
await goto(`${base}/console/project-${$page.params.project}/storage`);
|
||||
trackEvent('submit_bucket_delete');
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
type: 'error',
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { trackEvent } from '$lib/actions/analytics';
|
||||
import { Modal } from '$lib/components';
|
||||
import { Button } from '$lib/elements/forms';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
@@ -20,6 +21,7 @@
|
||||
type: 'success',
|
||||
message: `${file.name} has been deleted`
|
||||
});
|
||||
trackEvent('submit_file_delete');
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
type: 'error',
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
import { calculateSize } from '$lib/helpers/sizeConvertion';
|
||||
import { Permissions } from '$lib/components/permissions';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { trackEvent } from '$lib/actions/analytics';
|
||||
|
||||
export let showCreate = false;
|
||||
|
||||
@@ -39,6 +40,7 @@
|
||||
type: 'success',
|
||||
message: `${file.name} has been created`
|
||||
});
|
||||
trackEvent('submit_file_create');
|
||||
} catch ({ message }) {
|
||||
error = message;
|
||||
}
|
||||
|
||||
+6
-2
@@ -14,6 +14,7 @@
|
||||
import Delete from './deleteFile.svelte';
|
||||
import { invalidate } from '$app/navigation';
|
||||
import { Dependencies } from '$lib/constants';
|
||||
import { trackEvent } from '$lib/actions/analytics';
|
||||
|
||||
onMount(async () => {
|
||||
filePermissions = $file?.$permissions;
|
||||
@@ -51,6 +52,7 @@
|
||||
message: 'Permissions have been updated',
|
||||
type: 'success'
|
||||
});
|
||||
trackEvent('submit_file_update_permissions');
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
message: error.message,
|
||||
@@ -100,7 +102,7 @@
|
||||
</svelte:fragment>
|
||||
|
||||
<svelte:fragment slot="actions">
|
||||
<Button secondary href={downloadFile()}>
|
||||
<Button secondary href={downloadFile()} event="download_file">
|
||||
<span class="icon-download" aria-hidden="true" />
|
||||
<span class="text"> Download</span></Button>
|
||||
</svelte:fragment>
|
||||
@@ -143,7 +145,9 @@
|
||||
</svelte:fragment>
|
||||
|
||||
<svelte:fragment slot="actions">
|
||||
<Button secondary on:click={() => (showDelete = true)}>Delete</Button>
|
||||
<Button secondary on:click={() => (showDelete = true)} event="delete_file">
|
||||
Delete
|
||||
</Button>
|
||||
</svelte:fragment>
|
||||
</CardGrid>
|
||||
{/if}
|
||||
|
||||
+2
@@ -2,6 +2,7 @@
|
||||
import { goto } from '$app/navigation';
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/stores';
|
||||
import { trackEvent } from '$lib/actions/analytics';
|
||||
import { Modal } from '$lib/components';
|
||||
import { Button } from '$lib/elements/forms';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
@@ -21,6 +22,7 @@
|
||||
type: 'success',
|
||||
message: `${$file.name} has been deleted`
|
||||
});
|
||||
trackEvent('submit_file_delete');
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
type: 'error',
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@
|
||||
<CoverTitle href={`/console/project-${projectId}/storage/bucket-${bucketId}`}>
|
||||
{$file?.name}
|
||||
</CoverTitle>
|
||||
<Copy value={$file?.$id}>
|
||||
<Copy value={$file?.$id} event="file">
|
||||
<Pill button>
|
||||
<span class="icon-duplicate" aria-hidden="true" />
|
||||
File ID
|
||||
|
||||
@@ -13,14 +13,18 @@
|
||||
{
|
||||
href: path,
|
||||
title: 'Files',
|
||||
event: 'files',
|
||||
hasChildren: true
|
||||
},
|
||||
{
|
||||
href: `${path}/usage`,
|
||||
title: 'Usage'
|
||||
title: 'Usage',
|
||||
event: 'usage',
|
||||
hasChildren: true
|
||||
},
|
||||
{
|
||||
href: `${path}/settings`,
|
||||
event: 'settings',
|
||||
title: 'Settings'
|
||||
}
|
||||
];
|
||||
@@ -31,7 +35,7 @@
|
||||
<CoverTitle href={`/console/project-${projectId}/storage`}>
|
||||
{$bucket?.name}
|
||||
</CoverTitle>
|
||||
<Copy value={$bucket?.$id}>
|
||||
<Copy value={$bucket?.$id} event="bucket">
|
||||
<Pill button>
|
||||
<span class="icon-duplicate" aria-hidden="true" />
|
||||
Bucket ID
|
||||
@@ -41,7 +45,10 @@
|
||||
|
||||
<Tabs>
|
||||
{#each tabs as tab}
|
||||
<Tab href={tab.href} selected={isTabSelected(tab, $page.url.pathname, path, tabs)}>
|
||||
<Tab
|
||||
href={tab.href}
|
||||
selected={isTabSelected(tab, $page.url.pathname, path, tabs)}
|
||||
event={tab.event}>
|
||||
{tab.title}
|
||||
</Tab>
|
||||
{/each}
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
import { invalidate } from '$app/navigation';
|
||||
import { Dependencies } from '$lib/constants';
|
||||
import Delete from '../_deleteBucket.svelte';
|
||||
import { trackEvent } from '$lib/actions/analytics';
|
||||
|
||||
let showDelete = false;
|
||||
|
||||
@@ -79,6 +80,9 @@
|
||||
message: `${$bucket.name} has been updated`,
|
||||
type: 'success'
|
||||
});
|
||||
trackEvent('submit_bucket_enable', {
|
||||
value: enabled
|
||||
});
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
message: error.message,
|
||||
@@ -94,6 +98,7 @@
|
||||
message: 'Name has been updated',
|
||||
type: 'success'
|
||||
});
|
||||
trackEvent('submit_bucket_update_name');
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
message: error.message,
|
||||
@@ -110,6 +115,7 @@
|
||||
message: 'Permissions have been updated',
|
||||
type: 'success'
|
||||
});
|
||||
trackEvent('submit_bucket_update_permissions');
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
message: error.message,
|
||||
@@ -131,6 +137,7 @@
|
||||
message: 'Security has been updated',
|
||||
type: 'success'
|
||||
});
|
||||
trackEvent('submit_bucket_update_file_security');
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
message: error.message,
|
||||
@@ -158,6 +165,7 @@
|
||||
message: `${$bucket.name} has been updated`,
|
||||
type: 'success'
|
||||
});
|
||||
trackEvent('submit_bucket_update_security');
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
message: error.message,
|
||||
@@ -181,6 +189,7 @@
|
||||
message: `${$bucket.name} has been updated`,
|
||||
type: 'success'
|
||||
});
|
||||
trackEvent('submit_bucket_update_size');
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
message: error.message,
|
||||
@@ -205,6 +214,7 @@
|
||||
message: `${$bucket.name} has been updated`,
|
||||
type: 'success'
|
||||
});
|
||||
trackEvent('submit_bucket_update_extensions');
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
message: error.message,
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { trackEvent } from '$lib/actions/analytics';
|
||||
import { Modal, CustomId } from '$lib/components';
|
||||
import { Pill } from '$lib/elements';
|
||||
import { Button, InputText, FormList } from '$lib/elements/forms';
|
||||
@@ -25,6 +26,7 @@
|
||||
type: 'success',
|
||||
message: `${name} has been created`
|
||||
});
|
||||
trackEvent('submit_bucket_create');
|
||||
} catch ({ message }) {
|
||||
error = message;
|
||||
}
|
||||
|
||||
@@ -10,11 +10,14 @@
|
||||
{
|
||||
href: path,
|
||||
title: 'Buckets',
|
||||
event: 'buckets',
|
||||
hasChildren: true
|
||||
},
|
||||
{
|
||||
href: `${path}/usage`,
|
||||
title: 'Usage'
|
||||
title: 'Usage',
|
||||
event: 'usage',
|
||||
hasChildren: true
|
||||
}
|
||||
];
|
||||
</script>
|
||||
@@ -25,7 +28,10 @@
|
||||
</svelte:fragment>
|
||||
<Tabs>
|
||||
{#each tabs as tab}
|
||||
<Tab href={tab.href} selected={isTabSelected(tab, $page.url.pathname, path, tabs)}>
|
||||
<Tab
|
||||
href={tab.href}
|
||||
selected={isTabSelected(tab, $page.url.pathname, path, tabs)}
|
||||
event={tab.event}>
|
||||
{tab.title}
|
||||
</Tab>
|
||||
{/each}
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
import { Unauthenticated } from '$lib/layout';
|
||||
import { page } from '$app/stores';
|
||||
import { onMount } from 'svelte';
|
||||
import { trackEvent } from '$lib/actions/analytics';
|
||||
|
||||
let teamId: string, membershipId: string, userId: string, secret: string;
|
||||
let terms = false;
|
||||
@@ -26,6 +27,7 @@
|
||||
message: 'Successfully logged in.'
|
||||
});
|
||||
await goto(`${base}/console/organization-${teamId}`);
|
||||
trackEvent('submit_membership_update_status');
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
type: 'error',
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
import { sdkForConsole } from '$lib/stores/sdk';
|
||||
import { Unauthenticated } from '$lib/layout';
|
||||
import { Dependencies } from '$lib/constants';
|
||||
import { trackEvent } from '$lib/actions/analytics';
|
||||
|
||||
let mail: string, pass: string, disabled: boolean;
|
||||
|
||||
@@ -25,6 +26,7 @@
|
||||
type: 'success',
|
||||
message: 'Successfully logged in.'
|
||||
});
|
||||
trackEvent('submit_session_create');
|
||||
await goto(`${base}/console`);
|
||||
} catch (error) {
|
||||
disabled = false;
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { sdkForConsole } from '$lib/stores/sdk';
|
||||
import { Unauthenticated } from '$lib/layout';
|
||||
import { trackEvent } from '$lib/actions/analytics';
|
||||
|
||||
let mail: string;
|
||||
const recover = async () => {
|
||||
@@ -13,6 +14,7 @@
|
||||
type: 'success',
|
||||
message: 'We have sent you an email with a password reset link'
|
||||
});
|
||||
trackEvent('submit_account_recover');
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
type: 'error',
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
import { Unauthenticated } from '$lib/layout';
|
||||
import FormList from '$lib/elements/forms/formList.svelte';
|
||||
import { Dependencies } from '$lib/constants';
|
||||
import { trackEvent } from '$lib/actions/analytics';
|
||||
|
||||
let name: string, mail: string, pass: string, disabled: boolean;
|
||||
let terms = false;
|
||||
@@ -26,6 +27,7 @@
|
||||
await sdkForConsole.account.createEmailSession(mail, pass);
|
||||
await invalidate(Dependencies.ACCOUNT);
|
||||
await goto(`${base}/console`);
|
||||
trackEvent('submit_account_create');
|
||||
} catch (error) {
|
||||
disabled = false;
|
||||
addNotification({
|
||||
|
||||
Reference in New Issue
Block a user