feat(AI): add ai manager admin and create powerpoint with ai
This commit is contained in:
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\AiProviders\Tables;
|
||||
|
||||
use App\Enums\AiProviderDriver;
|
||||
use Filament\Actions\BulkActionGroup;
|
||||
use Filament\Actions\DeleteBulkAction;
|
||||
use Filament\Actions\EditAction;
|
||||
use Filament\Tables\Columns\IconColumn;
|
||||
use Filament\Tables\Columns\TextColumn;
|
||||
use Filament\Tables\Filters\TernaryFilter;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
class AiProvidersTable
|
||||
{
|
||||
public static function configure(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->columns([
|
||||
TextColumn::make('name')
|
||||
->label('نام')
|
||||
->searchable()
|
||||
->sortable(),
|
||||
TextColumn::make('driver')
|
||||
->label('سرویسدهنده')
|
||||
->badge()
|
||||
->formatStateUsing(fn (AiProviderDriver $state): string => $state->label()),
|
||||
TextColumn::make('model')
|
||||
->label('مدل')
|
||||
->searchable(),
|
||||
TextColumn::make('base_url')
|
||||
->label('آدرس API')
|
||||
->formatStateUsing(fn (?string $state, $record): string => $state ?: $record->driver->defaultBaseUrl())
|
||||
->toggleable(),
|
||||
IconColumn::make('is_active')
|
||||
->label('فعال')
|
||||
->boolean(),
|
||||
IconColumn::make('is_default')
|
||||
->label('پیشفرض')
|
||||
->boolean(),
|
||||
TextColumn::make('created_at')
|
||||
->label('تاریخ ایجاد')
|
||||
->dateTime()
|
||||
->sortable()
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
])
|
||||
->filters([
|
||||
TernaryFilter::make('is_active')
|
||||
->label('وضعیت')
|
||||
->placeholder('همه')
|
||||
->trueLabel('فعال')
|
||||
->falseLabel('غیرفعال'),
|
||||
])
|
||||
->recordActions([
|
||||
EditAction::make(),
|
||||
])
|
||||
->toolbarActions([
|
||||
BulkActionGroup::make([
|
||||
DeleteBulkAction::make(),
|
||||
]),
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user