snipe-it/resources/views/components/personal-access-tokens/panel.blade.php

86 lines
2.6 KiB
PHP
Raw Normal View History

2023-11-08 14:10:09 -08:00
@props([
'token_url' => url('oauth/personal-access-tokens'),
'scopes_url' => url('oauth/scopes'),
2023-11-08 14:48:20 -08:00
'tokens' => [],
2023-11-08 14:10:09 -08:00
])
<div>
<p>New Personal Access Token Component</p>
<div>
<p>{{ $token_url }}</p>
<p>{{ $scopes_url }}</p>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<div class="text-right" style="display: flex; justify-content: space-between; align-items: center;">
<a class="btn btn-info btn-sm action-link pull-right"
onclick="$('#modal-create-token').modal('show');"
>
Create New Token
</a>
</div>
</div>
2023-11-08 14:48:20 -08:00
<div class="panel-body">
<!-- No Tokens Notice -->
@if($tokens->count() === 0)
<p class="m-b-none"
>
You have not created any personal access tokens.
</p>
@endif
<!-- Personal Access Tokens -->
<table class="table table-borderless m-b-none">
@if($tokens->count() > 0)
<thead>
<tr>
<th class="col-md-3">Name</th>
<th class="col-md-2">Created</th>
<th class="col-md-2">Expires</th>
<th class="col-md-2"><span class="sr-only">Delete</span></th>
</tr>
</thead>
@endif
2023-11-13 17:47:03 -08:00
@foreach($tokens as $token)
2023-11-08 14:48:20 -08:00
<tbody>
<tr>
<!-- Client Name -->
2023-11-13 17:47:03 -08:00
2023-11-08 14:48:20 -08:00
<td style="vertical-align: middle;">
{{ $token->name }}
</td>
<td style="vertical-align: middle;">
{{ $token->created_at }}
</td>
<td style="vertical-align: middle;">
{{ $token->expires_at }}
</td>
2023-11-13 17:47:03 -08:00
2023-11-08 14:48:20 -08:00
<!-- Delete Button -->
<td style="vertical-align: middle;" class="text-right">
<a class="action-link btn btn-danger btn-sm" @click="revoke(token)">
<i class="fas fa-trash"></i>
</a>
</td>
</tr>
2023-11-13 17:47:03 -08:00
@endforeach
2023-11-08 14:48:20 -08:00
</tbody>
</table>
</div>
2023-11-08 14:10:09 -08:00
</div>
2023-11-08 14:48:20 -08:00
<!-- Create Token Modal -->
<x-personal-access-tokens.create-token-modal />
2023-11-08 14:55:29 -08:00
<!-- View New Token Modal -->
<x-personal-access-tokens.view-new-token />
2023-11-08 14:10:09 -08:00
</div>