fix(databases): remove leftover per-database Usage tab

Same cleanup as #3128/#3130: removes the per-database Usage tab
(database-[database]/usage) and its command-center shortcut. It
called tablesDB.getUsage(), which is going away with the backend
usage-endpoint removal.
This commit is contained in:
harsh mahajan committed 2026-07-21 17:41:40 +05:30
1 parent 1d1eabcec7
commit ac4672ec6c
4 files changed
-76

No files matched your search

@@ -147,18 +147,6 @@
keys: ['g', 'c'],
group: 'databases'
},
{
label: 'Go to usage',
callback() {
goto(
`${base}/project-${page.params.region}-${project}/databases/database-${databaseId}/usage`
);
},
disabled:
page.url.pathname.includes('/usage') || page.url.pathname.includes('table-'),
keys: ['g', 'u'],
group: 'databases'
},
{
label: 'Go to backups',
callback() {
@@ -34,12 +34,6 @@
event: 'backups',
hasChildren: true
},
{
href: withPath(baseDatabasePath, '/usage'),
title: 'Usage',
event: 'usage',
hasChildren: true
},
{
href: withPath(baseDatabasePath, '/settings'),
event: 'settings',
@@ -1,41 +0,0 @@
<script lang="ts">
import { base } from '$app/paths';
import { page } from '$app/state';
import { clampMin } from '$lib/helpers/numbers';
import { formatNum } from '$lib/helpers/string';
import { Container, UsageMultiple } from '$lib/layout';
import type { PageProps } from './$types';
let { data }: PageProps = $props();
const reads = $derived(data.databaseReads ?? []);
const readsTotal = $derived(clampMin(reads.reduce((sum, item) => sum + item.value, 0)));
const writes = $derived(data.databaseWrites ?? []);
const writesTotal = $derived(clampMin(writes.reduce((sum, item) => sum + item.value, 0)));
const usagePath = $derived(
`${base}/project-${page.params.region}-${page.params.project}/databases/database-${page.params.database}/usage`
);
</script>
<Container databasesMainScreen>
<UsageMultiple
title="Reads and writes"
path={usagePath}
total={[readsTotal, writesTotal]}
count={[reads, writes]}
isCumulative={false}
options={{
yAxis: {
axisLabel: {
formatter: formatNum
}
}
}}
legendNumberFormat="abbreviate"
legendData={[
{ name: 'Reads', value: readsTotal },
{ name: 'Writes', value: writesTotal }
]} />
</Container>
@@ -1,17 +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).tablesDB.getUsage({
databaseId: params.database,
range: period
}))
};
};