Sunil Mohan Adapa eca538169e diagnostics: Revamp main diagnostics page
- Run diagnostics on each module separately.

- Run diagnostics in a separate thread.

- Show progressive update while running diagnostics.

- Store and show old diagnostics.

- Prevent CSRF on the expensive operation of running diagnostics.
2015-08-29 06:22:01 -04:00

79 lines
2.2 KiB
HTML

{% extends 'base.html' %}
{% comment %}
#
# This file is part of Plinth.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
{% endcomment %}
{% block page_head %}
{% if is_running %}
<meta http-equiv="refresh" content="3" />
{% endif %}
{% endblock %}
{% block content %}
<h2>{{ title }}</h2>
<p>The system diagnostic test will run a number of checks on your
system to confirm that applications and services are working as expected.</p>
{% if not is_running %}
<form class="form form-diagnostics-button" method="post"
action="{% url 'diagnostics:index' %}">
{% csrf_token %}
<input type="submit" class="btn btn-primary" value="Run Diagnostics"/>
</form>
{% else %}
<p>Diagnotics test is currently running</p>
<div class="progress">
<div class="progress-bar progress-bar-striped active"
role="progressbar" aria-valuemin="0" aria-valuemax="100"
aria-valuenow="{{ results.progress_percentage }}"
style="width: {{ results.progress_percentage }}%">
{{ results.progress_percentage }}%
</div>
</div>
{% endif %}
{% if results %}
<h3>Results</h3>
{% if results.error %}
<div class="alert alert-danger alert-dismissable">
<a class="close" data-dismiss="alert">&times;</a>
{{ results.error }}
</div>
{% else %}
{% for module, module_results in results.results.items %}
<h4>Module: {{ module }}</h4>
{% if module_results %}
{% include "diagnostics_results.html" with results=module_results %}
{% else %}
<p><span class="glyphicon glyphicon-hourglass"></span></p>
{% endif %}
{% endfor %}
{% endif %}
{% endif %}
{% endblock %}