enhance(frontend): aboutページ・サーバー情報

This commit is contained in:
kakkokari-gtyih 2024-12-10 14:44:22 +09:00
parent 92bc2e71ca
commit 88a7d19160
2 changed files with 42 additions and 23 deletions

View file

@ -13,7 +13,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<MkSpacer v-else-if="tab === 'emojis'" :contentMax="1000" :marginMin="20"> <MkSpacer v-else-if="tab === 'emojis'" :contentMax="1000" :marginMin="20">
<XEmojis/> <XEmojis/>
</MkSpacer> </MkSpacer>
<MkSpacer v-else-if="tab === 'federation'" :contentMax="1000" :marginMin="20"> <MkSpacer v-else-if="instance.federation !== 'none' && tab === 'federation'" :contentMax="1000" :marginMin="20">
<XFederation/> <XFederation/>
</MkSpacer> </MkSpacer>
<MkSpacer v-else-if="tab === 'charts'" :contentMax="1000" :marginMin="20"> <MkSpacer v-else-if="tab === 'charts'" :contentMax="1000" :marginMin="20">
@ -25,6 +25,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<script lang="ts" setup> <script lang="ts" setup>
import { computed, defineAsyncComponent, ref, watch } from 'vue'; import { computed, defineAsyncComponent, ref, watch } from 'vue';
import { instance } from '@/instance.js';
import { i18n } from '@/i18n.js'; import { i18n } from '@/i18n.js';
import { claimAchievement } from '@/scripts/achievements.js'; import { claimAchievement } from '@/scripts/achievements.js';
import { definePageMetadata } from '@/scripts/page-metadata.js'; import { definePageMetadata } from '@/scripts/page-metadata.js';
@ -51,22 +52,34 @@ watch(tab, () => {
const headerActions = computed(() => []); const headerActions = computed(() => []);
const headerTabs = computed(() => [{ const headerTabs = computed(() => {
const items = [];
items.push({
key: 'overview', key: 'overview',
title: i18n.ts.overview, title: i18n.ts.overview,
}, { }, {
key: 'emojis', key: 'emojis',
title: i18n.ts.customEmojis, title: i18n.ts.customEmojis,
icon: 'ti ti-icons', icon: 'ti ti-icons',
}, { });
if (instance.federation !== 'none') {
items.push({
key: 'federation', key: 'federation',
title: i18n.ts.federation, title: i18n.ts.federation,
icon: 'ti ti-whirl', icon: 'ti ti-whirl',
}, { });
}
items.push({
key: 'charts', key: 'charts',
title: i18n.ts.charts, title: i18n.ts.charts,
icon: 'ti ti-chart-line', icon: 'ti ti-chart-line',
}]); });
return items;
});
definePageMetadata(() => ({ definePageMetadata(() => ({
title: i18n.ts.instanceInfo, title: i18n.ts.instanceInfo,

View file

@ -56,12 +56,18 @@ export function openInstanceMenu(ev: MouseEvent) {
text: i18n.ts.customEmojis, text: i18n.ts.customEmojis,
icon: 'ti ti-icons', icon: 'ti ti-icons',
to: '/about#emojis', to: '/about#emojis',
}, { });
if (instance.federation !== 'none') {
menuItems.push({
type: 'link', type: 'link',
text: i18n.ts.federation, text: i18n.ts.federation,
icon: 'ti ti-whirl', icon: 'ti ti-whirl',
to: '/about#federation', to: '/about#federation',
}, { });
}
menuItems.push({
type: 'link', type: 'link',
text: i18n.ts.charts, text: i18n.ts.charts,
icon: 'ti ti-chart-line', icon: 'ti ti-chart-line',