feat(generation): add retry action for failed template generations and update related schemas

This commit is contained in:
2026-08-21 14:53:19 +03:30
parent e58dcd8581
commit fe2090a5af
5 changed files with 100 additions and 0 deletions

View File

@@ -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(),
]);
}
}