2023-12-05 14:41:25 -08:00
|
|
|
<div>
|
2024-06-17 07:44:07 -07:00
|
|
|
<div class="box box-default">
|
|
|
|
|
|
|
|
<div class="box-header">
|
|
|
|
<h2 class="box-title">
|
|
|
|
{{ trans('admin/settings/general.oauth_clients') }}
|
2023-12-05 14:41:25 -08:00
|
|
|
</h2>
|
2024-06-17 07:44:07 -07:00
|
|
|
@if ($authorizationError)
|
2023-12-05 18:36:59 -08:00
|
|
|
<div class="alert alert-danger">
|
2024-06-17 07:44:07 -07:00
|
|
|
<p>{{ trans('admin/users/message.insufficient_permissions') }}
|
2023-12-05 18:36:59 -08:00
|
|
|
<br>
|
|
|
|
{{ $authorizationError }}
|
2024-06-17 07:44:07 -07:00
|
|
|
</p>
|
2023-12-05 18:36:59 -08:00
|
|
|
</div>
|
|
|
|
@endif
|
2023-12-05 14:41:25 -08:00
|
|
|
|
2024-06-17 07:44:07 -07:00
|
|
|
<div class="box-tools pull-right">
|
|
|
|
<a class="btn btn-primary"
|
|
|
|
wire:click="$emit('openModal')"
|
|
|
|
onclick="$('#modal-create-client').modal('show');">
|
|
|
|
{{ trans('general.create') }}
|
|
|
|
</a>
|
|
|
|
</div>
|
2023-12-05 12:52:14 -08:00
|
|
|
</div>
|
|
|
|
|
2024-06-17 07:44:07 -07:00
|
|
|
<div class="box-body">
|
|
|
|
<!-- Current Clients -->
|
|
|
|
@if($clients->count() === 0)
|
|
|
|
<p>
|
|
|
|
{{ trans('admin/settings/general.oauth_no_clients') }}
|
|
|
|
</p>
|
|
|
|
@endif
|
2023-12-05 14:41:25 -08:00
|
|
|
|
2024-06-17 07:44:07 -07:00
|
|
|
@if ($clients->count() > 0)
|
|
|
|
<table class="table table-striped snipe-table">
|
2023-12-05 14:41:25 -08:00
|
|
|
<thead>
|
2023-12-05 12:52:14 -08:00
|
|
|
<tr>
|
2024-06-17 07:44:07 -07:00
|
|
|
<th>{{ trans('general.id') }}</th>
|
|
|
|
<th>{{ trans('general.name') }}</th>
|
|
|
|
<th>{{ trans('admin/settings/general.oauth_redirect_url') }}</th>
|
|
|
|
<th>{{ trans('admin/settings/general.oauth_secret') }}</th>
|
|
|
|
<th><span class="sr-only">{{ trans('general.actions') }}</span></th>
|
2023-12-05 12:52:14 -08:00
|
|
|
</tr>
|
2023-12-05 14:41:25 -08:00
|
|
|
</thead>
|
|
|
|
<tbody>
|
2023-12-05 12:52:14 -08:00
|
|
|
@foreach($clients as $client)
|
2023-12-05 14:41:25 -08:00
|
|
|
<tr>
|
2023-12-05 12:52:14 -08:00
|
|
|
<!-- ID -->
|
2024-06-17 07:44:07 -07:00
|
|
|
<td>
|
2023-12-05 12:52:14 -08:00
|
|
|
{{ $client->id }}
|
|
|
|
</td>
|
|
|
|
|
|
|
|
<!-- Name -->
|
2024-06-17 07:44:07 -07:00
|
|
|
<td>
|
2023-12-05 12:52:14 -08:00
|
|
|
{{ $client->name }}
|
|
|
|
</td>
|
|
|
|
|
2024-06-17 07:44:07 -07:00
|
|
|
<!-- Redirect -->
|
|
|
|
<td>
|
|
|
|
{{ $client->redirect }}
|
|
|
|
</td>
|
|
|
|
|
2023-12-05 12:52:14 -08:00
|
|
|
<!-- Secret -->
|
2024-06-17 07:44:07 -07:00
|
|
|
<td>
|
2023-12-05 12:52:14 -08:00
|
|
|
<code>{{ $client->secret }}</code>
|
|
|
|
</td>
|
|
|
|
|
2024-06-17 07:44:07 -07:00
|
|
|
<!-- Edit / Delete Button -->
|
|
|
|
<td class="text-right">
|
|
|
|
|
|
|
|
<a class="action-link btn btn-sm btn-warning"
|
2023-12-05 15:39:35 -08:00
|
|
|
wire:click="editClient('{{ $client->id }}')"
|
2024-06-17 07:44:07 -07:00
|
|
|
onclick="$('#modal-edit-client').modal('show');">
|
|
|
|
<i class="fas fa-pencil-alt" aria-hidden="true"></i><span class="sr-only">{{ trans('general.update') }}</span>
|
2023-12-05 12:52:14 -08:00
|
|
|
</a>
|
|
|
|
|
2023-12-05 14:41:25 -08:00
|
|
|
<a class="action-link btn btn-danger btn-sm" wire:click="deleteClient('{{ $client->id }}')">
|
2024-06-17 07:44:07 -07:00
|
|
|
<i class="fas fa-trash" aria-hidden="true"></i>
|
|
|
|
<span class="sr-only">
|
|
|
|
{{ trans('general.delete') }}
|
|
|
|
</span>
|
2023-12-05 12:52:14 -08:00
|
|
|
</a>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
@endforeach
|
2023-12-05 14:41:25 -08:00
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
@endif
|
2023-12-05 12:52:14 -08:00
|
|
|
</div>
|
2024-06-17 07:44:07 -07:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-12-06 14:20:30 -08:00
|
|
|
<div>
|
|
|
|
@if ($authorized_tokens->count() > 0)
|
|
|
|
<div>
|
2024-06-17 07:44:07 -07:00
|
|
|
<div class="box box-default">
|
|
|
|
<div class="box-header">
|
|
|
|
<h2>
|
|
|
|
{{ trans('admin/settings/general.oauth_authorized_apps') }}
|
|
|
|
</h2>
|
|
|
|
</div>
|
2023-12-06 14:20:30 -08:00
|
|
|
|
2024-06-17 07:44:07 -07:00
|
|
|
<div class="box-body">
|
2023-12-06 14:20:30 -08:00
|
|
|
<!-- Authorized Tokens -->
|
2024-06-17 07:44:07 -07:00
|
|
|
<table class="table table-striped snipe-table">
|
2023-12-06 14:20:30 -08:00
|
|
|
<thead>
|
|
|
|
<tr>
|
2024-06-17 07:44:07 -07:00
|
|
|
<th>{{ trans('general.name') }}</th>
|
|
|
|
<th>{{ trans('admin/settings/general.oauth_scopes') }}</th>
|
|
|
|
<th></th>
|
2023-12-06 14:20:30 -08:00
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
|
|
|
@foreach($authorized_tokens as $token)
|
|
|
|
<tr>
|
|
|
|
<!-- Client Name -->
|
2024-06-17 07:44:07 -07:00
|
|
|
<td>
|
2023-12-06 14:20:30 -08:00
|
|
|
{{ $token->client->name }}
|
|
|
|
</td>
|
|
|
|
|
|
|
|
<!-- Scopes -->
|
2024-06-17 07:44:07 -07:00
|
|
|
<td>
|
2023-12-06 14:20:30 -08:00
|
|
|
@if(!$token->scopes)
|
2024-06-17 07:44:07 -07:00
|
|
|
<span class="label label-default">
|
|
|
|
{{ trans('admin/settings/general.no_scopes') }}
|
|
|
|
</span>
|
2023-12-06 14:20:30 -08:00
|
|
|
@endif
|
|
|
|
</td>
|
|
|
|
|
|
|
|
<!-- Revoke Button -->
|
2024-06-17 07:44:07 -07:00
|
|
|
<td>
|
|
|
|
<a class="btn btn-sm btn-danger pull-right"
|
2023-12-06 14:20:30 -08:00
|
|
|
wire:click="deleteToken('{{ $token->id }}')"
|
|
|
|
>
|
2024-06-17 07:44:07 -07:00
|
|
|
<i class="fas fa-trash" aria-hidden="true"></i>
|
|
|
|
<span class="sr-only">
|
|
|
|
{{ trans('general.delete') }}
|
|
|
|
</span>
|
2023-12-06 14:20:30 -08:00
|
|
|
</a>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
@endforeach
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
@endif
|
2024-06-17 07:44:07 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-12-05 12:52:14 -08:00
|
|
|
|
2023-12-05 14:41:25 -08:00
|
|
|
<!-- Create Client Modal -->
|
2023-12-05 15:39:35 -08:00
|
|
|
<div class="modal fade" id="modal-create-client" tabindex="-1" role="dialog" wire:ignore.self>
|
2023-12-05 14:41:25 -08:00
|
|
|
<div class="modal-dialog">
|
|
|
|
<div class="modal-content">
|
|
|
|
<div class="modal-header">
|
|
|
|
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
2023-12-05 12:52:14 -08:00
|
|
|
|
2023-12-05 14:41:25 -08:00
|
|
|
<h2 class="modal-title">
|
2024-06-17 07:44:07 -07:00
|
|
|
{{ trans('admin/settings/general.create_client') }}
|
2023-12-05 14:41:25 -08:00
|
|
|
</h2>
|
|
|
|
</div>
|
2023-12-05 12:52:14 -08:00
|
|
|
|
2023-12-05 14:41:25 -08:00
|
|
|
<div class="modal-body">
|
|
|
|
<!-- Form Errors -->
|
2023-12-05 15:39:35 -08:00
|
|
|
@if($errors->has('name') || $errors->has('redirect'))
|
|
|
|
<div class="alert alert-danger">
|
|
|
|
<p><strong>Whoops!</strong> Something went wrong!</p>
|
|
|
|
<br>
|
|
|
|
<ul>
|
|
|
|
@if($errors->has('name'))
|
|
|
|
<li>{{ $errors->first('name') }}</li>
|
|
|
|
@endif
|
|
|
|
@if($errors->has('redirect'))
|
|
|
|
<li>{{ $errors->first('redirect') }}</li>
|
|
|
|
@endif
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
@endif
|
2023-12-05 12:52:14 -08:00
|
|
|
|
2023-12-05 14:41:25 -08:00
|
|
|
<!-- Create Client Form -->
|
|
|
|
<form class="form-horizontal" role="form">
|
|
|
|
<!-- Name -->
|
|
|
|
<div class="form-group">
|
2024-06-17 07:44:07 -07:00
|
|
|
<label class="col-md-3 control-label" for="create-client-name">
|
|
|
|
{{ trans('general.name') }}
|
|
|
|
</label>
|
2023-12-05 12:52:14 -08:00
|
|
|
|
2023-12-05 14:41:25 -08:00
|
|
|
<div class="col-md-7">
|
2023-12-05 15:39:35 -08:00
|
|
|
<input id="create-client-name"
|
|
|
|
type="text"
|
|
|
|
aria-label="create-client-name"
|
|
|
|
class="form-control"
|
|
|
|
wire:model="name"
|
2023-12-12 11:28:04 -08:00
|
|
|
wire:keydown.enter="createClient"
|
2024-06-17 07:44:07 -07:00
|
|
|
autofocus>
|
2023-12-05 12:52:14 -08:00
|
|
|
|
2023-12-05 14:41:25 -08:00
|
|
|
<span class="help-block">
|
2024-06-17 07:44:07 -07:00
|
|
|
{{ trans('admin/settings/general.oauth_name_help') }}
|
2023-12-05 14:41:25 -08:00
|
|
|
</span>
|
2023-12-05 12:52:14 -08:00
|
|
|
</div>
|
2023-12-05 14:41:25 -08:00
|
|
|
</div>
|
2023-12-05 12:52:14 -08:00
|
|
|
|
2023-12-05 14:41:25 -08:00
|
|
|
<!-- Redirect URL -->
|
|
|
|
<div class="form-group">
|
2024-06-17 07:44:07 -07:00
|
|
|
<label class="col-md-3 control-label" for="redirect">{{ trans('admin/settings/general.oauth_redirect_url') }}</label>
|
2023-12-05 12:52:14 -08:00
|
|
|
|
2023-12-05 14:41:25 -08:00
|
|
|
<div class="col-md-7">
|
2023-12-05 15:39:35 -08:00
|
|
|
<input type="text"
|
|
|
|
class="form-control"
|
|
|
|
aria-label="redirect"
|
|
|
|
name="redirect"
|
|
|
|
wire:model="redirect"
|
2023-12-12 11:28:04 -08:00
|
|
|
wire:keydown.enter="createClient"
|
2023-12-05 14:41:25 -08:00
|
|
|
>
|
2023-12-05 12:52:14 -08:00
|
|
|
|
2023-12-05 14:41:25 -08:00
|
|
|
<span class="help-block">
|
2024-06-17 07:44:07 -07:00
|
|
|
{{ trans('admin/settings/general.oauth_callback_url') }}
|
2023-12-05 14:41:25 -08:00
|
|
|
</span>
|
2023-12-05 12:52:14 -08:00
|
|
|
</div>
|
2023-12-05 14:41:25 -08:00
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</div>
|
2023-12-05 12:52:14 -08:00
|
|
|
|
2023-12-05 14:41:25 -08:00
|
|
|
<!-- Modal Actions -->
|
|
|
|
<div class="modal-footer">
|
|
|
|
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
|
2023-12-05 15:39:35 -08:00
|
|
|
<button type="button"
|
|
|
|
class="btn btn-primary"
|
|
|
|
wire:click="createClient"
|
2023-12-05 14:41:25 -08:00
|
|
|
>
|
|
|
|
Create
|
|
|
|
</button>
|
2023-12-05 12:52:14 -08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2023-12-05 14:41:25 -08:00
|
|
|
</div>
|
2024-06-17 07:44:07 -07:00
|
|
|
</div>
|
|
|
|
|
2023-12-05 12:52:14 -08:00
|
|
|
|
2023-12-05 14:41:25 -08:00
|
|
|
<!-- Edit Client Modal -->
|
2023-12-05 15:39:35 -08:00
|
|
|
<div class="modal fade" id="modal-edit-client" tabindex="-1" role="dialog" wire:ignore.self>
|
2023-12-05 14:41:25 -08:00
|
|
|
<div class="modal-dialog">
|
|
|
|
<div class="modal-content">
|
|
|
|
<div class="modal-header">
|
|
|
|
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
|
|
|
<h4 class="modal-title">
|
2024-06-17 07:44:07 -07:00
|
|
|
{{ trans('general.update') }}
|
2023-12-05 14:41:25 -08:00
|
|
|
</h4>
|
|
|
|
</div>
|
2023-12-05 12:52:14 -08:00
|
|
|
|
2023-12-05 15:39:35 -08:00
|
|
|
|
2023-12-05 14:41:25 -08:00
|
|
|
<div class="modal-body">
|
2023-12-05 15:39:35 -08:00
|
|
|
@if($errors->has('newName') || $errors->has('newRedirect'))
|
|
|
|
<div class="alert alert-danger">
|
|
|
|
<p><strong>Whoops!</strong> Something went wrong!</p>
|
|
|
|
<br>
|
|
|
|
<ul>
|
|
|
|
@if($errors->has('newName'))
|
|
|
|
<li>{{ $errors->first('newName') }}</li>
|
|
|
|
@endif
|
|
|
|
@if($errors->has('newRedirect'))
|
|
|
|
<li>{{ $errors->first('newRedirect') }}</li>
|
|
|
|
@endif
|
2023-12-05 18:36:59 -08:00
|
|
|
@if($authorizationError)
|
2023-12-05 18:22:20 -08:00
|
|
|
<li>{{ $authorizationError }}</li>
|
|
|
|
@endif
|
2023-12-05 15:39:35 -08:00
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
@endif
|
2023-12-05 12:52:14 -08:00
|
|
|
|
2023-12-05 14:41:25 -08:00
|
|
|
<!-- Edit Client Form -->
|
2023-12-05 15:39:35 -08:00
|
|
|
<form class="form-horizontal">
|
2023-12-05 14:41:25 -08:00
|
|
|
<!-- Name -->
|
|
|
|
<div class="form-group">
|
|
|
|
<label class="col-md-3 control-label" for="edit-client-name">Name</label>
|
2023-12-05 12:52:14 -08:00
|
|
|
|
2023-12-05 14:41:25 -08:00
|
|
|
<div class="col-md-7">
|
2023-12-05 15:39:35 -08:00
|
|
|
<input
|
|
|
|
id="edit-client-name"
|
|
|
|
type="text"
|
|
|
|
aria-label="edit-client-name"
|
|
|
|
class="form-control"
|
|
|
|
wire:model="editName"
|
2023-12-12 11:33:51 -08:00
|
|
|
wire:keydown.enter="updateClient('{{ $editClientId }}')"
|
2023-12-05 14:41:25 -08:00
|
|
|
>
|
2023-12-05 12:52:14 -08:00
|
|
|
|
2023-12-05 14:41:25 -08:00
|
|
|
<span class="help-block">
|
2024-06-17 07:44:07 -07:00
|
|
|
{{ trans('admin/settings/general.oauth_name_help') }}
|
2023-12-05 14:41:25 -08:00
|
|
|
</span>
|
2023-12-05 12:52:14 -08:00
|
|
|
</div>
|
2023-12-05 14:41:25 -08:00
|
|
|
</div>
|
2023-12-05 12:52:14 -08:00
|
|
|
|
2023-12-05 14:41:25 -08:00
|
|
|
<!-- Redirect URL -->
|
|
|
|
<div class="form-group">
|
2024-06-17 07:44:07 -07:00
|
|
|
<label class="col-md-3 control-label" for="redirect">{{ trans('admin/settings/general.oauth_redirect_url') }}</label>
|
2023-12-05 12:52:14 -08:00
|
|
|
|
2023-12-05 14:41:25 -08:00
|
|
|
<div class="col-md-7">
|
2023-12-05 15:39:35 -08:00
|
|
|
<input
|
|
|
|
type="text"
|
|
|
|
class="form-control"
|
|
|
|
name="redirect"
|
|
|
|
aria-label="redirect"
|
|
|
|
wire:model="editRedirect"
|
2023-12-12 11:33:51 -08:00
|
|
|
wire:keydown.enter="updateClient('{{ $editClientId }}')"
|
2023-12-05 14:41:25 -08:00
|
|
|
>
|
2023-12-05 12:52:14 -08:00
|
|
|
|
2023-12-05 14:41:25 -08:00
|
|
|
<span class="help-block">
|
2024-06-17 07:44:07 -07:00
|
|
|
{{ trans('admin/settings/general.oauth_callback_url') }}
|
2023-12-05 14:41:25 -08:00
|
|
|
</span>
|
2023-12-05 12:52:14 -08:00
|
|
|
</div>
|
2023-12-05 14:41:25 -08:00
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</div>
|
2023-12-05 12:52:14 -08:00
|
|
|
|
2023-12-05 14:41:25 -08:00
|
|
|
<!-- Modal Actions -->
|
|
|
|
<div class="modal-footer">
|
|
|
|
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
|
2023-12-05 12:52:14 -08:00
|
|
|
|
2023-12-05 18:22:20 -08:00
|
|
|
<button
|
2023-12-05 15:39:35 -08:00
|
|
|
class="btn btn-primary"
|
|
|
|
wire:click="updateClient('{{ $editClientId }}')"
|
2023-12-05 14:41:25 -08:00
|
|
|
>
|
2023-12-05 15:39:35 -08:00
|
|
|
Update Client
|
2023-12-05 14:41:25 -08:00
|
|
|
</button>
|
2023-12-05 12:52:14 -08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2023-12-05 14:41:25 -08:00
|
|
|
<script>
|
2023-12-05 18:22:20 -08:00
|
|
|
document.addEventListener('DOMContentLoaded', function() {
|
2023-12-05 15:39:35 -08:00
|
|
|
window.livewire.on('openModal', () => {
|
2023-12-12 11:28:04 -08:00
|
|
|
$('#modal-create-client').modal('show').on('shown.bs.modal', function() {
|
|
|
|
$(this).find('[autofocus]').focus();
|
|
|
|
});
|
2023-12-05 15:39:35 -08:00
|
|
|
});
|
|
|
|
});
|
2023-12-05 18:22:20 -08:00
|
|
|
window.addEventListener('clientCreated', function() {
|
2023-12-05 15:39:35 -08:00
|
|
|
$('#modal-create-client').modal('hide');
|
|
|
|
});
|
2023-12-05 18:22:20 -08:00
|
|
|
window.addEventListener('editClient', function() {
|
2023-12-05 15:39:35 -08:00
|
|
|
$('#modal-edit-client').modal('show');
|
|
|
|
});
|
2023-12-05 18:22:20 -08:00
|
|
|
window.addEventListener('clientUpdated', function() {
|
|
|
|
$('#modal-edit-client').modal('hide');
|
|
|
|
});
|
|
|
|
|
2023-12-05 15:39:35 -08:00
|
|
|
|
2023-12-05 14:41:25 -08:00
|
|
|
|
|
|
|
</script>
|
2024-06-17 07:44:07 -07:00
|
|
|
</div>
|
|
|
|
|