From 64e244e24a9800a5c5668c3a526b1570866935d9 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Tue, 1 Oct 2024 23:00:37 -0700 Subject: [PATCH] networks: Don't show DNS-over-TLS when resolved is not installed Tests: - Ensure that systemd-resolved is not installed. The privacy section is entirely hidden in the connection information page. - Ensure that systemd-resolved is installed. The privacy section is shown in the connection information page. Signed-off-by: Sunil Mohan Adapa Reviewed-by: Veiko Aasa --- .../networks/templates/connection_show.html | 14 ++++++++------ plinth/modules/networks/views.py | 5 +++-- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/plinth/modules/networks/templates/connection_show.html b/plinth/modules/networks/templates/connection_show.html index 8b53d8509..28538e5f4 100644 --- a/plinth/modules/networks/templates/connection_show.html +++ b/plinth/modules/networks/templates/connection_show.html @@ -256,14 +256,16 @@

{% trans "This connection is not active." %}

{% endif %} -

{% trans "Privacy" %}

+ {% if is_resolved_installed %} +

{% trans "Privacy" %}

-
-
- {% trans "DNS-over-TLS" %} - {{ connection.dns_over_tls_string }} +
+
+ {% trans "DNS-over-TLS" %} + {{ connection.dns_over_tls_string }} +
-
+ {% endif %}

{% trans "Security" %}

diff --git a/plinth/modules/networks/views.py b/plinth/modules/networks/views.py index f90c4658d..6acc66ae8 100644 --- a/plinth/modules/networks/views.py +++ b/plinth/modules/networks/views.py @@ -13,7 +13,7 @@ from django.views.decorators.http import require_POST from django.views.generic.edit import FormView from plinth import network -from plinth.modules import first_boot, networks +from plinth.modules import first_boot, names, networks from plinth.views import AppView from .forms import (ConnectionTypeSelectForm, EthernetForm, GenericForm, @@ -212,7 +212,8 @@ def show(request, uuid): 'connection': connection_status, 'active_connection': active_connection_status, 'device': device_status, - 'access_point': access_point_status + 'access_point': access_point_status, + 'is_resolved_installed': names.is_resolved_installed() })