chore: Adjust the directory structure in preparation for real-time.

This commit is contained in:
ccbikai 2025-05-11 14:17:57 +08:00
parent e4a0abdebb
commit d580a9f882
22 changed files with 204 additions and 180 deletions

View file

@ -18,6 +18,9 @@ const route = useRoute()
<TabsTrigger value="/dashboard/analysis"> <TabsTrigger value="/dashboard/analysis">
{{ $t('nav.analysis') }} {{ $t('nav.analysis') }}
</TabsTrigger> </TabsTrigger>
<TabsTrigger value="/dashboard/realtime">
{{ $t('nav.realtime') }}
</TabsTrigger>
</TabsList> </TabsList>
</Tabs> </Tabs>
<slot name="left" /> <slot name="left" />

View file

@ -74,8 +74,8 @@ onBeforeMount(() => {
</DashboardNav> </DashboardNav>
<DashboardFilters v-if="!link" @change="changeFilter" /> <DashboardFilters v-if="!link" @change="changeFilter" />
</div> </div>
<DashboardCounters /> <DashboardAnalysisCounters />
<DashboardViews /> <DashboardAnalysisViews />
<DashboardMetrics /> <DashboardAnalysisMetrics />
</main> </main>
</template> </template>

View file

@ -31,7 +31,7 @@ defineProps({
:value="rawTabs[index]" :value="rawTabs[index]"
class="flex-1" class="flex-1"
> >
<DashboardMetricsMetric <DashboardAnalysisMetricsMetric
:type="rawTabs[index]" :type="rawTabs[index]"
:name="tab" :name="tab"
class="h-full" class="h-full"

View file

@ -20,28 +20,28 @@ const translatedTabs = computed(() => ({
<template> <template>
<main class="grid gap-8 lg:grid-cols-12"> <main class="grid gap-8 lg:grid-cols-12">
<LazyDashboardMetricsLocations class="col-span-1 lg:col-span-8" /> <LazyDashboardAnalysisMetricsLocations class="col-span-1 lg:col-span-8" />
<DashboardMetricsGroup <DashboardAnalysisMetricsGroup
class="lg:col-span-4" class="lg:col-span-4"
:tabs="translatedTabs.location" :tabs="translatedTabs.location"
:raw-tabs="tabs.location" :raw-tabs="tabs.location"
/> />
<DashboardMetricsGroup <DashboardAnalysisMetricsGroup
class="lg:col-span-6" class="lg:col-span-6"
:tabs="translatedTabs.referer" :tabs="translatedTabs.referer"
:raw-tabs="tabs.referer" :raw-tabs="tabs.referer"
/> />
<DashboardMetricsGroup <DashboardAnalysisMetricsGroup
class="lg:col-span-6" class="lg:col-span-6"
:tabs="translatedTabs.time" :tabs="translatedTabs.time"
:raw-tabs="tabs.time" :raw-tabs="tabs.time"
/> />
<DashboardMetricsGroup <DashboardAnalysisMetricsGroup
class="lg:col-span-6" class="lg:col-span-6"
:tabs="translatedTabs.device" :tabs="translatedTabs.device"
:raw-tabs="tabs.device" :raw-tabs="tabs.device"
/> />
<DashboardMetricsGroup <DashboardAnalysisMetricsGroup
class="lg:col-span-6" class="lg:col-span-6"
:tabs="translatedTabs.browser" :tabs="translatedTabs.browser"
:raw-tabs="tabs.browser" :raw-tabs="tabs.browser"

View file

@ -39,7 +39,7 @@ defineProps({
<div <div
class="flex-1 leading-5 truncate font-mediums" class="flex-1 leading-5 truncate font-mediums"
> >
<DashboardMetricsName <DashboardAnalysisMetricsName
:name="metric.name" :name="metric.name"
:type="type" :type="type"
/> />

View file

@ -61,7 +61,7 @@ onBeforeUnmount(() => {
<template> <template>
<Card class="flex flex-col"> <Card class="flex flex-col">
<template v-if="metrics.length"> <template v-if="metrics.length">
<DashboardMetricsList <DashboardAnalysisMetricsList
class="flex-1" class="flex-1"
:metrics="top6" :metrics="top6"
:type="type" :type="type"
@ -83,7 +83,7 @@ onBeforeUnmount(() => {
<DialogHeader> <DialogHeader>
<DialogTitle>{{ name }}</DialogTitle> <DialogTitle>{{ name }}</DialogTitle>
</DialogHeader> </DialogHeader>
<DashboardMetricsList <DashboardAnalysisMetricsList
class="overflow-y-auto" class="overflow-y-auto"
:metrics="metrics" :metrics="metrics"
:type="type" :type="type"

View file

@ -36,15 +36,15 @@ function formatName(name, type) {
<TooltipProvider> <TooltipProvider>
<Tooltip> <Tooltip>
<TooltipTrigger class="w-full text-left"> <TooltipTrigger class="w-full text-left">
<DashboardMetricsNameReferer <DashboardAnalysisMetricsNameReferer
v-if="name && type === 'referer'" v-if="name && type === 'referer'"
:name="name" :name="name"
/> />
<DashboardMetricsNameSlug <DashboardAnalysisMetricsNameSlug
v-else-if="name && type === 'slug'" v-else-if="name && type === 'slug'"
:name="name" :name="name"
/> />
<DashboardMetricsNameIcon <DashboardAnalysisMetricsNameIcon
v-else-if="name && ['os', 'browser', 'browserType', 'device', 'deviceType'].includes(type)" v-else-if="name && ['os', 'browser', 'browserType', 'device', 'deviceType'].includes(type)"
:name="name" :name="name"
:type="type" :type="type"

View file

@ -0,0 +1,10 @@
<template>
<main class="space-y-6">
<div class="flex flex-col gap-6 sm:gap-2 sm:flex-row sm:justify-between">
<DashboardNav />
</div>
<div>
Realtime
</div>
</main>
</template>

View file

@ -5,6 +5,6 @@ provide('id', ref())
<template> <template>
<main class="space-y-6"> <main class="space-y-6">
<DashboardBreadcrumb title="Analysis" /> <DashboardBreadcrumb title="Analysis" />
<Dashboard /> <DashboardAnalysis />
</main> </main>
</template> </template>

View file

@ -0,0 +1,6 @@
<template>
<main class="space-y-6">
<DashboardBreadcrumb title="Realtime" />
<DashboardRealtime />
</main>
</template>

View file

@ -50,7 +50,8 @@
}, },
"nav": { "nav": {
"links": "Links", "links": "Links",
"analysis": "Analysis" "analysis": "Analysis",
"realtime": "Realtime"
}, },
"home": { "home": {
"features": { "features": {

View file

@ -50,7 +50,8 @@
}, },
"nav": { "nav": {
"links": "Liens", "links": "Liens",
"analysis": "Statistique" "analysis": "Statistiques",
"realtime": "Realtime"
}, },
"home": { "home": {
"features": { "features": {

View file

@ -50,7 +50,8 @@
}, },
"nav": { "nav": {
"links": "Liên kết", "links": "Liên kết",
"analysis": "Phân tích" "analysis": "Phân tích",
"realtime": "Thời gian thực"
}, },
"home": { "home": {
"features": { "features": {

View file

@ -50,7 +50,8 @@
}, },
"nav": { "nav": {
"links": "链接", "links": "链接",
"analysis": "分析" "analysis": "分析",
"realtime": "实时"
}, },
"home": { "home": {
"features": { "features": {

View file

@ -50,7 +50,8 @@
}, },
"nav": { "nav": {
"links": "連結", "links": "連結",
"analysis": "分析" "analysis": "分析",
"realtime": "即時"
}, },
"home": { "home": {
"features": { "features": {
@ -167,4 +168,3 @@
} }
} }
} }

View file

@ -11,6 +11,7 @@ export default defineNuxtConfig({
'@nuxtjs/color-mode', '@nuxtjs/color-mode',
'@nuxtjs/i18n', '@nuxtjs/i18n',
], ],
devtools: { enabled: true }, devtools: { enabled: true },
colorMode: { colorMode: {