mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
Fix: reactivity of collections header
This commit is contained in:
+52
-40
@@ -8,46 +8,58 @@
|
||||
import { collection } from './store';
|
||||
import { isTabletViewport } from '$lib/stores/viewport';
|
||||
|
||||
$: projectId = page.params.project;
|
||||
$: databaseId = page.params.database;
|
||||
$: collectionId = page.params.collection;
|
||||
$: path = `${base}/project-${projectId}/databases/database-${databaseId}/collection-${collectionId}`;
|
||||
$: tabs = [
|
||||
{
|
||||
href: path,
|
||||
title: 'Documents',
|
||||
event: 'documents',
|
||||
hasChildren: true
|
||||
},
|
||||
{
|
||||
href: `${path}/attributes`,
|
||||
title: 'Attributes',
|
||||
event: 'attributes'
|
||||
},
|
||||
{
|
||||
href: `${path}/indexes`,
|
||||
title: 'Indexes',
|
||||
event: 'indexes'
|
||||
},
|
||||
{
|
||||
href: `${path}/activity`,
|
||||
title: 'Activity',
|
||||
event: 'activity',
|
||||
hasChildren: true
|
||||
},
|
||||
{
|
||||
href: `${path}/usage`,
|
||||
title: 'Usage',
|
||||
event: 'usage',
|
||||
hasChildren: true
|
||||
},
|
||||
{
|
||||
href: `${path}/settings`,
|
||||
title: 'Settings',
|
||||
event: 'settings',
|
||||
disabled: !$canWriteCollections
|
||||
}
|
||||
].filter((tab) => !tab.disabled);
|
||||
let projectId = $derived.by(() => {
|
||||
return page.params.project;
|
||||
});
|
||||
let databaseId = $derived.by(() => {
|
||||
return page.params.database;
|
||||
});
|
||||
let collectionId = $derived.by(() => {
|
||||
return page.params.collection;
|
||||
});
|
||||
|
||||
let path = $derived.by(() => {
|
||||
return `${base}/project-${projectId}/databases/database-${databaseId}/collection-${collectionId}`;
|
||||
});
|
||||
|
||||
let tabs = $derived.by(() => {
|
||||
return [
|
||||
{
|
||||
href: path,
|
||||
title: 'Documents',
|
||||
event: 'documents',
|
||||
hasChildren: true
|
||||
},
|
||||
{
|
||||
href: `${path}/attributes`,
|
||||
title: 'Attributes',
|
||||
event: 'attributes'
|
||||
},
|
||||
{
|
||||
href: `${path}/indexes`,
|
||||
title: 'Indexes',
|
||||
event: 'indexes'
|
||||
},
|
||||
{
|
||||
href: `${path}/activity`,
|
||||
title: 'Activity',
|
||||
event: 'activity',
|
||||
hasChildren: true
|
||||
},
|
||||
{
|
||||
href: `${path}/usage`,
|
||||
title: 'Usage',
|
||||
event: 'usage',
|
||||
hasChildren: true
|
||||
},
|
||||
{
|
||||
href: `${path}/settings`,
|
||||
title: 'Settings',
|
||||
event: 'settings',
|
||||
disabled: !$canWriteCollections
|
||||
}
|
||||
].filter((tab) => !tab.disabled);
|
||||
});
|
||||
</script>
|
||||
|
||||
<div style:margin-top={$isTabletViewport ? '48px' : 0}>
|
||||
|
||||
Reference in New Issue
Block a user