2021-04-22 07:29:33 -06:00
|
|
|
<template>
|
2022-01-04 06:42:04 -07:00
|
|
|
<MkSpacer :content-max="800" :margin-min="16" :margin-max="32">
|
2021-11-19 03:36:12 -07:00
|
|
|
<FormSuspense v-slot="{ result: database }" :p="databasePromiseFactory">
|
2022-01-04 05:37:16 -07:00
|
|
|
<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>
|
2021-04-22 07:29:33 -06:00
|
|
|
</FormSuspense>
|
2022-01-04 05:37:16 -07:00
|
|
|
</MkSpacer>
|
2021-04-22 07:29:33 -06:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
import { defineComponent } from 'vue';
|
2022-01-04 05:37:16 -07:00
|
|
|
import FormSuspense from '@/components/form/suspense.vue';
|
|
|
|
import MkKeyValue from '@/components/key-value.vue';
|
2021-11-11 10:02:25 -07:00
|
|
|
import * as os from '@/os';
|
|
|
|
import * as symbols from '@/symbols';
|
|
|
|
import bytes from '@/filters/bytes';
|
|
|
|
import number from '@/filters/number';
|
2021-04-22 07:29:33 -06:00
|
|
|
|
|
|
|
export default defineComponent({
|
|
|
|
components: {
|
|
|
|
FormSuspense,
|
2022-01-04 05:37:16 -07:00
|
|
|
MkKeyValue,
|
2021-04-22 07:29:33 -06:00
|
|
|
},
|
|
|
|
|
|
|
|
emits: ['info'],
|
|
|
|
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
[symbols.PAGE_INFO]: {
|
|
|
|
title: this.$ts.database,
|
2021-10-10 00:19:16 -06:00
|
|
|
icon: 'fas fa-database',
|
|
|
|
bg: 'var(--bg)',
|
2021-04-22 07:29:33 -06:00
|
|
|
},
|
|
|
|
databasePromiseFactory: () => os.api('admin/get-table-stats', {}).then(res => Object.entries(res).sort((a, b) => b[1].size - a[1].size)),
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
|
|
|
bytes, number,
|
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|