diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2021-10-22 17:37:51 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2021-10-22 17:37:51 +0900 |
| commit | 81a0ee4b2d089b9266d79595707a28f655f5cb27 (patch) | |
| tree | 769ee1d2fe4ab72abe74008eafe49297ee152a5b /src/client/pages/admin/database.vue | |
| parent | tweak ui (diff) | |
| download | misskey-81a0ee4b2d089b9266d79595707a28f655f5cb27.tar.gz misskey-81a0ee4b2d089b9266d79595707a28f655f5cb27.tar.bz2 misskey-81a0ee4b2d089b9266d79595707a28f655f5cb27.zip | |
client: change url /instance -> /admin
Diffstat (limited to 'src/client/pages/admin/database.vue')
| -rw-r--r-- | src/client/pages/admin/database.vue | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/src/client/pages/admin/database.vue b/src/client/pages/admin/database.vue new file mode 100644 index 0000000000..ffbeed8b30 --- /dev/null +++ b/src/client/pages/admin/database.vue @@ -0,0 +1,61 @@ +<template> +<FormBase> + <FormSuspense :p="databasePromiseFactory" v-slot="{ result: database }"> + <FormGroup v-for="table in database" :key="table[0]"> + <template #label>{{ table[0] }}</template> + <FormKeyValueView> + <template #key>Size</template> + <template #value>{{ bytes(table[1].size) }}</template> + </FormKeyValueView> + <FormKeyValueView> + <template #key>Records</template> + <template #value>{{ number(table[1].count) }}</template> + </FormKeyValueView> + </FormGroup> + </FormSuspense> +</FormBase> +</template> + +<script lang="ts"> +import { defineComponent } from 'vue'; +import FormSuspense from '@client/components/debobigego/suspense.vue'; +import FormKeyValueView from '@client/components/debobigego/key-value-view.vue'; +import FormLink from '@client/components/debobigego/link.vue'; +import FormBase from '@client/components/debobigego/base.vue'; +import FormGroup from '@client/components/debobigego/group.vue'; +import * as os from '@client/os'; +import * as symbols from '@client/symbols'; +import bytes from '@client/filters/bytes'; +import number from '@client/filters/number'; + +export default defineComponent({ + components: { + FormSuspense, + FormKeyValueView, + FormBase, + FormGroup, + FormLink, + }, + + emits: ['info'], + + data() { + return { + [symbols.PAGE_INFO]: { + title: this.$ts.database, + icon: 'fas fa-database', + bg: 'var(--bg)', + }, + databasePromiseFactory: () => os.api('admin/get-table-stats', {}).then(res => Object.entries(res).sort((a, b) => b[1].size - a[1].size)), + } + }, + + mounted() { + this.$emit('info', this[symbols.PAGE_INFO]); + }, + + methods: { + bytes, number, + } +}); +</script> |