1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-08 18:30:53 +00:00

show quota in deparment page

This commit is contained in:
LeoSirius
2019-06-27 18:38:23 +08:00
parent 9185d675bd
commit 4beb2eea16
3 changed files with 9 additions and 1 deletions

View File

@@ -9,6 +9,8 @@ class Group {
this.parent_group_id = object.parent_group_id;
this.wiki_enabled = object.wiki_enabled;
this.repos = object.repos || [];
this.group_quota = object.group_quota;
this.group_quota_usage = object.group_quota_usage;
}
}

View File

@@ -388,7 +388,10 @@ class GroupView extends React.Component {
<span className="path-split">/</span>
<span>{currentGroup.name}</span>
{currentGroup.parent_group_id !== 0 && (
<span className="department-group-icon fas fa-building" title={gettext('This is a special group representing a department.')}></span>
<Fragment>
<span className="department-group-icon fas fa-building" title={gettext('This is a special group representing a department.')}></span>
<span>{' '}{''}{gettext('Used:')}{' '}{Utils.bytesToSize(currentGroup.group_quota_usage)}{'/'}{Utils.bytesToSize(currentGroup.group_quota)}{''}</span>
</Fragment>
)}
</div>
<div className="path-tool">

View File

@@ -68,6 +68,9 @@ def get_group_info(request, group_id, avatar_size=GROUP_AVATAR_DEFAULT_SIZE):
"admins": get_group_admins(group.id),
"wiki_enabled": is_wiki_mod_enabled_for_group(group_id)
}
if group.parent_group_id != 0:
group_info['group_quota'] = seafile_api.get_group_quota(group_id)
group_info['group_quota_usage'] = seafile_api.get_group_quota_usage(group_id)
return group_info