mirror of
https://github.com/nextcloud/server.git
synced 2026-06-13 18:50:47 -04:00
Merge pull request #23726 from nextcloud/backport/23711/stable20
[stable20] Fix default quota display value in user row
This commit is contained in:
commit
86c66c29a9
12 changed files with 20 additions and 19 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -154,11 +154,21 @@ export default {
|
|||
return getCurrentUser().uid !== this.user.id || this.settings.isAdmin
|
||||
},
|
||||
userQuota() {
|
||||
if (this.user.quota.quota === 'none') {
|
||||
return t('settings', 'Unlimited')
|
||||
let quota = this.user.quota.quota
|
||||
|
||||
if (quota === 'default') {
|
||||
quota = this.settings.defaultQuota
|
||||
if (quota !== 'none') {
|
||||
// convert to numeric value to match what the server would usually return
|
||||
quota = OC.Util.computerFileSize(quota)
|
||||
}
|
||||
}
|
||||
if (this.user.quota.quota >= 0) {
|
||||
return OC.Util.humanFileSize(this.user.quota.quota)
|
||||
|
||||
// when the default quota is unlimited, the server returns -3 here, map it to "none"
|
||||
if (quota === 'none' || quota === -3) {
|
||||
return t('settings', 'Unlimited')
|
||||
} else if (quota >= 0) {
|
||||
return OC.Util.humanFileSize(quota)
|
||||
}
|
||||
return OC.Util.humanFileSize(0)
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue