Skip to content

Commit

Permalink
feat: add supports for display database info in actuator page (halo-d…
Browse files Browse the repository at this point in the history
…ev/console#872)

#### What type of PR is this?

/kind feature

#### What this PR does / why we need it:

支持在系统概览页面显示数据库信息。

#### Which issue(s) this PR fixes:

Fixes halo-dev#3263

#### Screenshots:

<img width="1413" alt="image" src="https://user-images.githubusercontent.com/21301288/220119998-dcf58a6e-cbe5-46ed-9fda-67d0ce5b85c1.png">

#### Special notes for your reviewer:

测试方式:

1. Halo 需要切换到 halo-dev#3351 分支。
2. 进入系统概览页面,检查是否有数据库信息。

#### Does this PR introduce a user-facing change?

```release-note
Console 端的系统概览页面支持显示数据库信息
```
  • Loading branch information
ruibaby authored Feb 21, 2023
1 parent ce604e6 commit 76bbe52
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/modules/system/actuator/Actuator.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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}
`;
Expand Down Expand Up @@ -247,6 +248,14 @@ const handleDownloadLogfile = () => {
{{ info.java.runtime.name }} / {{ info.java.runtime.version }}
</dd>
</div>
<div
class="bg-white px-4 py-5 hover:bg-gray-50 sm:grid sm:grid-cols-6 sm:gap-4 sm:px-6"
>
<dt class="text-sm font-medium text-gray-900">数据库</dt>
<dd class="mt-1 text-sm text-gray-900 sm:col-span-2 sm:mt-0">
{{ [info.database.name, info.database.version].join(" / ") }}
</dd>
</div>
<div
class="bg-white px-4 py-5 hover:bg-gray-50 sm:grid sm:grid-cols-6 sm:gap-4 sm:px-6"
>
Expand Down
6 changes: 6 additions & 0 deletions src/modules/system/actuator/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 76bbe52

Please sign in to comment.