wireguard: Add button for direct APK download

**clients.py**
- allow download type for mobile os

**manifest.py**
- add entry for apk download

**plinth/templates/clients.html**
- add logic to show button for apk download

**themes > icons**
- add icon for android

source: https://www.wireguard.com/install/

Signed-off-by: Frederico Gomes <fredericojfgomes@gmail.com>
[sunil: Minor indentation]
[sunil: Refactor logic to eliminate packages from Desktop clients list]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
Frederico Gomes 2026-03-09 10:58:35 +00:00 committed by Sunil Mohan Adapa
parent 176bb97c88
commit 0ba4cbe259
No known key found for this signature in database
GPG Key ID: 43EA1CFF0AA7C5F2
4 changed files with 32 additions and 15 deletions

View File

@ -116,7 +116,7 @@ def _validate_platform_package(platform):
def _validate_platform_download(platform):
"""Validate a platform of type download."""
assert platform['os'] in enum_values(Desktop_OS)
assert platform['os'] in enum_values(Desktop_OS) + enum_values(Mobile_OS)
assert isinstance(platform['url'], (str, Promise))

View File

@ -25,6 +25,11 @@ clients = [{
'type': 'package',
'format': 'deb',
'name': 'wireguard'
}, {
'type': 'download',
'os': 'android',
'url': ('https://www.wireguard.com/'
'install/#android-play-store-direct-apk-file')
}, {
'type': 'store',
'os': 'android',

View File

@ -45,20 +45,22 @@
<td>
{% for platform in client.platforms %}
{% if platform.type == 'download' %}
<a class="btn btn-default" href="{{ platform.url }}" role="button">
<span>
{% with 'theme/icons/'|add:platform.os|add:'.png' as icon %}
<img class="client-icon" src="{% static icon %}" />
{% if platform.os == 'gnu-linux' %}
{% trans 'GNU/Linux' %}
{% elif platform.os == 'windows' %}
{% trans 'Windows' %}
{% elif platform.os == 'macos' %}
{% trans 'macOS' %}
{% endif %}
{% endwith %}
</span>
</a>
{% if platform.os == 'gnu-linux' or platform.os == 'macos' or platform.os == 'windows' %}
<a class="btn btn-default" href="{{ platform.url }}" role="button">
<span>
{% with 'theme/icons/'|add:platform.os|add:'.png' as icon %}
<img class="client-icon" src="{% static icon %}" />
{% if platform.os == 'gnu-linux' %}
{% trans 'GNU/Linux' %}
{% elif platform.os == 'windows' %}
{% trans 'Windows' %}
{% elif platform.os == 'macos' %}
{% trans 'macOS' %}
{% endif %}
{% endwith %}
</span>
</a>
{% endif %}
{% endif %}
{% endfor %}
</td>
@ -75,6 +77,16 @@
<td>{{ client.name }}</td>
<td>
{% for platform in client.platforms %}
{% if platform.type == 'download' and platform.os == 'android' %}
<a class="btn btn-default" href="{{ platform.url }}" role="button">
<span>
{% with 'theme/icons/'|add:platform.os|add:'.png' as icon %}
<img class="client-icon" src="{% static icon %}" />
{% trans 'Android APK' %}
{% endwith %}
</span>
</a>
{% endif %}
{% if platform.type == 'store' and platform.os == 'android' or platform.os == 'ios' %}
<a class="btn btn-default" href="{{ platform.url }}" role="button">
<span>

Binary file not shown.

After

Width:  |  Height:  |  Size: 500 B