diff --git a/app/Http/Controllers/Meet/RecordingController.php b/app/Http/Controllers/Meet/RecordingController.php index 474af64..402d641 100644 --- a/app/Http/Controllers/Meet/RecordingController.php +++ b/app/Http/Controllers/Meet/RecordingController.php @@ -39,9 +39,12 @@ class RecordingController extends Controller { $this->authorizeAbility($request, 'meetings.view'); $this->authorizeOwner($request, $recording); - $recording->load(['session.room', 'session.participants']); + $recording->load(['session.room', 'session.aiSummaries', 'session.participants']); - return view('meet.recordings.show', compact('recording')); + $canManage = app(\App\Services\Meet\MeetPermissions::class) + ->can($this->member($request), 'meetings.manage'); + + return view('meet.recordings.show', compact('recording', 'canManage')); } public function download(Request $request, Recording $recording): StreamedResponse diff --git a/resources/views/components/confirm-dialog.blade.php b/resources/views/components/confirm-dialog.blade.php new file mode 100644 index 0000000..34d102b --- /dev/null +++ b/resources/views/components/confirm-dialog.blade.php @@ -0,0 +1,69 @@ +@props([ + 'name', + 'title', + 'message' => null, + 'action', + 'method' => 'POST', + 'confirmLabel' => 'Confirm', + 'cancelLabel' => 'Cancel', + 'variant' => 'danger', +]) + +@php + $confirmBtnClass = $variant === 'danger' + ? 'bg-red-600 hover:bg-red-700' + : 'bg-violet-600 hover:bg-violet-700'; + $iconWrapClass = $variant === 'danger' + ? 'bg-red-100 text-red-600' + : 'bg-violet-100 text-violet-600'; +@endphp + +@if(isset($trigger)) + + {{ $trigger }} + +@endif + + +
+
+
+ @if($variant === 'danger') + + + + @else + + + + @endif +
+

{{ $title }}

+ @if($message) +

{{ $message }}

+ @endif + @isset($details) +
{{ $details }}
+ @endisset +
+ +
+ @csrf + @if(strtoupper($method) !== 'POST') + @method($method) + @endif + @isset($fields) + {{ $fields }} + @endisset + + +
+
+
diff --git a/resources/views/meet/recordings/show.blade.php b/resources/views/meet/recordings/show.blade.php index f52a06f..bf0be99 100644 --- a/resources/views/meet/recordings/show.blade.php +++ b/resources/views/meet/recordings/show.blade.php @@ -1,27 +1,127 @@ +@php + $room = $recording->session->room; + $statusLabel = config('meet.recording_statuses')[$recording->status] ?? ucfirst($recording->status); + $statusClass = match ($recording->status) { + 'ready' => 'bg-emerald-50 text-emerald-700', + 'processing' => 'bg-amber-50 text-amber-700', + 'recording' => 'bg-red-50 text-red-700', + 'failed' => 'bg-red-50 text-red-700', + default => 'bg-slate-100 text-slate-600', + }; + $summary = $recording->session->aiSummaries->where('status', 'ready')->sortByDesc('created_at')->first(); + $fileExtension = $recording->storage_path ? strtoupper(pathinfo($recording->storage_path, PATHINFO_EXTENSION)) : null; + $fileSizeLabel = null; + if ($recording->file_size) { + $bytes = (int) $recording->file_size; + if ($bytes >= 1073741824) { + $fileSizeLabel = number_format($bytes / 1073741824, 2).' GB'; + } elseif ($bytes >= 1048576) { + $fileSizeLabel = number_format($bytes / 1048576, 1).' MB'; + } elseif ($bytes >= 1024) { + $fileSizeLabel = number_format($bytes / 1024, 1).' KB'; + } else { + $fileSizeLabel = $bytes.' B'; + } + } +@endphp +
-

{{ $recording->session->room->title }}

-

{{ config('meet.recording_statuses')[$recording->status] ?? $recording->status }}

+ + + Recordings + -
- @if ($recording->duration_seconds) -

Duration: {{ gmdate('H:i:s', $recording->duration_seconds) }}

- @endif - @if ($recording->isReady()) - Download recording - @else -

Recording is still processing. Refresh shortly.

- @endif - - @php $summary = $recording->session->aiSummaries()->latest()->first(); @endphp - @if ($summary?->status === 'ready') - View AI summary → - @endif +
+
+

{{ $room->title }}

+

+ {{ $recording->started_at?->timezone($room->timezone)->format('l, M j, Y · g:i A') ?? $recording->created_at->format('M j, Y g:i A') }} +

+
+ {{ $statusLabel }}
-
- @csrf @method('DELETE') - -
+
+
+ @if ($recording->duration_seconds) +
+
Duration
+
{{ gmdate('H:i:s', $recording->duration_seconds) }}
+
+ @endif + @if ($fileSizeLabel) +
+
File size
+
{{ $fileSizeLabel }}@if ($fileExtension) · {{ $fileExtension }}@endif
+
+ @endif + @if ($recording->ended_at) +
+
Ended
+
{{ $recording->ended_at->timezone($room->timezone)->format('M j, Y g:i A') }}
+
+ @endif +
+
Layout
+
{{ $recording->layout ?? 'gallery' }}
+
+
+ + @if ($recording->isReady()) +

Your recording is stored on Ladill and ready to download.

+ @elseif ($recording->status === 'processing') +
+ +
+

Processing recording

+

This usually takes a moment after the meeting ends. Refresh shortly.

+
+
+ @elseif ($recording->status === 'failed') +
+ {{ $recording->failure_reason ?? 'This recording could not be processed.' }} +
+ @endif + +
+ @if ($recording->isReady()) + + + Download + + @endif + View meeting + @if ($summary) + AI summary + @endif +
+
+ + @if ($canManage) +
+ + + + + +
+ @endif