mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-03-11 09:04:54 +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):
|
||||
"""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))
|
||||
|
||||
|
||||
|
||||
@ -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',
|
||||
|
||||
@ -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>
|
||||
|
||||
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