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

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

@@ -174,6 +174,10 @@ export const uploadFile = async (
value.status = "canceled";
return value;
});
fileUploadStatusStore.update((value) => {
value = value.filter((v) => v !== status);
return value;
});
return false;
}

View File

@@ -20,3 +20,10 @@ export const formatFileSize = (size: number) => {
if (size < 1024 * 1024 * 1024) return `${(size / 1024 / 1024).toFixed(1)} MiB`;
return `${(size / 1024 / 1024 / 1024).toFixed(1)} GiB`;
};
export const formatNetworkSpeed = (speed: number) => {
if (speed < 1000) return `${speed} bps`;
if (speed < 1000 * 1000) return `${(speed / 1000).toFixed(1)} kbps`;
if (speed < 1000 * 1000 * 1000) return `${(speed / 1000 / 1000).toFixed(1)} Mbps`;
return `${(speed / 1000 / 1000 / 1000).toFixed(1)} Gbps`;
};