Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

fix: correct event class names in callEventOnFinish

Andras Bacsai18f30b7fabc5
diff --git a/app/Livewire/Project/Database/Import.php b/app/Livewire/Project/Database/Import.php
index 95597e8eac..fe30b6f671 100644
--- a/app/Livewire/Project/Database/Import.php
+++ b/app/Livewire/Project/Database/Import.php
@@ -394,7 +394,7 @@ EOD;
$commands[] = "docker exec {$containerName} mc cp temporary/{$bucket}/{$cleanPath} {$downloadPath}";
// Execute download commands
- $activity = remote_process($commands, $this->server, ignore_errors: false, callEventOnFinish: 'App\\Events\\S3DownloadFinished', callEventData: [
+ $activity = remote_process($commands, $this->server, ignore_errors: false, callEventOnFinish: 'S3DownloadFinished', callEventData: [
'downloadPath' => $downloadPath,
'containerName' => $containerName,
'serverId' => $this->server->id,
@@ -478,7 +478,7 @@ EOD;
$this->importCommands[] = "docker exec {$this->container} sh -c 'echo \"Import finished with exit code $?\"'";
if (! empty($this->importCommands)) {
- $activity = remote_process($this->importCommands, $this->server, ignore_errors: true, callEventOnFinish: 'App\\Events\\S3RestoreJobFinished', callEventData: [
+ $activity = remote_process($this->importCommands, $this->server, ignore_errors: true, callEventOnFinish: 'S3RestoreJobFinished', callEventData: [
'scriptPath' => $scriptPath,
'tmpPath' => $tmpPath,
'container' => $this->container,
diff --git a/app/Livewire/Settings/Index.php b/app/Livewire/Settings/Index.php
index 96f13b173e..7a96eabb26 100644
--- a/app/Livewire/Settings/Index.php
+++ b/app/Livewire/Settings/Index.php
@@ -44,6 +44,8 @@ class Index extends Component
public bool $forceSaveDomains = false;
+ public $buildActivityId = null;
+
public function render()
{
return view('livewire.settings.index');
@@ -151,4 +153,37 @@ class Index extends Component
return handleError($e, $this);
}
}
+
+ public function buildHelperImage()
+ {
+ try {
+ if (! isDev()) {
+ $this->dispatch('error', 'Building helper image is only available in development mode.');
+
+ return;
+ }
+
+ $version = $this->dev_helper_version ?: config('constants.coolify.helper_version');
+ if (empty($version)) {
+ $this->dispatch('error', 'Please specify a version to build.');
+
+ return;
+ }
+
+ $buildCommand = "docker build -t ghcr.io/coollabsio/coolify-helper:{$version} -f docker/coolify-helper/Dockerfile .";
+
+ $activity = remote_process(
+ command: [$buildCommand],
+ server: $this->server,
+ type: 'build-helper-image'
+ );
+
+ $this->buildActivityId = $activity->id;
+ $this->dispatch('activityMonitor', $activity->id);
+
+ $this->dispatch('success', "Building coolify-helper:{$version}...");
+ } catch (\Exception $e) {
+ return handleError($e, $this);
+ }
+ }
}
diff --git a/resources/views/livewire/settings/index.blade.php b/resources/views/livewire/settings/index.blade.php
index 4ceb2043ac..ac247f7bd3 100644
--- a/resources/views/livewire/settings/index.blade.php
+++ b/resources/views/livewire/settings/index.blade.php
@@ -78,10 +78,22 @@
</div>
@if(isDev())
<div class="flex gap-2 md:flex-row flex-col w-full">
- <x-forms.input id="dev_helper_version" label="Dev Helper Version (Development Only)"
- helper="Override the default coolify-helper image version. Leave empty to use the default version from config ({{ config('constants.coolify.helper_version') }}). Examples: 1.0.11, latest, dev"
- placeholder="{{ config('constants.coolify.helper_version') }}" />
+ <div class="flex-1">
+ <x-forms.input id="dev_helper_version" label="Dev Helper Version (Development Only)"
+ helper="Override the default coolify-helper image version. Leave empty to use the default version from config ({{ config('constants.coolify.helper_version') }}). Examples: 1.0.11, latest, dev"
+ placeholder="{{ config('constants.coolify.helper_version') }}" />
+ </div>
+ <div class="flex items-end">
+ <x-forms.button wire:click="buildHelperImage" type="button">
+ Build Image
+ </x-forms.button>
+ </div>
</div>
+ @if($buildActivityId)
+ <div class="w-full mt-4">
+ <livewire:activity-monitor header="Building Helper Image" :activityId="$buildActivityId" :fullHeight="false" />
+ </div>
+ @endif
@endif
</div>
</div>