deluge: Implement diagnostics

This commit is contained in:
Sunil Mohan Adapa 2015-08-21 20:09:16 +05:30 committed by James Valleroy
parent 6b7de75b62
commit 20d8c56aa0
2 changed files with 23 additions and 12 deletions

View File

@ -53,3 +53,15 @@ def is_enabled():
def is_running():
"""Return whether the service is running."""
return action_utils.service_is_running('deluge-web')
def diagnose():
"""Run diagnostics and return the results."""
results = []
results.append(action_utils.diagnose_port_listening(8112, 'tcp4'))
results.append(action_utils.diagnose_port_listening(8112, 'tcp6'))
results.extend(action_utils.diagnose_url_on_all(
'https://{host}/deluge', extra_options=['--no-check-certificate']))
return results

View File

@ -31,6 +31,17 @@
password is 'deluge', but you should log in and change it immediately after
enabling this service.</p>
<h3>Status</h3>
<p class="running-status-parent">
{% if status.is_running %}
<span class="running-status active"></span> deluge-web is running
{% else %}
<span class="running-status inactive"></span> deluge-web is not running
{% endif %}
</p>
{% include "diagnostics_button.html" with module="deluge" %}
<h3>Configuration</h3>
<form class="form" method="post">
@ -41,16 +52,4 @@
<input type="submit" class="btn btn-primary" value="Update setup"/>
</form>
{% if status.enabled %}
<h3>Status</h3>
<p>
{% if status.is_running %}
<span class="running-status active"></span> deluge-web is running
{% else %}
<span class="running-status inactive"></span> deluge-web is not running
{% endif %}
</p>
{% endif %}
{% endblock %}