fix: S3 download and database restore output showing same content

- Add unique wire keys to activity-monitor components (s3-download-monitor and database-restore-monitor)
- Update dispatch calls to target specific components using ->to() method
- This prevents both activity monitors from listening to the same activityMonitor event and displaying identical output
- S3 download now shows in s3-download-monitor component
- Database restore now shows in database-restore-monitor component

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Andras Bacsai 2025-11-02 16:44:02 +01:00
parent 6cb3e4d515
commit a5dafe785b
2 changed files with 5 additions and 5 deletions

View file

@ -263,7 +263,7 @@ public function runImport()
'container' => $this->container, 'container' => $this->container,
'serverId' => $this->server->id, 'serverId' => $this->server->id,
]); ]);
$this->dispatch('activityMonitor', $activity->id); $this->dispatch('activityMonitor', $activity->id)->to('database-restore-monitor');
} }
} catch (\Throwable $e) { } catch (\Throwable $e) {
return handleError($e, $this); return handleError($e, $this);
@ -404,7 +404,7 @@ public function downloadFromS3()
$this->s3DownloadedFile = $downloadPath; $this->s3DownloadedFile = $downloadPath;
$this->filename = $downloadPath; $this->filename = $downloadPath;
$this->dispatch('activityMonitor', $activity->id); $this->dispatch('activityMonitor', $activity->id)->to('s3-download-monitor');
$this->dispatch('info', 'Downloading file from S3. This may take a few minutes for large backups...'); $this->dispatch('info', 'Downloading file from S3. This may take a few minutes for large backups...');
} catch (\Throwable $e) { } catch (\Throwable $e) {
$this->s3DownloadInProgress = false; $this->s3DownloadInProgress = false;
@ -486,7 +486,7 @@ public function restoreFromS3()
's3DownloadedFile' => $this->s3DownloadedFile, 's3DownloadedFile' => $this->s3DownloadedFile,
'resourceUuid' => $this->resource->uuid, 'resourceUuid' => $this->resource->uuid,
]); ]);
$this->dispatch('activityMonitor', $activity->id); $this->dispatch('activityMonitor', $activity->id)->to('database-restore-monitor');
} }
} catch (\Throwable $e) { } catch (\Throwable $e) {
return handleError($e, $this); return handleError($e, $this);

View file

@ -150,7 +150,7 @@
<div x-show="s3DownloadInProgress" class="pt-2"> <div x-show="s3DownloadInProgress" class="pt-2">
<div class="text-sm text-warning">Downloading from S3... This may take a few minutes for large <div class="text-sm text-warning">Downloading from S3... This may take a few minutes for large
backups.</div> backups.</div>
<livewire:activity-monitor header="S3 Download Progress" :showWaiting="false" /> <livewire:activity-monitor key="s3-download-monitor" header="S3 Download Progress" :showWaiting="false" />
</div> </div>
<div x-show="s3DownloadedFile && !s3DownloadInProgress" class="pt-2"> <div x-show="s3DownloadedFile && !s3DownloadInProgress" class="pt-2">
@ -173,7 +173,7 @@
<x-forms.button class="w-full my-4" wire:click='runImport'>Restore Backup</x-forms.button> <x-forms.button class="w-full my-4" wire:click='runImport'>Restore Backup</x-forms.button>
</div> </div>
<div class="container w-full mx-auto" x-show="$wire.importRunning"> <div class="container w-full mx-auto" x-show="$wire.importRunning">
<livewire:activity-monitor header="Database Restore Output" :showWaiting="false" /> <livewire:activity-monitor key="database-restore-monitor" header="Database Restore Output" :showWaiting="false" />
</div> </div>
@else @else
<div>Database must be running to restore a backup.</div> <div>Database must be running to restore a backup.</div>