From 9d344d887c46c7dec87c94a9ff2de4ef83102e09 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Mon, 25 Feb 2019 17:52:51 +0100 Subject: [PATCH] add more information to administrator Overview --- .../templates/administration/overview.html | 38 +++++++++++++++++++ passbook/admin/views/overview.py | 4 ++ 2 files changed, 42 insertions(+) diff --git a/passbook/admin/templates/administration/overview.html b/passbook/admin/templates/administration/overview.html index 823891450..c0a75ae1a 100644 --- a/passbook/admin/templates/administration/overview.html +++ b/passbook/admin/templates/administration/overview.html @@ -137,5 +137,43 @@ +
+ +
+
+ +
{% endblock %} diff --git a/passbook/admin/views/overview.py b/passbook/admin/views/overview.py index bcacd6cae..4bb524a8c 100644 --- a/passbook/admin/views/overview.py +++ b/passbook/admin/views/overview.py @@ -2,6 +2,8 @@ from django.views.generic import TemplateView from passbook.admin.mixins import AdminRequiredMixin +from passbook.core import __version__ +from passbook.core.celery import CELERY_APP from passbook.core.models import (Application, Factor, Invitation, Policy, Provider, Source, User) @@ -19,4 +21,6 @@ class AdministrationOverviewView(AdminRequiredMixin, TemplateView): kwargs['source_count'] = len(Source.objects.all()) kwargs['factor_count'] = len(Factor.objects.all()) kwargs['invitation_count'] = len(Invitation.objects.all()) + kwargs['version'] = __version__ + kwargs['worker_count'] = len(CELERY_APP.control.ping(timeout=0.5)) return super().get_context_data(**kwargs)