add(ServerFinder): 最終更新日を表示するように

This commit is contained in:
kakkokari-gtyih 2024-04-05 01:25:56 +09:00
parent 683ab0f757
commit adf5531836
4 changed files with 11 additions and 4 deletions

View File

@ -149,7 +149,7 @@ import ListIco from 'bi/view-stacked.svg';
const { t, locale } = useI18n(); const { t, locale } = useI18n();
const route = useRoute(); const route = useRoute();
const emits = defineEmits<{ const emits = defineEmits<{
(e: 'load', value?: InstancesStatsObj): void; (e: 'load', value?: InstancesStatsObj, updatedAt?: string): void;
}>(); }>();
// //
@ -215,7 +215,7 @@ if (data.value?.stats.usersCount) {
notesCount: data.value.stats.notesCount, notesCount: data.value.stats.notesCount,
usersCount: data.value.stats.usersCount, usersCount: data.value.stats.usersCount,
instancesCount: data.value.stats.instancesCount, instancesCount: data.value.stats.instancesCount,
}); }, data.value.date);
} }
watch(data, (to) => { watch(data, (to) => {
@ -224,7 +224,7 @@ watch(data, (to) => {
notesCount: to.stats.notesCount, notesCount: to.stats.notesCount,
usersCount: to.stats.usersCount, usersCount: to.stats.usersCount,
instancesCount: to.stats.instancesCount, instancesCount: to.stats.instancesCount,
}); }, to.date);
} }
}, { }, {
deep: true, deep: true,

View File

@ -14,6 +14,7 @@ settings: "設定"
goToLegacyHub: "従来のMisskey Hub" goToLegacyHub: "従来のMisskey Hub"
contactUs: "お問い合わせ" contactUs: "お問い合わせ"
detail: "詳細" detail: "詳細"
lastUpdate: "最終更新"
_error: _error:
notFound: "ページが見つかりませんでした" notFound: "ページが見つかりませんでした"

View File

@ -13,6 +13,7 @@ browse: "参照"
settings: "設定" settings: "設定"
goToLegacyHub: "前のMisskey Hub" goToLegacyHub: "前のMisskey Hub"
contactUs: "お問い合わせ" contactUs: "お問い合わせ"
lastUpdate: "最終更新"
_error: _error:
notFound: "ページ食べた" notFound: "ページ食べた"

View File

@ -7,6 +7,9 @@
<I18nT scope="global" keypath="_servers.addYourServer" tag="span"> <I18nT scope="global" keypath="_servers.addYourServer" tag="span">
<GNuxtLink class="font-bold hover:underline underline-offset-4" to="https://github.com/joinmisskey/api">{{ $t('_servers.addYourServerLink') }}</GNuxtLink> <GNuxtLink class="font-bold hover:underline underline-offset-4" to="https://github.com/joinmisskey/api">{{ $t('_servers.addYourServerLink') }}</GNuxtLink>
</I18nT> </I18nT>
<div class="!mt-2 text-sm p-3 rounded-lg bg-white dark:bg-slate-800 border border-gray-300 dark:border-gray-950">
{{ $t('lastUpdate') }}: {{ updatedAt ? $d(updatedAt) : $t('loading') }}
</div>
</template> </template>
<template #icon> <template #icon>
<div class="relative px-6 py-8"> <div class="relative px-6 py-8">
@ -63,9 +66,11 @@ const localePath = useGLocalePath();
const route = useRoute(); const route = useRoute();
const instancesStats = ref<InstancesStatsObj>(); const instancesStats = ref<InstancesStatsObj>();
const updatedAt = shallowRef<Date>();
function setServerStats(val?: InstancesStatsObj) { function setServerStats(val?: InstancesStatsObj, updated?: string) {
instancesStats.value = val; instancesStats.value = val;
if (updated) updatedAt.value = new Date(updated);
} }
route.meta.title = t('_servers.title'); route.meta.title = t('_servers.title');