Skip to content

Commit

Permalink
use localized memory uage in quota component
Browse files Browse the repository at this point in the history
  • Loading branch information
memurats committed Oct 17, 2023
1 parent 75a62ad commit 8949a0e
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/components/StorageQuota.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
<!-- eslint-disable-next-line vue/no-v-html -->
<p v-html="storageStatsTitle" />
</div>
<ProgressBar :percentage="memoryUsage" />
<p v-if="memoryUsage > 0">
<ProgressBar :percentage="memoryUsed" />
<p v-if="memoryUsed > 0">
{{ t('nmctheme', 'Memory used up to {memoryUsage}%', { memoryUsage }) }}
</p>
<a class="storage-quota__link"
Expand All @@ -26,7 +26,7 @@ import { throttle, debounce } from 'throttle-debounce'
import { generateUrl } from '@nextcloud/router'
import ProgressBar from './ProgressBar.vue'
import axios from '@nextcloud/axios'
import { translate } from '@nextcloud/l10n'
import { translate, getCanonicalLocale } from '@nextcloud/l10n'
export default {
components: {
Expand All @@ -53,9 +53,12 @@ export default {
return `<b>${usedQuotaByte}</b> ${t('nmctheme', 'of')} ${quotaByte}`
},
memoryUsage() {
memoryUsed() {
return parseFloat((this.storageStats?.used / this.storageStats?.quota) * 100).toFixed(2)
},
memoryUsage() {
return parseFloat((this.storageStats?.used / this.storageStats?.quota) * 100).toLocaleString(getCanonicalLocale())
},
},
beforeMount() {
this.loadStorageStats()
Expand Down

0 comments on commit 8949a0e

Please sign in to comment.