mirror of
https://github.com/pelican-dev/panel.git
synced 2025-05-29 12:04:44 +02:00

* Move these Move List/Create to their own pages to follow the flow of the other resources. * Move EditPage aswell * Move Save * Labels * Change Edit/Delete --------- Co-authored-by: RMartinOscar <40749467+RMartinOscar@users.noreply.github.com>
53 lines
1.5 KiB
PHP
53 lines
1.5 KiB
PHP
<?php
|
|
|
|
namespace App\Filament\Resources\WebhookResource\Pages;
|
|
|
|
use App\Filament\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('Description'),
|
|
TextColumn::make('endpoint')
|
|
->label('Endpoint'),
|
|
])
|
|
->actions([
|
|
DeleteAction::make()
|
|
->label('Delete'),
|
|
EditAction::make()
|
|
->label('Edit'),
|
|
])
|
|
->emptyStateIcon('tabler-webhook')
|
|
->emptyStateDescription('')
|
|
->emptyStateHeading('No Webhooks')
|
|
->emptyStateActions([
|
|
CreateAction::make('create')
|
|
->label('Create Webhook')
|
|
->button(),
|
|
]);
|
|
}
|
|
|
|
protected function getHeaderActions(): array
|
|
{
|
|
return [
|
|
Actions\CreateAction::make()
|
|
->label('Create Webhook')
|
|
->hidden(fn () => WebhookConfiguration::count() <= 0),
|
|
];
|
|
}
|
|
}
|