Completed first-found updates for the API keys list view.

This commit is contained in:
Matt Scott 2023-02-20 09:39:13 -05:00
parent 4a12d62828
commit db70e34c98

View File

@ -1,22 +1,13 @@
{% extends "base.html" %} {% extends "base.html" %}
{% set active_page = "admin_keys" %} {% set active_page = "admin_keys" %}
{% block title %}<title>API Keys - {{ SITE_NAME }}</title>{% endblock %}
{% block title %}
<title>
Key Management - {{ SITE_NAME }}
</title>
{% endblock %}
{% block dashboard_stat %} {% block dashboard_stat %}
<div class="content-header"> <div class="content-header">
<div class="container-fluid"> <div class="container-fluid">
<div class="row mb-2"> <div class="row mb-2">
<div class="col-sm-6"> <div class="col-sm-6">
<h1 class="m-0 text-dark"> <h1 class="m-0 text-dark">API Keys</h1>
API Keys
<small>Management</small>
</h1>
</div> </div>
<div class="col-sm-6"> <div class="col-sm-6">
<ol class="breadcrumb float-sm-right"> <ol class="breadcrumb float-sm-right">
@ -30,19 +21,23 @@
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<section class="content"> <section class="content">
<div class="container-fluid"> <div class="container-fluid">
<div class="card"> <div class="card">
<div class="card-header with-border"> <div class="card-header with-border">
<h3 class="card-title">Key Management</h3> <h3 class="card-title">API Keys</h3>
<div class="card-tools">
<a href="{{ url_for('admin.edit_key') }}"> <a href="{{ url_for('admin.edit_key') }}">
<button type="button" class="btn btn-primary float-right button_add_key"> <button type="button" class="btn btn-primary float-right button_add_key" title="Create Key">
<i class="fa-solid fa-plus"></i>&nbsp;Add Key <i class="fa-solid fa-plus"></i>&nbsp;Create Key
</button> </button>
</a> </a>
</div> </div>
<div class="card-body"> <!-- /.card-tools -->
<table id="tbl_keys" class="table table-bordered table-striped"> </div>
<!-- /.card-header -->
<div class="card-body table-responsive">
<table id="tbl_keys" class="table table-bordered table-striped table-hover table-sm records">
<thead> <thead>
<tr> <tr>
<th>Id</th> <th>Id</th>
@ -59,19 +54,24 @@
<td>{{ key.id }}</td> <td>{{ key.id }}</td>
<td>{{ key.role.name }}</td> <td>{{ key.role.name }}</td>
<td>{{ key.description }}</td> <td>{{ key.description }}</td>
<td>{% for domain in key.domains %}{{ domain.name }}{% if not loop.last %}, {% endif %}{% endfor %}</td> <td>{% for domain in key.domains %}{{ domain.name }}{% if not loop.last %},
<td>{% for account in key.accounts %}{{ account.name }}{% if not loop.last %}, {% endif %}{% endfor %}</td> {% endif %}{% endfor %}</td>
<td width="15%"> <td>{% for account in key.accounts %}{{ account.name }}{% if not loop.last %},
{% endif %}{% endfor %}</td>
<td>
<div class="dropdown"> <div class="dropdown">
<button class="btn btn-primary dropdown-toggle" type="button" id="dropdownMenu" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <button class="btn btn-primary dropdown-toggle" type="button" id="dropdownMenu"
<i class="fa-solid fa-bars"></i>&nbsp;Actions data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="fa-solid fa-bars"></i>
</button> </button>
<div class="dropdown-menu" aria-labelledby="dropdownMenu"> <div class="dropdown-menu" aria-labelledby="dropdownMenu">
<button type="button" class="dropdown-item btn-warning" onclick="window.location.href='{{ url_for('admin.edit_key', key_id=key.id) }}'"> <button type="button" class="dropdown-item btn-warning"
onclick="window.location.href='{{ url_for('admin.edit_key', key_id=key.id) }}'">
<i class="fa-solid fa-edit"></i>&nbsp;Edit API Key <i class="fa-solid fa-edit"></i>&nbsp;Edit API Key
</button> </button>
<div class="dropdown-divider"></div> <div class="dropdown-divider"></div>
<button type="button"class="dropdown-item btn-secondary button_delete" id="{{ key.id }}"> <button type="button" class="dropdown-item btn-secondary button_delete"
id="{{ key.id }}">
<font color="red"> <font color="red">
<i class="fa-solid fa-trash"></i>&nbsp;Delete API Key <i class="fa-solid fa-trash"></i>&nbsp;Delete API Key
</font> </font>
@ -84,9 +84,12 @@
</tbody> </tbody>
</table> </table>
</div> </div>
<!-- /.card-body -->
</div> </div>
<!-- /.card -->
</div> </div>
</section> <!-- /.container-fluid -->
</section>
{% endblock %} {% endblock %}
{% block extrascripts %} {% block extrascripts %}