diff --git a/app/Livewire/Project/Database/Import.php b/app/Livewire/Project/Database/Import.php index fe30b6f67..d69316a59 100644 --- a/app/Livewire/Project/Database/Import.php +++ b/app/Livewire/Project/Database/Import.php @@ -68,6 +68,8 @@ class Import extends Component public bool $s3DownloadInProgress = false; + public ?int $currentActivityId = null; + public function getListeners() { $userId = Auth::id(); @@ -263,7 +265,7 @@ public function runImport() 'container' => $this->container, 'serverId' => $this->server->id, ]); - $this->dispatch('activityMonitor', $activity->id); + $this->currentActivityId = $activity->id; } } catch (\Throwable $e) { return handleError($e, $this); @@ -403,8 +405,8 @@ public function downloadFromS3() $this->s3DownloadedFile = $downloadPath; $this->filename = $downloadPath; + $this->currentActivityId = $activity->id; - $this->dispatch('activityMonitor', $activity->id); $this->dispatch('info', 'Downloading file from S3. This may take a few minutes for large backups...'); } catch (\Throwable $e) { $this->s3DownloadInProgress = false; @@ -486,7 +488,7 @@ public function restoreFromS3() 's3DownloadedFile' => $this->s3DownloadedFile, 'resourceUuid' => $this->resource->uuid, ]); - $this->dispatch('activityMonitor', $activity->id); + $this->currentActivityId = $activity->id; } } catch (\Throwable $e) { return handleError($e, $this); @@ -516,6 +518,7 @@ public function cancelS3Download() // Reset S3 download state $this->s3DownloadedFile = null; $this->s3DownloadInProgress = false; + $this->currentActivityId = null; $this->filename = null; } } diff --git a/resources/views/livewire/project/database/import.blade.php b/resources/views/livewire/project/database/import.blade.php index be5b0f00a..49f51af5a 100644 --- a/resources/views/livewire/project/database/import.blade.php +++ b/resources/views/livewire/project/database/import.blade.php @@ -147,23 +147,25 @@ -