mirror of
https://github.com/kmc7468/arkvault.git
synced 2025-12-16 06:58:46 +00:00
파일 업로드/다운로드 현황을 모두 볼 수 있는 페이지 구현
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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`;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user