Add online status and jumping to nick to Insights page

This commit is contained in:
2022-07-21 13:52:31 +01:00
parent bb8f6d119e
commit 589ee6d735
3 changed files with 28 additions and 3 deletions

View File

@@ -10,6 +10,7 @@ from core.lib.opensearch import query_single_result
from core.lib.threshold import (
annotate_num_chans,
annotate_num_users,
annotate_online,
get_chans,
get_users,
)
@@ -66,9 +67,10 @@ class InsightsNicks(LoginRequiredMixin, APIView):
net = request.data["net"]
nick = request.data["nick"]
nicks = get_nicks(request, net, nick)
online = annotate_online(net, nicks)
if not nicks:
return HttpResponseForbidden()
context = {"net": net, "nick": nick, "nicks": nicks}
context = {"net": net, "nick": nick, "nicks": nicks, "online": online}
return render(request, self.template_name, context)