null, ]; public function toggleVisibility(int $id): void { $run = BenchmarkRun::where('user_id', auth()->id())->findOrFail($id); $run->fill([ 'visibility' => $run->visibility === BenchmarkRun::VISIBILITY_PUBLIC ? BenchmarkRun::VISIBILITY_PRIVATE : BenchmarkRun::VISIBILITY_PUBLIC, ])->save(); Flux::toast(variant: 'success', text: __('Visibility updated.')); } public function resetFilters(): void { $this->filters = ['search' => null]; $this->resetPage(); } #[Computed] public function runs(): LengthAwarePaginator { return BenchmarkRun::query() ->where('user_id', auth()->id()) ->withCount([ 'results', 'results as passed_count' => fn ($q) => $q->where('ok', true), ]) ->when($this->filters['search'], fn ($q, $search) => $q->where(function ($q) use ($search) { $q->where('run_id', 'like', "%{$search}%") ->orWhere('model_id', 'like', "%{$search}%") ->orWhere('label', 'like', "%{$search}%"); })) ->orderByDesc('ran_at') ->orderByDesc('id') ->paginate(25); } }; ?>
{{ __('My Runs') }} {{ __('Runs attributed to you. Toggle visibility or add notes from a run page.') }}
{{ __('All results') }}
@if ($this->runs->count() > 0) {{ __('Date') }} {{ __('Run') }} {{ __('Model') }} {{ __('Suite') }} {{ __('Tasks') }} {{ __('Passed') }} {{ __('Visibility') }} @foreach ($this->runs as $run) {{ optional($run->ran_at)->format('Y-m-d') }} {{ $run->run_id }} {{ $run->model_id }} {{ $run->suite }} {{ $run->results_count }} {{ $run->passed_count }} {{ __($run->visibility) }} {{ $run->visibility === 'public' ? __('Make private') : __('Make public') }} @endforeach @else {{ __('No runs yet') }} {{ __('Runs you import or submit will appear here.') }} @endif