diagnostics: Disable button if app/service is not running

Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
Johannes Keyser 2017-05-31 23:53:44 +02:00 committed by Sunil Mohan Adapa
parent fb52c059c9
commit 249403a6dd
No known key found for this signature in database
GPG Key ID: 43EA1CFF0AA7C5F2
7 changed files with 13 additions and 8 deletions

View File

@ -23,6 +23,11 @@
action="{% url 'diagnostics:module' module %}">
{% csrf_token %}
<input type="submit" class="btn btn-default"
value="{% trans "Run Diagnostics" %}"/>
{% if enabled %}
<input type="submit" class="btn btn-default"
value="{% trans "Run Diagnostics" %}"/>
{% else %}
<input type="submit" class="btn btn-default"
value="{% trans "Run Diagnostics" %}" disabled="disabled"/>
{% endif %}
</form>

View File

@ -100,7 +100,7 @@
</div>
</div>
{% include "diagnostics_button.html" with module="letsencrypt" %}
{% include "diagnostics_button.html" with module="letsencrypt" enabled=True %}
{% else %}
{% blocktrans trimmed %}
No domains have been configured. Configure domains to be able to

View File

@ -108,7 +108,7 @@
{% include "connections_diagram.html" %}
{% include "diagnostics_button.html" with module="networks" %}
{% include "diagnostics_button.html" with module="networks" enabled=True %}
</div>
</div>

View File

@ -111,7 +111,7 @@
{% endif %}
</p>
{% include "diagnostics_button.html" with module="openvpn" %}
{% include "diagnostics_button.html" with module="openvpn" enabled=status.is_running %}
<h3>{% trans "Configuration" %}</h3>

View File

@ -53,7 +53,7 @@
{% endif %}
</p>
{% include "diagnostics_button.html" with module="tor" %}
{% include "diagnostics_button.html" with module="tor" enabled=status.is_running %}
{% if status.hs_enabled %}
<div class="row">

View File

@ -64,7 +64,7 @@
{% endfor %}
</div>
{% include "diagnostics_button.html" with module="users" %}
{% include "diagnostics_button.html" with module="users" enabled=True %}
</div>
</div>

View File

@ -57,7 +57,7 @@
{% block diagnostics %}
{% if diagnostics_module_name %}
{% include "diagnostics_button.html" with module=diagnostics_module_name %}
{% include "diagnostics_button.html" with module=diagnostics_module_name enabled=service.is_running %}
{% endif %}
{% endblock %}