2020-11-25 05:31:34 -07:00
|
|
|
<template>
|
|
|
|
<FormBase>
|
|
|
|
<FormKeyValueView>
|
|
|
|
<template #key>ID</template>
|
2020-12-18 18:55:52 -07:00
|
|
|
<template #value><span class="_monospace">{{ $i.id }}</span></template>
|
2020-11-25 05:31:34 -07:00
|
|
|
</FormKeyValueView>
|
|
|
|
|
|
|
|
<FormGroup>
|
|
|
|
<FormKeyValueView>
|
|
|
|
<template #key>{{ $t('registeredDate') }}</template>
|
2020-12-18 18:55:52 -07:00
|
|
|
<template #value><MkTime :time="$i.createdAt" mode="detail"/></template>
|
2020-11-25 05:31:34 -07:00
|
|
|
</FormKeyValueView>
|
|
|
|
</FormGroup>
|
|
|
|
|
|
|
|
<FormGroup v-if="stats">
|
|
|
|
<template #label>{{ $t('statistics') }}</template>
|
|
|
|
<FormKeyValueView>
|
|
|
|
<template #key>{{ $t('notesCount') }}</template>
|
|
|
|
<template #value>{{ number(stats.notesCount) }}</template>
|
|
|
|
</FormKeyValueView>
|
|
|
|
<FormKeyValueView>
|
|
|
|
<template #key>{{ $t('repliesCount') }}</template>
|
|
|
|
<template #value>{{ number(stats.repliesCount) }}</template>
|
|
|
|
</FormKeyValueView>
|
|
|
|
<FormKeyValueView>
|
|
|
|
<template #key>{{ $t('renotesCount') }}</template>
|
|
|
|
<template #value>{{ number(stats.renotesCount) }}</template>
|
|
|
|
</FormKeyValueView>
|
|
|
|
<FormKeyValueView>
|
|
|
|
<template #key>{{ $t('repliedCount') }}</template>
|
|
|
|
<template #value>{{ number(stats.repliedCount) }}</template>
|
|
|
|
</FormKeyValueView>
|
|
|
|
<FormKeyValueView>
|
|
|
|
<template #key>{{ $t('renotedCount') }}</template>
|
|
|
|
<template #value>{{ number(stats.renotedCount) }}</template>
|
|
|
|
</FormKeyValueView>
|
|
|
|
<FormKeyValueView>
|
|
|
|
<template #key>{{ $t('pollVotesCount') }}</template>
|
|
|
|
<template #value>{{ number(stats.pollVotesCount) }}</template>
|
|
|
|
</FormKeyValueView>
|
|
|
|
<FormKeyValueView>
|
|
|
|
<template #key>{{ $t('pollVotedCount') }}</template>
|
|
|
|
<template #value>{{ number(stats.pollVotedCount) }}</template>
|
|
|
|
</FormKeyValueView>
|
|
|
|
<FormKeyValueView>
|
|
|
|
<template #key>{{ $t('sentReactionsCount') }}</template>
|
|
|
|
<template #value>{{ number(stats.sentReactionsCount) }}</template>
|
|
|
|
</FormKeyValueView>
|
|
|
|
<FormKeyValueView>
|
|
|
|
<template #key>{{ $t('receivedReactionsCount') }}</template>
|
|
|
|
<template #value>{{ number(stats.receivedReactionsCount) }}</template>
|
|
|
|
</FormKeyValueView>
|
|
|
|
<FormKeyValueView>
|
|
|
|
<template #key>{{ $t('noteFavoritesCount') }}</template>
|
|
|
|
<template #value>{{ number(stats.noteFavoritesCount) }}</template>
|
|
|
|
</FormKeyValueView>
|
|
|
|
<FormKeyValueView>
|
|
|
|
<template #key>{{ $t('followingCount') }}</template>
|
|
|
|
<template #value>{{ number(stats.followingCount) }}</template>
|
|
|
|
</FormKeyValueView>
|
|
|
|
<FormKeyValueView>
|
|
|
|
<template #key>{{ $t('followingCount') }} ({{ $t('local') }})</template>
|
|
|
|
<template #value>{{ number(stats.localFollowingCount) }}</template>
|
|
|
|
</FormKeyValueView>
|
|
|
|
<FormKeyValueView>
|
|
|
|
<template #key>{{ $t('followingCount') }} ({{ $t('remote') }})</template>
|
|
|
|
<template #value>{{ number(stats.remoteFollowingCount) }}</template>
|
|
|
|
</FormKeyValueView>
|
|
|
|
<FormKeyValueView>
|
|
|
|
<template #key>{{ $t('followersCount') }}</template>
|
|
|
|
<template #value>{{ number(stats.followersCount) }}</template>
|
|
|
|
</FormKeyValueView>
|
|
|
|
<FormKeyValueView>
|
|
|
|
<template #key>{{ $t('followersCount') }} ({{ $t('local') }})</template>
|
|
|
|
<template #value>{{ number(stats.localFollowersCount) }}</template>
|
|
|
|
</FormKeyValueView>
|
|
|
|
<FormKeyValueView>
|
|
|
|
<template #key>{{ $t('followersCount') }} ({{ $t('remote') }})</template>
|
|
|
|
<template #value>{{ number(stats.remoteFollowersCount) }}</template>
|
|
|
|
</FormKeyValueView>
|
|
|
|
<FormKeyValueView>
|
|
|
|
<template #key>{{ $t('pageLikesCount') }}</template>
|
|
|
|
<template #value>{{ number(stats.pageLikesCount) }}</template>
|
|
|
|
</FormKeyValueView>
|
|
|
|
<FormKeyValueView>
|
|
|
|
<template #key>{{ $t('pageLikedCount') }}</template>
|
|
|
|
<template #value>{{ number(stats.pageLikedCount) }}</template>
|
|
|
|
</FormKeyValueView>
|
|
|
|
<FormKeyValueView>
|
|
|
|
<template #key>{{ $t('driveFilesCount') }}</template>
|
|
|
|
<template #value>{{ number(stats.driveFilesCount) }}</template>
|
|
|
|
</FormKeyValueView>
|
|
|
|
<FormKeyValueView>
|
|
|
|
<template #key>{{ $t('driveUsage') }}</template>
|
|
|
|
<template #value>{{ bytes(stats.driveUsage) }}</template>
|
|
|
|
</FormKeyValueView>
|
|
|
|
<FormKeyValueView>
|
|
|
|
<template #key>{{ $t('reversiCount') }}</template>
|
|
|
|
<template #value>{{ number(stats.reversiCount) }}</template>
|
|
|
|
</FormKeyValueView>
|
|
|
|
</FormGroup>
|
|
|
|
|
|
|
|
<FormGroup>
|
|
|
|
<template #label>{{ $t('other') }}</template>
|
|
|
|
<FormKeyValueView>
|
|
|
|
<template #key>emailVerified</template>
|
2020-12-18 18:55:52 -07:00
|
|
|
<template #value>{{ $i.emailVerified ? $t('yes') : $t('no') }}</template>
|
2020-11-25 05:31:34 -07:00
|
|
|
</FormKeyValueView>
|
|
|
|
<FormKeyValueView>
|
|
|
|
<template #key>twoFactorEnabled</template>
|
2020-12-18 18:55:52 -07:00
|
|
|
<template #value>{{ $i.twoFactorEnabled ? $t('yes') : $t('no') }}</template>
|
2020-11-25 05:31:34 -07:00
|
|
|
</FormKeyValueView>
|
|
|
|
<FormKeyValueView>
|
|
|
|
<template #key>securityKeys</template>
|
2020-12-18 18:55:52 -07:00
|
|
|
<template #value>{{ $i.securityKeys ? $t('yes') : $t('no') }}</template>
|
2020-11-25 05:31:34 -07:00
|
|
|
</FormKeyValueView>
|
|
|
|
<FormKeyValueView>
|
|
|
|
<template #key>usePasswordLessLogin</template>
|
2020-12-18 18:55:52 -07:00
|
|
|
<template #value>{{ $i.usePasswordLessLogin ? $t('yes') : $t('no') }}</template>
|
2020-11-25 05:31:34 -07:00
|
|
|
</FormKeyValueView>
|
|
|
|
<FormKeyValueView>
|
|
|
|
<template #key>isModerator</template>
|
2020-12-18 18:55:52 -07:00
|
|
|
<template #value>{{ $i.isModerator ? $t('yes') : $t('no') }}</template>
|
2020-11-25 05:31:34 -07:00
|
|
|
</FormKeyValueView>
|
|
|
|
<FormKeyValueView>
|
|
|
|
<template #key>isAdmin</template>
|
2020-12-18 18:55:52 -07:00
|
|
|
<template #value>{{ $i.isAdmin ? $t('yes') : $t('no') }}</template>
|
2020-11-25 05:31:34 -07:00
|
|
|
</FormKeyValueView>
|
|
|
|
</FormGroup>
|
|
|
|
</FormBase>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
import { defineAsyncComponent, defineComponent } from 'vue';
|
|
|
|
import { faInfoCircle } from '@fortawesome/free-solid-svg-icons';
|
|
|
|
import FormSwitch from '@/components/form/switch.vue';
|
|
|
|
import FormSelect from '@/components/form/select.vue';
|
|
|
|
import FormLink from '@/components/form/link.vue';
|
|
|
|
import FormBase from '@/components/form/base.vue';
|
|
|
|
import FormGroup from '@/components/form/group.vue';
|
|
|
|
import FormButton from '@/components/form/button.vue';
|
|
|
|
import FormKeyValueView from '@/components/form/key-value-view.vue';
|
|
|
|
import * as os from '@/os';
|
|
|
|
import number from '@/filters/number';
|
|
|
|
import bytes from '@/filters/bytes';
|
|
|
|
|
|
|
|
export default defineComponent({
|
|
|
|
components: {
|
|
|
|
FormBase,
|
|
|
|
FormSelect,
|
|
|
|
FormSwitch,
|
|
|
|
FormButton,
|
|
|
|
FormLink,
|
|
|
|
FormGroup,
|
|
|
|
FormKeyValueView,
|
|
|
|
},
|
|
|
|
|
|
|
|
emits: ['info'],
|
|
|
|
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
INFO: {
|
|
|
|
title: this.$t('accountInfo'),
|
|
|
|
icon: faInfoCircle
|
|
|
|
},
|
|
|
|
stats: null
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
mounted() {
|
|
|
|
this.$emit('info', this.INFO);
|
|
|
|
|
|
|
|
os.api('users/stats', {
|
2020-12-18 18:55:52 -07:00
|
|
|
userId: this.$i.id
|
2020-11-25 05:31:34 -07:00
|
|
|
}).then(stats => {
|
|
|
|
this.stats = stats;
|
|
|
|
});
|
|
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
|
|
|
number,
|
|
|
|
bytes,
|
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|