This commit is contained in:
Tomas Dvorak
2025-11-02 01:04:02 +01:00
parent ac886502e0
commit b9cea0cd77
153 changed files with 43713 additions and 1700 deletions
+18
View File
@@ -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,