56 lines
2.1 KiB
TypeScript
56 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 BizServerInfo extends BasicModel<BizServerInfo> {
|
|
createTime?: string; // 记录时间
|
|
uptime: string; // 主机运行时间
|
|
os: string; // 操作系统
|
|
kernelVersion: string; // 内核版本
|
|
hostname: string; // 主机名称
|
|
ipAddress: string; // 主机地址
|
|
cpuModel: string; // CPU型号
|
|
memoryTotal: string; // 内存总量
|
|
cpuUsage: number; // CPU使用率(%)
|
|
memoryUsage: number; // 内存使用率(%)
|
|
lastOnlineTime: string; // 最后一次检测时间
|
|
hostId: string; // 主机标识
|
|
}
|
|
|
|
export const bizServerInfoList = (params?: BizServerInfo | any) =>
|
|
defHttp.get<BizServerInfo>({ url: adminPath + '/biz/serverInfo/list', params });
|
|
|
|
export const bizServerInfoListData = (params?: BizServerInfo | any) =>
|
|
defHttp.post<Page<BizServerInfo>>({ url: adminPath + '/biz/serverInfo/listData', params });
|
|
|
|
export const bizServerInfoForm = (params?: BizServerInfo | any) =>
|
|
defHttp.get<BizServerInfo>({ url: adminPath + '/biz/serverInfo/form', params });
|
|
|
|
export const bizServerInfoSave = (params?: any, data?: BizServerInfo | any) =>
|
|
defHttp.postJson<BizServerInfo>({ url: adminPath + '/biz/serverInfo/save', params, data });
|
|
|
|
export const bizServerInfoImportData = (
|
|
params: UploadFileParams,
|
|
onUploadProgress: (progressEvent: AxiosProgressEvent) => void,
|
|
) =>
|
|
defHttp.uploadFile<UploadApiResult>(
|
|
{
|
|
url: ctxPath + adminPath + '/biz/serverInfo/importData',
|
|
onUploadProgress,
|
|
},
|
|
params,
|
|
);
|
|
|
|
export const bizServerInfoDelete = (params?: BizServerInfo | any) =>
|
|
defHttp.get<BizServerInfo>({ url: adminPath + '/biz/serverInfo/delete', params });
|