mirror of
https://github.com/acepanel/panel.git
synced 2026-02-05 13:37:21 +08:00
feat: alova.js替换axios
This commit is contained in:
@@ -1,57 +1,57 @@
|
||||
import { request } from '@/utils'
|
||||
import { http } from '@/utils'
|
||||
|
||||
export default {
|
||||
// 获取容器列表
|
||||
containerList: (page: number, limit: number): any =>
|
||||
request.get('/container/container', { params: { page, limit } }),
|
||||
http.Get('/container/container', { params: { page, limit } }),
|
||||
// 添加容器
|
||||
containerCreate: (config: any): any => request.post('/container/container', config),
|
||||
containerCreate: (config: any): any => http.Post('/container/container', config),
|
||||
// 删除容器
|
||||
containerRemove: (id: string): any => request.delete(`/container/container/${id}`),
|
||||
containerRemove: (id: string): any => http.Delete(`/container/container/${id}`),
|
||||
// 启动容器
|
||||
containerStart: (id: string): any => request.post(`/container/container/${id}/start`),
|
||||
containerStart: (id: string): any => http.Post(`/container/container/${id}/start`),
|
||||
// 停止容器
|
||||
containerStop: (id: string): any => request.post(`/container/container/${id}/stop`),
|
||||
containerStop: (id: string): any => http.Post(`/container/container/${id}/stop`),
|
||||
// 重启容器
|
||||
containerRestart: (id: string): any => request.post(`/container/container/${id}/restart`),
|
||||
containerRestart: (id: string): any => http.Post(`/container/container/${id}/restart`),
|
||||
// 暂停容器
|
||||
containerPause: (id: string): any => request.post(`/container/container/${id}/pause`),
|
||||
containerPause: (id: string): any => http.Post(`/container/container/${id}/pause`),
|
||||
// 恢复容器
|
||||
containerUnpause: (id: string): any => request.post(`/container/container/${id}/unpause`),
|
||||
containerUnpause: (id: string): any => http.Post(`/container/container/${id}/unpause`),
|
||||
// 杀死容器
|
||||
containerKill: (id: string): any => request.post(`/container/container/${id}/kill`),
|
||||
containerKill: (id: string): any => http.Post(`/container/container/${id}/kill`),
|
||||
// 重命名容器
|
||||
containerRename: (id: string, name: string): any =>
|
||||
request.post(`/container/container/${id}/rename`, { name }),
|
||||
http.Post(`/container/container/${id}/rename`, { name }),
|
||||
// 获取容器日志
|
||||
containerLogs: (id: string): any => request.get(`/container/container/${id}/logs`),
|
||||
containerLogs: (id: string): any => http.Get(`/container/container/${id}/logs`),
|
||||
// 清理容器
|
||||
containerPrune: (): any => request.post(`/container/container/prune`),
|
||||
containerPrune: (): any => http.Post(`/container/container/prune`),
|
||||
// 获取网络列表
|
||||
networkList: (page: number, limit: number): any =>
|
||||
request.get(`/container/network`, { params: { page, limit } }),
|
||||
http.Get(`/container/network`, { params: { page, limit } }),
|
||||
// 创建网络
|
||||
networkCreate: (config: any): any => request.post(`/container/network`, config),
|
||||
networkCreate: (config: any): any => http.Post(`/container/network`, config),
|
||||
// 删除网络
|
||||
networkRemove: (id: string): any => request.delete(`/container/network/${id}`),
|
||||
networkRemove: (id: string): any => http.Delete(`/container/network/${id}`),
|
||||
// 清理网络
|
||||
networkPrune: (): any => request.post(`/container/network/prune`),
|
||||
networkPrune: (): any => http.Post(`/container/network/prune`),
|
||||
// 获取镜像列表
|
||||
imageList: (page: number, limit: number): any =>
|
||||
request.get(`/container/image`, { params: { page, limit } }),
|
||||
http.Get(`/container/image`, { params: { page, limit } }),
|
||||
// 拉取镜像
|
||||
imagePull: (config: any): any => request.post(`/container/image`, config),
|
||||
imagePull: (config: any): any => http.Post(`/container/image`, config),
|
||||
// 删除镜像
|
||||
imageRemove: (id: string): any => request.delete(`/container/image/${id}`),
|
||||
imageRemove: (id: string): any => http.Delete(`/container/image/${id}`),
|
||||
// 清理镜像
|
||||
imagePrune: (): any => request.post(`/container/image/prune`),
|
||||
imagePrune: (): any => http.Post(`/container/image/prune`),
|
||||
// 获取卷列表
|
||||
volumeList: (page: number, limit: number): any =>
|
||||
request.get(`/container/volume`, { params: { page, limit } }),
|
||||
http.Get(`/container/volume`, { params: { page, limit } }),
|
||||
// 创建卷
|
||||
volumeCreate: (config: any): any => request.post(`/container/volume`, config),
|
||||
volumeCreate: (config: any): any => http.Post(`/container/volume`, config),
|
||||
// 删除卷
|
||||
volumeRemove: (id: string): any => request.delete(`/container/volume/${id}`),
|
||||
volumeRemove: (id: string): any => http.Delete(`/container/volume/${id}`),
|
||||
// 清理卷
|
||||
volumePrune: (): any => request.post(`/container/volume/prune`)
|
||||
volumePrune: (): any => http.Post(`/container/volume/prune`)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user