mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-06-05 01:24:38 +08:00
Revised webhooks list to new format
Also aligned query naming to start with model in use. Also added created/updated sort options to roles.
This commit is contained in:
3
resources/views/common/status-indicator.blade.php
Normal file
3
resources/views/common/status-indicator.blade.php
Normal file
@ -0,0 +1,3 @@
|
||||
<span title="{{ trans('common.status_' . ($status ? 'active' : 'inactive')) }}"
|
||||
class="status-indicator-{{ $status ? 'active' : 'inactive' }}"
|
||||
></span>
|
@ -31,6 +31,8 @@
|
||||
'display_name' => trans('common.sort_name'),
|
||||
'users_count' => trans('settings.roles_assigned_users'),
|
||||
'permissions_count' => trans('settings.roles_permissions_provided'),
|
||||
'created_at' => trans('common.sort_created_at'),
|
||||
'updated_at' => trans('common.sort_updated_at'),
|
||||
], 'order' => $listDetails['order'], 'sort' => $listDetails['sort'], 'type' => 'roles'])
|
||||
</div>
|
||||
</div>
|
||||
|
@ -8,48 +8,51 @@
|
||||
|
||||
<div class="card content-wrap auto-height">
|
||||
|
||||
<div class="grid half v-center">
|
||||
<div class="flex-container-row items-center justify-space-between wrap">
|
||||
<h1 class="list-heading">{{ trans('settings.webhooks') }}</h1>
|
||||
|
||||
<div class="text-right">
|
||||
<div>
|
||||
<a href="{{ url("/settings/webhooks/create") }}"
|
||||
class="button outline">{{ trans('settings.webhooks_create') }}</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if(count($webhooks) > 0)
|
||||
<p class="text-muted">{{ trans('settings.webhooks_index_desc') }}</p>
|
||||
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>{{ trans('common.name') }}</th>
|
||||
<th width="100">{{ trans('settings.webhook_events_table_header') }}</th>
|
||||
<th width="100">{{ trans('common.status') }}</th>
|
||||
</tr>
|
||||
<div class="flex-container-row items-center justify-space-between gap-m mt-m mb-l wrap">
|
||||
<div>
|
||||
<div class="block inline mr-xs">
|
||||
<form method="get" action="{{ url("/settings/webhooks") }}">
|
||||
<input type="text" name="search" placeholder="{{ trans('common.search') }}" @if($listDetails['search']) value="{{$listDetails['search']}}" @endif>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="justify-flex-end">
|
||||
@include('common.sort', ['options' => [
|
||||
'name' => trans('common.sort_name'),
|
||||
'endpoint' => trans('settings.webhooks_endpoint'),
|
||||
'created_at' => trans('common.sort_created_at'),
|
||||
'updated_at' => trans('common.sort_updated_at'),
|
||||
'active' => trans('common.status'),
|
||||
], 'order' => $listDetails['order'], 'sort' => $listDetails['sort'], 'type' => 'webhooks'])
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if(count($webhooks) > 0)
|
||||
<div class="item-list">
|
||||
@foreach($webhooks as $webhook)
|
||||
<tr>
|
||||
<td>
|
||||
<a href="{{ $webhook->getUrl() }}">{{ $webhook->name }}</a> <br>
|
||||
<span class="small text-muted italic">{{ $webhook->endpoint }}</span>
|
||||
</td>
|
||||
<td>
|
||||
@if($webhook->tracksEvent('all'))
|
||||
{{ trans('settings.webhooks_events_all') }}
|
||||
@else
|
||||
{{ $webhook->trackedEvents->count() }}
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
{{ trans('common.status_' . ($webhook->active ? 'active' : 'inactive')) }}
|
||||
</td>
|
||||
</tr>
|
||||
@include('settings.webhooks.parts.webhooks-list-item', ['webhook' => $webhook])
|
||||
@endforeach
|
||||
</table>
|
||||
</div>
|
||||
@else
|
||||
<p class="text-muted empty-text px-none">
|
||||
{{ trans('settings.webhooks_none_created') }}
|
||||
</p>
|
||||
@endif
|
||||
|
||||
<div class="my-m">
|
||||
{{ $webhooks->links() }}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
@ -0,0 +1,18 @@
|
||||
<div class="item-list-row py-s">
|
||||
<div class="flex-container-row">
|
||||
<div class="flex-2 py-xxs px-m flex-container-row items-center gap-s">
|
||||
@include('common.status-indicator', ['status' => $webhook->active])
|
||||
<a href="{{ $webhook->getUrl() }}">{{ $webhook->name }}</a>
|
||||
</div>
|
||||
<div class="flex py-xxs px-m text-right text-muted">
|
||||
@if($webhook->tracksEvent('all'))
|
||||
{{ trans('settings.webhooks_events_all') }}
|
||||
@else
|
||||
{{ trans_choice('settings.webhooks_x_trigger_events', $webhook->tracked_events_count, ['count' => $webhook->tracked_events_count]) }}
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
<div class="px-m py-xxs text-muted italic text-limit-lines-1">
|
||||
<small>{{ $webhook->endpoint }}</small>
|
||||
</div>
|
||||
</div>
|
Reference in New Issue
Block a user