feat(generation): add retry action for failed template generations and update related schemas
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\TemplateGenerations\Schemas;
|
||||
|
||||
use App\Enums\TemplateGenerationStatus;
|
||||
use Filament\Infolists\Components\KeyValueEntry;
|
||||
use Filament\Infolists\Components\TextEntry;
|
||||
use Filament\Schemas\Schema;
|
||||
|
||||
class TemplateGenerationInfolist
|
||||
{
|
||||
public static function configure(Schema $schema): Schema
|
||||
{
|
||||
return $schema
|
||||
->components([
|
||||
TextEntry::make('uuid')
|
||||
->label('شناسه')
|
||||
->copyable(),
|
||||
TextEntry::make('template.title')
|
||||
->label('قالب'),
|
||||
TextEntry::make('status')
|
||||
->label('وضعیت')
|
||||
->badge()
|
||||
->formatStateUsing(fn (TemplateGenerationStatus $state): string => $state->label())
|
||||
->color(fn (TemplateGenerationStatus $state): string => match ($state) {
|
||||
TemplateGenerationStatus::Pending => 'gray',
|
||||
TemplateGenerationStatus::Processing => 'warning',
|
||||
TemplateGenerationStatus::Completed => 'success',
|
||||
TemplateGenerationStatus::Failed => 'danger',
|
||||
}),
|
||||
TextEntry::make('requester.name')
|
||||
->label('درخواستدهنده')
|
||||
->placeholder('—'),
|
||||
TextEntry::make('error_message')
|
||||
->label('پیام خطا')
|
||||
->placeholder('—')
|
||||
->columnSpanFull(),
|
||||
KeyValueEntry::make('values')
|
||||
->label('محتوای ذخیرهشده (از جمله متنهای تولیدشده با هوش مصنوعی)')
|
||||
->keyLabel('کلید')
|
||||
->valueLabel('مقدار')
|
||||
->columnSpanFull(),
|
||||
TextEntry::make('created_at')
|
||||
->label('تاریخ ایجاد')
|
||||
->dateTime(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user