diff --git a/packages/frontend/src/components/MkInstanceStats.vue b/packages/frontend/src/components/MkInstanceStats.vue index 91dabeebf9..f612615f7c 100644 --- a/packages/frontend/src/components/MkInstanceStats.vue +++ b/packages/frontend/src/components/MkInstanceStats.vue @@ -164,8 +164,8 @@ onMounted(() => { value: number, onClick?: () => void, }[]; - let totalFollowersCount = fedStats.topSubInstances.reduce((partialSum, a) => partialSum + a.followersCount, 0); - let totalFollowingCount = fedStats.topPubInstances.reduce((partialSum, a) => partialSum + a.followingCount, 0); + let totalFollowersCount = fedStats.topSubInstances.reduce((partialSum, a) => partialSum + a.followersCount, 0) + fedStats.otherFollowersCount; + let totalFollowingCount = fedStats.topPubInstances.reduce((partialSum, a) => partialSum + a.followingCount, 0) + fedStats.otherFollowingCount; const { handler: externalTooltipHandler1 } = useChartTooltip({ position: 'middle', diff --git a/packages/frontend/src/pages/admin/overview.federation.vue b/packages/frontend/src/pages/admin/overview.federation.vue index 022b392d2d..43bacdc6d1 100644 --- a/packages/frontend/src/pages/admin/overview.federation.vue +++ b/packages/frontend/src/pages/admin/overview.federation.vue @@ -10,12 +10,12 @@ SPDX-License-Identifier: AGPL-3.0-only
Sub
- +
Top 10
Pub
- +
Top 10
@@ -55,6 +55,8 @@ import MkNumberDiff from '@/components/MkNumberDiff.vue'; import { i18n } from '@/i18n.js'; import { useChartTooltip } from '@/scripts/use-chart-tooltip.js'; +const totalFollowersCount = ref(undefined); +const totalFollowingCount = ref(undefined); const topSubInstancesForPie = ref(null); const topPubInstancesForPie = ref(null); const federationPubActive = ref(null); @@ -73,6 +75,8 @@ onMounted(async () => { federationSubActiveDiff.value = chart.subActive[0] - chart.subActive[1]; misskeyApiGet('federation/stats', { limit: 10 }).then(res => { + totalFollowersCount.value = res.topSubInstances.reduce((partialSum, a) => partialSum + a.followersCount, 0) + res.otherFollowersCount; + totalFollowingCount.value = res.topPubInstances.reduce((partialSum, a) => partialSum + a.followingCount, 0) + res.otherFollowingCount; topSubInstancesForPie.value = [ ...res.topSubInstances.map(x => ({ name: x.host, diff --git a/packages/frontend/src/pages/admin/overview.pie.vue b/packages/frontend/src/pages/admin/overview.pie.vue index c7a9f2a702..1745211c3d 100644 --- a/packages/frontend/src/pages/admin/overview.pie.vue +++ b/packages/frontend/src/pages/admin/overview.pie.vue @@ -24,17 +24,18 @@ initChart(); const props = defineProps<{ data: InstanceForPie[]; + total?:number; }>(); const chartEl = shallowRef(null); -const { handler: externalTooltipHandler } = useChartTooltip({ - position: 'middle', -}); - let chartInstance: Chart; onMounted(() => { + const { handler: externalTooltipHandler } = useChartTooltip({ + position: 'middle', + total: props.total, + }); chartInstance = new Chart(chartEl.value, { type: 'doughnut', data: {