networks: Fix display of strength and channel for Wi-Fi connections

- Currently, strength and channel information is not shown for Wi-Fi connections
in connection information page. This is a regression related to handling SSID as
a binary string. Fix this.

- Also fix the styling to not make signal strength too prominent.

Tests:

- On a machine with Wi-Fi network device. Viewing the Wi-Fi connection
information does not signal strength and channel without patch but show with the
patch.

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-11-04 10:27:06 -08:00 committed by Veiko Aasa
parent 7fa664d445
commit 0e59b67bbd
No known key found for this signature in database
GPG Key ID: 478539CAE680674E
2 changed files with 2 additions and 2 deletions

View File

@ -152,7 +152,7 @@
{% if access_point.channel %}
<div class="list-group-item">
<span class="primary">{% trans "Signal strength" %}</span>
<span class="btn btn-primary btn-sm secondary">
<span class="badge badge-secondary secondary">
{{ access_point.strength }}%
</span>
</div>

View File

@ -183,7 +183,7 @@ def get_status_from_wifi_access_point(device, ssid):
for access_point in device.get_access_points():
if access_point and access_point.get_ssid() and \
access_point.get_ssid().get_data() == ssid:
access_point.get_ssid().get_data().decode() == ssid:
status['strength'] = access_point.get_strength()
frequency = access_point.get_frequency()
status['channel'] = _get_wifi_channel_from_frequency(frequency)