From 20d8c56aa0e6aa4952c4c15ce1b19188eb4fb28e Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Fri, 21 Aug 2015 20:09:16 +0530 Subject: [PATCH] deluge: Implement diagnostics --- plinth/modules/deluge/__init__.py | 12 +++++++++++ plinth/modules/deluge/templates/deluge.html | 23 ++++++++++----------- 2 files changed, 23 insertions(+), 12 deletions(-) diff --git a/plinth/modules/deluge/__init__.py b/plinth/modules/deluge/__init__.py index 92df0a566..f313b8c6e 100644 --- a/plinth/modules/deluge/__init__.py +++ b/plinth/modules/deluge/__init__.py @@ -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 diff --git a/plinth/modules/deluge/templates/deluge.html b/plinth/modules/deluge/templates/deluge.html index 23c0d0b49..20f839f87 100644 --- a/plinth/modules/deluge/templates/deluge.html +++ b/plinth/modules/deluge/templates/deluge.html @@ -31,6 +31,17 @@ password is 'deluge', but you should log in and change it immediately after enabling this service.

+

Status

+ +

+ {% if status.is_running %} + deluge-web is running + {% else %} + deluge-web is not running + {% endif %} +

+{% include "diagnostics_button.html" with module="deluge" %} +

Configuration

@@ -41,16 +52,4 @@
-{% if status.enabled %} -

Status

- -

- {% if status.is_running %} - deluge-web is running - {% else %} - deluge-web is not running - {% endif %} -

-{% endif %} - {% endblock %}