mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2026-09-26 16:00:55 +00:00
feat: Add disk management (#10282)
Co-authored-by: wanghe-fit2cloud <wanghe@fit2cloud.com>
This commit is contained in:
co-authored by
wanghe-fit2cloud
parent
7448953b7d
commit
9c22005b79
@@ -204,4 +204,50 @@ export namespace Host {
|
||||
status: string;
|
||||
message: string;
|
||||
}
|
||||
|
||||
export interface DiskBasicInfo {
|
||||
device: string;
|
||||
size: string;
|
||||
model: string;
|
||||
diskType: string;
|
||||
isRemovable: boolean;
|
||||
isSystem: boolean;
|
||||
filesystem: string;
|
||||
used: string;
|
||||
avail: string;
|
||||
usePercent: number;
|
||||
mountPoint: string;
|
||||
isMounted: boolean;
|
||||
serial: string;
|
||||
}
|
||||
|
||||
export interface DiskInfo extends DiskBasicInfo {
|
||||
partitions?: DiskBasicInfo[];
|
||||
}
|
||||
|
||||
export interface CompleteDiskInfo {
|
||||
disks: DiskInfo[];
|
||||
unpartitionedDisks: DiskBasicInfo[];
|
||||
systemDisk?: DiskInfo;
|
||||
totalDisks: number;
|
||||
totalCapacity: number;
|
||||
}
|
||||
|
||||
export interface DiskPartition {
|
||||
device: string;
|
||||
filesystem: string;
|
||||
label: string;
|
||||
autoMount: boolean;
|
||||
mountPoint: string;
|
||||
}
|
||||
|
||||
export interface DiskMount {
|
||||
device: string;
|
||||
mountPoint: string;
|
||||
filesystem?: string;
|
||||
}
|
||||
|
||||
export interface DiskUmount {
|
||||
mountPoint: string;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -106,5 +106,21 @@ export const loadSSHLogs = (params: Host.searchSSHLog) => {
|
||||
return http.post<ResPage<Host.sshHistory>>(`/hosts/ssh/log`, params);
|
||||
};
|
||||
export const exportSSHLogs = (params: Host.searchSSHLog) => {
|
||||
return http.post<string>('/hosts/ssh/log/export', params, TimeoutEnum.T_40S);
|
||||
return http.post<string>(`/hosts/ssh/log/export`, params, TimeoutEnum.T_40S);
|
||||
};
|
||||
|
||||
export const listDisks = () => {
|
||||
return http.get<Host.CompleteDiskInfo>(`/hosts/disks`);
|
||||
};
|
||||
|
||||
export const partitionDisk = (params: Host.DiskPartition) => {
|
||||
return http.post(`/hosts/disks/partition`, params, TimeoutEnum.T_60S);
|
||||
};
|
||||
|
||||
export const mountDisk = (params: Host.DiskMount) => {
|
||||
return http.post(`/hosts/disks/mount`, params, TimeoutEnum.T_60S);
|
||||
};
|
||||
|
||||
export const unmountDisk = (params: Host.DiskUmount) => {
|
||||
return http.post(`/hosts/disks/unmount`, params, TimeoutEnum.T_60S);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user