2021-04-16 02:34:06 -06:00
|
|
|
<template>
|
|
|
|
<FormBase>
|
2021-04-22 07:29:33 -06:00
|
|
|
<FormSuspense :p="init">
|
2021-04-16 02:34:06 -06:00
|
|
|
<FormGroup>
|
2021-04-22 07:29:33 -06:00
|
|
|
<template #label><MkAcct :user="user"/></template>
|
2021-04-16 02:34:06 -06:00
|
|
|
|
2021-04-16 23:06:32 -06:00
|
|
|
<FormKeyValueView>
|
2021-04-22 07:29:33 -06:00
|
|
|
<template #key>ID</template>
|
|
|
|
<template #value><span class="_monospace">{{ user.id }}</span></template>
|
2021-04-16 23:06:32 -06:00
|
|
|
</FormKeyValueView>
|
|
|
|
|
2021-04-22 07:29:33 -06:00
|
|
|
<FormGroup>
|
|
|
|
<FormLink :to="`/user-ap-info/${user.id}`">ActivityPub</FormLink>
|
|
|
|
|
|
|
|
<FormLink v-if="user.host" :to="`/instance-info/${user.host}`">{{ $ts.instanceInfo }}<template #suffix>{{ user.host }}</template></FormLink>
|
|
|
|
<FormKeyValueView v-else>
|
|
|
|
<template #key>{{ $ts.instanceInfo }}</template>
|
|
|
|
<template #value>(Local user)</template>
|
|
|
|
</FormKeyValueView>
|
|
|
|
</FormGroup>
|
|
|
|
|
|
|
|
<FormGroup>
|
|
|
|
<FormKeyValueView>
|
|
|
|
<template #key>{{ $ts.updatedAt }}</template>
|
|
|
|
<template #value><MkTime v-if="user.lastFetchedAt" mode="detail" :time="user.lastFetchedAt"/><span v-else>N/A</span></template>
|
|
|
|
</FormKeyValueView>
|
|
|
|
</FormGroup>
|
|
|
|
|
|
|
|
<FormObjectView tall :value="user">
|
|
|
|
<span>Raw</span>
|
|
|
|
</FormObjectView>
|
|
|
|
</FormGroup>
|
|
|
|
</FormSuspense>
|
2021-04-16 02:34:06 -06:00
|
|
|
</FormBase>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
2021-04-16 06:47:12 -06:00
|
|
|
import { computed, defineAsyncComponent, defineComponent } from 'vue';
|
2021-04-16 02:34:06 -06:00
|
|
|
import FormObjectView from '@client/components/form/object-view.vue';
|
|
|
|
import FormTextarea from '@client/components/form/textarea.vue';
|
|
|
|
import FormLink from '@client/components/form/link.vue';
|
|
|
|
import FormBase from '@client/components/form/base.vue';
|
|
|
|
import FormGroup from '@client/components/form/group.vue';
|
|
|
|
import FormButton from '@client/components/form/button.vue';
|
|
|
|
import FormKeyValueView from '@client/components/form/key-value-view.vue';
|
|
|
|
import FormSuspense from '@client/components/form/suspense.vue';
|
|
|
|
import * as os from '@client/os';
|
|
|
|
import number from '@client/filters/number';
|
|
|
|
import bytes from '@client/filters/bytes';
|
|
|
|
import * as symbols from '@client/symbols';
|
|
|
|
import { url } from '@client/config';
|
|
|
|
|
|
|
|
export default defineComponent({
|
|
|
|
components: {
|
|
|
|
FormBase,
|
|
|
|
FormTextarea,
|
|
|
|
FormObjectView,
|
|
|
|
FormButton,
|
|
|
|
FormLink,
|
|
|
|
FormGroup,
|
|
|
|
FormKeyValueView,
|
|
|
|
FormSuspense,
|
|
|
|
},
|
|
|
|
|
|
|
|
props: {
|
|
|
|
userId: {
|
|
|
|
type: String,
|
|
|
|
required: true
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
data() {
|
|
|
|
return {
|
2021-04-16 06:47:12 -06:00
|
|
|
[symbols.PAGE_INFO]: computed(() => ({
|
2021-04-16 02:34:06 -06:00
|
|
|
title: this.$ts.userInfo,
|
2021-04-20 08:22:59 -06:00
|
|
|
icon: 'fas fa-info-circle',
|
2021-04-16 06:47:12 -06:00
|
|
|
actions: this.user ? [this.user.url ? {
|
|
|
|
text: this.user.url,
|
2021-04-20 08:22:59 -06:00
|
|
|
icon: 'fas fa-external-link-alt',
|
2021-04-16 06:47:12 -06:00
|
|
|
handler: () => {
|
|
|
|
window.open(this.user.url, '_blank');
|
|
|
|
}
|
|
|
|
} : undefined].filter(x => x !== undefined) : [],
|
|
|
|
})),
|
2021-04-22 07:29:33 -06:00
|
|
|
init: null,
|
2021-04-16 02:34:06 -06:00
|
|
|
user: null,
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2021-04-22 07:29:33 -06:00
|
|
|
watch: {
|
|
|
|
userId: {
|
|
|
|
handler() {
|
|
|
|
this.init = () => os.api('users/show', {
|
|
|
|
userId: this.userId
|
|
|
|
}).then(user => {
|
|
|
|
this.user = user;
|
|
|
|
});
|
|
|
|
},
|
|
|
|
immediate: true
|
|
|
|
}
|
2021-04-16 02:34:06 -06:00
|
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
|
|
|
number,
|
|
|
|
bytes,
|
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|