diff --git a/front/components/AboutChartTooltip.vue b/front/components/AboutChartTooltip.vue index 49c3a7d..1ea1732 100644 --- a/front/components/AboutChartTooltip.vue +++ b/front/components/AboutChartTooltip.vue @@ -5,11 +5,12 @@ const props = defineProps<{ data: { name: string; value: string; color: string }[]; title: string; }>(); +const { t } = useI18n(); const dataKeyMap = { - file_size: "文件大小", - file_num: "文件数量", - processed: "处理数量", - failed: "失败数量", + file_size: t("about.fileSize"), + file_num: t("about.fileNum"), + processed: t("about.processed"), + failed: t("about.failed"), }; diff --git a/front/i18n/locales/en.json b/front/i18n/locales/en.json index 3ace311..e173294 100644 --- a/front/i18n/locales/en.json +++ b/front/i18n/locales/en.json @@ -5,5 +5,20 @@ }, "i18n": { "switchLocale": "Switch Language" + }, + "about": { + "file": "File", + "task": "Task", + "admin": "Admin", + "author": "Author", + "title": "About", + "systemInfo": "System Info", + "systemVersion": "System Version", + "storage": "Storage", + "analysis": "Analysis", + "fileSize": "File Size", + "fileNum": "File Num", + "processed": "Processed", + "failed": "Failed" } } diff --git a/front/i18n/locales/zh-CN.json b/front/i18n/locales/zh-CN.json index 4e5bd83..410156c 100644 --- a/front/i18n/locales/zh-CN.json +++ b/front/i18n/locales/zh-CN.json @@ -5,5 +5,20 @@ }, "i18n": { "switchLocale": "切换语言" + }, + "about": { + "file": "文件", + "task": "任务", + "admin": "站长", + "author": "作者", + "title": "关于", + "systemInfo": "系统信息", + "systemVersion": "系统版本", + "storage": "存储空间", + "analysis": "分析", + "fileSize": "文件大小", + "fileNum": "文件数量", + "processed": "处理数量", + "failed": "失败数量" } } diff --git a/front/pages/about.vue b/front/pages/about.vue index dff3442..74691e7 100644 --- a/front/pages/about.vue +++ b/front/pages/about.vue @@ -8,6 +8,9 @@ import AboutChartTooltip from "@/components/AboutChartTooltip.vue"; import { filesize } from "filesize"; import SparkMD5 from "spark-md5"; +const appConfig = useAppConfig(); +const { site_title, site_desc } = appConfig.value || {}; + const { data, isLoading } = useQuery({ queryKey: ["stat"], queryFn: async () => { @@ -16,10 +19,12 @@ const { data, isLoading } = useQuery({ }, }); +const { t } = useI18n(); + const chartTabs = computed(() => { return [ { - label: "文件", + label: t("about.file"), value: "storage", total: data.value?.chart?.storage?.reduce( @@ -29,7 +34,7 @@ const chartTabs = computed(() => { ) ?? 0, }, { - label: "任务", + label: t("about.task"), value: "queue", total: data.value?.chart?.queue?.reduce( @@ -93,7 +98,7 @@ const users = computed(() => { ...(!!name ? [ { - title: "站长", + title: t("about.admin"), email, name, url: url ?? (email ? `mailto:${email}` : null), @@ -101,7 +106,7 @@ const users = computed(() => { ] : []), { - title: "作者", + title: t("about.author"), name: "keven1024", email: "keven@fudaoyuan.icu", url: "https://github.com/keven1024", @@ -114,16 +119,18 @@ const users = computed(() => {
-
关于
+
{{ t("about.title") }}
-
015
+
{{ site_title ?? "015" }}
- 015 - 是一个开源的临时文件分享平台项目,支持临时大文件切片上传,临时文本上传、下载、分享 + {{ + site_desc ?? + "015 是一个开源的临时文件分享平台项目,支持临时大文件切片上传,临时文本上传、下载、分享" + }}
-
系统信息
+
{{ t("about.systemInfo") }}