From 9fa1c2eb3e55ef630333ae24284aa8b54e3414b6 Mon Sep 17 00:00:00 2001 From: xiaojunnuo Date: Mon, 26 Jan 2026 00:42:47 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E9=A6=96=E9=A1=B5?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E6=95=B0=E6=8D=AE=EF=BC=8C=E9=A5=BC=E5=9B=BE?= =?UTF-8?q?=E6=9B=BF=E6=8D=A2=E6=88=90=E8=AF=81=E4=B9=A6=E6=95=B0=E9=87=8F?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/locales/langs/en-US/certd.ts | 8 ++ .../src/locales/langs/zh-CN/certd.ts | 9 +++ .../views/framework/home/dashboard/index.vue | 29 ++++++- .../home/dashboard/statistic-card.vue | 78 ++++++++++++++++++- .../user/dashboard/statistic-controller.ts | 21 +++++ .../monitor/service/cert-info-service.ts | 32 +++++++- .../pipeline/service/pipeline-service.ts | 20 +++++ 7 files changed, 192 insertions(+), 5 deletions(-) diff --git a/packages/ui/certd-client/src/locales/langs/en-US/certd.ts b/packages/ui/certd-client/src/locales/langs/en-US/certd.ts index a0c04c859..22cde1e8a 100644 --- a/packages/ui/certd-client/src/locales/langs/en-US/certd.ts +++ b/packages/ui/certd-client/src/locales/langs/en-US/certd.ts @@ -88,6 +88,14 @@ export default { helpDoc: "Help Docs", pipelineCount: "Number of Certificate Pipelines", noPipeline: "You have no certificate pipelines yet", + enabledCount: "Enabled", + disabledCount: "Disabled", + certCount: "Number of Certificates", + noCert: "You have no certificates yet", + manageCert: "View Certificates", + certExpiringCount: "Soon-to-Expire", + certExpiredCount: "Expired", + certNoExpireCount: "Not Expired", createNow: "Create Now", managePipeline: "Manage Pipelines", pipelineStatus: "Pipeline Status", diff --git a/packages/ui/certd-client/src/locales/langs/zh-CN/certd.ts b/packages/ui/certd-client/src/locales/langs/zh-CN/certd.ts index 3f8f046ec..e0ff0f88e 100644 --- a/packages/ui/certd-client/src/locales/langs/zh-CN/certd.ts +++ b/packages/ui/certd-client/src/locales/langs/zh-CN/certd.ts @@ -93,7 +93,16 @@ export default { alertMessage: "证书和授权为敏感信息,不要使用来历不明的在线Certd服务和镜像,以免泄露;请务必私有化部署使用,认准官方版本发布渠道:", helpDoc: "帮助文档", pipelineCount: "证书流水线数量", + enabledCount: "已启用", + disabledCount: "已禁用", noPipeline: "您还没有证书流水线", + certCount: "证书数量", + certExpiringCount: "即将过期", + certExpiredCount: "已过期", + certNoExpireCount: "未过期", + noCert: "还没有证书", + manageCert: "查看证书", + createNow: "立即创建", managePipeline: "管理流水线", pipelineStatus: "流水线状态", diff --git a/packages/ui/certd-client/src/views/framework/home/dashboard/index.vue b/packages/ui/certd-client/src/views/framework/home/dashboard/index.vue index 8f38b4eeb..62fed124b 100644 --- a/packages/ui/certd-client/src/views/framework/home/dashboard/index.vue +++ b/packages/ui/certd-client/src/views/framework/home/dashboard/index.vue @@ -67,7 +67,7 @@
- + - + + + + + + @@ -242,6 +254,19 @@ function transformStatusCount() { } } count.value.pipelineStatusCount = result; + + const pipelineEnableCount = count.value.pipelineEnableCount; + count.value.pipelineEnableCount = [ + { name: t("certd.dashboard.enabledCount"), value: pipelineEnableCount.enabled, color: "green" }, + { name: t("certd.dashboard.disabledCount"), value: pipelineEnableCount.disabled, color: "gray" }, + ]; + const certCount = count.value.certCount; + count.value.certStatusCount = [ + { name: t("certd.dashboard.certExpiredCount"), value: certCount.expired, color: "red", checkIcon: "mingcute:warning-fill:#f44336" }, + { name: t("certd.dashboard.certExpiringCount"), value: certCount.expiring, color: "yellow", checkIcon: "mingcute:alert-fill:#ff9800" }, + { name: t("certd.dashboard.certNoExpireCount"), value: certCount.notExpired, color: "green" }, + ]; + count.value.certCount = certCount.total; } async function loadCount() { count.value = await GetStatisticCount(); diff --git a/packages/ui/certd-client/src/views/framework/home/dashboard/statistic-card.vue b/packages/ui/certd-client/src/views/framework/home/dashboard/statistic-card.vue index ad8608b91..a760afe7a 100644 --- a/packages/ui/certd-client/src/views/framework/home/dashboard/statistic-card.vue +++ b/packages/ui/certd-client/src/views/framework/home/dashboard/statistic-card.vue @@ -8,7 +8,27 @@
-
{{ count }}
+
+
+ {{ count }} + {{ title }} +
+ +
+
+
+
+ {{ item.name }}: +
+
+ {{ item.value }} +
+ +
+
+
+
+
@@ -25,51 +45,103 @@ import { FsIcon } from "@fast-crud/fast-crud"; const props = defineProps<{ title: string; count?: number; + subCounts?: { + name: string; + value: number; + color: string; + checkIcon?: string; + }[]; }>(); const slots = defineSlots();