diff --git a/app/Filament/Admin/Resources/NodeResource/Pages/ListNodes.php b/app/Filament/Admin/Resources/NodeResource/Pages/ListNodes.php index 5839980ab7..25d5b2d2d0 100644 --- a/app/Filament/Admin/Resources/NodeResource/Pages/ListNodes.php +++ b/app/Filament/Admin/Resources/NodeResource/Pages/ListNodes.php @@ -3,6 +3,7 @@ namespace App\Filament\Admin\Resources\NodeResource\Pages; use App\Filament\Admin\Resources\NodeResource; +use App\Filament\Components\Tables\Columns\NodeHealthColumn; use App\Models\Node; use Filament\Actions; use Filament\Resources\Pages\ListRecords; @@ -27,10 +28,7 @@ public function table(Table $table): Table ->label('UUID') ->searchable() ->hidden(), - IconColumn::make('health') - ->alignCenter() - ->state(fn (Node $node) => $node) - ->view('livewire.columns.version-column'), + NodeHealthColumn::make('health'), TextColumn::make('name') ->icon('tabler-server-2') ->sortable() diff --git a/app/Filament/Components/Tables/Columns/NodeHealthColumn.php b/app/Filament/Components/Tables/Columns/NodeHealthColumn.php new file mode 100644 index 0000000000..ebde23d0a6 --- /dev/null +++ b/app/Filament/Components/Tables/Columns/NodeHealthColumn.php @@ -0,0 +1,17 @@ +alignCenter(); + } +} diff --git a/resources/views/livewire/columns/version-column.blade.php b/resources/views/livewire/columns/version-column.blade.php index 758cfd7c2c..706b1f81e0 100644 --- a/resources/views/livewire/columns/version-column.blade.php +++ b/resources/views/livewire/columns/version-column.blade.php @@ -1,8 +1,8 @@ @php use Filament\Tables\Columns\IconColumn\IconColumnSize; - $node = $getState(); - $size = $getSize($state) ?? IconColumnSize::Large; + $node = $getRecord(); + $size = $getSize($node) ?? IconColumnSize::Large; $sizeClasses = match ($size) { IconColumnSize::ExtraSmall, 'xs' => 'fi-ta-icon-item-size-xs h-3 w-3',