mirror of
https://github.com/khairul169/garage-webui.git
synced 2026-09-15 00:43:21 +07:00
feat: fix responsive layout, add theme switcher
This commit is contained in:
+1
-1
@@ -13,7 +13,7 @@ export const ucfirst = (text?: string | null) => {
|
||||
export const readableBytes = (bytes?: number | null, divider = 1024) => {
|
||||
if (bytes == null || Number.isNaN(bytes)) return "n/a";
|
||||
|
||||
const sizes = ["Bytes", "KB", "MB", "GB", "TB"];
|
||||
const sizes = ["B", "KB", "MB", "GB", "TB"];
|
||||
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