feat(Admin Dashboard): add crond & sendmail service status and related documentation

This commit is contained in:
cubic
2022-03-16 11:31:38 +08:00
parent 545ede66c6
commit 506c6c5bc2
3 changed files with 49 additions and 1 deletions

View File

@@ -421,6 +421,8 @@ class Admin extends Base
'nginx' => FALSE,
'php' => FALSE,
'codefever' => FALSE,
'crond' => FALSE,
'sendmail' => FALSE
];
$output = [];
@@ -444,6 +446,20 @@ class Admin extends Base
}
}
$output = [];
if (Command::run(['ps uax | grep "crond" | grep -v "grep" | wc -l'], $output)) {
if ($output[0] > 0) {
$service['crond'] = TRUE;
}
}
$output = [];
if (Command::run(['ps uax | grep "sendmail" | grep -v "grep" | wc -l'], $output)) {
if ($output[0] > 0) {
$service['sendmail'] = TRUE;
}
}
Response::output([
'usage' => $usage,
'vm' => $vm,

View File

@@ -34,7 +34,7 @@
### 系统服务状态及维护
`CodeFever`个主要的系统服务, 分别是 `PHP` , `Nginx` `CodeFever` 。如果某个服务异常需要手动重新启动。
`CodeFever`个主要的系统服务, 分别是 `PHP` , `Nginx` , `CodeFever` , `Crond``Sendmail` 。如果某个服务异常需要手动重新启动。
具体服务启动方式如下:
@@ -77,3 +77,29 @@ service codefever stop # 停止
service codefever restart # 重新启动
service codefever status # 查看状态
```
#### Crond
说明: 基础服务, 用于 `CodeFever` 的定时任务时钟事件源
支持的维护命令:
```shell
service conrd start # 启动
service codefever stop # 停止
service codefever restart # 重新启动
service codefever status # 查看状态
```
#### Sendmail
说明: 基础服务, 用于 `CodeFever` 的邮件发送队列管理和代理
支持的维护命令:
```shell
service sendmail start # 启动
service sendmail stop # 停止
service sendmail restart # 重新启动
service sendmail status # 查看状态
```

View File

@@ -110,6 +110,12 @@ class Dashboard extends React.Component {
<Grid item sm={6} md={3}>
<NumbericDashboard title='PHP-FPM' paletteName='fromValue' icon={psNewFeature} numbericValue={pending ? null : this.state.data.service.php ? 'Running' : 'Stopped'} />
</Grid>
<Grid item sm={6} md={3}>
<NumbericDashboard title='Crond' paletteName='fromValue' icon={psNewFeature} numbericValue={pending ? null : this.state.data.service.crond ? 'Running' : 'Stopped'} />
</Grid>
<Grid item sm={6} md={3}>
<NumbericDashboard title='SendMail' paletteName='fromValue' icon={psNewFeature} numbericValue={pending ? null : this.state.data.service.sendmail ? 'Running' : 'Stopped'} />
</Grid>
</Grid>)
}
}