354 lines
7.5 KiB
TypeScript
354 lines
7.5 KiB
TypeScript
// import request from '@/utils/request';
|
|
import { useHttp } from '@crami/http';
|
|
|
|
interface createFileVolume {
|
|
appCode: string;
|
|
volumeCode: string;
|
|
volumeName: string;
|
|
volumeDescription: string;
|
|
storageCode: string;
|
|
fileLimitType: string; //文件类型
|
|
singleFileLimit: string; //单文件大小限制(KB)
|
|
volumeCapacityLimit: string; //文件卷容量上限(GB)
|
|
volumeUsedCapacity: string; //文件卷已使用容量(GB)
|
|
volumeCapacityWarning: string; //文件卷容量预警值(GB)
|
|
typeLimit: string; //类型限制
|
|
}
|
|
interface editFileVolume {
|
|
eid: string;
|
|
appCode: string;
|
|
volumeCode: string;
|
|
volumeName: string;
|
|
volumeDescription: string;
|
|
storageCode: string;
|
|
fileLimitType: string; //文件类型
|
|
singleFileLimit: string; //单文件大小限制(KB)
|
|
volumeCapacityLimit: string; //文件卷容量上限(GB)
|
|
volumeUsedCapacity: string; //文件卷已使用容量(GB)
|
|
volumeCapacityWarning: string; //文件卷容量预警值(GB)
|
|
typeLimit: string; //类型限制
|
|
}
|
|
|
|
interface editApplication {
|
|
eid: string;
|
|
appCode: string;
|
|
appName: string;
|
|
appDescription: string;
|
|
}
|
|
|
|
interface createApplication {
|
|
appCode: string;
|
|
appName: string;
|
|
appDescription: string;
|
|
}
|
|
|
|
interface deleteFileVolume {
|
|
EID: string;
|
|
}
|
|
|
|
interface fileList {
|
|
eid: string;
|
|
appCode: string;
|
|
volumeCode: string;
|
|
filePath: string;
|
|
fileShowName: string;
|
|
fileDescription: string;
|
|
versionCode: string;
|
|
metaInfo: string;
|
|
expiresOn: string;
|
|
isgeneralfile: string;
|
|
fileSize: string;
|
|
fileType: string;
|
|
}
|
|
|
|
interface createExtensions {
|
|
eid: string;
|
|
extensionName: string; //插件名称
|
|
extensionDescription: string; //插件描述
|
|
extensionId: string; //插string;件标识
|
|
serviceCode: string; //服务标识
|
|
inUse: string; //是否启用
|
|
fileTypes: string; //文件类型
|
|
}
|
|
|
|
interface createStorage {
|
|
eid: string;
|
|
storageName: string; //存储名称
|
|
storageDescription: string; //存储描述
|
|
states: string; //状态
|
|
accAddress: string; //地址
|
|
accUser: string; //用户
|
|
accPwd: string; //密码
|
|
capacityWarning: BigInt;
|
|
usedCapacity: BigInt;
|
|
}
|
|
|
|
/*
|
|
新建文件卷
|
|
*/
|
|
|
|
export async function createFileVolume(params: createFileVolume) {
|
|
return await useHttp({
|
|
method: 'post',
|
|
url: '/api/file/fileVolume/createFileVolume',
|
|
params,
|
|
});
|
|
}
|
|
/*
|
|
编辑文件卷
|
|
*/
|
|
|
|
export async function editFileVolume(params: editFileVolume) {
|
|
return await useHttp({
|
|
method: 'put',
|
|
url: '/api/file/fileVolume/editFileVolume',
|
|
params,
|
|
});
|
|
}
|
|
|
|
/*
|
|
删除文件卷
|
|
*/
|
|
|
|
export async function deleteFileVolume(eid: string) {
|
|
return await useHttp({
|
|
method: 'get',
|
|
url: `/api/file/fileVolume/${eid}`,
|
|
});
|
|
}
|
|
|
|
/*
|
|
新建文件卷获取主存储集群数据
|
|
*/
|
|
|
|
export async function duplicationStrategy() {
|
|
return await useHttp({
|
|
method: 'get',
|
|
url: '/api/file/storage/getOtherStrategy',
|
|
});
|
|
}
|
|
/*
|
|
编辑文件卷回显主集群数据
|
|
*/
|
|
|
|
export async function getDetail(eid: string) {
|
|
return await useHttp({
|
|
method: 'get',
|
|
url: `/api/file/fileVolume/getDetailMsg/${eid}`,
|
|
});
|
|
}
|
|
|
|
//删除历史版本
|
|
|
|
export async function deleteHistory(eid: string) {
|
|
return await useHttp({
|
|
method: 'delete',
|
|
url: `/api/file/applicationFile/deleteHistoryFile/${eid}`,
|
|
});
|
|
}
|
|
|
|
//替换当前版本
|
|
|
|
export async function updateHistory(eid: string) {
|
|
return await useHttp({
|
|
method: 'get',
|
|
url: `/api/file/applicationFile/changeHistoryVersion/${eid}`,
|
|
});
|
|
}
|
|
|
|
// 新增应用仓库
|
|
|
|
export async function createApplication(params: createApplication) {
|
|
return await useHttp({
|
|
method: 'post',
|
|
url: '/api/file/applications/createApplication',
|
|
params,
|
|
});
|
|
}
|
|
|
|
// 编辑应用仓库
|
|
|
|
export async function editApplication(params: editApplication) {
|
|
return await useHttp({
|
|
method: 'put',
|
|
url: '/api/file/applications/editApplication',
|
|
params,
|
|
});
|
|
}
|
|
|
|
// 删除应用仓库
|
|
export async function deleteApplication(eid: string) {
|
|
return await useHttp({
|
|
method: 'delete',
|
|
url: `/api/file/applications/${eid}`,
|
|
});
|
|
}
|
|
|
|
// 新建文件信息保存
|
|
|
|
export async function createApplicationFile(params: fileList) {
|
|
return await useHttp({
|
|
method: 'post',
|
|
url: '/api/file/applicationFile/createApplicationFile',
|
|
params,
|
|
});
|
|
}
|
|
|
|
// 编辑文件信息保存
|
|
|
|
export async function editApplicationFile(params: fileList) {
|
|
return await useHttp({
|
|
method: 'put',
|
|
url: '/api/file/applicationFile/editApplicationFile',
|
|
params,
|
|
});
|
|
}
|
|
|
|
// 删除文件信息列表
|
|
|
|
export async function applicationFile(eid: string) {
|
|
return await useHttp({
|
|
method: 'delete',
|
|
url: `/api/file/applicationFile/${eid}`,
|
|
});
|
|
}
|
|
|
|
// 存储结构禁用
|
|
|
|
export async function changeStateDisable(eid: string) {
|
|
return await useHttp({
|
|
method: 'get',
|
|
url: `/api/file/storage/changeStateDisable/${eid}`,
|
|
});
|
|
}
|
|
|
|
// 存储结构启用
|
|
export async function changeStateEnable(eid: string) {
|
|
return await useHttp({
|
|
method: 'get',
|
|
url: `/api/file/storage/changeStateEnable/${eid}`,
|
|
});
|
|
}
|
|
|
|
// 传输策略启用
|
|
export async function transferEnable(eid: string) {
|
|
return await useHttp({
|
|
method: 'get',
|
|
url: `/api/file/transfer/changeStateEnable/${eid}`,
|
|
});
|
|
}
|
|
// 传输策略禁用
|
|
export async function transferDisable(eid: string) {
|
|
return await useHttp({
|
|
method: 'get',
|
|
url: `/api/file/transfer/changeStateDisable/${eid}`,
|
|
});
|
|
}
|
|
|
|
// 插件管理新增保存
|
|
export async function createExtensions(params: createExtensions) {
|
|
return await useHttp({
|
|
method: 'post',
|
|
url: '/api/file/transfer/createExtensions',
|
|
params,
|
|
});
|
|
}
|
|
// 插件管理编辑保存
|
|
|
|
export async function editExtensions(params: createExtensions) {
|
|
return await useHttp({
|
|
method: 'put',
|
|
url: '/api/file/transfer/editExtensions',
|
|
params,
|
|
});
|
|
}
|
|
|
|
// 存储结构新增保存
|
|
|
|
export async function createStorage(params: createStorage) {
|
|
return await useHttp({
|
|
method: 'post',
|
|
url: '/api/file/storage/createStorage',
|
|
params,
|
|
});
|
|
}
|
|
// 存储结构编辑保存
|
|
export async function editStorage(params: createStorage) {
|
|
return await useHttp({
|
|
method: 'put',
|
|
url: '/api/file/storage/editStorage',
|
|
params,
|
|
});
|
|
}
|
|
|
|
// 存储结构管理删除
|
|
export async function deleteStorage(eid: string) {
|
|
return await useHttp({
|
|
method: 'delete',
|
|
url: `/api/file/storage/Storage/${eid}`,
|
|
});
|
|
}
|
|
//文件同步服务--删除
|
|
interface DeleteParams {
|
|
eidstr: Array<string>;
|
|
}
|
|
|
|
|
|
export async function deleteFileSync(params: DeleteParams) {
|
|
return await useHttp({
|
|
method: 'post',
|
|
url: '/api/system/model/deleteObjectData',
|
|
params,
|
|
});
|
|
}
|
|
//重试同步
|
|
export async function reTrySync(params: DeleteParams) {
|
|
return await useHttp({
|
|
method: 'post',
|
|
url: '/api/file/syncRecord/retryFileSync',
|
|
params,
|
|
});
|
|
}
|
|
|
|
// interface eidArr {
|
|
// eid: Array;
|
|
// }
|
|
interface storageIds {
|
|
storageIds: Array<string>;
|
|
}
|
|
export async function getResetAlert(params: storageIds) {
|
|
return await useHttp({
|
|
method: 'post',
|
|
url: '/api/file/storage/getResetAlert',
|
|
params,
|
|
});
|
|
}
|
|
|
|
//文件卷容量预警
|
|
interface volumeIds {
|
|
volumeIds: Array<string>;
|
|
}
|
|
export async function resetWarn(params: volumeIds) {
|
|
return await useHttp({
|
|
method: 'post',
|
|
url: '/api/file/fileVolume/resetWarn',
|
|
params,
|
|
});
|
|
}
|
|
|
|
//存储集群详情
|
|
export async function getStorageByData(eid: string) {
|
|
return await useHttp({
|
|
method: 'get',
|
|
url: `/api/file/storage/getStorageByData/${eid}`,
|
|
});
|
|
}
|
|
|
|
//查看文件信息列表
|
|
export async function getFileByData(eid: string) {
|
|
return await useHttp({
|
|
method: 'get',
|
|
url: `/api/file/applicationFile/getFileByData/${eid}`,
|
|
});
|
|
}
|