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 <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
This commit is contained in:
Sunil Mohan Adapa 2024-10-01 23:00:37 -07:00 committed by Veiko Aasa
parent 1f17728321
commit 64e244e24a
No known key found for this signature in database
GPG Key ID: 478539CAE680674E
2 changed files with 11 additions and 8 deletions

View File

@ -256,14 +256,16 @@
<p>{% trans "This connection is not active." %}</p>
{% endif %}
<h3>{% trans "Privacy" %}</h3>
{% if is_resolved_installed %}
<h3>{% trans "Privacy" %}</h3>
<div class="list-group list-group-two-column">
<div class="list-group-item">
<span class="primary">{% trans "DNS-over-TLS" %}</span>
<span class="secondary">{{ connection.dns_over_tls_string }}</span>
<div class="list-group list-group-two-column">
<div class="list-group-item">
<span class="primary">{% trans "DNS-over-TLS" %}</span>
<span class="secondary">{{ connection.dns_over_tls_string }}</span>
</div>
</div>
</div>
{% endif %}
<h3>{% trans "Security" %}</h3>

View File

@ -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()
})