From 0bd5a3d9a11fd51f932765f7a85bdb1504798bd0 Mon Sep 17 00:00:00 2001 From: Jannik Stehle Date: Fri, 13 Jan 2023 16:19:32 +0100 Subject: [PATCH] Fix quota display in spaces management table --- .../unreleased/enhancement-spaces-list-in-admin-settings | 1 + .../src/components/Spaces/SpacesList.vue | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/changelog/unreleased/enhancement-spaces-list-in-admin-settings b/changelog/unreleased/enhancement-spaces-list-in-admin-settings index 5ab3ec5319e..8c9324841ca 100644 --- a/changelog/unreleased/enhancement-spaces-list-in-admin-settings +++ b/changelog/unreleased/enhancement-spaces-list-in-admin-settings @@ -11,4 +11,5 @@ https://github.com/owncloud/web/pull/8224 https://github.com/owncloud/web/pull/8228 https://github.com/owncloud/web/pull/8229 https://github.com/owncloud/web/pull/8231 +https://github.com/owncloud/web/pull/8238 https://github.com/owncloud/web/issues/8219 diff --git a/packages/web-app-admin-settings/src/components/Spaces/SpacesList.vue b/packages/web-app-admin-settings/src/components/Spaces/SpacesList.vue index 6c41b38188d..0793795111c 100644 --- a/packages/web-app-admin-settings/src/components/Spaces/SpacesList.vue +++ b/packages/web-app-admin-settings/src/components/Spaces/SpacesList.vue @@ -139,6 +139,7 @@ import { useTranslations } from 'web-pkg/src/composables' import { spaceRoleEditor, spaceRoleManager, spaceRoleViewer } from 'web-client/src/helpers/share' import Mark from 'mark.js' import Fuse from 'fuse.js' +import filesize from 'filesize' export default defineComponent({ name: 'SpacesList', @@ -326,19 +327,19 @@ export default defineComponent({ return formatRelativeDateFromJSDate(new Date(date), $language.current) } const getTotalQuota = (space: SpaceResource) => { - return `${space.spaceQuota.total * Math.pow(10, -9)} GB` + return filesize(space.spaceQuota.total) } const getUsedQuota = (space: SpaceResource) => { if (space.spaceQuota.used === undefined) { return '-' } - return `${(space.spaceQuota.used * Math.pow(10, -9)).toFixed(2)} GB` + return filesize(space.spaceQuota.used) } const getRemainingQuota = (space: SpaceResource) => { if (space.spaceQuota.remaining === undefined) { return '-' } - return `${(space.spaceQuota.remaining * Math.pow(10, -9)).toFixed(0)} GB` + return filesize(space.spaceQuota.remaining) } const getMemberCount = (space: SpaceResource) => { return (