mirror of
https://github.com/appwrite/console.git
synced 2026-11-18 20:47:21 +00:00
refactor(databases): remove DocumentsDB collection usage page
The per-service DocumentsDB usage endpoints were removed in cloud (appwrite-labs/cloud#4679, 'remove per-service /usage endpoints') as they duplicated the org/project usage surface. The console collection usage page was the only consumer of documentsDB.getCollectionUsage, so remove it and its command-center 'Go to usage' entry. Database/table/project usage pages are unaffected (they use the retained tablesDB.* usage endpoints).
This commit is contained in:
1 parent
c9543b208d
commit
b3f0cc9533
3 files changed
-38
No files matched your search
-9
@@ -137,15 +137,6 @@
|
||||
disabled: page.url.pathname.endsWith('indexes'),
|
||||
group: 'collections'
|
||||
},
|
||||
{
|
||||
label: 'Go to usage',
|
||||
keys: ['g', 'u'],
|
||||
callback() {
|
||||
goto(withPath(basePath, '/usage'));
|
||||
},
|
||||
disabled: page.url.pathname.endsWith('usage'),
|
||||
group: 'collections'
|
||||
},
|
||||
{
|
||||
label: 'Go to settings',
|
||||
keys: ['g', 's'],
|
||||
|
||||
-11
@@ -1,11 +0,0 @@
|
||||
<script lang="ts">
|
||||
import type { PageProps } from './$types';
|
||||
import { Usage } from '$database/(entity)';
|
||||
|
||||
let { data }: PageProps = $props();
|
||||
|
||||
const count = $derived(data.documents);
|
||||
const total = $derived(data.documentsTotal);
|
||||
</script>
|
||||
|
||||
<Usage {count} {total} />
|
||||
-18
@@ -1,18 +0,0 @@
|
||||
import { isValueOfStringEnum } from '$lib/helpers/types';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { UsageRange } from '@appwrite.io/console';
|
||||
import type { PageLoad } from './$types';
|
||||
|
||||
export const load: PageLoad = async ({ params }) => {
|
||||
const period = isValueOfStringEnum(UsageRange, params.period)
|
||||
? params.period
|
||||
: UsageRange.ThirtyDays;
|
||||
|
||||
return {
|
||||
...(await sdk.forProject(params.region, params.project).documentsDB.getCollectionUsage({
|
||||
databaseId: params.database,
|
||||
collectionId: params.collection,
|
||||
range: period
|
||||
}))
|
||||
};
|
||||
};
|
||||
Reference in new issue
Block a user