Merge pull request #18818 from nextcloud/rethink_quota
change quota design
This commit is contained in:
commit
e4adccbc61
|
@ -1614,14 +1614,14 @@ doesnotexist:-o-prefocus, .strengthify-wrapper {
|
||||||
}
|
}
|
||||||
|
|
||||||
&.quota {
|
&.quota {
|
||||||
height: 44px;
|
display: flex;;
|
||||||
display: flex;
|
justify-content: left;
|
||||||
align-items: center;
|
white-space: nowrap;
|
||||||
justify-content: center;
|
position: relative;
|
||||||
|
|
||||||
progress {
|
progress {
|
||||||
width: 100%;
|
width: 150px;
|
||||||
margin: 0 10px;
|
margin-top: 35px;
|
||||||
height: 3px;
|
height: 3px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
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
|
@ -32,13 +32,16 @@
|
||||||
<div v-if="subAdminsGroups.length > 0 && settings.isAdmin" class="subAdminsGroups">
|
<div v-if="subAdminsGroups.length > 0 && settings.isAdmin" class="subAdminsGroups">
|
||||||
{{ userSubAdminsGroupsLabels }}
|
{{ userSubAdminsGroupsLabels }}
|
||||||
</div>
|
</div>
|
||||||
<div v-tooltip.auto="usedSpace" class="quota">
|
<div class="userQuota">
|
||||||
|
<div class="quota">
|
||||||
|
{{ userQuota }} ({{ usedSpace }})
|
||||||
<progress
|
<progress
|
||||||
class="quota-user-progress"
|
class="quota-user-progress"
|
||||||
:class="{'warn': usedQuota > 80}"
|
:class="{'warn': usedQuota > 80}"
|
||||||
:value="usedQuota"
|
:value="usedQuota"
|
||||||
max="100" />
|
max="100" />
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
<div v-if="showConfig.showLanguages" class="languages">
|
<div v-if="showConfig.showLanguages" class="languages">
|
||||||
{{ userLanguage.name }}
|
{{ userLanguage.name }}
|
||||||
</div>
|
</div>
|
||||||
|
@ -55,7 +58,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="userActions">
|
<div class="userActions">
|
||||||
<div v-if="canEditUser(user) && !loading.all" class="toggleUserActions">
|
<div v-if="canEdit && !loading.all" class="toggleUserActions">
|
||||||
<Actions>
|
<Actions>
|
||||||
<ActionButton icon="icon-rename" @click="toggleEdit">
|
<ActionButton icon="icon-rename" @click="toggleEdit">
|
||||||
{{ t('settings', 'Edit User') }}
|
{{ t('settings', 'Edit User') }}
|
||||||
|
@ -79,6 +82,7 @@
|
||||||
<script>
|
<script>
|
||||||
import { PopoverMenu, Actions, ActionButton } from '@nextcloud/vue'
|
import { PopoverMenu, Actions, ActionButton } from '@nextcloud/vue'
|
||||||
import ClickOutside from 'vue-click-outside'
|
import ClickOutside from 'vue-click-outside'
|
||||||
|
import { getCurrentUser } from '@nextcloud/auth'
|
||||||
|
|
||||||
import UserRowMixin from '../../mixins/UserRowMixin'
|
import UserRowMixin from '../../mixins/UserRowMixin'
|
||||||
export default {
|
export default {
|
||||||
|
@ -143,9 +147,19 @@ export default {
|
||||||
}
|
}
|
||||||
return t('settings', '{size} used', { size: OC.Util.humanFileSize(0) })
|
return t('settings', '{size} used', { size: OC.Util.humanFileSize(0) })
|
||||||
},
|
},
|
||||||
canEditUser() {
|
canEdit() {
|
||||||
return (user) => this.settings.isAdmin || user.id !== OC.getCurrentUser().uid
|
return getCurrentUser().uid !== this.user.id && this.user.id !== 'admin'
|
||||||
},
|
},
|
||||||
|
userQuota() {
|
||||||
|
if (this.user.quota.quota === 'none') {
|
||||||
|
return t('settings', 'Unlimited')
|
||||||
|
}
|
||||||
|
if (this.user.quota.quota >= 0) {
|
||||||
|
return OC.Util.humanFileSize(this.user.quota.quota)
|
||||||
|
}
|
||||||
|
return OC.Util.humanFileSize(0)
|
||||||
|
},
|
||||||
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
hideMenu() {
|
hideMenu() {
|
||||||
|
|
Loading…
Reference in New Issue