mirror of
https://github.com/coollabsio/coolify.git
synced 2026-11-16 09:42:29 -04:00
The compose parser queued ServerFilesFromServerJob for every volume on each parse, and pages that only show data parse the Compose file. Each sync also sent two SSH commands for each file. - Queue the sync only for a compose deployment, and for each service resource with file storages when the service starts or deploys. - Read the compose service names without a parse on the Domains and scheduled task pages. - Check all file storages with one remote command, and stop when a symbolic link, a special file, or an unknown state is at a file path. - Keep the application path in a file storage when a pull request preview is parsed. Preview deployments of the current parser write their `-pr-<id>` copies through LocalFileVolume::forPullRequest(). - Remove the unreachable file sync from the service resource page.
93 lines
2.4 KiB
PHP
93 lines
2.4 KiB
PHP
<?php
|
|
|
|
namespace App\Livewire\Project\Shared\ScheduledTask;
|
|
|
|
use Illuminate\Contracts\View\View;
|
|
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
|
|
use Illuminate\Support\Collection;
|
|
use Livewire\Attributes\Locked;
|
|
use Livewire\Attributes\On;
|
|
use Livewire\Attributes\Url;
|
|
use Livewire\Component;
|
|
|
|
class All extends Component
|
|
{
|
|
use AuthorizesRequests;
|
|
|
|
#[Locked]
|
|
public $resource;
|
|
|
|
#[Locked]
|
|
public array $parameters;
|
|
|
|
public Collection $containerNames;
|
|
|
|
public ?string $variables = null;
|
|
|
|
#[Url(as: 'task_uuid', except: '')]
|
|
public string $taskUuid = '';
|
|
|
|
public bool $taskModalOpen = false;
|
|
|
|
public function getListeners(): array
|
|
{
|
|
return [
|
|
'modalClosed' => 'closeTask',
|
|
];
|
|
}
|
|
|
|
public function mount()
|
|
{
|
|
$this->parameters = get_route_parameters();
|
|
if ($this->resource->type() === 'service') {
|
|
$this->containerNames = $this->resource->applications()->pluck('name');
|
|
$this->containerNames = $this->containerNames->merge($this->resource->databases()->pluck('name'));
|
|
} elseif ($this->resource->type() === 'application') {
|
|
if ($this->resource->build_pack === 'dockercompose') {
|
|
$this->containerNames = collect($this->resource->composeServicesWithoutParse())->keys();
|
|
} else {
|
|
$this->containerNames = collect([]);
|
|
}
|
|
}
|
|
|
|
if ($this->taskUuid !== '') {
|
|
$this->openTask($this->taskUuid);
|
|
}
|
|
}
|
|
|
|
public function openTask(string $taskUuid): void
|
|
{
|
|
$this->authorize('view', $this->resource);
|
|
$this->taskUuid = $this->resource->scheduled_tasks()->where('uuid', $taskUuid)->firstOrFail()->uuid;
|
|
$this->taskModalOpen = true;
|
|
}
|
|
|
|
public function closeTask(): void
|
|
{
|
|
$this->taskUuid = '';
|
|
$this->taskModalOpen = false;
|
|
$this->resource->refresh();
|
|
}
|
|
|
|
#[On('scheduledTaskDeleted')]
|
|
public function taskDeleted(): void
|
|
{
|
|
$this->closeTask();
|
|
}
|
|
|
|
#[On('refreshTasks')]
|
|
public function refreshTasks()
|
|
{
|
|
$this->resource->refresh();
|
|
}
|
|
|
|
public function render(): View
|
|
{
|
|
return view('livewire.project.shared.scheduled-task.all', [
|
|
'selectedTask' => $this->taskUuid === ''
|
|
? null
|
|
: $this->resource->scheduled_tasks()->where('uuid', $this->taskUuid)->first(),
|
|
]);
|
|
}
|
|
}
|