2023-07-08 19:23:27 +02:00
|
|
|
<template>
|
|
|
|
<div>
|
2023-07-09 11:58:53 +02:00
|
|
|
<GHero>
|
|
|
|
<template #title>{{ $t('_servers.title') }}</template>
|
|
|
|
<template #description>
|
|
|
|
{{ $t('_servers.description') }}<br>
|
|
|
|
<I18nT keypath="_servers.addYourServer" tag="span">
|
|
|
|
<NuxtLink class="font-bold hover:underline underline-offset-4" to="https://github.com/joinmisskey/api">{{ $t('_servers.addYourServerLink') }}</NuxtLink>
|
|
|
|
</I18nT>
|
|
|
|
</template>
|
|
|
|
<template #icon>
|
|
|
|
<div class="relative px-6 py-8">
|
|
|
|
<GDots class="absolute top-0 left-0 w-32 h-32 text-accent-600" />
|
|
|
|
<GDots class="absolute bottom-0 right-0 w-32 h-32 text-accent-600" />
|
|
|
|
<div class="relative bg-white dark:bg-slate-800 shadow-lg rounded-lg lg:w-72 p-6 space-y-4">
|
|
|
|
<dl>
|
|
|
|
<dt>{{ $t('_servers._statistics.notes') }}</dt>
|
2023-07-13 17:25:30 +02:00
|
|
|
<dd class="font-bold text-accent-600 text-2xl">{{ instancesStats?.notesCount?.toLocaleString() || $t('loading') }}</dd>
|
2023-07-09 11:58:53 +02:00
|
|
|
</dl>
|
|
|
|
<dl>
|
|
|
|
<dt>{{ $t('_servers._statistics.users') }}</dt>
|
2023-07-13 17:25:30 +02:00
|
|
|
<dd class="font-bold text-accent-600 text-2xl">{{ instancesStats?.usersCount?.toLocaleString() || $t('loading') }}</dd>
|
2023-07-09 11:58:53 +02:00
|
|
|
</dl>
|
|
|
|
<dl>
|
|
|
|
<dt>{{ $t('_servers._statistics.servers') }}</dt>
|
2023-07-13 17:25:30 +02:00
|
|
|
<dd class="font-bold text-accent-600 text-2xl">{{ instancesStats?.instancesCount?.toLocaleString() || $t('loading') }}</dd>
|
2023-07-09 11:58:53 +02:00
|
|
|
</dl>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
</GHero>
|
2023-07-11 19:19:32 +02:00
|
|
|
<div class="pb-12 lg:mt-12 pt-6 bg-white dark:bg-slate-950">
|
2023-07-13 17:25:30 +02:00
|
|
|
<ClientOnly>
|
|
|
|
<ServersFinder @load="setServerStats" />
|
|
|
|
</ClientOnly>
|
2023-07-09 11:58:53 +02:00
|
|
|
</div>
|
2023-07-08 19:23:27 +02:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
2023-07-09 11:58:53 +02:00
|
|
|
const { t, locale } = useI18n();
|
|
|
|
const route = useRoute();
|
|
|
|
|
2023-07-13 17:25:30 +02:00
|
|
|
type InstancesStatsObj = {
|
|
|
|
notesCount?: number;
|
|
|
|
usersCount?: number;
|
|
|
|
instancesCount?: number;
|
2023-07-09 20:09:50 +02:00
|
|
|
};
|
|
|
|
|
2023-07-13 17:25:30 +02:00
|
|
|
const instancesStats = ref<InstancesStatsObj>();
|
2023-07-09 20:09:50 +02:00
|
|
|
|
2023-07-13 17:25:30 +02:00
|
|
|
function setServerStats(val: InstancesStatsObj) {
|
|
|
|
console.log(val);
|
|
|
|
instancesStats.value = val;
|
|
|
|
}
|
2023-07-09 20:09:50 +02:00
|
|
|
|
2023-07-09 11:58:53 +02:00
|
|
|
route.meta.title = t('_servers.title');
|
2023-07-08 19:23:27 +02:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped>
|
2023-07-09 11:58:53 +02:00
|
|
|
@screen lg {
|
|
|
|
.server-list {
|
|
|
|
grid-template-columns: 300px 1fr;
|
|
|
|
}
|
|
|
|
}
|
2023-07-08 19:23:27 +02:00
|
|
|
</style>
|