Skip to content

Commit

Permalink
Fix quota display in spaces management table
Browse files Browse the repository at this point in the history
  • Loading branch information
JammingBen committed Jan 13, 2023
1 parent a07ad4f commit 0bd5a3d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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 (
Expand Down

0 comments on commit 0bd5a3d

Please sign in to comment.