adding known users column

This commit is contained in:
Alan Roberts 2024-09-04 23:10:40 -04:00
parent 959d5a386a
commit 94bc1a6867
2 changed files with 4 additions and 1 deletions

View file

@ -973,6 +973,7 @@ def admin_instances():
low_bandwidth = request.cookies.get('low_bandwidth', '0') == '1'
instances = Instance.query.order_by(Instance.domain)
user_model = User
if search:
instances = instances.filter(Instance.domain.ilike(f"%{search}%"))
@ -987,7 +988,7 @@ def admin_instances():
return render_template('admin/instances.html', instances=instances,
title=_('Instances'), search=search,
next_url=next_url, prev_url=prev_url,
low_bandwidth=low_bandwidth,
low_bandwidth=low_bandwidth, user_model=user_model,
moderating_communities=moderating_communities(current_user.get_id()),
joined_communities=joined_communities(current_user.get_id()),
menu_topics=menu_topics(), site=g.site)

View file

@ -18,6 +18,7 @@
<th>Domain</th>
<th>Software</th>
<th>Version</th>
<th title="{{ _('Known Users') }}">Users</td>
<th>Posts</th>
<th>Post Replies</th>
<th>Communities</th>
@ -32,6 +33,7 @@
<td><a href="https://{{ instance.domain }}" rel="noopener nofollow noindex noreferrer">{{ instance.domain }}</a></td>
<td>{{ instance.software }}</td>
<td>{{ instance.version if instance.version }}</td>
<td>{{ len(user_model.query.filter_by(instance_id=instance.id).all()) }}</td>
<td>{{ len(instance.posts.all()) }}</td>
<td>{{ len(instance.post_replies.all()) }}</td>
<td>{{ len(instance.communities.all()) }}</td>