2
0
mirror of https://github.com/acepanel/panel.git synced 2026-02-04 20:57:19 +08:00
This commit is contained in:
耗子
2024-10-11 02:03:10 +08:00
parent 3157011cc0
commit cfc1d46381
2 changed files with 8 additions and 10 deletions

View File

@@ -5,26 +5,26 @@ import { request } from '@/utils'
export default {
// 服务状态
status: (service: string): Promise<AxiosResponse<any>> =>
request.get('/system/service/status', { params: { service } }),
request.get('/systemctl/status', { params: { service } }),
// 是否启用服务
isEnabled: (service: string): Promise<AxiosResponse<any>> =>
request.get('/system/service/isEnabled', { params: { service } }),
request.get('/systemctl/isEnabled', { params: { service } }),
// 启用服务
enable: (service: string): Promise<AxiosResponse<any>> =>
request.post('/system/service/enable', { service }),
request.post('/systemctl/enable', { service }),
// 禁用服务
disable: (service: string): Promise<AxiosResponse<any>> =>
request.post('/system/service/disable', { service }),
request.post('/systemctl/disable', { service }),
// 重启服务
restart: (service: string): Promise<AxiosResponse<any>> =>
request.post('/system/service/restart', { service }),
request.post('/systemctl/restart', { service }),
// 重载服务
reload: (service: string): Promise<AxiosResponse<any>> =>
request.post('/system/service/reload', { service }),
request.post('/systemctl/reload', { service }),
// 启动服务
start: (service: string): Promise<AxiosResponse<any>> =>
request.post('/system/service/start', { service }),
request.post('/systemctl/start', { service }),
// 停止服务
stop: (service: string): Promise<AxiosResponse<any>> =>
request.post('/system/service/stop', { service })
request.post('/systemctl/stop', { service })
}