You've already forked AstralRinth
453369ca07
* Make dashboard page localizable * dashboard sidebar * prepr:frontend * don't change the keys * undo fix * fix any err * don't i18n csv * prepr:frontend * fix: do not use button key * prepr:frontend * capitalize string date --------- Co-authored-by: Prospector <6166773+Prospector@users.noreply.github.com>
46 lines
964 B
Vue
46 lines
964 B
Vue
<template>
|
|
<div>
|
|
<Suspense>
|
|
<ChartDisplay :projects="projects" :personal="true" />
|
|
<template #fallback>
|
|
<div class="universal-card">
|
|
<h2><span class="label__title">Loading analytics...</span></h2>
|
|
</div>
|
|
</template>
|
|
</Suspense>
|
|
</div>
|
|
</template>
|
|
|
|
<script setup>
|
|
import {
|
|
commonProjectSettingsMessages,
|
|
injectModrinthClient,
|
|
useDebugLogger,
|
|
useVIntl,
|
|
} from '@modrinth/ui'
|
|
|
|
import ChartDisplay from '~/components/ui/charts/ChartDisplay.vue'
|
|
|
|
const { formatMessage } = useVIntl()
|
|
|
|
const debug = useDebugLogger('analytics.vue')
|
|
|
|
definePageMeta({
|
|
middleware: 'auth',
|
|
})
|
|
|
|
useHead({
|
|
title: () => `${formatMessage(commonProjectSettingsMessages.analytics)} - Modrinth`,
|
|
})
|
|
|
|
const auth = await useAuth()
|
|
const client = injectModrinthClient()
|
|
const id = auth.value?.user?.id
|
|
|
|
debug('auth resolved', { id })
|
|
|
|
const projects = await client.labrinth.users_v2.getProjects(id)
|
|
|
|
debug('projects resolved', { count: projects?.length })
|
|
</script>
|