mirror of
https://github.com/haiwen/seahub.git
synced 2025-08-12 04:12:16 +00:00
[org admin / users] fixup for sort by 'Space Used' (#4682)
This commit is contained in:
parent
98ca2dfaa1
commit
44c20e5bc7
@ -11,8 +11,8 @@ class OrgUserInfo {
|
|||||||
this.email = object.email;
|
this.email = object.email;
|
||||||
this.contact_email = object.owner_contact_email;
|
this.contact_email = object.owner_contact_email;
|
||||||
this.is_active = object.is_active;
|
this.is_active = object.is_active;
|
||||||
this.quota = object.quota > 0 ? Utils.bytesToSize(object.quota) : '';
|
this.quota_usage = object.quota_usage;
|
||||||
this.self_usage = Utils.bytesToSize(object.self_usage);
|
this.quota_total = object.quota_total;
|
||||||
this.last_login = object.last_login ? moment(object.last_login).fromNow() : '--';
|
this.last_login = object.last_login ? moment(object.last_login).fromNow() : '--';
|
||||||
this.ctime = moment(object.ctime).format('YYYY-MM-DD HH:mm:ss');
|
this.ctime = moment(object.ctime).format('YYYY-MM-DD HH:mm:ss');
|
||||||
}
|
}
|
||||||
|
@ -53,7 +53,7 @@ class OrgAdminList extends React.Component {
|
|||||||
{orgAdminUsers.map(item => {
|
{orgAdminUsers.map(item => {
|
||||||
return (
|
return (
|
||||||
<UserItem
|
<UserItem
|
||||||
key={item.id}
|
key={item.index}
|
||||||
user={item}
|
user={item}
|
||||||
currentTab="admins"
|
currentTab="admins"
|
||||||
isItemFreezed={this.state.isItemFreezed}
|
isItemFreezed={this.state.isItemFreezed}
|
||||||
|
@ -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() {
|
render() {
|
||||||
let { user, currentTab } = this.props;
|
let { user, currentTab } = this.props;
|
||||||
let href = siteRoot + 'org/useradmin/info/' + encodeURIComponent(user.email) + '/';
|
let href = siteRoot + 'org/useradmin/info/' + encodeURIComponent(user.email) + '/';
|
||||||
@ -141,7 +152,7 @@ class UserItem extends React.Component {
|
|||||||
onStatusChanged={this.changeStatus}
|
onStatusChanged={this.changeStatus}
|
||||||
/>
|
/>
|
||||||
</td>
|
</td>
|
||||||
<td>{`${user.self_usage} / ${user.quota || '--'}`}</td>
|
<td>{`${Utils.formatSize({bytes: user.quota_usage})} / ${this.getQuotaTotal(user.quota_total)}`}</td>
|
||||||
<td>
|
<td>
|
||||||
{user.ctime} /
|
{user.ctime} /
|
||||||
<br />
|
<br />
|
||||||
|
@ -71,10 +71,10 @@ class OrgUsersList extends React.Component {
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{orgUsers.map(item => {
|
{orgUsers.map((item, index) => {
|
||||||
return (
|
return (
|
||||||
<UserItem
|
<UserItem
|
||||||
key={item.id}
|
key={index}
|
||||||
user={item}
|
user={item}
|
||||||
currentTab="users"
|
currentTab="users"
|
||||||
isItemFreezed={this.state.isItemFreezed}
|
isItemFreezed={this.state.isItemFreezed}
|
||||||
|
Loading…
Reference in New Issue
Block a user