mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
update: cleanup, lint.
This commit is contained in:
+14
-17
@@ -93,20 +93,18 @@ const createUploader = () => {
|
||||
n.files.unshift(newFile);
|
||||
return n;
|
||||
});
|
||||
const uploadedFile = await temporaryStorage(region, projectId).createFile(
|
||||
{
|
||||
bucketId,
|
||||
fileId: id ?? ID.unique(),
|
||||
file,
|
||||
permissions,
|
||||
onProgress: ((progress) => {
|
||||
newFile.$id = progress.$id;
|
||||
newFile.progress = progress.progress;
|
||||
newFile.status = progress.progress === 100 ? 'success' : 'pending';
|
||||
updateFile(progress.$id, newFile);
|
||||
}) as (progress: UploadProgress) => {}
|
||||
}
|
||||
);
|
||||
const uploadedFile = await temporaryStorage(region, projectId).createFile({
|
||||
bucketId,
|
||||
fileId: id ?? ID.unique(),
|
||||
file,
|
||||
permissions,
|
||||
onProgress: ((progress) => {
|
||||
newFile.$id = progress.$id;
|
||||
newFile.progress = progress.progress;
|
||||
newFile.status = progress.progress === 100 ? 'success' : 'pending';
|
||||
updateFile(progress.$id, newFile);
|
||||
}) as (progress: UploadProgress) => {}
|
||||
});
|
||||
newFile.$id = uploadedFile.$id;
|
||||
newFile.progress = 100;
|
||||
newFile.status = 'success';
|
||||
@@ -130,13 +128,12 @@ const createUploader = () => {
|
||||
const uploadedFile = await temporarySites(
|
||||
page.params.region,
|
||||
page.params.project
|
||||
).createDeployment(
|
||||
siteId, code, true, undefined, undefined, undefined, (p) => {
|
||||
).createDeployment(siteId, code, true, undefined, undefined, undefined, (p) => {
|
||||
newDeployment.$id = p.$id;
|
||||
newDeployment.progress = p.progress;
|
||||
newDeployment.status = p.progress === 100 ? 'success' : 'pending';
|
||||
updateFile(p.$id, newDeployment);
|
||||
return {}
|
||||
return {};
|
||||
});
|
||||
newDeployment.$id = uploadedFile.$id;
|
||||
newDeployment.progress = 100;
|
||||
|
||||
+2
-1
@@ -272,7 +272,8 @@
|
||||
:global(.sub-navigation header) {
|
||||
top: 48px !important;
|
||||
}
|
||||
.trigger {
|
||||
|
||||
:global(.trigger) {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
+1
-4
@@ -15,10 +15,7 @@
|
||||
Tooltip,
|
||||
Typography
|
||||
} from '@appwrite.io/pink-svelte';
|
||||
import {
|
||||
isRelationship,
|
||||
isString
|
||||
} from '../rows/store';
|
||||
import { isRelationship, isString } from '../rows/store';
|
||||
import FailedModal from '../failedModal.svelte';
|
||||
import {
|
||||
columns,
|
||||
|
||||
-2
@@ -1,6 +1,4 @@
|
||||
<script lang="ts">
|
||||
import { page } from '$app/state';
|
||||
import { flags } from '$lib/flags';
|
||||
import { InputText } from '$lib/elements/forms';
|
||||
import { Layout } from '@appwrite.io/pink-svelte';
|
||||
import type { Models } from '@appwrite.io/console';
|
||||
|
||||
-65
@@ -1,65 +0,0 @@
|
||||
<script lang="ts">
|
||||
import { base } from '$app/paths';
|
||||
import { page } from '$app/state';
|
||||
import { Modal, Paginator } from '$lib/components';
|
||||
import Id from '$lib/components/id.svelte';
|
||||
import { preferences } from '$lib/stores/preferences';
|
||||
import type { Models } from '@appwrite.io/console';
|
||||
import { Table } from '@appwrite.io/pink-svelte';
|
||||
|
||||
export let show = false;
|
||||
export let data: Partial<Models.Row>[];
|
||||
export let selectedRelationship: Models.ColumnRelationship = null;
|
||||
const databaseId = page.params.database;
|
||||
const limit = 10;
|
||||
|
||||
$: args =
|
||||
preferences
|
||||
.getDisplayNames()
|
||||
?.[selectedRelationship?.relatedTable]?.filter((p) => p !== '$id') ?? [];
|
||||
|
||||
$: if (!show) {
|
||||
data = null;
|
||||
selectedRelationship = null;
|
||||
}
|
||||
|
||||
$: tableColumns = [
|
||||
// take full width if no display names set
|
||||
{ id: '$id', width: args.length ? 200 : undefined },
|
||||
...args.map((id) => ({ id }))
|
||||
];
|
||||
</script>
|
||||
|
||||
<Modal bind:show title={selectedRelationship?.key} hideFooter>
|
||||
{#if data?.length}
|
||||
<Paginator items={data} {limit}>
|
||||
{#snippet children(paginatedItems: typeof data)}
|
||||
<Table.Root let:root columns={tableColumns}>
|
||||
<svelte:fragment slot="header" let:root>
|
||||
<Table.Header.Cell column="$id" {root}>Row ID</Table.Header.Cell>
|
||||
{#if args.length}
|
||||
{#each args as arg}
|
||||
<Table.Header.Cell column={arg} {root}>{arg}</Table.Header.Cell>
|
||||
{/each}
|
||||
{/if}
|
||||
</svelte:fragment>
|
||||
{#each paginatedItems as doc}
|
||||
<Table.Row.Link
|
||||
{root}
|
||||
href={`${base}/project-${page.params.region}-${page.params.project}/databases/database-${databaseId}/table-${selectedRelationship.relatedTable}/row-${doc.$id}`}
|
||||
on:click={() => (show = false)}>
|
||||
<Table.Cell column="$id" {root}>
|
||||
<Id value={doc.$id}>{doc.$id}</Id>
|
||||
</Table.Cell>
|
||||
{#if args.length}
|
||||
{#each args as arg}
|
||||
<Table.Cell column={arg} {root}>{doc[arg]}</Table.Cell>
|
||||
{/each}
|
||||
{/if}
|
||||
</Table.Row.Link>
|
||||
{/each}
|
||||
</Table.Root>
|
||||
{/snippet}
|
||||
</Paginator>
|
||||
{/if}
|
||||
</Modal>
|
||||
Reference in New Issue
Block a user