首页接口重构
This commit is contained in:
58
web-vue/packages/biz/api/biz/myDocker.ts
Normal file
58
web-vue/packages/biz/api/biz/myDocker.ts
Normal file
@@ -0,0 +1,58 @@
|
||||
/**
|
||||
* Copyright (c) 2013-Now https://jeesite.com All rights reserved.
|
||||
* No deletion without permission, or be held responsible to law.
|
||||
* @author gaoxq
|
||||
*/
|
||||
import { defHttp } from '@jeesite/core/utils/http/axios';
|
||||
import { useGlobSetting } from '@jeesite/core/hooks/setting';
|
||||
import { BasicModel } from '@jeesite/core/api/model/baseModel';
|
||||
|
||||
const { adminPath } = useGlobSetting();
|
||||
|
||||
export interface ServerInfo extends BasicModel<ServerInfo> {
|
||||
hostIp?: string; // 主机域名
|
||||
hostPort?: number; // 主机端口
|
||||
username: string; // 登录账号
|
||||
hostName: string; // 主机名称
|
||||
accountId: string; // 账号标识
|
||||
containerId: string; // 容器ID
|
||||
}
|
||||
|
||||
export interface ContainerInfo extends BasicModel<ContainerInfo> {
|
||||
image: string; // 镜像名称
|
||||
command: string; // 启动命令
|
||||
status: string; // 运行状态
|
||||
created: string; // 创建时间
|
||||
names: string; // 容器名称
|
||||
ports: string; // 容器端口
|
||||
containerId: string; // 容器ID
|
||||
accountId: string; // 账号标识
|
||||
}
|
||||
|
||||
export interface DockerResult extends BasicModel<DockerResult> {
|
||||
success: boolean; // 执行状态
|
||||
output: string; // 执行结果
|
||||
error: string; // 异常结果
|
||||
message: string; // 执行信息
|
||||
}
|
||||
|
||||
export const ServerInfo = () =>
|
||||
defHttp.get<ServerInfo[]>({ url: adminPath + '/docker/myServer/listAll' });
|
||||
|
||||
export const ContainerInfo = (params?: ContainerInfo | any) =>
|
||||
defHttp.get<ContainerInfo[]>({ url: adminPath + '/docker/myContainer/listAll', params });
|
||||
|
||||
export const myDockerStart = (params?: ContainerInfo | any) =>
|
||||
defHttp.get<DockerResult>({ url: adminPath + '/docker/myContainer/start', params });
|
||||
|
||||
export const myDockerStop = (params?: ContainerInfo | any) =>
|
||||
defHttp.get<DockerResult>({ url: adminPath + '/docker/myContainer/stop', params });
|
||||
|
||||
export const myDockerRestart = (params?: ContainerInfo | any) =>
|
||||
defHttp.get<DockerResult>({ url: adminPath + '/docker/myContainer/restart', params });
|
||||
|
||||
export const myDockerLogs = (params?: ContainerInfo | any) =>
|
||||
defHttp.get<DockerResult>({ url: adminPath + '/docker/myContainer/logs', params });
|
||||
|
||||
export const myDockerInspect = (params?: ContainerInfo | any) =>
|
||||
defHttp.get<DockerResult>({ url: adminPath + '/docker/myContainer/inspect', params });
|
||||
Reference in New Issue
Block a user