2020-01-18 22:03:11 +08:00
|
|
|
<section class="card content-wrap auto-height" id="api_tokens">
|
2022-10-30 23:37:52 +08:00
|
|
|
<div class="flex-container-row wrap justify-space-between items-center mb-s">
|
|
|
|
<h2 class="list-heading">{{ trans('settings.users_api_tokens') }}</h2>
|
2020-01-18 22:03:11 +08:00
|
|
|
<div class="text-right pt-xs">
|
|
|
|
@if(userCan('access-api'))
|
|
|
|
<a href="{{ url('/api/docs') }}" class="button outline">{{ trans('settings.users_api_tokens_docs') }}</a>
|
2023-10-19 18:31:45 +08:00
|
|
|
<a href="{{ url('/api-tokens/' . $user->id . '/create?context=' . $context) }}" class="button outline">{{ trans('settings.users_api_tokens_create') }}</a>
|
2020-01-18 22:03:11 +08:00
|
|
|
@endif
|
|
|
|
</div>
|
|
|
|
</div>
|
2023-10-18 00:38:07 +08:00
|
|
|
<p class="text-small text-muted">{{ trans('settings.users_api_tokens_desc') }}</p>
|
2020-01-18 22:03:11 +08:00
|
|
|
@if (count($user->apiTokens) > 0)
|
2022-10-30 23:37:52 +08:00
|
|
|
<div class="item-list my-m">
|
2020-01-18 22:03:11 +08:00
|
|
|
@foreach($user->apiTokens as $token)
|
2022-10-30 23:37:52 +08:00
|
|
|
<div class="item-list-row flex-container-row items-center wrap py-xs gap-x-m">
|
|
|
|
<div class="flex px-m py-xs min-width-m">
|
2023-10-19 18:31:45 +08:00
|
|
|
<a href="{{ $token->getUrl("?context={$context}") }}">{{ $token->name }}</a> <br>
|
2020-01-18 22:03:11 +08:00
|
|
|
<span class="small text-muted italic">{{ $token->token_id }}</span>
|
2022-10-30 23:37:52 +08:00
|
|
|
</div>
|
|
|
|
<div class="flex flex-container-row items-center min-width-m">
|
|
|
|
<div class="flex px-m py-xs text-muted">
|
|
|
|
<strong class="text-small">{{ trans('settings.users_api_tokens_expires') }}</strong> <br>
|
|
|
|
{{ $token->expires_at->format('Y-m-d') ?? '' }}
|
|
|
|
</div>
|
|
|
|
<div class="flex px-m py-xs text-right">
|
2023-10-19 18:31:45 +08:00
|
|
|
<a class="button outline small" href="{{ $token->getUrl("?context={$context}") }}">{{ trans('common.edit') }}</a>
|
2022-10-30 23:37:52 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2020-01-18 22:03:11 +08:00
|
|
|
@endforeach
|
2022-10-30 23:37:52 +08:00
|
|
|
</div>
|
2020-01-18 22:03:11 +08:00
|
|
|
@else
|
|
|
|
<p class="text-muted italic py-m">{{ trans('settings.users_api_tokens_none') }}</p>
|
|
|
|
@endif
|
|
|
|
</section>
|