mirror of
https://github.com/khairul169/garage-webui.git
synced 2026-09-23 20:37:40 +07:00
feat: add keys & bucket permissions management
This commit is contained in:
+1
-2
@@ -14,8 +14,7 @@ export const readableBytes = (bytes?: number | null, divider = 1024) => {
|
||||
if (bytes == null || Number.isNaN(bytes)) return "n/a";
|
||||
|
||||
const sizes = ["Bytes", "KB", "MB", "GB", "TB"];
|
||||
if (bytes === 0) return "n/a";
|
||||
const i = Math.floor(Math.log(bytes) / Math.log(divider));
|
||||
const i = Math.max(0, Math.floor(Math.log(bytes) / Math.log(divider)));
|
||||
|
||||
return `${(bytes / Math.pow(divider, i)).toFixed(1)} ${sizes[i]}`;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user