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(() => {
key: 'overview', const items = [];
title: i18n.ts.overview,
}, { items.push({
key: 'emojis', key: 'overview',
title: i18n.ts.customEmojis, title: i18n.ts.overview,
icon: 'ti ti-icons', }, {
}, { key: 'emojis',
key: 'federation', title: i18n.ts.customEmojis,
title: i18n.ts.federation, icon: 'ti ti-icons',
icon: 'ti ti-whirl', });
}, {
key: 'charts', if (instance.federation !== 'none') {
title: i18n.ts.charts, items.push({
icon: 'ti ti-chart-line', key: 'federation',
}]); title: i18n.ts.federation,
icon: 'ti ti-whirl',
});
}
items.push({
key: 'charts',
title: i18n.ts.charts,
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',
}, { });
type: 'link',
text: i18n.ts.federation, if (instance.federation !== 'none') {
icon: 'ti ti-whirl', menuItems.push({
to: '/about#federation', type: 'link',
}, { text: i18n.ts.federation,
icon: 'ti ti-whirl',
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',