From 43702ed126e1bd2f4272d2b55f5182862012b66f Mon Sep 17 00:00:00 2001 From: Ryan Wang Date: Tue, 21 Feb 2023 11:36:10 +0800 Subject: [PATCH] feat: add supports for display database info in actuator page (#872) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #### What type of PR is this? /kind feature #### What this PR does / why we need it: 支持在系统概览页面显示数据库信息。 #### Which issue(s) this PR fixes: Fixes https://github.com/halo-dev/halo/issues/3263 #### Screenshots: image #### Special notes for your reviewer: 测试方式: 1. Halo 需要切换到 https://github.com/halo-dev/halo/pull/3351 分支。 2. 进入系统概览页面,检查是否有数据库信息。 #### Does this PR introduce a user-facing change? ```release-note Console 端的系统概览页面支持显示数据库信息 ``` --- src/modules/system/actuator/Actuator.vue | 9 +++++++++ src/modules/system/actuator/types/index.ts | 6 ++++++ 2 files changed, 15 insertions(+) diff --git a/src/modules/system/actuator/Actuator.vue b/src/modules/system/actuator/Actuator.vue index 09a5288b..ea40e281 100644 --- a/src/modules/system/actuator/Actuator.vue +++ b/src/modules/system/actuator/Actuator.vue @@ -78,6 +78,7 @@ const handleCopy = () => { - 构建时间:${formatDatetime(info.value?.build?.time)} - Git Commit:${info.value?.git?.commit.id} - Java:${info.value?.java.runtime.name} / ${info.value?.java.runtime.version} +- 数据库:${info.value?.database.name} / ${info.value?.database.version} - 操作系统:${info.value?.os.name} / ${info.value?.os.version} `; @@ -247,6 +248,14 @@ const handleDownloadLogfile = () => { {{ info.java.runtime.name }} / {{ info.java.runtime.version }} +
+
数据库
+
+ {{ [info.database.name, info.database.version].join(" / ") }} +
+
diff --git a/src/modules/system/actuator/types/index.ts b/src/modules/system/actuator/types/index.ts index 7cccd5b1..e6cb4cda 100644 --- a/src/modules/system/actuator/types/index.ts +++ b/src/modules/system/actuator/types/index.ts @@ -12,6 +12,12 @@ export interface Info { build?: Build; java: Java; os: Os; + database: Database; +} + +export interface Database { + name: string; + version: string; } export interface Commit {