0ef386b4a8
ui: show status on project
34 lines
809 B
PHP
34 lines
809 B
PHP
<?php
|
|
|
|
namespace App\Http\Livewire\Project\Shared;
|
|
|
|
use App\Jobs\StopResourceJob;
|
|
use Livewire\Component;
|
|
use Visus\Cuid2\Cuid2;
|
|
|
|
class Danger extends Component
|
|
{
|
|
public $resource;
|
|
public array $parameters;
|
|
public ?string $modalId = null;
|
|
|
|
public function mount()
|
|
{
|
|
$this->modalId = new Cuid2(7);
|
|
$this->parameters = get_route_parameters();
|
|
}
|
|
|
|
public function delete()
|
|
{
|
|
try {
|
|
StopResourceJob::dispatchSync($this->resource);
|
|
return redirect()->route('project.resources', [
|
|
'project_uuid' => $this->parameters['project_uuid'],
|
|
'environment_name' => $this->parameters['environment_name']
|
|
]);
|
|
} catch (\Throwable $e) {
|
|
return handleError($e, $this);
|
|
}
|
|
}
|
|
}
|