
* Init * Health Page * Admin API Keys * Update API Keys * Database Hosts * Mounts * remove `s` * Users * Webhooks * Server never again... * Fix Server * Settings * Update Mounts * Update Databasehost * Update Server * Oops, Update Server * Nodes * Update User * Dashboard * Update Server * Profile * Egg * Role & Update Egg * Add base Laravel lang files * update apikey * remove html back to settings, remove comment * add `:resource` to create_action * Update Egg * Update Egg v2 * Update 1 * trans cf info label * Update charts * more trans * Update Webhook * update Health * Update Server * Update Role * Fixes * Bulk Update * AnotherOne * Fix relation button label * rename `admin1` to `admin` Leftover from testing... oops * More Translations * Updates * `pint` + Relation Manager Titles
51 lines
1.7 KiB
PHP
51 lines
1.7 KiB
PHP
<?php
|
|
|
|
namespace App\Filament\Admin\Resources\WebhookResource\Pages;
|
|
|
|
use App\Filament\Admin\Resources\WebhookResource;
|
|
use App\Models\WebhookConfiguration;
|
|
use Filament\Actions;
|
|
use Filament\Resources\Pages\ListRecords;
|
|
use Filament\Tables\Actions\CreateAction;
|
|
use Filament\Tables\Columns\TextColumn;
|
|
use Filament\Tables\Table;
|
|
use Filament\Tables\Actions\EditAction;
|
|
use Filament\Tables\Actions\DeleteAction;
|
|
|
|
class ListWebhookConfigurations extends ListRecords
|
|
{
|
|
protected static string $resource = WebhookResource::class;
|
|
|
|
public function table(Table $table): Table
|
|
{
|
|
return $table
|
|
->columns([
|
|
TextColumn::make('description')
|
|
->label(trans('admin/webhook.table.description')),
|
|
TextColumn::make('endpoint')
|
|
->label(trans('admin/webhook.table.endpoint')),
|
|
])
|
|
->actions([
|
|
DeleteAction::make(),
|
|
EditAction::make(),
|
|
])
|
|
->emptyStateIcon('tabler-webhook')
|
|
->emptyStateDescription('')
|
|
->emptyStateHeading(trans('admin/webhook.no_webhooks'))
|
|
->emptyStateActions([
|
|
CreateAction::make('create')
|
|
->label(trans('admin/webhook.create_action', ['action' => trans('filament-actions::create.single.modal.actions.create.label')]))
|
|
->button(),
|
|
]);
|
|
}
|
|
|
|
protected function getHeaderActions(): array
|
|
{
|
|
return [
|
|
Actions\CreateAction::make()
|
|
->label(trans('admin/webhook.create_action', ['action' => trans('filament-actions::create.single.modal.actions.create.label')]))
|
|
->hidden(fn () => WebhookConfiguration::count() <= 0),
|
|
];
|
|
}
|
|
}
|