From 71b27be7202237abe3d3b699d12e5f08f209c612 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Sun, 19 Oct 2014 17:51:18 +0530 Subject: [PATCH] Minor updates to Tor service --- plinth/modules/tor/templates/tor.html | 6 +++--- plinth/modules/tor/tor.py | 16 ++++++++-------- static/themes/default/css/plinth.css | 10 ++++++---- 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/plinth/modules/tor/templates/tor.html b/plinth/modules/tor/templates/tor.html index 93e68c5fe..2f717ed18 100644 --- a/plinth/modules/tor/templates/tor.html +++ b/plinth/modules/tor/templates/tor.html @@ -26,9 +26,9 @@
{% if is_running %} -
Tor is running +
Tor is running {% else %} -
Tor is not running +
Tor is not running {% endif %}
@@ -84,7 +84,7 @@ A Tor SOCKS port is available on your FreedomBox on TCP port website. For best protection when web surfing, the Tor Project recommends that you use the Tor - Browser Bundle.

+ Browser Bundle.

diff --git a/plinth/modules/tor/tor.py b/plinth/modules/tor/tor.py index b1b1ff384..8804b5b19 100644 --- a/plinth/modules/tor/tor.py +++ b/plinth/modules/tor/tor.py @@ -39,7 +39,7 @@ class TorForm(forms.Form): # pylint: disable=W0232 def init(): """Initialize the Tor module""" menu = cfg.main_menu.get('apps:index') - menu.add_urlname("Tor", "icon-eye-close", "tor:index", 30) + menu.add_urlname('Tor', 'icon-eye-close', 'tor:index', 30) @login_required @@ -71,10 +71,10 @@ def index(request): def get_status(): """Return the current status""" - is_running = actions.superuser_run("tor", ["is-running"]).strip() == "yes" + is_running = actions.superuser_run('tor', ['is-running']).strip() == 'yes' - output = actions.superuser_run("tor-get-ports") - port_info = output.split("\n") + output = actions.superuser_run('tor-get-ports') + port_info = output.split('\n') ports = {} for line in port_info: try: @@ -83,12 +83,12 @@ def get_status(): except ValueError: continue - output = actions.superuser_run("tor", ["get-hs"]) + output = actions.superuser_run('tor', ['get-hs']) output = output.strip() - if output == "": + if output == '': hs_enabled = False - hs_hostname = "Not Configured" - hs_ports = "" + hs_hostname = 'Not Configured' + hs_ports = '' else: hs_enabled = True hs_info = output.split() diff --git a/static/themes/default/css/plinth.css b/static/themes/default/css/plinth.css index f09bf917c..7d72fe909 100644 --- a/static/themes/default/css/plinth.css +++ b/static/themes/default/css/plinth.css @@ -56,16 +56,18 @@ body { padding-left: 3em; } -.circle { - border-radius: 50%/50%; +.running-status { + border-radius: 50%; border: 1px solid black; width: 8px; height: 8px; display: inline-block; } -.circle.active { + +.running-status.active { background-color: rgb(0, 167, 0); } -.circle.inactive { + +.running-status.inactive { background-color: rgb(228, 66, 66); }