Commit 82ab896c authored by Birin Sanchez's avatar Birin Sanchez

Move Activate/Deactivate button to last column.

Remove double quotes in sample config files.
Signed-off-by: Birin Sanchez's avatarBirin Sanchez <birin.sanchez@puri.sm>
parent 151563c8
Pipeline #4824 passed with stage
in 39 seconds
......@@ -37,4 +37,4 @@ OVPN_PORT=22
OVPN_USERNAME=username
OVPN_FILEPATH="/path/to/{IDENTITY}/{IDENTITY}.ovpn"
TUNNEL_HOST="https://example.com"
\ No newline at end of file
TUNNEL_HOST=https://example.com
\ No newline at end of file
......@@ -7,8 +7,8 @@ AUTH_LDAP_BIND_PASSWORD = ldap_password
WOO_CONSUMER_KEY = woo_key
WOO_CONSUMER_SECRET = woo_secret
TUNNEL_IDENTITY = "partner_id"
TUNNEL_SECRET = "secret"
TUNNEL_IDENTITY = partner_id
TUNNEL_SECRET = secret
# Fernet key generation can be done with:
# $ python3 -c 'from cryptography.fernet import Fernet; \
# print(Fernet.generate_key().decode())'
......
......@@ -64,6 +64,7 @@ SPDX-License-Identifier: AGPL-3.0
<th>{% trans "Active" %}</th>
<th>{% trans "Renews/Expires" %}</th>
<th>{% trans "Credit" %}</th>
<th>{% trans "Actions" %}</th>
</tr>
</thead>
......@@ -71,21 +72,24 @@ SPDX-License-Identifier: AGPL-3.0
{% for limit in limits %}
<tr>
<th class="row_header">{{ limit.service_label() }}
{% if limit.service_label() == 'Tunnel' and limit.service_activable_by_user() %}
<form method="post" action="{% url 'toggle_tunnel' %}">{% csrf_token %}
{% if limit.is_active %}
<input type="submit" value="Deactivate"/>
{% else %}
<input type="submit" value="Activate"/>
{% endif %}
<input type="hidden" name="enable_tunnel" value="{{ not limit.is_active }}"/>
</form>
{% endif %}
<th class="row_header">{{ limit.service_label() }}</th>
</th>
<td>{{ limit.active_label() }}</td>
<td title="{{ limit.endpoint_full_label() }}">{{ limit.endpoint_short_label() }}</td>
<td>{{ limit.credit_label() }}</td>
<td>
<!-- We will have to change the action url per type of service -->
<form method="post" action="{% url 'toggle_tunnel' %}">{% csrf_token %}
{% if limit.is_active and limit.service_activable_by_user() %}
<input type="submit" value="Deactivate"/>
{% elif not limit.is_active and limit.service_activable_by_user() %}
<input type="submit" value="Activate"/>
{% else %}
<input type="submit" value="---" disabled/>
{% endif %}
<input type="hidden" name="enable_tunnel" value="{{ not limit.is_active }}"/>
</form>
</td>
</tr>
{% endfor %}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment