diff options
| author | Andreas Nedbal <github-bf215181b5140522137b3d4f6b73544a@desu.email> | 2022-05-14 14:35:08 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-05-14 21:35:08 +0900 |
| commit | 577f63c4f4d56b7d6fda6ca042821e7a0667d521 (patch) | |
| tree | d3b6020c611c73121f27cd11411bdb305132d136 /packages | |
| parent | Refactor admin/security to use Composition API (#8652) (diff) | |
| download | misskey-577f63c4f4d56b7d6fda6ca042821e7a0667d521.tar.gz misskey-577f63c4f4d56b7d6fda6ca042821e7a0667d521.tar.bz2 misskey-577f63c4f4d56b7d6fda6ca042821e7a0667d521.zip | |
Refactor admin/database to use Composition API (#8654)
* refactor(client): refactor admin/database to use Composition API
* Apply review suggestion from @Johann150
Co-authored-by: Johann150 <johann@qwertqwefsday.eu>
Co-authored-by: Johann150 <johann@qwertqwefsday.eu>
Diffstat (limited to 'packages')
| -rw-r--r-- | packages/client/src/pages/admin/database.vue | 31 |
1 files changed, 9 insertions, 22 deletions
diff --git a/packages/client/src/pages/admin/database.vue b/packages/client/src/pages/admin/database.vue index 3a835eeafa..d3519922b1 100644 --- a/packages/client/src/pages/admin/database.vue +++ b/packages/client/src/pages/admin/database.vue @@ -9,36 +9,23 @@ </MkSpacer> </template> -<script lang="ts"> -import { defineComponent } from 'vue'; +<script lang="ts" setup> +import { } from 'vue'; import FormSuspense from '@/components/form/suspense.vue'; import MkKeyValue from '@/components/key-value.vue'; import * as os from '@/os'; import * as symbols from '@/symbols'; import bytes from '@/filters/bytes'; import number from '@/filters/number'; +import { i18n } from '@/i18n'; -export default defineComponent({ - components: { - FormSuspense, - MkKeyValue, - }, +const databasePromiseFactory = () => os.api('admin/get-table-stats').then(res => Object.entries(res).sort((a, b) => b[1].size - a[1].size)); - 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)), - } - }, - - methods: { - bytes, number, +defineExpose({ + [symbols.PAGE_INFO]: { + title: i18n.ts.database, + icon: 'fas fa-database', + bg: 'var(--bg)', } }); </script> |