mirror of
https://github.com/Dvorinka/MyClubServer.git
synced 2026-06-04 10:42:57 +00:00
dev day #79
This commit is contained in:
@@ -45,6 +45,17 @@ export interface DuplicateFiles {
|
||||
[hash: string]: FileInfo[];
|
||||
}
|
||||
|
||||
export interface StorageUsage {
|
||||
used_bytes: number;
|
||||
used_count: number;
|
||||
quota_mb: number;
|
||||
quota_bytes: number;
|
||||
percent: number;
|
||||
warn_percent: number;
|
||||
critical_percent: number;
|
||||
status: 'ok' | 'warn' | 'critical';
|
||||
}
|
||||
|
||||
export const getAllFiles = async (params?: {
|
||||
search?: string;
|
||||
mime_type?: string;
|
||||
@@ -72,6 +83,13 @@ export const getDuplicateFiles = async (): Promise<DuplicateFiles> => {
|
||||
return response.data;
|
||||
};
|
||||
|
||||
export const getStorageUsage = async (): Promise<StorageUsage> => {
|
||||
const response = await axios.get(`${API_URL}/admin/files/usage`, {
|
||||
withCredentials: true,
|
||||
});
|
||||
return response.data;
|
||||
};
|
||||
|
||||
export const getFileUsages = async (fileId: number): Promise<any[]> => {
|
||||
const response = await axios.get(`${API_URL}/admin/files/${fileId}/usages`, {
|
||||
withCredentials: true,
|
||||
|
||||
Reference in New Issue
Block a user