feat: 进程守护状态增加信息列 (#1873)

This commit is contained in:
zhengkunwang 2023-08-08 16:38:12 +08:00 committed by GitHub
parent 075ae253a1
commit 0c4400d6f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 37 additions and 6 deletions

View File

@ -37,4 +37,5 @@ type ProcessStatus struct {
Status string `json:"status"`
PID string `json:"PID"`
Uptime string `json:"uptime"`
Msg string `json:"msg"`
}

View File

@ -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)
}

View File

@ -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',
},
},
};

View File

@ -1594,6 +1594,7 @@ const message = {
initHelper: '尚未初始化 Supervisor 請先初始化',
serviceNameHelper: '當前僅支持 systemctl 管理的 Supervisor 服務',
restartHelper: '初始化會重啟服務導致原有的守護進程全部關閉',
msg: '信息',
},
},
};

View File

@ -1596,6 +1596,7 @@ const message = {
initHelper: '尚未初始化 Supervisor 请先初始化',
serviceNameHelper: '当前仅支持 systemctl 管理的 Supervisor 服务',
restartHelper: '初始化会重启服务导致原有的守护进程全部关闭',
msg: '信息',
},
},
};

View File

@ -21,8 +21,18 @@
<template #main v-if="showTable">
<ComplexTable :data="data" :class="{ mask: !supervisorStatus.isRunning }">
<el-table-column :label="$t('commons.table.name')" fix prop="name" width="150px"></el-table-column>
<el-table-column :label="$t('tool.supervisor.command')" prop="command"></el-table-column>
<el-table-column :label="$t('tool.supervisor.dir')" prop="dir"></el-table-column>
<el-table-column
:label="$t('tool.supervisor.command')"
prop="command"
fix
show-overflow-tooltip
></el-table-column>
<el-table-column
:label="$t('tool.supervisor.dir')"
prop="dir"
fix
show-overflow-tooltip
></el-table-column>
<el-table-column :label="$t('tool.supervisor.user')" prop="user" width="100px"></el-table-column>
<el-table-column
:label="$t('tool.supervisor.numprocs')"
@ -45,11 +55,26 @@
<el-table-column
property="name"
:label="$t('commons.table.name')"
width="300"
fix
show-overflow-tooltip
/>
<el-table-column
property="status"
:label="$t('commons.table.status')"
width="100px"
/>
<el-table-column property="PID" label="PID" width="100px" />
<el-table-column
property="uptime"
:label="$t('tool.supervisor.uptime')"
width="100px"
/>
<el-table-column
property="msg"
:label="$t('tool.supervisor.msg')"
fix
show-overflow-tooltip
/>
<el-table-column property="status" :label="$t('commons.table.status')" />
<el-table-column property="PID" label="PID" />
<el-table-column property="uptime" :label="$t('tool.supervisor.uptime')" />
</el-table>
</el-popover>
</div>