analytics: Add chart key to remote activity page.

Adds a chart key to the top of the remote activity page.

Also, combines the support and stats links for a remote server into
one column.
This commit is contained in:
Lauryn Menard 2023-11-29 15:52:19 +01:00 committed by Tim Abbott
parent 9180819a9e
commit 26168728ca
3 changed files with 20 additions and 8 deletions

View File

@ -69,9 +69,8 @@ def get_remote_server_activity(request: HttpRequest) -> HttpResponse:
"Analytics users",
"Mobile users",
"Last update time",
"7 day count of mobile pushes forwarded (includes today's current count)",
"Analytics",
"Support",
"Mobile pushes forwarded",
"Links",
]
rows = get_query_data(query)
@ -79,14 +78,12 @@ def get_remote_server_activity(request: HttpRequest) -> HttpResponse:
totals_columns = [4, 5]
for row in rows:
stats = remote_installation_stats_link(row[0])
row.append(stats)
support = remote_installation_support_link(row[1])
links = stats + " " + support
row.append(links)
for i, col in enumerate(cols):
if col == "Last update time":
fix_rows(rows, i, format_date_for_activity_reports)
if col == "Hostname":
for row in rows:
support = remote_installation_support_link(row[i])
row.append(support)
if i == 0:
total_row.append("Total")
elif i in totals_columns:

View File

@ -1,5 +1,9 @@
<h3>{{ data.title }}</h3>
{% if data.title == "Remote servers" %}
{% include "analytics/remote_activity_key.html" %}
{% endif %}
{{ data.rows|length}} rows
<table class="table sortable table-striped table-bordered analytics_table">

View File

@ -0,0 +1,11 @@
<h4>Chart key:</h4>
<ul>
<li><strong>Zulip version</strong> - as of last update time</li>
<li><strong>Mobile pushes forwarded</strong> - last 7 days, including today's current count</li>
<li><strong>Links</strong>
<ul>
<li><strong><i class="fa fa-pie-chart"></i></strong> - remote server's stats page</li>
<li><strong><i class="fa fa-gear"></i></strong> - remote server's support page</li>
</ul>
</li>
</ul>