mirror of
https://github.com/acepanel/panel.git
synced 2026-02-06 22:32:24 +08:00
feat: alova.js替换axios
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
import { request } from '@/utils'
|
||||
import { http } from '@/utils'
|
||||
|
||||
export default {
|
||||
// 列表
|
||||
list: (page: number, limit: number): any =>
|
||||
request.get('/apps/s3fs/mounts', { params: { page, limit } }),
|
||||
mounts: (page: number, limit: number): any =>
|
||||
http.Get('/apps/s3fs/mounts', { params: { page, limit } }),
|
||||
// 添加
|
||||
add: (data: any): any => request.post('/apps/s3fs/mounts', data),
|
||||
add: (data: any): any => http.Post('/apps/s3fs/mounts', data),
|
||||
// 删除
|
||||
delete: (id: number): any => request.delete('/apps/s3fs/mounts', { data: { id } })
|
||||
delete: (id: number): any => http.Delete('/apps/s3fs/mounts', { data: { id } })
|
||||
}
|
||||
|
||||
@@ -1,39 +1,38 @@
|
||||
import { request } from '@/utils'
|
||||
import { http } from '@/utils'
|
||||
|
||||
export default {
|
||||
// 服务名称
|
||||
service: (): any => request.get('/apps/supervisor/service'),
|
||||
service: (): any => http.Get('/apps/supervisor/service'),
|
||||
// 获取错误日志
|
||||
log: (): any => request.get('/apps/supervisor/log'),
|
||||
log: (): any => http.Get('/apps/supervisor/log'),
|
||||
// 清空错误日志
|
||||
clearLog: (): any => request.post('/apps/supervisor/clearLog'),
|
||||
clearLog: (): any => http.Post('/apps/supervisor/clearLog'),
|
||||
// 获取配置
|
||||
config: (): any => request.get('/apps/supervisor/config'),
|
||||
config: (): any => http.Get('/apps/supervisor/config'),
|
||||
// 保存配置
|
||||
saveConfig: (config: string): any => request.post('/apps/supervisor/config', { config }),
|
||||
saveConfig: (config: string): any => http.Post('/apps/supervisor/config', { config }),
|
||||
// 进程列表
|
||||
processes: (page: number, limit: number): any =>
|
||||
request.get('/apps/supervisor/processes', { params: { page, limit } }),
|
||||
http.Get('/apps/supervisor/processes', { params: { page, limit } }),
|
||||
// 进程启动
|
||||
startProcess: (process: string): any =>
|
||||
request.post(`/apps/supervisor/processes/${process}/start`),
|
||||
startProcess: (process: string): any => http.Post(`/apps/supervisor/processes/${process}/start`),
|
||||
// 进程停止
|
||||
stopProcess: (process: string): any => request.post(`/apps/supervisor/processes/${process}/stop`),
|
||||
stopProcess: (process: string): any => http.Post(`/apps/supervisor/processes/${process}/stop`),
|
||||
// 进程重启
|
||||
restartProcess: (process: string): any =>
|
||||
request.post(`/apps/supervisor/processes/${process}/restart`),
|
||||
http.Post(`/apps/supervisor/processes/${process}/restart`),
|
||||
// 进程日志
|
||||
processLog: (process: string): any => request.get(`/apps/supervisor/processes/${process}/log`),
|
||||
processLog: (process: string): any => http.Get(`/apps/supervisor/processes/${process}/log`),
|
||||
// 清空进程日志
|
||||
clearProcessLog: (process: string): any =>
|
||||
request.post(`/apps/supervisor/processes/${process}/clearLog`),
|
||||
http.Post(`/apps/supervisor/processes/${process}/clearLog`),
|
||||
// 进程配置
|
||||
processConfig: (process: string): any => request.get(`/apps/supervisor/processes/${process}`),
|
||||
processConfig: (process: string): any => http.Get(`/apps/supervisor/processes/${process}`),
|
||||
// 保存进程配置
|
||||
saveProcessConfig: (process: string, config: string): any =>
|
||||
request.post(`/apps/supervisor/processes/${process}`, { config }),
|
||||
http.Post(`/apps/supervisor/processes/${process}`, { config }),
|
||||
// 创建进程
|
||||
createProcess: (process: any): any => request.post('/apps/supervisor/processes', process),
|
||||
createProcess: (process: any): any => http.Post('/apps/supervisor/processes', process),
|
||||
// 删除进程
|
||||
deleteProcess: (process: string): any => request.delete(`/apps/supervisor/processes/${process}`)
|
||||
deleteProcess: (process: string): any => http.Delete(`/apps/supervisor/processes/${process}`)
|
||||
}
|
||||
|
||||
@@ -1,31 +1,31 @@
|
||||
import { request } from '@/utils'
|
||||
import { http } from '@/utils'
|
||||
|
||||
export default {
|
||||
// DNS
|
||||
dns: (): any => request.get('/apps/toolbox/dns'),
|
||||
dns: (): any => http.Get('/apps/toolbox/dns'),
|
||||
// 设置 DNS
|
||||
updateDns: (dns1: string, dns2: string): any => request.post('/apps/toolbox/dns', { dns1, dns2 }),
|
||||
updateDns: (dns1: string, dns2: string): any => http.Post('/apps/toolbox/dns', { dns1, dns2 }),
|
||||
// SWAP
|
||||
swap: (): any => request.get('/apps/toolbox/swap'),
|
||||
swap: (): any => http.Get('/apps/toolbox/swap'),
|
||||
// 设置 SWAP
|
||||
updateSwap: (size: number): any => request.post('/apps/toolbox/swap', { size }),
|
||||
updateSwap: (size: number): any => http.Post('/apps/toolbox/swap', { size }),
|
||||
// 时区
|
||||
timezone: (): any => request.get('/apps/toolbox/timezone'),
|
||||
timezone: (): any => http.Get('/apps/toolbox/timezone'),
|
||||
// 设置时区
|
||||
updateTimezone: (timezone: string): any => request.post('/apps/toolbox/timezone', { timezone }),
|
||||
updateTimezone: (timezone: string): any => http.Post('/apps/toolbox/timezone', { timezone }),
|
||||
// 设置时间
|
||||
updateTime: (time: string): any => request.post('/apps/toolbox/time', { time }),
|
||||
updateTime: (time: string): any => http.Post('/apps/toolbox/time', { time }),
|
||||
// 同步时间
|
||||
syncTime: (): any => request.post('/apps/toolbox/syncTime'),
|
||||
syncTime: (): any => http.Post('/apps/toolbox/syncTime'),
|
||||
// 主机名
|
||||
hostname: (): any => request.get('/apps/toolbox/hostname'),
|
||||
hostname: (): any => http.Get('/apps/toolbox/hostname'),
|
||||
// Hosts
|
||||
hosts: (): any => request.get('/apps/toolbox/hosts'),
|
||||
hosts: (): any => http.Get('/apps/toolbox/hosts'),
|
||||
// 设置主机名
|
||||
updateHostname: (hostname: string): any => request.post('/apps/toolbox/hostname', { hostname }),
|
||||
updateHostname: (hostname: string): any => http.Post('/apps/toolbox/hostname', { hostname }),
|
||||
// 设置 Hosts
|
||||
updateHosts: (hosts: string): any => request.post('/apps/toolbox/hosts', { hosts }),
|
||||
updateHosts: (hosts: string): any => http.Post('/apps/toolbox/hosts', { hosts }),
|
||||
// 设置 Root 密码
|
||||
updateRootPassword: (password: string): any =>
|
||||
request.post('/apps/toolbox/rootPassword', { password })
|
||||
http.Post('/apps/toolbox/rootPassword', { password })
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user