1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-10 11:21:29 +00:00

[org admin / users] fixup for sort by 'Space Used' (#4682)

This commit is contained in:
llj
2020-09-24 16:53:55 +08:00
committed by GitHub
parent 98ca2dfaa1
commit 44c20e5bc7
4 changed files with 17 additions and 6 deletions

View File

@@ -122,6 +122,17 @@ class UserItem extends React.Component {
);
}
getQuotaTotal = (data) => {
switch (data) {
case -1: // failed to fetch quota
return gettext('Failed');
case -2:
return '--';
default: // data > 0
return Utils.formatSize({bytes: data});
}
}
render() {
let { user, currentTab } = this.props;
let href = siteRoot + 'org/useradmin/info/' + encodeURIComponent(user.email) + '/';
@@ -141,7 +152,7 @@ class UserItem extends React.Component {
onStatusChanged={this.changeStatus}
/>
</td>
<td>{`${user.self_usage} / ${user.quota || '--'}`}</td>
<td>{`${Utils.formatSize({bytes: user.quota_usage})} / ${this.getQuotaTotal(user.quota_total)}`}</td>
<td>
{user.ctime} /
<br />