2023-05-21 10:56:38 +02:00
|
|
|
@php require_frontend_packages(['datatables', 'animatecss', 'bwipjs']); @endphp
|
|
|
|
|
2018-04-21 19:18:00 +02:00
|
|
|
@extends('layout.default')
|
|
|
|
|
2019-05-01 20:19:18 +02:00
|
|
|
@section('title', $__t('API keys'))
|
2018-04-21 19:18:00 +02:00
|
|
|
|
2023-05-23 20:31:51 +02:00
|
|
|
@push('pageStyles')
|
|
|
|
<style>
|
|
|
|
.modal-body {
|
|
|
|
text-align: center;
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
@endpush
|
|
|
|
|
2018-04-21 19:18:00 +02:00
|
|
|
@section('content')
|
2018-07-10 20:37:13 +02:00
|
|
|
<div class="row">
|
|
|
|
<div class="col">
|
2020-10-31 18:37:10 +01:00
|
|
|
<div class="title-related-links">
|
|
|
|
<h2 class="title">@yield('title')</h2>
|
2020-11-07 14:53:45 +01:00
|
|
|
<div class="float-right">
|
|
|
|
<button class="btn btn-outline-dark d-md-none mt-2 order-1 order-md-3"
|
|
|
|
type="button"
|
|
|
|
data-toggle="collapse"
|
|
|
|
data-target="#table-filter-row">
|
2022-04-04 20:10:29 +02:00
|
|
|
<i class="fa-solid fa-filter"></i>
|
2020-11-07 14:53:45 +01:00
|
|
|
</button>
|
|
|
|
<button class="btn btn-outline-dark d-md-none mt-2 order-1 order-md-3"
|
|
|
|
type="button"
|
|
|
|
data-toggle="collapse"
|
|
|
|
data-target="#related-links">
|
2022-04-04 20:10:29 +02:00
|
|
|
<i class="fa-solid fa-ellipsis-v"></i>
|
2020-11-07 14:53:45 +01:00
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
<div class="related-links collapse d-md-flex order-2 width-xs-sm-100"
|
|
|
|
id="related-links">
|
2023-05-23 20:31:51 +02:00
|
|
|
<a id="add-api-key-button"
|
|
|
|
class="btn btn-primary responsive-button m-1 mt-md-0 mb-md-0 float-right"
|
|
|
|
href="#">
|
2020-10-31 18:37:10 +01:00
|
|
|
{{ $__t('Add') }}
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
2020-04-19 08:51:02 -04:00
|
|
|
</div>
|
|
|
|
</div>
|
2020-10-31 18:37:10 +01:00
|
|
|
|
2020-11-08 15:09:10 +01:00
|
|
|
<hr class="my-2">
|
2020-10-31 18:37:10 +01:00
|
|
|
|
2020-11-07 14:53:45 +01:00
|
|
|
<div class="row collapse d-md-flex"
|
|
|
|
id="table-filter-row">
|
2021-06-24 22:46:47 +02:00
|
|
|
<div class="col-12 col-md-6 col-xl-3">
|
2020-10-31 18:37:10 +01:00
|
|
|
<div class="input-group">
|
2020-04-19 08:51:02 -04:00
|
|
|
<div class="input-group-prepend">
|
2022-04-04 20:10:29 +02:00
|
|
|
<span class="input-group-text"><i class="fa-solid fa-search"></i></span>
|
2020-04-19 08:51:02 -04:00
|
|
|
</div>
|
2020-08-31 20:32:50 +02:00
|
|
|
<input type="text"
|
|
|
|
id="search"
|
|
|
|
class="form-control"
|
|
|
|
placeholder="{{ $__t('Search') }}">
|
2020-04-19 08:51:02 -04:00
|
|
|
</div>
|
2018-07-09 19:27:22 +02:00
|
|
|
</div>
|
2020-11-07 14:53:45 +01:00
|
|
|
<div class="col">
|
|
|
|
<div class="float-right">
|
2022-04-04 22:42:10 +02:00
|
|
|
<button id="clear-filter-button"
|
2020-11-07 14:53:45 +01:00
|
|
|
class="btn btn-sm btn-outline-info"
|
2022-04-04 21:07:14 +02:00
|
|
|
data-toggle="tooltip"
|
|
|
|
title="{{ $__t('Clear filter') }}">
|
|
|
|
<i class="fa-solid fa-filter-circle-xmark"></i>
|
2022-04-04 22:42:10 +02:00
|
|
|
</button>
|
2020-11-07 14:53:45 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
2018-07-09 19:27:22 +02:00
|
|
|
</div>
|
|
|
|
|
2018-07-10 20:37:13 +02:00
|
|
|
<div class="row">
|
|
|
|
<div class="col">
|
2020-08-31 20:32:50 +02:00
|
|
|
<table id="apikeys-table"
|
2020-11-07 14:53:45 +01:00
|
|
|
class="table table-sm table-striped nowrap w-100">
|
2018-07-10 20:37:13 +02:00
|
|
|
<thead>
|
|
|
|
<tr>
|
2020-11-11 22:28:05 +01:00
|
|
|
<th class="border-right"><a class="text-muted change-table-columns-visibility-button"
|
|
|
|
data-toggle="tooltip"
|
2020-11-11 21:11:17 +01:00
|
|
|
data-toggle="tooltip"
|
2020-12-16 18:18:03 +01:00
|
|
|
title="{{ $__t('Table options') }}"
|
2020-11-11 21:11:17 +01:00
|
|
|
data-table-selector="#apikeys-table"
|
2022-04-04 20:10:29 +02:00
|
|
|
href="#"><i class="fa-solid fa-eye"></i></a>
|
2020-11-11 21:11:17 +01:00
|
|
|
</th>
|
2023-05-23 20:31:51 +02:00
|
|
|
<th>{{ $__t('Description') }}</th>
|
2019-05-01 20:19:18 +02:00
|
|
|
<th>{{ $__t('API key') }}</th>
|
2022-02-15 18:40:42 +01:00
|
|
|
<th class="allow-grouping">{{ $__t('User') }}</th>
|
2019-05-01 20:19:18 +02:00
|
|
|
<th>{{ $__t('Expires') }}</th>
|
|
|
|
<th>{{ $__t('Last used') }}</th>
|
|
|
|
<th>{{ $__t('Created') }}</th>
|
2022-02-15 18:40:42 +01:00
|
|
|
<th class="allow-grouping">{{ $__t('Key type') }}</th>
|
2018-07-10 20:37:13 +02:00
|
|
|
</tr>
|
|
|
|
</thead>
|
2019-01-05 20:06:35 +01:00
|
|
|
<tbody class="d-none">
|
2018-07-10 20:37:13 +02:00
|
|
|
@foreach($apiKeys as $apiKey)
|
2023-05-23 20:31:51 +02:00
|
|
|
<tr class="@if($apiKey->id == $selectedKeyId) table-primary @endif">
|
2019-03-09 10:49:26 +01:00
|
|
|
<td class="fit-content border-right">
|
2020-08-31 20:32:50 +02:00
|
|
|
<a class="btn btn-danger btn-sm apikey-delete-button"
|
|
|
|
href="#"
|
|
|
|
data-apikey-id="{{ $apiKey->id }}"
|
2023-05-23 20:31:51 +02:00
|
|
|
data-apikey-key="{{ $apiKey->api_key }}"
|
2020-11-12 21:35:10 +01:00
|
|
|
data-toggle="tooltip"
|
|
|
|
title="{{ $__t('Delete this item') }}">
|
2022-04-04 20:10:29 +02:00
|
|
|
<i class="fa-solid fa-trash"></i>
|
2018-07-10 20:37:13 +02:00
|
|
|
</a>
|
2020-09-06 10:00:49 +02:00
|
|
|
<a class="btn btn-info btn-sm apikey-show-qr-button"
|
|
|
|
href="#"
|
|
|
|
data-apikey-key="{{ $apiKey->api_key }}"
|
2020-11-12 21:35:10 +01:00
|
|
|
data-apikey-type="{{ $apiKey->key_type }}"
|
2023-05-23 20:31:51 +02:00
|
|
|
data-apikey-description="{{ $apiKey->description }}"
|
2020-11-12 21:35:10 +01:00
|
|
|
data-toggle="tooltip"
|
|
|
|
title="{{ $__t('Show a QR-Code for this API key') }}">
|
2022-04-04 20:10:29 +02:00
|
|
|
<i class="fa-solid fa-qrcode"></i>
|
2020-09-06 10:00:49 +02:00
|
|
|
</a>
|
2018-07-10 20:37:13 +02:00
|
|
|
</td>
|
2023-05-23 20:31:51 +02:00
|
|
|
<td>
|
|
|
|
{{ $apiKey->description }}
|
|
|
|
</td>
|
2018-07-10 20:37:13 +02:00
|
|
|
<td>
|
|
|
|
{{ $apiKey->api_key }}
|
|
|
|
</td>
|
2018-07-25 19:28:15 +02:00
|
|
|
<td>
|
|
|
|
{{ GetUserDisplayName(FindObjectInArrayByPropertyValue($users, 'id', $apiKey->user_id)) }}
|
|
|
|
</td>
|
2018-07-10 20:37:13 +02:00
|
|
|
<td>
|
|
|
|
{{ $apiKey->expires }}
|
2020-08-31 20:32:50 +02:00
|
|
|
<time class="timeago timeago-contextual"
|
|
|
|
datetime="{{ $apiKey->expires }}"></time>
|
2018-07-10 20:37:13 +02:00
|
|
|
</td>
|
|
|
|
<td>
|
2019-05-01 20:19:18 +02:00
|
|
|
@if(empty($apiKey->last_used)){{ $__t('never') }}@else{{ $apiKey->last_used }}@endif
|
2020-08-31 20:32:50 +02:00
|
|
|
<time class="timeago timeago-contextual"
|
|
|
|
datetime="{{ $apiKey->last_used }}"></time>
|
2018-07-10 20:37:13 +02:00
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
{{ $apiKey->row_created_timestamp }}
|
2020-08-31 20:32:50 +02:00
|
|
|
<time class="timeago timeago-contextual"
|
|
|
|
datetime="{{ $apiKey->row_created_timestamp }}"></time>
|
2018-07-10 20:37:13 +02:00
|
|
|
</td>
|
2019-03-04 17:44:48 +01:00
|
|
|
<td>
|
|
|
|
{{ $apiKey->key_type }}
|
|
|
|
</td>
|
2018-07-10 20:37:13 +02:00
|
|
|
</tr>
|
|
|
|
@endforeach
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
2018-04-21 19:18:00 +02:00
|
|
|
</div>
|
2023-05-23 20:31:51 +02:00
|
|
|
|
|
|
|
<div class="modal fade"
|
|
|
|
id="add-api-key-modal"
|
|
|
|
tabindex="-1">
|
|
|
|
<div class="modal-dialog">
|
|
|
|
<div class="modal-content">
|
|
|
|
<div class="modal-header">
|
|
|
|
<h4 class="modal-title w-100">{{ $__t('Create new API key') }}</h4>
|
|
|
|
</div>
|
|
|
|
<div class="modal-body">
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="name">{{ $__t('Name') }}</label>
|
|
|
|
<input type="text"
|
|
|
|
class="form-control"
|
|
|
|
id="description"
|
|
|
|
name="description">
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="modal-footer">
|
|
|
|
<button type="button"
|
|
|
|
class="btn btn-secondary"
|
|
|
|
data-dismiss="modal">{{ $__t('Cancel') }}</button>
|
|
|
|
<button id="new-api-key-button"
|
|
|
|
class="btn btn-primary">{{ $__t('OK') }}</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2018-04-21 19:18:00 +02:00
|
|
|
@stop
|