Skip to content
Snippets Groups Projects
Verified Commit 88fa7287 authored by Jonathan Weth's avatar Jonathan Weth :keyboard:
Browse files

Fix system status page in SPA

parent 6238df53
No related branches found
No related tags found
3 merge requests!1237Release 3.0,!1225Resolve "Offline fallback page for django legacy pages is misleading in some situations",!1183Release 3.0
Pipeline #124811 failed
......@@ -13,6 +13,7 @@ Added
~~~~~
* GraphQL schema for Rooms
* Provide API endpoint for system status.
* [Dev] UpdateIndicator Vue Component to display the status of interactive pages
* [Dev] DeleteDialog Vue Component to unify item deletion in the new frontend
......@@ -38,6 +39,7 @@ Fixed
* When the Celery worker wasn't able to execute all tasks in time, notifications were sent multiple times.
* Changing the maintenance mode state spawned another SPA instance in the iframe
* Phone numbers couldn't be in regional format.
* System status view wasn't accessible through new frontend if a check failed.
`3.0b3`_ - 2023-03-19
---------------------
......
......@@ -38,6 +38,7 @@ urlpatterns = [
"oauth/authorized_tokens/", views.TemplateView.as_view(template_name="core/vue_index.html")
),
path("oauth/", include("oauth2_provider.urls", namespace="oauth2_provider")),
path("system_status/", views.SystemStatusAPIView.as_view(), name="system_status_api"),
path(
"django/",
include(
......
......@@ -493,7 +493,6 @@ class SystemStatus(PermissionRequiredMixin, MainView):
context = {}
def get(self, request, *args, **kwargs):
status_code = 500 if self.errors else 200
task_results = []
if app.control.inspect().registered_tasks():
......@@ -505,12 +504,11 @@ class SystemStatus(PermissionRequiredMixin, MainView):
context = {
"plugins": self.plugins,
"status_code": status_code,
"tasks": task_results,
"DEBUG": settings.DEBUG,
"form": MaintenanceModeForm(),
}
return self.render_to_response(context, status=status_code)
return self.render_to_response(context)
def post(self, request, *args, **kwargs):
form = MaintenanceModeForm(request.POST)
......@@ -532,6 +530,18 @@ class SystemStatus(PermissionRequiredMixin, MainView):
return self.get(request, *args, **kwargs)
class SystemStatusAPIView(PermissionRequiredMixin, MainView):
"""Provide information about system status as JSON."""
permission_required = "core.view_system_status_rule"
@method_decorator(never_cache)
def get(self, request, *args, **kwargs):
status_code = 500 if self.errors else 200
return self.render_to_response_json(self.plugins, status_code)
class TestPDFGenerationView(PermissionRequiredMixin, RenderPDFView):
template_name = "core/pages/test_pdf.html"
permission_required = "core.test_pdf_rule"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment