From 0c4400d6f73d4f4ec4458f7d1e6ebf4ced60345a Mon Sep 17 00:00:00 2001 From: zhengkunwang <31820853+zhengkunwang223@users.noreply.github.com> Date: Tue, 8 Aug 2023 16:38:12 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=BF=9B=E7=A8=8B=E5=AE=88=E6=8A=A4?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E5=A2=9E=E5=8A=A0=E4=BF=A1=E6=81=AF=E5=88=97?= =?UTF-8?q?=20(#1873)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/dto/response/host_tool.go | 1 + backend/app/service/host_tool.go | 2 + frontend/src/lang/modules/en.ts | 1 + frontend/src/lang/modules/tw.ts | 1 + frontend/src/lang/modules/zh.ts | 1 + .../src/views/host/tool/supervisor/index.vue | 37 ++++++++++++++++--- 6 files changed, 37 insertions(+), 6 deletions(-) diff --git a/backend/app/dto/response/host_tool.go b/backend/app/dto/response/host_tool.go index 1b9ca012f..e97a675d8 100644 --- a/backend/app/dto/response/host_tool.go +++ b/backend/app/dto/response/host_tool.go @@ -37,4 +37,5 @@ type ProcessStatus struct { Status string `json:"status"` PID string `json:"PID"` Uptime string `json:"uptime"` + Msg string `json:"msg"` } diff --git a/backend/app/service/host_tool.go b/backend/app/service/host_tool.go index 40f164a9c..2dca140c2 100644 --- a/backend/app/service/host_tool.go +++ b/backend/app/service/host_tool.go @@ -540,6 +540,8 @@ func getProcessStatus(config *response.SupervisorProcessConfig) error { if fields[1] == "RUNNING" { status.PID = strings.TrimSuffix(fields[3], ",") status.Uptime = fields[5] + } else { + status.Msg = strings.Join(fields[2:], " ") } config.Status = append(config.Status, status) } diff --git a/frontend/src/lang/modules/en.ts b/frontend/src/lang/modules/en.ts index 4a9e76cff..1c0ca0d0c 100644 --- a/frontend/src/lang/modules/en.ts +++ b/frontend/src/lang/modules/en.ts @@ -1682,6 +1682,7 @@ const message = { serviceNameHelper: 'Currently only supports the Supervisor service managed by systemctl', restartHelper: 'Initialization will restart the service, causing all the original daemon processes to close', + msg: 'Message', }, }, }; diff --git a/frontend/src/lang/modules/tw.ts b/frontend/src/lang/modules/tw.ts index c8e653015..0a85d6a0e 100644 --- a/frontend/src/lang/modules/tw.ts +++ b/frontend/src/lang/modules/tw.ts @@ -1594,6 +1594,7 @@ const message = { initHelper: '尚未初始化 Supervisor ,請先初始化', serviceNameHelper: '當前僅支持 systemctl 管理的 Supervisor 服務', restartHelper: '初始化會重啟服務,導致原有的守護進程全部關閉', + msg: '信息', }, }, }; diff --git a/frontend/src/lang/modules/zh.ts b/frontend/src/lang/modules/zh.ts index f3a8e14e9..583b3b929 100644 --- a/frontend/src/lang/modules/zh.ts +++ b/frontend/src/lang/modules/zh.ts @@ -1596,6 +1596,7 @@ const message = { initHelper: '尚未初始化 Supervisor ,请先初始化', serviceNameHelper: '当前仅支持 systemctl 管理的 Supervisor 服务', restartHelper: '初始化会重启服务,导致原有的守护进程全部关闭', + msg: '信息', }, }, }; diff --git a/frontend/src/views/host/tool/supervisor/index.vue b/frontend/src/views/host/tool/supervisor/index.vue index 8fcf39b51..760780d1b 100644 --- a/frontend/src/views/host/tool/supervisor/index.vue +++ b/frontend/src/views/host/tool/supervisor/index.vue @@ -21,8 +21,18 @@