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">
{{ $t('nav.analysis') }}
</TabsTrigger>
<TabsTrigger value="/dashboard/realtime">
{{ $t('nav.realtime') }}
</TabsTrigger>
</TabsList>
</Tabs>
<slot name="left" />

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -36,15 +36,15 @@ function formatName(name, type) {
<TooltipProvider>
<Tooltip>
<TooltipTrigger class="w-full text-left">
<DashboardMetricsNameReferer
<DashboardAnalysisMetricsNameReferer
v-if="name && type === 'referer'"
:name="name"
/>
<DashboardMetricsNameSlug
<DashboardAnalysisMetricsNameSlug
v-else-if="name && type === 'slug'"
:name="name"
/>
<DashboardMetricsNameIcon
<DashboardAnalysisMetricsNameIcon
v-else-if="name && ['os', 'browser', 'browserType', 'device', 'deviceType'].includes(type)"
:name="name"
: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>
<main class="space-y-6">
<DashboardBreadcrumb title="Analysis" />
<Dashboard />
<DashboardAnalysis />
</main>
</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": {
"links": "Links",
"analysis": "Analysis"
"analysis": "Analysis",
"realtime": "Realtime"
},
"home": {
"features": {

View file

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

View file

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

View file

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

View file

@ -50,7 +50,8 @@
},
"nav": {
"links": "連結",
"analysis": "分析"
"analysis": "分析",
"realtime": "即時"
},
"home": {
"features": {
@ -166,5 +167,4 @@
"tip": "體驗功能: 僅對已經加載的連結有效"
}
}
}
}

View file

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