mirror of
https://github.com/pelican-dev/panel.git
synced 2025-05-20 19:14:45 +02:00
Webhook updates (#666)
This commit is contained in:
parent
86c369d7ce
commit
291b514e24
@ -4,10 +4,12 @@ namespace App\Filament\Resources;
|
|||||||
|
|
||||||
use App\Filament\Resources\WebhookResource\Pages;
|
use App\Filament\Resources\WebhookResource\Pages;
|
||||||
use App\Models\WebhookConfiguration;
|
use App\Models\WebhookConfiguration;
|
||||||
use Filament\Forms;
|
use Filament\Forms\Components\CheckboxList;
|
||||||
|
use Filament\Forms\Components\TextInput;
|
||||||
use Filament\Forms\Form;
|
use Filament\Forms\Form;
|
||||||
use Filament\Resources\Resource;
|
use Filament\Resources\Resource;
|
||||||
use Filament\Tables;
|
use Filament\Tables;
|
||||||
|
use Filament\Tables\Columns\TextColumn;
|
||||||
use Filament\Tables\Table;
|
use Filament\Tables\Table;
|
||||||
|
|
||||||
class WebhookResource extends Resource
|
class WebhookResource extends Resource
|
||||||
@ -16,17 +18,21 @@ class WebhookResource extends Resource
|
|||||||
|
|
||||||
protected static ?string $navigationIcon = 'tabler-webhook';
|
protected static ?string $navigationIcon = 'tabler-webhook';
|
||||||
|
|
||||||
|
protected static ?string $navigationGroup = 'Advanced';
|
||||||
|
|
||||||
protected static ?string $label = 'Webhooks';
|
protected static ?string $label = 'Webhooks';
|
||||||
|
|
||||||
public static function form(Form $form): Form
|
public static function form(Form $form): Form
|
||||||
{
|
{
|
||||||
return $form
|
return $form
|
||||||
->schema([
|
->schema([
|
||||||
Forms\Components\TextInput::make('endpoint')->activeUrl()->required(),
|
TextInput::make('endpoint')->activeUrl()->required(),
|
||||||
Forms\Components\TextInput::make('description')->nullable(),
|
TextInput::make('description')->nullable(),
|
||||||
Forms\Components\CheckboxList::make('events')->lazy()->options(
|
CheckboxList::make('events')->lazy()->options(
|
||||||
fn () => WebhookConfiguration::filamentCheckboxList()
|
fn () => WebhookConfiguration::filamentCheckboxList()
|
||||||
)
|
)
|
||||||
|
->searchable()
|
||||||
|
->bulkToggleable()
|
||||||
->columns(3)
|
->columns(3)
|
||||||
->columnSpanFull()
|
->columnSpanFull()
|
||||||
->gridDirection('row')
|
->gridDirection('row')
|
||||||
@ -38,18 +44,11 @@ class WebhookResource extends Resource
|
|||||||
{
|
{
|
||||||
return $table
|
return $table
|
||||||
->columns([
|
->columns([
|
||||||
//
|
TextColumn::make('description'),
|
||||||
])
|
TextColumn::make('endpoint'),
|
||||||
->filters([
|
|
||||||
//
|
|
||||||
])
|
])
|
||||||
->actions([
|
->actions([
|
||||||
Tables\Actions\EditAction::make(),
|
Tables\Actions\EditAction::make(),
|
||||||
])
|
|
||||||
->bulkActions([
|
|
||||||
Tables\Actions\BulkActionGroup::make([
|
|
||||||
Tables\Actions\DeleteBulkAction::make(),
|
|
||||||
]),
|
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,15 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Traits\Services;
|
|
||||||
|
|
||||||
trait HasWebhookPayload
|
|
||||||
{
|
|
||||||
public function getPayload(): array
|
|
||||||
{
|
|
||||||
if (method_exists($this, '__serialize')) {
|
|
||||||
return $this->__serialize();
|
|
||||||
}
|
|
||||||
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user