mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
feat(databases): show attribute/index failed error in modal
This commit is contained in:
+22
-7
@@ -16,6 +16,7 @@
|
||||
import { Container } from '$lib/layout';
|
||||
import Create from '../createAttribute.svelte';
|
||||
import { isRelationship } from '../document-[document]/attributes/store';
|
||||
import FailedModal from '../failedModal.svelte';
|
||||
import CreateIndex from '../indexes/createIndex.svelte';
|
||||
import { attributes, type Attributes } from '../store';
|
||||
import CreateAttributeDropdown from './createAttributeDropdown.svelte';
|
||||
@@ -35,6 +36,8 @@
|
||||
let showDelete = false;
|
||||
let showEdit = false;
|
||||
let showCreateIndex = false;
|
||||
let showFailed = false;
|
||||
let error = '';
|
||||
|
||||
enum attributeFormatIcon {
|
||||
ip = 'location-marker',
|
||||
@@ -89,13 +92,24 @@
|
||||
<span class="text u-trim-1" data-private>{attribute.key}</span>
|
||||
</div>
|
||||
{#if attribute.status !== 'available'}
|
||||
<Pill
|
||||
warning={attribute.status === 'processing'}
|
||||
danger={['deleting', 'stuck', 'failed'].includes(
|
||||
attribute.status
|
||||
)}>
|
||||
{attribute.status}
|
||||
</Pill>
|
||||
<div class="u-inline-flex u-gap-12 u-cross-center">
|
||||
<Pill
|
||||
warning={attribute.status === 'processing'}
|
||||
danger={['deleting', 'stuck', 'failed'].includes(
|
||||
attribute.status
|
||||
)}>
|
||||
{attribute.status}
|
||||
</Pill>
|
||||
{#if attribute.error}
|
||||
<Button
|
||||
link
|
||||
on:click={(e) => {
|
||||
e.preventDefault();
|
||||
error = attribute.error;
|
||||
showFailed = true;
|
||||
}}>Details</Button>
|
||||
{/if}
|
||||
</div>
|
||||
{:else if attribute.required}
|
||||
<Pill>Required</Pill>
|
||||
{/if}
|
||||
@@ -214,3 +228,4 @@
|
||||
<Delete bind:showDelete {selectedAttribute} />
|
||||
<Edit bind:showEdit {selectedAttribute} />
|
||||
<CreateIndex bind:showCreateIndex externalAttribute={selectedAttribute} />
|
||||
<FailedModal bind:show={showFailed} title="Create attribute" header="Creation failed" {error} />
|
||||
|
||||
+23
-7
@@ -20,6 +20,7 @@
|
||||
import { Button } from '$lib/elements/forms';
|
||||
import CreateAttributeDropdown from '../attributes/createAttributeDropdown.svelte';
|
||||
import type { Option } from '../attributes/store';
|
||||
import FailedModal from '../failedModal.svelte';
|
||||
|
||||
let showDropdown = [];
|
||||
let selectedIndex: Models.Index = null;
|
||||
@@ -29,6 +30,8 @@
|
||||
let showCreateAttribute = false;
|
||||
let showCreateDropdown = false;
|
||||
let selectedAttribute: Option['name'] = null;
|
||||
let showFailed = false;
|
||||
let error = '';
|
||||
</script>
|
||||
|
||||
<Container>
|
||||
@@ -60,13 +63,24 @@
|
||||
<div class="u-flex u-main-space-between">
|
||||
<span class="text u-trim"> {index.key}</span>
|
||||
{#if index.status !== 'available'}
|
||||
<Pill
|
||||
warning={index.status === 'processing'}
|
||||
danger={['deleting', 'stuck', 'failed'].includes(
|
||||
index.status
|
||||
)}>
|
||||
{index.status}
|
||||
</Pill>
|
||||
<div class="u-inline-flex u-gap-12 u-cross-center">
|
||||
<Pill
|
||||
warning={index.status === 'processing'}
|
||||
danger={['deleting', 'stuck', 'failed'].includes(
|
||||
index.status
|
||||
)}>
|
||||
{index.status}
|
||||
</Pill>
|
||||
{#if index.error}
|
||||
<Button
|
||||
link
|
||||
on:click={(e) => {
|
||||
e.preventDefault();
|
||||
error = index.error;
|
||||
showFailed = true;
|
||||
}}>Details</Button>
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
</TableCell>
|
||||
@@ -162,3 +176,5 @@
|
||||
{/if}
|
||||
|
||||
<CreateAttribute bind:showCreate={showCreateAttribute} bind:selectedOption={selectedAttribute} />
|
||||
|
||||
<FailedModal bind:show={showFailed} title="Create index" header="Creation failed" {error} />
|
||||
|
||||
Reference in New Issue
Block a user