2023-07-26 22:31:52 -07:00
|
|
|
<!--
|
2024-02-11 18:37:45 -08:00
|
|
|
SPDX-FileCopyrightText: syuilo and misskey-project
|
2023-07-26 22:31:52 -07:00
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
-->
|
|
|
|
|
2022-12-19 02:01:30 -08:00
|
|
|
<template>
|
|
|
|
<MkStickyContainer>
|
2022-06-20 01:38:49 -07:00
|
|
|
<template #header><MkPageHeader :actions="headerActions" :tabs="headerTabs"/></template>
|
2023-05-19 04:52:15 -07:00
|
|
|
<MkSpacer :contentMax="800" :marginMin="16" :marginMax="32">
|
2022-12-19 02:01:30 -08: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 06:29:33 -07:00
|
|
|
</template>
|
|
|
|
|
2022-05-14 05:35:08 -07:00
|
|
|
<script lang="ts" setup>
|
2023-12-06 21:42:09 -08:00
|
|
|
import { computed } from 'vue';
|
2022-01-04 04:37:16 -08:00
|
|
|
import FormSuspense from '@/components/form/suspense.vue';
|
2022-08-30 08:24:33 -07:00
|
|
|
import MkKeyValue from '@/components/MkKeyValue.vue';
|
2024-01-04 01:32:46 -08:00
|
|
|
import { misskeyApi } from '@/scripts/misskey-api.js';
|
2023-09-19 00:37:43 -07:00
|
|
|
import bytes from '@/filters/bytes.js';
|
|
|
|
import number from '@/filters/number.js';
|
|
|
|
import { i18n } from '@/i18n.js';
|
|
|
|
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
2021-04-22 06:29:33 -07:00
|
|
|
|
2024-01-04 01:32:46 -08:00
|
|
|
const databasePromiseFactory = () => misskeyApi('admin/get-table-stats').then(res => Object.entries(res).sort((a, b) => b[1].size - a[1].size));
|
2021-04-22 06:29:33 -07:00
|
|
|
|
2023-12-06 21:42:09 -08:00
|
|
|
const headerActions = computed(() => []);
|
2022-06-20 01:38:49 -07:00
|
|
|
|
2023-12-06 21:42:09 -08:00
|
|
|
const headerTabs = computed(() => []);
|
2022-06-20 01:38:49 -07:00
|
|
|
|
|
|
|
definePageMetadata({
|
|
|
|
title: i18n.ts.database,
|
2022-12-19 02:01:30 -08:00
|
|
|
icon: 'ti ti-database',
|
2021-04-22 06:29:33 -07:00
|
|
|
});
|
|
|
|
</script>
|