feat:对接ACS容器和虚拟机

This commit is contained in:
2025-09-11 22:57:54 +08:00
parent 67ce6f66ac
commit d9021caca2
18 changed files with 13389 additions and 47 deletions
+68
View File
@@ -0,0 +1,68 @@
import {http2} from "@/utils/request.js";
export const getFileList = (data) => {
return http2.get(`/v1/file/list?container_id=${data.container_id}&path=${data.path}`)
}
/** 读取文件内容 */
export const readFile = (data) => {
return http2.post(`/v1/file/read`,data, {
headers: {
"Content-Type": "multipart/form-data"
}
})
}
/*删除文件或文件夹 */
export const deleteFile = (data) => {
return http2.post(`/v1/file/delete`,data, {
headers: {
"Content-Type": "multipart/form-data"
}
})
}
/*写入文件 */
export const writeFile = (data) => {
return http2.post(`/v1/file/write`,data, {
headers: {
"Content-Type": "multipart/form-data"
}
})
}
/*创建文件夹 */
export const createFolder = (data) => {
return http2.post(`/v1/file/mkdir`,data, {
headers: {
"Content-Type": "multipart/form-data"
}
})
}
/**上传文件 */
export const uploadFile = (data) => {
return http2.post(`/v1/file/upload_file`,data, {
headers: {
"Content-Type": "multipart/form-data"
}
})
}
/**下载文件链接 */
export const downloadFile = (data) => {
return http2.post(`/v1/file/get_down_link`,data, {
headers: {
"Content-Type": "multipart/form-data"
}
})
}
/**压缩文件 */
export const compressFile = (data) => {
return http2.post(`/v1/file/zip_file`,data, {
headers: {
"Content-Type": "multipart/form-data"
}
})
}
/**解压文件 */
export const decompressFile = (data) => {
return http2.post(`/v1/file/unzip_file`,data, {
headers: {
"Content-Type": "multipart/form-data"
}
})
}
+12 -1
View File
@@ -53,6 +53,16 @@ export const selectServerPlan = data => {
}
});
};
/**删除容器网络 */
export const deleteContainerNetwork = data => {
return http2.post("/v1/user/container/delete_connect", data, {
headers: {
"Content-Type": "multipart/form-data"
}
});
};
/**修改套餐信息 */
export const editServerPlan = data => {
return http2.post("/v1/admin/container_plan/update_server_plan", data, {
@@ -275,7 +285,7 @@ export const getInstanceConsole = data => {
};
/**查询容器所有卷信息 */
export const getVolumeList = data => {
return http2.get(`/v1/admin/volume/get_volume_list?container_id=${data}`);
return http2.get(`/v1/admin/volume/get_volume_list?instance_id=${data.instance_id}&page=${data.page}&count=${data.count}`);
};
/**查询虚拟机所有卷信息 */
export const getInstanceVolumeList = data => {
@@ -307,6 +317,7 @@ export const deleteVolume = data => {
}
});
};
/**获取容器网络信息 */
export const getNetworkList = data => {
return http2.get(