From 0dea5c98774812386a0f58d1bc752b21b863bf14 Mon Sep 17 00:00:00 2001 From: vabene1111 Date: Tue, 12 Nov 2024 15:53:13 +0100 Subject: [PATCH] api stats --- cookbook/templates/system.html | 31 +++++++- cookbook/views/api.py | 140 +++++++++++++++++++++------------ cookbook/views/views.py | 47 ++++++++++- recipes/settings.py | 8 ++ requirements.txt | 1 + 5 files changed, 172 insertions(+), 55 deletions(-) diff --git a/cookbook/templates/system.html b/cookbook/templates/system.html index e6995578b..1c154160c 100644 --- a/cookbook/templates/system.html +++ b/cookbook/templates/system.html @@ -82,9 +82,9 @@ {% else %} {% trans 'Everything is fine!' %} {% endif %} - +

{% trans 'Allowed Hosts' %} {% if '*' in allowed_hosts %} + class="badge badge-{% if '*' in allowed_hosts %}warning{% else %}success{% endif %}">{% if '*' in allowed_hosts %} {% trans 'Warning' %}{% else %}{% trans 'Ok' %}{% endif %}

{% if debug %} {% blocktrans %} @@ -176,6 +176,33 @@ {#{% endfor %}#} {# #} +

API Stats

+
User Stats
+ + {% for r in api_user_stats %} + + {% for c in r %} + + {% endfor %} + + {% endfor %} +
+ {{ c }} +
+ +
Endpoint Stats
+ + {% for r in api_stats %} + + {% for c in r %} + + {% endfor %} + + {% endfor %} +
+ {{ c }} +
+

Debug