Skip to content

Commit

Permalink
Hide quota on external storage
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasHirt committed Dec 9, 2019
1 parent 2cadcbc commit 13364d2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
16 changes: 14 additions & 2 deletions apps/files/src/components/AllFilesList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
‐ {{ filesTotalSize | fileSize }}
</template>
</div>
<div v-if="!publicPage()" class="uk-visible@s uk-width-2-3 uk-width-1-2@xl uk-text-meta uk-flex" :class="{ 'uk-visible@xl' : _sidebarOpen }">
<div v-if="quotaVisible" class="uk-visible@s uk-width-2-3 uk-width-1-2@xl uk-text-meta uk-flex" :class="{ 'uk-visible@xl' : _sidebarOpen }">
<span class="uk-margin-small-right">
<translate>Used space:</translate> {{ quota.used | fileSize }}
<template v-if="quota.definition !== 'default' && quota.definition !== 'none'">
Expand Down Expand Up @@ -158,11 +158,23 @@ export default {
},
computed: {
...mapState(['route']),
...mapGetters('Files', ['loadingFolder', 'activeFiles', 'quota', 'filesTotalSize', 'activeFilesCount']),
...mapGetters('Files', ['loadingFolder', 'activeFiles', 'quota', 'filesTotalSize', 'activeFilesCount', 'currentFolder']),
...mapGetters(['configuration']),
item () {
return this.$route.params.item
},
quotaVisible () {
if (this.publicPage()) {
return false
}
if (this.configuration.hideQuotaOnExternalStorage) {
return this.currentFolder && !this.currentFolder.isMounted()
}
return true
}
},
watch: {
Expand Down
2 changes: 2 additions & 0 deletions src/store/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const state = {
authority: ''
},
rootFolder: '',
hideQuotaOnExternalStorage: false,
theme: {
general: {
name: '',
Expand Down Expand Up @@ -42,6 +43,7 @@ const mutations = {
state.auth = config.auth
state.openIdConnect = config.openIdConnect
state.rootFolder = config.rootFolder === undefined ? '/' : config.rootFolder
state.hideQuotaOnExternalStorage = config.hideQuotaOnExternalStorage === undefined ? false : config.hideQuotaOnExternalStorage
state.state = config.state === undefined ? 'working' : config.state
if (config.corrupted) state.corrupted = config.corrupted
},
Expand Down

0 comments on commit 13364d2

Please sign in to comment.