파일 업로드/다운로드 현황을 모두 볼 수 있는 페이지 구현

This commit is contained in:
static
2025-01-18 10:26:35 +09:00
parent bde090c464
commit 811713cd03
21 changed files with 322 additions and 52 deletions

View File

@@ -1,5 +1,4 @@
import { getFileCache, storeFileCache, downloadFile } from "$lib/modules/file";
import { formatFileSize } from "$lib/modules/util";
export const requestFileDownload = async (
fileId: number,
@@ -13,11 +12,3 @@ export const requestFileDownload = async (
storeFileCache(fileId, fileBuffer); // Intended
return fileBuffer;
};
export const formatDownloadProgress = (progress?: number) => {
return `${Math.floor((progress ?? 0) * 100)}%`;
};
export const formatDownloadRate = (rate?: number) => {
return `${formatFileSize((rate ?? 0) / 8)}/s`;
};