Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
},
"dependencies": {
"@aw-labs/appwrite-console": "^10.0.0",
"@aw-labs/icons": "0.0.0-75",
"@aw-labs/ui": "0.0.0-75",
"@aw-labs/icons": "0.0.0-76",
"@aw-labs/ui": "0.0.0-76",
"@popperjs/core": "^2.11.6",
"echarts": "^5.4.0",
"pretty-bytes": "^6.0.0",
Expand Down
4 changes: 2 additions & 2 deletions src/lib/components/empty.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
<div class="u-flex u-flex-vertical u-cross-center u-gap-24">
<button type="button" on:click|preventDefault>
{#if $app.themeInUse === 'dark'}
<img src={EmptyDark} alt="create" aria-hidden="true" />
<img src={EmptyDark} alt="create" aria-hidden="true" height="124" />
{:else}
<img src={EmptyLight} alt="create" aria-hidden="true" />
<img src={EmptyLight} alt="create" aria-hidden="true" height="124" />
{/if}
</button>
<slot>
Expand Down
3 changes: 2 additions & 1 deletion src/lib/components/heading.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
export let tag: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
export let size: '1' | '2' | '3' | '4' | '5' | '6' | '7';
export let trimmed = true;
export let id: string = null;
</script>

<svelte:element this={tag} class={`heading-level-${size}`} class:u-trim-1={trimmed}>
<svelte:element this={tag} class={`heading-level-${size}`} class:u-trim-1={trimmed} {id}>
<slot />
</svelte:element>
2 changes: 1 addition & 1 deletion src/lib/components/output.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<Copy {value}>
<div class="interactive-text-output is-textarea">
<span class="text u-line-height-1-5 u-break-word"><slot /></span>
<span class="text u-line-height-1-5 u-break-all"><slot /></span>

<div class="u-flex u-cross-child-start u-gap-8">
<button class="interactive-text-output-button" aria-label="copy text">
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/secret.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<div class="interactive-text-output" class:is-textarea={show}>
{#if show}
<span class="text u-line-height-1-5 u-break-word">{value}</span>
<span class="text u-line-height-1-5 u-break-all">{value}</span>
{:else}
<span class="text">••••••••••••</span>
{/if}
Expand Down
8 changes: 7 additions & 1 deletion src/lib/elements/forms/inputFile.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
export let label: string = null;
export let files: FileList;
export let list = new DataTransfer();
export let allowedFileExtensions: string[] = [];

let input: HTMLInputElement;
let hovering = false;
Expand All @@ -28,7 +29,12 @@
}
</script>

<input bind:files bind:this={input} type="file" style="display: none" />
<input
bind:files
bind:this={input}
accept={allowedFileExtensions.map((n) => `.${n}`).join(',')}
type="file"
style="display: none" />

<div>
{#if label}
Expand Down
4 changes: 2 additions & 2 deletions src/routes/console/onboarding/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
let id: string;
let showCustomId = false;
let loading = false;

async function createProject() {
try {
loading = true;
Expand All @@ -28,12 +29,11 @@
await invalidate(Dependencies.ACCOUNT);
goto(`/console/project-${project.$id}`);
} catch ({ message }) {
loading = false;
addNotification({
message,
type: 'error'
});
} finally {
loading = false;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
let error: string;
let isCreating = false;

const create = async () => {
async function create() {
try {
isCreating = true;
const project = await sdkForConsole.projects.create(
Expand All @@ -34,11 +34,10 @@
});
await goto(`/console/project-${project.$id}`);
} catch ({ message }) {
error = message;
} finally {
isCreating = false;
error = message;
}
};
}
</script>

<Modal {error} on:submit={create} size="big" bind:show>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@
{/if}

<section class="common-section u-margin-block-start-100">
<Heading tag="h2" size="5">Integrations</Heading>
<Heading tag="h2" size="5" id="integrations">Integrations</Heading>
<div class="tabs u-margin-block-start-24 u-sep-block-end">
<button
class="tabs-button-scroll is-start u-hide"
Expand Down
4 changes: 3 additions & 1 deletion src/routes/console/project-[project]/settings/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@
</FormList>
</svelte:fragment>
<svelte:fragment slot="actions">
<Button secondary href={`${base}/console/project-${projectId}/overview/keys`}>
<Button
secondary
href={`${base}/console/project-${projectId}/overview/keys#integrations`}>
View API Keys
</Button>
</svelte:fragment>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
<svelte:fragment slot="header">Create File</svelte:fragment>
<FormList>
<div>
<InputFile bind:files />
<InputFile bind:files allowedFileExtensions={$bucket.allowedFileExtensions} />
<p>Max file size: {calculateSize($bucket.maximumFileSize)}</p>
</div>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { derived } from 'svelte/store';
import { page } from '$app/stores';
import type { Models } from '@aw-labs/appwrite-console';

export const bucket = derived(page, ($page) => $page.data.bucket);
export const bucket = derived(page, ($page) => $page.data.bucket as Models.Bucket);
10 changes: 6 additions & 4 deletions src/routes/login/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@
import { Unauthenticated } from '$lib/layout';
import { Dependencies } from '$lib/constants';

let mail: string, pass: string;
let mail: string, pass: string, disabled: boolean;

const login = async () => {
async function login() {
try {
disabled = true;
await sdkForConsole.account.createEmailSession(mail, pass);
await invalidate(Dependencies.ACCOUNT);
addNotification({
Expand All @@ -26,12 +27,13 @@
});
await goto(`${base}/console`);
} catch (error) {
disabled = false;
addNotification({
type: 'error',
message: error.message
});
}
};
}
</script>

<svelte:head>
Expand Down Expand Up @@ -59,7 +61,7 @@
showPasswordButton={true}
bind:value={pass} />
<FormItem>
<Button fullWidth submit>Sign in</Button>
<Button fullWidth submit {disabled}>Sign in</Button>
</FormItem>
</FormList>
</Form>
Expand Down
10 changes: 6 additions & 4 deletions src/routes/register/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,24 @@
import FormList from '$lib/elements/forms/formList.svelte';
import { Dependencies } from '$lib/constants';

let name: string, mail: string, pass: string;
let name: string, mail: string, pass: string, disabled: boolean;
let terms = false;

const register = async () => {
async function register() {
try {
disabled = true;
await sdkForConsole.account.create('unique()', mail, pass, name ?? '');
await sdkForConsole.account.createEmailSession(mail, pass);
await invalidate(Dependencies.ACCOUNT);
await goto(`${base}/console`);
} catch (error) {
disabled = false;
addNotification({
type: 'error',
message: error.message
});
}
};
}
</script>

<svelte:head>
Expand Down Expand Up @@ -77,7 +79,7 @@
rel="noopener noreferrer">General Terms of Use</a
>.</InputChoice>
<FormItem>
<Button fullWidth submit>Sign up</Button>
<Button fullWidth submit {disabled}>Sign up</Button>
</FormItem>
</FormList>
</Form>
Expand Down