summaryrefslogtreecommitdiff
path: root/src/client/pages/about.vue
blob: 4084256cf4f6b4f7ff609bbfdb80685a1f5b277d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
<template>
<FormBase class="mmnnbwxb" v-if="meta">
	<div class="_formItem logo">
		<img v-if="meta.logoImageUrl" :src="meta.logoImageUrl">
		<span v-else class="text">{{ instanceName }}</span>
	</div>
	<FormGroup>
		<FormKeyValueView>
			<template #key>Misskey</template>
			<template #value>v{{ version }}</template>
		</FormKeyValueView>
	</FormGroup>

	<FormGroup>
		<FormKeyValueView>
			<template #key>{{ $ts.administrator }}</template>
			<template #value>{{ meta.maintainerName }}</template>
		</FormKeyValueView>
		<FormKeyValueView>
			<template #key>{{ $ts.contact }}</template>
			<template #value>{{ meta.maintainerEmail }}</template>
		</FormKeyValueView>
	</FormGroup>

	<FormLink v-if="meta.tosUrl" :to="meta.tosUrl" external>{{ $ts.tos }}</FormLink>

	<FormGroup v-if="stats">
		<template #label>{{ $ts.statistics }}</template>
		<FormKeyValueView>
			<template #key>{{ $ts.users }}</template>
			<template #value>{{ number(stats.originalUsersCount) }}</template>
		</FormKeyValueView>
		<FormKeyValueView>
			<template #key>{{ $ts.notes }}</template>
			<template #value>{{ number(stats.originalNotesCount) }}</template>
		</FormKeyValueView>
	</FormGroup>
</FormBase>
</template>

<script lang="ts">
import { defineComponent } from 'vue';
import { faInfoCircle } from '@fortawesome/free-solid-svg-icons';
import { version, instanceName } from '@client/config';
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 FormKeyValueView from '@client/components/form/key-value-view.vue';
import * as os from '@client/os';
import number from '@client/filters/number';
import * as symbols from '@client/symbols';

export default defineComponent({
	components: {
		FormBase,
		FormGroup,
		FormLink,
		FormKeyValueView,
	},

	data() {
		return {
			[symbols.PAGE_INFO]: {
				title: this.$ts.instanceInfo,
				icon: faInfoCircle
			},
			version,
			instanceName,
			stats: null,
			faInfoCircle
		}
	},

	computed: {
		meta() {
			return this.$instance;
		},
	},

	created() {
		os.api('stats').then(stats => {
			this.stats = stats;
		});
	},

	methods: {
		number
	}
});
</script>

<style lang="scss" scoped>
.mmnnbwxb {
	max-width: 800px;
	box-sizing: border-box;
	margin: 0 auto;

	> .logo {
		text-align: center;

		> img {
			vertical-align: bottom;
			max-height: 100px;
		}
	}
}
</style>