diff --git a/frontend/src/common/util.js b/frontend/src/common/util.js index 5525079b3..e9aace805 100644 --- a/frontend/src/common/util.js +++ b/frontend/src/common/util.js @@ -44,6 +44,38 @@ let start = new Date(); const debug = window.__CONFIG__?.debug || window.__CONFIG__?.trace; export default class $util { + static formatBytes(b) { + if (!b) { + return "0 KB"; + } + + if (typeof b === "string") { + b = Number.parseFloat(b); + } + + if (b >= 1073741824) { + const gb = b / 1073741824; + return gb.toFixed(1) + " GB"; + } else if (b >= 1048576) { + const mb = b / 1048576; + return mb.toFixed(1) + " MB"; + } + + return Math.ceil(b / 1024) + " KB"; + } + + static gigaBytes(b) { + if (!b) { + return 0; + } + + if (typeof b === "string") { + b = Number.parseFloat(b); + } + + return Math.round(b / 1073741824); + } + static formatDate(s) { if (!s || !s.length) { return s; diff --git a/frontend/src/component/defaults.js b/frontend/src/component/defaults.js index 1ce7f79cf..e170ae93b 100644 --- a/frontend/src/component/defaults.js +++ b/frontend/src/component/defaults.js @@ -137,6 +137,13 @@ export default { flat: true, transition: false, }, + VNavigationDrawer: { + width: 270, + railWidth: 70, + mobileBreakpoint: 960, + location: "start", + touchless: true, + }, VListItem: { ripple: false, }, diff --git a/frontend/src/component/navigation.vue b/frontend/src/component/navigation.vue index d42037134..fbcca1184 100644 --- a/frontend/src/component/navigation.vue +++ b/frontend/src/component/navigation.vue @@ -50,14 +50,9 @@