mod optimalized UI spaces

This commit is contained in:
E98Developer 2026-03-20 06:15:24 +01:00
parent a4a3f33082
commit 87722fdb87
2 changed files with 145 additions and 131 deletions

View File

@ -19,20 +19,10 @@ protected function getHeaderActions(): array
]; ];
} }
public function getHeading(): string
{
return "Árlista fájl: " . $this->record->filename;
}
protected function getHeaderWidgets(): array protected function getHeaderWidgets(): array
{ {
return [ return [
// Később ide jöhetnek widgetek, pl. statisztika a feldolgozásról // Később ide jöhetnek widgetek, pl. statisztika a feldolgozásról
]; ];
} }
public function getSubheading(): ?string
{
return "Beszállító: " . $this->record->supplier?->name;
}
} }

View File

@ -27,6 +27,10 @@ public static function configure(Schema $schema): Schema
Grid::make(2) Grid::make(2)
->columnSpanFull() ->columnSpanFull()
->maxWidth(Width::Full) ->maxWidth(Width::Full)
->schema([
// BAL OSZLOP
Grid::make(1)
->columnSpan(1)
->schema([ ->schema([
Section::make('Fájl információk') Section::make('Fájl információk')
->schema([ ->schema([
@ -55,86 +59,89 @@ public static function configure(Schema $schema): Schema
Grid::make(3) Grid::make(3)
->schema([ ->schema([
TextEntry::make('available_date') TextEntry::make('available_date')
->label('Életbelépés dátuma') ->label('Életbelépés')
->date('Y.m.d'), ->date('Y.m.d'),
TextEntry::make('created_at') TextEntry::make('created_at')
->label('Feltöltés időpontja') ->label('Feltöltés')
->dateTime('Y.m.d H:i'), ->dateTime('Y.m.d H:i'),
TextEntry::make('processing_current_step')
->label('Aktuális folyamat')
->weight('bold')
->color(fn ($record) => $record->status === PricelistFileStatusEnum::fail ? 'danger' : 'info')
->formatStateUsing(fn ($state, $record) => "$state ({$record->processing_current_step_percentage}%)"),
]), ]),
// SÁRGA NÉGYZET JAVÍTÁSA: Teljes szélességben alul, csak hiba esetén
TextEntry::make('processing_current_step')
->label('Validációs hiba')
->weight('bold')
->color('danger')
->columnSpanFull()
->visible(fn ($record) => $record->status === PricelistFileStatusEnum::fail)
->formatStateUsing(fn ($state, $record) => str_contains((string)$state, 'hibás') ? $state : "Hiba történt a folyamat során: $state"),
// Folyamatban lévő állapot kijelzése (nem hiba, de hasznos)
TextEntry::make('processing_current_step_inprogress')
->label('Aktuális folyamat')
->getStateUsing(fn ($record) => $record->processing_current_step)
->weight('bold')
->color('info')
->columnSpanFull()
->visible(fn ($record) => $record->status === PricelistFileStatusEnum::inprogress)
->formatStateUsing(fn ($state, $record) => "$state ({$record->processing_current_step_percentage}%)"),
TextEntry::make('note') TextEntry::make('note')
->label('Megjegyzés') ->label('Megjegyzés')
->placeholder('Nincs megjegyzés') ->placeholder('Nincs megjegyzés')
->columnSpanFull(), ->columnSpanFull(),
]), ]),
]),
Section::make('Validáció statisztika') // JOBB OSZLOP
Grid::make(1)
->columnSpan(1)
->schema([
Section::make('Fájl statisztika') // KÉK NÉGYZETEK JAVÍTÁSA: Összevont szekció
->schema([ ->schema([
Grid::make(5)->schema([ Grid::make(5)->schema([
TextEntry::make('lines_count') TextEntry::make('lines_count')
->label('Összes sor') ->label('Sorok')
->icon('heroicon-o-list-bullet') ->icon('heroicon-o-list-bullet')
->getStateUsing(fn ($record) => $record->lines()->count()), ->getStateUsing(fn ($record) => $record->lines()->count()),
TextEntry::make('error_lines_count') TextEntry::make('error_lines_count')
->label('Hibás sorok') ->label('Hibás')
->icon('heroicon-o-x-circle') ->icon('heroicon-o-x-circle')
->color('danger') ->color('danger')
->getStateUsing(fn ($record) => $record->lines()->where('status', 'error')->count()), ->getStateUsing(fn ($record) => $record->lines()->where('status', 'error')->count()),
TextEntry::make('warning_lines_count') TextEntry::make('warning_lines_count')
->label('Figyelmeztetések') ->label('Figyelm.')
->icon('heroicon-o-exclamation-triangle') ->icon('heroicon-o-exclamation-triangle')
->color('warning') ->color('warning')
->getStateUsing(fn ($record) => $record->lines()->where('status', 'warning')->count()), ->getStateUsing(fn ($record) => $record->lines()->where('status', 'warning')->count()),
TextEntry::make('new_lines_count') TextEntry::make('new_lines_count')
->label('Új termékek') ->label('Új')
->icon('heroicon-o-sparkles') ->icon('heroicon-o-sparkles')
->color('info') ->color('info')
->getStateUsing(fn ($record) => $record->lines()->where('status', 'new_product')->count()), ->getStateUsing(fn ($record) => $record->lines()->where('status', 'new_product')->count()),
TextEntry::make('updated_lines_count') TextEntry::make('updated_lines_count')
->label('Módosult termékek') ->label('Módosult')
->icon('heroicon-o-pencil-square') ->icon('heroicon-o-pencil-square')
->color('primary') ->color('primary')
->getStateUsing(fn ($record) => $record->lines()->where('status', 'updated')->count()), ->getStateUsing(fn ($record) => $record->lines()->where('status', 'updated')->count()),
]), ]),
])
->visible(fn ($record) => $record->lines()->exists()),
Section::make('Előfeldolgozás eredménye')
->schema([
Grid::make(4)->schema([ Grid::make(4)->schema([
TextEntry::make('file_meta.preprocess.statistics.data_rows') TextEntry::make('file_meta.preprocess.statistics.data_rows')
->label('Adatsorok') ->label('Adatsorok')
->icon('heroicon-o-table-cells'), ->icon('heroicon-o-table-cells'),
TextEntry::make('file_meta.preprocess.statistics.column_count') TextEntry::make('file_meta.preprocess.statistics.column_count')
->label('Oszlopok száma'), ->label('Oszlopok'),
TextEntry::make('file_meta.preprocess.file_info.file_size_human') TextEntry::make('file_meta.preprocess.file_info.file_size_human')
->label('Fájlméret'), ->label('Fájlméret'),
TextEntry::make('file_meta.preprocess.duration_seconds') TextEntry::make('file_meta.preprocess.duration_seconds')
->label('Feldolgozási idő') ->label('Idő')
->suffix(' mp'), ->suffix(' mp'),
]),
RepeatableEntry::make('file_meta.preprocess.warnings')
->label('Figyelmeztetések')
->schema([
TextEntry::make('message')->label('Leírás')->color('warning'),
TextEntry::make('severity')->label('Súlyosság')->badge()->color('warning'),
]) ])
->visible(fn ($record) => !empty($record->file_meta['preprocess']['warnings'] ?? [])), ->extraAttributes(['class' => 'mt-4 border-t pt-4']),
RepeatableEntry::make('file_meta.preprocess.errors')
->label('Hibák')
->schema([
TextEntry::make('message')->label('Leírás')->color('danger'),
TextEntry::make('severity')->label('Súlyosság')->badge()->color('danger'),
]) ])
->visible(fn ($record) => !empty($record->file_meta['preprocess']['errors'] ?? [])), ->visible(fn ($record) => $record->lines()->exists() || !empty($record->file_meta['preprocess'] ?? [])),
])
->visible(fn ($record) => !empty($record->file_meta['preprocess'] ?? [])),
Section::make('Feldolgozási folyamat (Workflow)') Section::make('Feldolgozási folyamat (Workflow)')
->collapsible()
->collapsed(fn ($record) => $record->status !== PricelistFileStatusEnum::inprogress)
->schema([ ->schema([
RepeatableEntry::make('workflow_steps') RepeatableEntry::make('workflow_steps')
->label(false) ->label(false)
@ -172,6 +179,23 @@ public static function configure(Schema $schema): Schema
->columns(2) ->columns(2)
->columnSpanFull(), ->columnSpanFull(),
]), ]),
RepeatableEntry::make('file_meta.preprocess.warnings')
->label('Előfeldolgozási figyelmeztetések')
->schema([
TextEntry::make('message')->label('Leírás')->color('warning'),
TextEntry::make('severity')->label('Súlyosság')->badge()->color('warning'),
])
->visible(fn ($record) => !empty($record->file_meta['preprocess']['warnings'] ?? [])),
RepeatableEntry::make('file_meta.preprocess.errors')
->label('Előfeldolgozási hibák')
->schema([
TextEntry::make('message')->label('Leírás')->color('danger'),
TextEntry::make('severity')->label('Súlyosság')->badge()->color('danger'),
])
->visible(fn ($record) => !empty($record->file_meta['preprocess']['errors'] ?? [])),
]),
]), ]),
]), ]),
]); ]);