mirror of
https://github.com/retspen/webvirtcloud
synced 2026-11-08 11:16:47 +00:00
The 403, 404 and 500 pages said "Oops!" and one generic sentence; a bad request and a failed CSRF check fell back to Django's plain pages. Every error page now shares templates/error.html: a card with the status in a coloured badge with an icon, a heading in plain words, what happened and what to do, and Back and Home buttons. It uses only theme-defined Bootstrap classes, so it reads in the light and dark themes alike. - 400: the request was not accepted; a new address belongs in ALLOWED_HOSTS. - 403: the account lacks the permission; ask an administrator. - 403 CSRF: the form's security check failed; reload and submit again, and where to look when it happens on every form. - 404: the path, and that the object may be gone or hidden from the account. - 500: a libvirt failure on a page says the host's data could not be loaded, under libvirt's message; any other failure says it was logged and shows the time to give an administrator.
18 lines
1.2 KiB
HTML
18 lines
1.2 KiB
HTML
{% extends "error.html" %}
|
|
{% load i18n %}
|
|
|
|
{% block title %}{% if libvirt_error %}{% trans "Could not load data from the host" %}{% else %}{% trans "Server error" %}{% endif %}{% endblock %}
|
|
{% block code %}500{% endblock %}
|
|
{% block status_classes %}text-bg-danger{% endblock %}
|
|
{% block icon %}{% if libvirt_error %}bi-hdd-network{% else %}bi-exclamation-octagon{% endif %}{% endblock %}
|
|
{% block heading %}{% if libvirt_error %}{% trans "Could not load data from the host" %}{% else %}{% trans "Server error" %}{% endif %}{% endblock %}
|
|
|
|
{% block text %}
|
|
{% if libvirt_error %}
|
|
<p class="mb-3">{% trans "This page needs data from the host, and libvirt returned the error shown above." %}</p>
|
|
<p class="text-body-secondary mb-0">{% trans "Check that the host is running and reachable, then reload the page." %}</p>
|
|
{% else %}
|
|
<p class="mb-3">{% trans "The panel failed while handling this request. This is a fault in the panel, not something you did, and it was written to the panel's log." %}</p>
|
|
<p class="text-body-secondary mb-0">{% now "Y-m-d H:i:s" as now %}{% blocktrans %}Reload the page to try again. If it keeps happening, tell an administrator the time: {{ now }}.{% endblocktrans %}</p>
|
|
{% endif %}
|
|
{% endblock %}
|