55 lines
2.1 KiB
TypeScript
55 lines
2.1 KiB
TypeScript
/**
|
|
* Copyright (c) 2013-Now http://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, Page } from '@jeesite/core/api/model/baseModel';
|
|
import { UploadApiResult } from '@jeesite/core/api/sys/upload';
|
|
import { UploadFileParams } from '@jeesite/types/axios';
|
|
import { AxiosProgressEvent } from 'axios';
|
|
|
|
const { ctxPath, adminPath } = useGlobSetting();
|
|
|
|
export interface BizDeviceInfo extends BasicModel<BizDeviceInfo> {
|
|
createTime?: string; // 记录时间
|
|
device: string; // 设备名称
|
|
mountPoint: string; // 挂载点
|
|
totalSize: string; // 总容量
|
|
usedSize: string; // 已使用容量
|
|
usageRate: number; // 使用率(%)
|
|
lastOnlineTime: string; // 最后一次检测时间
|
|
hostId: string; // 主机标识
|
|
}
|
|
|
|
export const bizDeviceInfoList = (params?: BizDeviceInfo | any) =>
|
|
defHttp.get<BizDeviceInfo>({ url: adminPath + '/biz/deviceInfo/list', params });
|
|
|
|
export const bizDeviceInfoListAll = (params?: BizDeviceInfo | any) =>
|
|
defHttp.get<BizDeviceInfo[]>({ url: adminPath + '/biz/deviceInfo/listAll', params });
|
|
|
|
export const bizDeviceInfoListData = (params?: BizDeviceInfo | any) =>
|
|
defHttp.post<Page<BizDeviceInfo>>({ url: adminPath + '/biz/deviceInfo/listData', params });
|
|
|
|
export const bizDeviceInfoForm = (params?: BizDeviceInfo | any) =>
|
|
defHttp.get<BizDeviceInfo>({ url: adminPath + '/biz/deviceInfo/form', params });
|
|
|
|
export const bizDeviceInfoSave = (params?: any, data?: BizDeviceInfo | any) =>
|
|
defHttp.postJson<BizDeviceInfo>({ url: adminPath + '/biz/deviceInfo/save', params, data });
|
|
|
|
export const bizDeviceInfoImportData = (
|
|
params: UploadFileParams,
|
|
onUploadProgress: (progressEvent: AxiosProgressEvent) => void,
|
|
) =>
|
|
defHttp.uploadFile<UploadApiResult>(
|
|
{
|
|
url: ctxPath + adminPath + '/biz/deviceInfo/importData',
|
|
onUploadProgress,
|
|
},
|
|
params,
|
|
);
|
|
|
|
export const bizDeviceInfoDelete = (params?: BizDeviceInfo | any) =>
|
|
defHttp.get<BizDeviceInfo>({ url: adminPath + '/biz/deviceInfo/delete', params });
|