2022-12-19 04:01:30 -06:00
|
|
|
<template>
|
|
|
|
<MkStickyContainer>
|
2022-06-20 03:38:49 -05:00
|
|
|
<template #header><MkPageHeader :actions="headerActions" :tabs="headerTabs"/></template>
|
2023-05-19 06:52:15 -05:00
|
|
|
<MkSpacer :contentMax="800" :marginMin="16" :marginMax="32">
|
2022-12-19 04:01:30 -06:00
|
|
|
<FormSuspense v-slot="{ result: database }" :p="databasePromiseFactory">
|
|
|
|
<MkKeyValue v-for="table in database" :key="table[0]" oneline style="margin: 1em 0;">
|
|
|
|
<template #key>{{ table[0] }}</template>
|
|
|
|
<template #value>{{ bytes(table[1].size) }} ({{ number(table[1].count) }} recs)</template>
|
|
|
|
</MkKeyValue>
|
|
|
|
</FormSuspense>
|
|
|
|
</MkSpacer>
|
|
|
|
</MkStickyContainer>
|
2021-04-22 08:29:33 -05:00
|
|
|
</template>
|
|
|
|
|
2022-05-14 07:35:08 -05:00
|
|
|
<script lang="ts" setup>
|
|
|
|
import { } from 'vue';
|
2022-01-04 06:37:16 -06:00
|
|
|
import FormSuspense from '@/components/form/suspense.vue';
|
2022-08-30 10:24:33 -05:00
|
|
|
import MkKeyValue from '@/components/MkKeyValue.vue';
|
2021-11-11 11:02:25 -06:00
|
|
|
import * as os from '@/os';
|
|
|
|
import bytes from '@/filters/bytes';
|
|
|
|
import number from '@/filters/number';
|
2022-05-14 07:35:08 -05:00
|
|
|
import { i18n } from '@/i18n';
|
2022-06-20 03:38:49 -05:00
|
|
|
import { definePageMetadata } from '@/scripts/page-metadata';
|
2021-04-22 08:29:33 -05:00
|
|
|
|
2022-05-14 07:35:08 -05:00
|
|
|
const databasePromiseFactory = () => os.api('admin/get-table-stats').then(res => Object.entries(res).sort((a, b) => b[1].size - a[1].size));
|
2021-04-22 08:29:33 -05:00
|
|
|
|
2022-06-20 03:38:49 -05:00
|
|
|
const headerActions = $computed(() => []);
|
|
|
|
|
|
|
|
const headerTabs = $computed(() => []);
|
|
|
|
|
|
|
|
definePageMetadata({
|
|
|
|
title: i18n.ts.database,
|
2022-12-19 04:01:30 -06:00
|
|
|
icon: 'ti ti-database',
|
2021-04-22 08:29:33 -05:00
|
|
|
});
|
|
|
|
</script>
|