diff --git a/core/templates/ui/insights/meta.html b/core/templates/ui/insights/meta.html index f1c55ad..9cfb858 100644 --- a/core/templates/ui/insights/meta.html +++ b/core/templates/ui/insights/meta.html @@ -1,63 +1,19 @@
- {% for item in meta %} - + {% for key,items in meta.items %} + +
{{ key }}
- {% if 'ts' in item %} + {% for item in items %} - - {% endif %} - {% if 'nick' in item %} - - - - - {% endif %} - {% if 'ident' in item %} - - - - - {% endif %} - {% if 'host' in item %} - - - - - {% endif %} - {% if 'realname' in item %} - - - - - {% endif %} - {% if 'status' in item %} - - - - - {% endif %} - {% if 'server' in item %} - - - - - {% endif %} - {% if 'channel' in item %} - - - - - {% endif %} + {% endfor %}
ts -

{{ item.date }}

-

{{ item.time }}

+ {{ item }}
nick{{ item.nick }}
ident{{ item.ident }}
host{{ item.host }}
realname{{ item.realname }}
status{{ item.status }}
server{{ item.server }}
channel{{ item.channel }}
-
{% endfor %}
diff --git a/core/views/dynamic/insights.py b/core/views/dynamic/insights.py index 972d74d..a177329 100644 --- a/core/views/dynamic/insights.py +++ b/core/views/dynamic/insights.py @@ -107,16 +107,15 @@ class InsightsMeta(LoginRequiredMixin, APIView): if k in ["ts", "time", "date", "id"]: continue unique_values[nick][k].add(v) - meta_dedup = [] + meta_dedup = {} for x in meta: nick = x["nick"] - meta_l2 = {} for k, v in x.items(): if v in unique_values[nick][k]: - meta_l2[k] = v + if k not in meta_dedup: + meta_dedup[k] = set() + meta_dedup[k].add(v) unique_values[nick][k].remove(v) - if not set(meta_l2.keys()).issubset(set(["ts", "time", "date", "id"])): - meta_dedup.append(meta_l2) context = {"net": net, "nicks": nicks, "meta": meta_dedup} return render(request, self.template_name, context)