2022-06-17 07:44:46 +00:00
|
|
|
{% extends 'frontend/base.html.j2' %}
|
|
|
|
|
2022-06-18 11:05:18 +00:00
|
|
|
{% block title %}{{ gettext('app token') }}{% endblock %}
|
2022-06-17 07:44:46 +00:00
|
|
|
|
|
|
|
{% block content %}
|
|
|
|
|
|
|
|
<ul class="nav nav-tabs" id="myTab" role="tablist">
|
2022-07-15 08:53:06 +00:00
|
|
|
{% for service in services.values() if service.app_token %}
|
2022-06-17 07:44:46 +00:00
|
|
|
<li class="nav-item">
|
|
|
|
<a class="nav-link{{' active' if loop.first else ''}}" id="home-tab" data-toggle="tab" href="#{{ service.name }}" role="tab" aria-controls="home" aria-selected="true">{{ service.name }}</a>
|
|
|
|
</li>
|
|
|
|
{% endfor %}
|
|
|
|
</ul>
|
2022-07-15 08:53:06 +00:00
|
|
|
|
2022-06-17 07:44:46 +00:00
|
|
|
<div class="tab-content" id="myTabContent">
|
2022-07-15 08:53:06 +00:00
|
|
|
{% for service in services.values() if service.app_token %}
|
2022-06-17 07:44:46 +00:00
|
|
|
|
|
|
|
<div class="tab-pane fade{{ ' show active' if loop.first else '' }}" id="{{ service.name }}" role="tabpanel" aria-labelledby="{{ service.name }}-tab">
|
|
|
|
<table class="table">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
2022-07-15 08:53:06 +00:00
|
|
|
<th>name</th>
|
|
|
|
<th>last used</th>
|
|
|
|
<th>created at<th>
|
2022-06-17 07:44:46 +00:00
|
|
|
<th> <th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
2022-07-15 08:53:06 +00:00
|
|
|
{% for app_token in current_user.get_tokens_by_service(service) %}
|
|
|
|
<tr>
|
|
|
|
<td>{{ app_token.name }}</td>
|
|
|
|
<td>{{ app_token.last_used }}</td>
|
|
|
|
<td>{{ app_token.created_at }}</td>
|
2022-06-17 07:44:46 +00:00
|
|
|
<td>
|
2022-07-15 08:53:06 +00:00
|
|
|
{{ render_form(delete_form, action_url=url_for('frontend.app_token_delete', service_name=service.name,app_token_name=app_token.name)) }}
|
|
|
|
{#
|
|
|
|
<a title="{{ gettext('Revoke')}}" href="{{ url_for('.app_token_revoce', id=app_token.id) }}" onclick="client_cert.revoke_certificate(this.href, '{{ cert.serial_number_hex }}'); return false;"><i class="fas fa-ban"></i></a>
|
|
|
|
#}
|
2022-06-17 07:44:46 +00:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
{% endfor %}
|
2022-07-15 08:53:06 +00:00
|
|
|
</table>
|
|
|
|
<a class="btn btn-primary" href="{{ url_for('frontend.app_token_new', service_name=service.name) }}">
|
|
|
|
New Token
|
|
|
|
</a>
|
2022-06-17 07:44:46 +00:00
|
|
|
</div>
|
|
|
|
{% endfor %}
|
|
|
|
</div>
|
|
|
|
|
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
|
|
|
|
{% block script_js %}
|
|
|
|
|
|
|
|
{% endblock %}
|