Improve admin views

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2022-01-13 15:04:43 +01:00
parent d428d1ddf7
commit ca6ef9b06b
13 changed files with 382 additions and 343 deletions

View File

@@ -19,8 +19,8 @@ function localeShortWeekDayNames(): string[] {
}
// https://stackoverflow.com/a/18650828/10204399
function formatBytes(bytes: number, decimals = 2): string {
if (bytes === 0) return "0 Bytes";
function formatBytes(bytes: number, decimals = 2, zero = "0 Bytes"): string {
if (bytes === 0) return zero;
const k = 1024;
const dm = decimals < 0 ? 0 : decimals;