*/ protected function getHeaderActions(): array { $operateHubShell = app(OperateHubShell::class); $actions = [ Action::make('operate_hub_scope_run_detail') ->label($operateHubShell->scopeLabel(request())) ->color('gray') ->disabled(), ]; $activeTenant = $operateHubShell->activeEntitledTenant(request()); if ($activeTenant instanceof Tenant) { $actions[] = Action::make('operate_hub_back_to_tenant_run_detail') ->label('← Back to '.$activeTenant->name) ->color('gray') ->url(\App\Filament\Pages\TenantDashboard::getUrl(panel: 'tenant', tenant: $activeTenant)); $actions[] = Action::make('operate_hub_show_all_operations') ->label('Show all operations') ->color('gray') ->url(fn (): string => route('admin.operations.index')); } else { $actions[] = Action::make('operate_hub_back_to_operations') ->label('Back to Operations') ->color('gray') ->url(fn (): string => route('admin.operations.index')); } $actions[] = Action::make('refresh') ->label('Refresh') ->icon('heroicon-o-arrow-path') ->color('gray') ->url(fn (): string => isset($this->run) ? route('admin.operations.view', ['run' => (int) $this->run->getKey()]) : route('admin.operations.index')); if (! isset($this->run)) { return $actions; } $user = auth()->user(); $tenant = $this->run->tenant; if ($tenant instanceof Tenant && (! $user instanceof User || ! app(CapabilityResolver::class)->isMember($user, $tenant))) { $tenant = null; } $related = OperationRunLinks::related($this->run, $tenant); $relatedActions = []; foreach ($related as $label => $url) { $relatedActions[] = Action::make(Str::slug((string) $label, '_')) ->label((string) $label) ->url((string) $url) ->openUrlInNewTab(); } if ($relatedActions !== []) { $actions[] = ActionGroup::make($relatedActions) ->label('Open') ->icon('heroicon-o-arrow-top-right-on-square') ->color('gray'); } return $actions; } public function mount(OperationRun $run): void { $user = auth()->user(); if (! $user instanceof User) { abort(403); } $this->authorize('view', $run); $this->run = $run->loadMissing(['workspace', 'tenant', 'user']); } public function infolist(Schema $schema): Schema { return OperationRunResource::infolist($schema); } public function defaultInfolist(Schema $schema): Schema { return $schema ->record($this->run) ->columns(2); } public function content(Schema $schema): Schema { return $schema->schema([ EmbeddedSchema::make('infolist'), ]); } }