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

@ -1,170 +1,170 @@
{ {
"common": { "common": {
"i18n": "多語言", "i18n": "多語言",
"abbreviations": "繁", "abbreviations": "繁",
"current_language": "繁體中文", "current_language": "繁體中文",
"try_again": "重試", "try_again": "重試",
"cancel": "取消", "cancel": "取消",
"continue": "繼續", "continue": "繼續",
"close": "關閉", "close": "關閉",
"save": "保存", "save": "保存",
"edit": "編輯", "edit": "編輯",
"delete": "刪除", "delete": "刪除",
"delete_success": "刪除成功!", "delete_success": "刪除成功!",
"search": "搜尋" "search": "搜尋"
}, },
"theme": { "theme": {
"toggle": "切換主题", "toggle": "切換主题",
"light": "淺色", "light": "淺色",
"dark": "深色", "dark": "深色",
"system": "跟隨系統" "system": "跟隨系統"
}, },
"login": { "login": {
"title": "登入", "title": "登入",
"description": "請輸入站點密碼以登入", "description": "請輸入站點密碼以登入",
"tips": "提示", "tips": "提示",
"preview_token": "預覽模式的站點密碼是", "preview_token": "預覽模式的站點密碼是",
"submit": "登入", "submit": "登入",
"failed": "登入失敗,請重試" "failed": "登入失敗,請重試"
}, },
"logout": { "logout": {
"title": "登出?", "title": "登出?",
"confirm": "確定要登出嗎?", "confirm": "確定要登出嗎?",
"action": "登出" "action": "登出"
}, },
"layouts": { "layouts": {
"footer": { "footer": {
"copyright": "產品來自 HTML.ZONE", "copyright": "產品來自 HTML.ZONE",
"social": { "social": {
"email": "郵箱", "email": "郵箱",
"telegram": "Telegram", "telegram": "Telegram",
"blog": "部落個", "blog": "部落個",
"twitter": "Twitter", "twitter": "Twitter",
"mastodon": "Mastodon", "mastodon": "Mastodon",
"github": "GitHub" "github": "GitHub"
}
},
"header": {
"select_language": "選擇語言"
} }
}, },
"nav": { "header": {
"links": "連結", "select_language": "選擇語言"
"analysis": "分析" }
}, },
"home": { "nav": {
"features": { "links": "連結",
"title": "功能特色", "analysis": "分析",
"subtitle": "簡單而實用的功能", "realtime": "即時"
"url_shortening": { },
"title": "URL 縮短", "home": {
"description": "將您的 URL 壓縮到最小長度" "features": {
}, "title": "功能特色",
"analytics": { "subtitle": "簡單而實用的功能",
"title": "數據分析", "url_shortening": {
"description": "監控連結分析病收集有價值的統計數據" "title": "URL 縮短",
}, "description": "將您的 URL 壓縮到最小長度"
"serverless": {
"title": "免伺服器",
"description": "無需傳統伺服器即可部署"
},
"customizable_slug": {
"title": "自定義短連結",
"description": "支持自訂連結和大小寫敏感"
},
"ai_slug": {
"title": "AI 短連結",
"description": "利用 AI 生成短連接"
},
"link_expiration": {
"title": "短連結過期",
"description": "為您的短連結設置過期日期"
}
}, },
"cta": { "analytics": {
"title": "立即部署", "title": "數據分析",
"description": "只需幾個簡單的點擊,您就可以免費開始部署", "description": "監控連結分析病收集有價值的統計數據"
"button": "開始部署"
}, },
"logos": { "serverless": {
"title": "使用優秀的技術構建" "title": "免伺服器",
"description": "無需傳統伺服器即可部署"
}, },
"twitter": { "customizable_slug": {
"follow": "在 X(Twitter) 上關注我" "title": "自定義短連結",
"description": "支持自訂連結和大小寫敏感"
},
"ai_slug": {
"title": "AI 短連結",
"description": "利用 AI 生成短連接"
},
"link_expiration": {
"title": "短連結過期",
"description": "為您的短連結設置過期日期"
} }
}, },
"dashboard": { "cta": {
"title": "儀表板", "title": "立即部署",
"visits": "訪問次數", "description": "只需幾個簡單的點擊,您就可以免費開始部署",
"views": "瀏覽次數", "button": "開始部署"
"visitors": "訪客人數",
"referers": "引薦來源",
"stats": "的統計",
"custom_date": "自定義日期",
"date": "日期",
"date_range": "日期範圍",
"locations": "地理位置",
"details": "詳細資料",
"name": "名稱",
"count": "數量",
"loading": "載入中",
"no_data": "暫無數據",
"none": "(無)",
"filter_placeholder": "過濾連結...",
"date_picker": {
"today": "今天",
"last_24h": "最近24小時",
"this_week": "本週",
"last_7d": "最近7天",
"this_month": "本月",
"last_30d": "最近30天",
"last_90d": "最近90天",
"custom": "自定義",
"custom_title": "自定義日期",
"single_date": "單個日期",
"date_range": "日期範圍"
},
"metrics": {
"country": "國家",
"region": "地區",
"city": "城市",
"referer": "來源",
"slug": "短連結",
"language": "語言",
"timezone": "時區",
"device": "設備",
"deviceType": "設備類型",
"os": "操作系統",
"browser": "瀏覽器",
"browserType": "瀏覽器類型"
}
}, },
"links": { "logos": {
"create": "創建連結", "title": "使用優秀的技術構建"
"edit": "編輯連結", },
"delete_confirm_title": "確定要刪除嗎?", "twitter": {
"delete_confirm_desc": "此操作無法撤銷。这將從伺服器中永久刪除您的連結。", "follow": "在 X(Twitter) 上關注我"
"delete_success": "刪除成功!", }
"update_success": "連結更新成功", },
"create_success": "連結創建成功", "dashboard": {
"preview_mode_tip": "預覽模式下的連結最多有效5分鐘", "title": "儀表板",
"search_placeholder": "搜尋連結...", "visits": "訪問次數",
"no_results": "未找到連結。", "views": "瀏覽次數",
"group_title": "連結列表", "visitors": "訪客人數",
"copy_success": "複製成功!", "referers": "引薦來源",
"created_at": "創建時間", "stats": "的統計",
"updated_at": "更新時間", "custom_date": "自定義日期",
"expires_at": "過期時間", "date": "日期",
"no_more": "沒有更多連結", "date_range": "日期範圍",
"load_failed": "加載連接失敗,", "locations": "地理位置",
"download_qr_code": "下載QR code", "details": "詳細資料",
"sort": { "name": "名稱",
"newest": "最新", "count": "數量",
"oldest": "最舊", "loading": "載入中",
"az": "短連結(A-Z)", "no_data": "暫無數據",
"za": "短連結(Z-A)", "none": "(無)",
"tip": "體驗功能: 僅對已經加載的連結有效" "filter_placeholder": "過濾連結...",
} "date_picker": {
"today": "今天",
"last_24h": "最近24小時",
"this_week": "本週",
"last_7d": "最近7天",
"this_month": "本月",
"last_30d": "最近30天",
"last_90d": "最近90天",
"custom": "自定義",
"custom_title": "自定義日期",
"single_date": "單個日期",
"date_range": "日期範圍"
},
"metrics": {
"country": "國家",
"region": "地區",
"city": "城市",
"referer": "來源",
"slug": "短連結",
"language": "語言",
"timezone": "時區",
"device": "設備",
"deviceType": "設備類型",
"os": "操作系統",
"browser": "瀏覽器",
"browserType": "瀏覽器類型"
}
},
"links": {
"create": "創建連結",
"edit": "編輯連結",
"delete_confirm_title": "確定要刪除嗎?",
"delete_confirm_desc": "此操作無法撤銷。这將從伺服器中永久刪除您的連結。",
"delete_success": "刪除成功!",
"update_success": "連結更新成功",
"create_success": "連結創建成功",
"preview_mode_tip": "預覽模式下的連結最多有效5分鐘",
"search_placeholder": "搜尋連結...",
"no_results": "未找到連結。",
"group_title": "連結列表",
"copy_success": "複製成功!",
"created_at": "創建時間",
"updated_at": "更新時間",
"expires_at": "過期時間",
"no_more": "沒有更多連結",
"load_failed": "加載連接失敗,",
"download_qr_code": "下載QR code",
"sort": {
"newest": "最新",
"oldest": "最舊",
"az": "短連結(A-Z)",
"za": "短連結(Z-A)",
"tip": "體驗功能: 僅對已經加載的連結有效"
} }
} }
}

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: {