This commit is contained in:
syuilo 2022-01-04 21:37:16 +09:00
parent 89053d5747
commit 76b2561893
2 changed files with 79 additions and 102 deletions

View file

@ -1,28 +1,18 @@
<template> <template>
<FormBase> <MkSpacer :content-max="700" :margin-min="16" :margin-max="32">
<FormSuspense v-slot="{ result: database }" :p="databasePromiseFactory"> <FormSuspense v-slot="{ result: database }" :p="databasePromiseFactory">
<FormGroup v-for="table in database" :key="table[0]"> <MkKeyValue v-for="table in database" :key="table[0]" oneline style="margin: 1em 0;">
<template #label>{{ table[0] }}</template> <template #key>{{ table[0] }}</template>
<FormKeyValueView> <template #value>{{ bytes(table[1].size) }} ({{ number(table[1].count) }} recs)</template>
<template #key>Size</template> </MkKeyValue>
<template #value>{{ bytes(table[1].size) }}</template>
</FormKeyValueView>
<FormKeyValueView>
<template #key>Records</template>
<template #value>{{ number(table[1].count) }}</template>
</FormKeyValueView>
</FormGroup>
</FormSuspense> </FormSuspense>
</FormBase> </MkSpacer>
</template> </template>
<script lang="ts"> <script lang="ts">
import { defineComponent } from 'vue'; import { defineComponent } from 'vue';
import FormSuspense from '@/components/debobigego/suspense.vue'; import FormSuspense from '@/components/form/suspense.vue';
import FormKeyValueView from '@/components/debobigego/key-value-view.vue'; import MkKeyValue from '@/components/key-value.vue';
import FormLink from '@/components/debobigego/link.vue';
import FormBase from '@/components/debobigego/base.vue';
import FormGroup from '@/components/debobigego/group.vue';
import * as os from '@/os'; import * as os from '@/os';
import * as symbols from '@/symbols'; import * as symbols from '@/symbols';
import bytes from '@/filters/bytes'; import bytes from '@/filters/bytes';
@ -31,10 +21,7 @@ import number from '@/filters/number';
export default defineComponent({ export default defineComponent({
components: { components: {
FormSuspense, FormSuspense,
FormKeyValueView, MkKeyValue,
FormBase,
FormGroup,
FormLink,
}, },
emits: ['info'], emits: ['info'],

View file

@ -1,144 +1,139 @@
<template> <template>
<FormBase> <div class="_formRoot">
<FormKeyValueView> <MkKeyValue>
<template #key>ID</template> <template #key>ID</template>
<template #value><span class="_monospace">{{ $i.id }}</span></template> <template #value><span class="_monospace">{{ $i.id }}</span></template>
</FormKeyValueView> </MkKeyValue>
<FormGroup> <FormSection>
<FormKeyValueView> <MkKeyValue>
<template #key>{{ $ts.registeredDate }}</template> <template #key>{{ $ts.registeredDate }}</template>
<template #value><MkTime :time="$i.createdAt" mode="detail"/></template> <template #value><MkTime :time="$i.createdAt" mode="detail"/></template>
</FormKeyValueView> </MkKeyValue>
</FormGroup> </FormSection>
<FormGroup v-if="stats"> <FormSection v-if="stats">
<template #label>{{ $ts.statistics }}</template> <template #label>{{ $ts.statistics }}</template>
<FormKeyValueView> <MkKeyValue oneline style="margin: 1em 0;">
<template #key>{{ $ts.notesCount }}</template> <template #key>{{ $ts.notesCount }}</template>
<template #value>{{ number(stats.notesCount) }}</template> <template #value>{{ number(stats.notesCount) }}</template>
</FormKeyValueView> </MkKeyValue>
<FormKeyValueView> <MkKeyValue oneline style="margin: 1em 0;">
<template #key>{{ $ts.repliesCount }}</template> <template #key>{{ $ts.repliesCount }}</template>
<template #value>{{ number(stats.repliesCount) }}</template> <template #value>{{ number(stats.repliesCount) }}</template>
</FormKeyValueView> </MkKeyValue>
<FormKeyValueView> <MkKeyValue oneline style="margin: 1em 0;">
<template #key>{{ $ts.renotesCount }}</template> <template #key>{{ $ts.renotesCount }}</template>
<template #value>{{ number(stats.renotesCount) }}</template> <template #value>{{ number(stats.renotesCount) }}</template>
</FormKeyValueView> </MkKeyValue>
<FormKeyValueView> <MkKeyValue oneline style="margin: 1em 0;">
<template #key>{{ $ts.repliedCount }}</template> <template #key>{{ $ts.repliedCount }}</template>
<template #value>{{ number(stats.repliedCount) }}</template> <template #value>{{ number(stats.repliedCount) }}</template>
</FormKeyValueView> </MkKeyValue>
<FormKeyValueView> <MkKeyValue oneline style="margin: 1em 0;">
<template #key>{{ $ts.renotedCount }}</template> <template #key>{{ $ts.renotedCount }}</template>
<template #value>{{ number(stats.renotedCount) }}</template> <template #value>{{ number(stats.renotedCount) }}</template>
</FormKeyValueView> </MkKeyValue>
<FormKeyValueView> <MkKeyValue oneline style="margin: 1em 0;">
<template #key>{{ $ts.pollVotesCount }}</template> <template #key>{{ $ts.pollVotesCount }}</template>
<template #value>{{ number(stats.pollVotesCount) }}</template> <template #value>{{ number(stats.pollVotesCount) }}</template>
</FormKeyValueView> </MkKeyValue>
<FormKeyValueView> <MkKeyValue oneline style="margin: 1em 0;">
<template #key>{{ $ts.pollVotedCount }}</template> <template #key>{{ $ts.pollVotedCount }}</template>
<template #value>{{ number(stats.pollVotedCount) }}</template> <template #value>{{ number(stats.pollVotedCount) }}</template>
</FormKeyValueView> </MkKeyValue>
<FormKeyValueView> <MkKeyValue oneline style="margin: 1em 0;">
<template #key>{{ $ts.sentReactionsCount }}</template> <template #key>{{ $ts.sentReactionsCount }}</template>
<template #value>{{ number(stats.sentReactionsCount) }}</template> <template #value>{{ number(stats.sentReactionsCount) }}</template>
</FormKeyValueView> </MkKeyValue>
<FormKeyValueView> <MkKeyValue oneline style="margin: 1em 0;">
<template #key>{{ $ts.receivedReactionsCount }}</template> <template #key>{{ $ts.receivedReactionsCount }}</template>
<template #value>{{ number(stats.receivedReactionsCount) }}</template> <template #value>{{ number(stats.receivedReactionsCount) }}</template>
</FormKeyValueView> </MkKeyValue>
<FormKeyValueView> <MkKeyValue oneline style="margin: 1em 0;">
<template #key>{{ $ts.noteFavoritesCount }}</template> <template #key>{{ $ts.noteFavoritesCount }}</template>
<template #value>{{ number(stats.noteFavoritesCount) }}</template> <template #value>{{ number(stats.noteFavoritesCount) }}</template>
</FormKeyValueView> </MkKeyValue>
<FormKeyValueView> <MkKeyValue oneline style="margin: 1em 0;">
<template #key>{{ $ts.followingCount }}</template> <template #key>{{ $ts.followingCount }}</template>
<template #value>{{ number(stats.followingCount) }}</template> <template #value>{{ number(stats.followingCount) }}</template>
</FormKeyValueView> </MkKeyValue>
<FormKeyValueView> <MkKeyValue oneline style="margin: 1em 0;">
<template #key>{{ $ts.followingCount }} ({{ $ts.local }})</template> <template #key>{{ $ts.followingCount }} ({{ $ts.local }})</template>
<template #value>{{ number(stats.localFollowingCount) }}</template> <template #value>{{ number(stats.localFollowingCount) }}</template>
</FormKeyValueView> </MkKeyValue>
<FormKeyValueView> <MkKeyValue oneline style="margin: 1em 0;">
<template #key>{{ $ts.followingCount }} ({{ $ts.remote }})</template> <template #key>{{ $ts.followingCount }} ({{ $ts.remote }})</template>
<template #value>{{ number(stats.remoteFollowingCount) }}</template> <template #value>{{ number(stats.remoteFollowingCount) }}</template>
</FormKeyValueView> </MkKeyValue>
<FormKeyValueView> <MkKeyValue oneline style="margin: 1em 0;">
<template #key>{{ $ts.followersCount }}</template> <template #key>{{ $ts.followersCount }}</template>
<template #value>{{ number(stats.followersCount) }}</template> <template #value>{{ number(stats.followersCount) }}</template>
</FormKeyValueView> </MkKeyValue>
<FormKeyValueView> <MkKeyValue oneline style="margin: 1em 0;">
<template #key>{{ $ts.followersCount }} ({{ $ts.local }})</template> <template #key>{{ $ts.followersCount }} ({{ $ts.local }})</template>
<template #value>{{ number(stats.localFollowersCount) }}</template> <template #value>{{ number(stats.localFollowersCount) }}</template>
</FormKeyValueView> </MkKeyValue>
<FormKeyValueView> <MkKeyValue oneline style="margin: 1em 0;">
<template #key>{{ $ts.followersCount }} ({{ $ts.remote }})</template> <template #key>{{ $ts.followersCount }} ({{ $ts.remote }})</template>
<template #value>{{ number(stats.remoteFollowersCount) }}</template> <template #value>{{ number(stats.remoteFollowersCount) }}</template>
</FormKeyValueView> </MkKeyValue>
<FormKeyValueView> <MkKeyValue oneline style="margin: 1em 0;">
<template #key>{{ $ts.pageLikesCount }}</template> <template #key>{{ $ts.pageLikesCount }}</template>
<template #value>{{ number(stats.pageLikesCount) }}</template> <template #value>{{ number(stats.pageLikesCount) }}</template>
</FormKeyValueView> </MkKeyValue>
<FormKeyValueView> <MkKeyValue oneline style="margin: 1em 0;">
<template #key>{{ $ts.pageLikedCount }}</template> <template #key>{{ $ts.pageLikedCount }}</template>
<template #value>{{ number(stats.pageLikedCount) }}</template> <template #value>{{ number(stats.pageLikedCount) }}</template>
</FormKeyValueView> </MkKeyValue>
<FormKeyValueView> <MkKeyValue oneline style="margin: 1em 0;">
<template #key>{{ $ts.driveFilesCount }}</template> <template #key>{{ $ts.driveFilesCount }}</template>
<template #value>{{ number(stats.driveFilesCount) }}</template> <template #value>{{ number(stats.driveFilesCount) }}</template>
</FormKeyValueView> </MkKeyValue>
<FormKeyValueView> <MkKeyValue oneline style="margin: 1em 0;">
<template #key>{{ $ts.driveUsage }}</template> <template #key>{{ $ts.driveUsage }}</template>
<template #value>{{ bytes(stats.driveUsage) }}</template> <template #value>{{ bytes(stats.driveUsage) }}</template>
</FormKeyValueView> </MkKeyValue>
<FormKeyValueView> <MkKeyValue oneline style="margin: 1em 0;">
<template #key>{{ $ts.reversiCount }}</template> <template #key>{{ $ts.reversiCount }}</template>
<template #value>{{ number(stats.reversiCount) }}</template> <template #value>{{ number(stats.reversiCount) }}</template>
</FormKeyValueView> </MkKeyValue>
</FormGroup> </FormSection>
<FormGroup> <FormSection>
<template #label>{{ $ts.other }}</template> <template #label>{{ $ts.other }}</template>
<FormKeyValueView> <MkKeyValue oneline style="margin: 1em 0;">
<template #key>emailVerified</template> <template #key>emailVerified</template>
<template #value>{{ $i.emailVerified ? $ts.yes : $ts.no }}</template> <template #value>{{ $i.emailVerified ? $ts.yes : $ts.no }}</template>
</FormKeyValueView> </MkKeyValue>
<FormKeyValueView> <MkKeyValue oneline style="margin: 1em 0;">
<template #key>twoFactorEnabled</template> <template #key>twoFactorEnabled</template>
<template #value>{{ $i.twoFactorEnabled ? $ts.yes : $ts.no }}</template> <template #value>{{ $i.twoFactorEnabled ? $ts.yes : $ts.no }}</template>
</FormKeyValueView> </MkKeyValue>
<FormKeyValueView> <MkKeyValue oneline style="margin: 1em 0;">
<template #key>securityKeys</template> <template #key>securityKeys</template>
<template #value>{{ $i.securityKeys ? $ts.yes : $ts.no }}</template> <template #value>{{ $i.securityKeys ? $ts.yes : $ts.no }}</template>
</FormKeyValueView> </MkKeyValue>
<FormKeyValueView> <MkKeyValue oneline style="margin: 1em 0;">
<template #key>usePasswordLessLogin</template> <template #key>usePasswordLessLogin</template>
<template #value>{{ $i.usePasswordLessLogin ? $ts.yes : $ts.no }}</template> <template #value>{{ $i.usePasswordLessLogin ? $ts.yes : $ts.no }}</template>
</FormKeyValueView> </MkKeyValue>
<FormKeyValueView> <MkKeyValue oneline style="margin: 1em 0;">
<template #key>isModerator</template> <template #key>isModerator</template>
<template #value>{{ $i.isModerator ? $ts.yes : $ts.no }}</template> <template #value>{{ $i.isModerator ? $ts.yes : $ts.no }}</template>
</FormKeyValueView> </MkKeyValue>
<FormKeyValueView> <MkKeyValue oneline style="margin: 1em 0;">
<template #key>isAdmin</template> <template #key>isAdmin</template>
<template #value>{{ $i.isAdmin ? $ts.yes : $ts.no }}</template> <template #value>{{ $i.isAdmin ? $ts.yes : $ts.no }}</template>
</FormKeyValueView> </MkKeyValue>
</FormGroup> </FormSection>
</FormBase> </div>
</template> </template>
<script lang="ts"> <script lang="ts">
import { defineAsyncComponent, defineComponent } from 'vue'; import { defineAsyncComponent, defineComponent } from 'vue';
import FormSwitch from '@/components/form/switch.vue'; import FormSection from '@/components/form/section.vue';
import FormSelect from '@/components/form/select.vue'; import MkKeyValue from '@/components/key-value.vue';
import FormLink from '@/components/debobigego/link.vue';
import FormBase from '@/components/debobigego/base.vue';
import FormGroup from '@/components/debobigego/group.vue';
import FormButton from '@/components/debobigego/button.vue';
import FormKeyValueView from '@/components/debobigego/key-value-view.vue';
import * as os from '@/os'; import * as os from '@/os';
import number from '@/filters/number'; import number from '@/filters/number';
import bytes from '@/filters/bytes'; import bytes from '@/filters/bytes';
@ -146,13 +141,8 @@ import * as symbols from '@/symbols';
export default defineComponent({ export default defineComponent({
components: { components: {
FormBase, FormSection,
FormSelect, MkKeyValue,
FormSwitch,
FormButton,
FormLink,
FormGroup,
FormKeyValueView,
}, },
emits: ['info'], emits: ['info'],