mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-05-27 10:44:33 +00:00
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:
parent
176bb97c88
commit
0ba4cbe259
@ -116,7 +116,7 @@ def _validate_platform_package(platform):
|
|||||||
|
|
||||||
def _validate_platform_download(platform):
|
def _validate_platform_download(platform):
|
||||||
"""Validate a platform of type download."""
|
"""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))
|
assert isinstance(platform['url'], (str, Promise))
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -25,6 +25,11 @@ clients = [{
|
|||||||
'type': 'package',
|
'type': 'package',
|
||||||
'format': 'deb',
|
'format': 'deb',
|
||||||
'name': 'wireguard'
|
'name': 'wireguard'
|
||||||
|
}, {
|
||||||
|
'type': 'download',
|
||||||
|
'os': 'android',
|
||||||
|
'url': ('https://www.wireguard.com/'
|
||||||
|
'install/#android-play-store-direct-apk-file')
|
||||||
}, {
|
}, {
|
||||||
'type': 'store',
|
'type': 'store',
|
||||||
'os': 'android',
|
'os': 'android',
|
||||||
|
|||||||
@ -45,6 +45,7 @@
|
|||||||
<td>
|
<td>
|
||||||
{% for platform in client.platforms %}
|
{% for platform in client.platforms %}
|
||||||
{% if platform.type == 'download' %}
|
{% if platform.type == 'download' %}
|
||||||
|
{% if platform.os == 'gnu-linux' or platform.os == 'macos' or platform.os == 'windows' %}
|
||||||
<a class="btn btn-default" href="{{ platform.url }}" role="button">
|
<a class="btn btn-default" href="{{ platform.url }}" role="button">
|
||||||
<span>
|
<span>
|
||||||
{% with 'theme/icons/'|add:platform.os|add:'.png' as icon %}
|
{% with 'theme/icons/'|add:platform.os|add:'.png' as icon %}
|
||||||
@ -60,6 +61,7 @@
|
|||||||
</span>
|
</span>
|
||||||
</a>
|
</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@ -75,6 +77,16 @@
|
|||||||
<td>{{ client.name }}</td>
|
<td>{{ client.name }}</td>
|
||||||
<td>
|
<td>
|
||||||
{% for platform in client.platforms %}
|
{% 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' %}
|
{% if platform.type == 'store' and platform.os == 'android' or platform.os == 'ios' %}
|
||||||
<a class="btn btn-default" href="{{ platform.url }}" role="button">
|
<a class="btn btn-default" href="{{ platform.url }}" role="button">
|
||||||
<span>
|
<span>
|
||||||
|
|||||||
BIN
static/themes/default/icons/android.png
Normal file
BIN
static/themes/default/icons/android.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 500 B |
Loading…
x
Reference in New Issue
Block a user