lasthourcloud/app/Http/Livewire/Server/Proxy/Deploy.php
Andras Bacsai b57b4f9bd3 fixes
2023-07-28 21:36:19 +02:00

34 lines
919 B
PHP

<?php
namespace App\Http\Livewire\Server\Proxy;
use App\Actions\Proxy\StartProxy;
use App\Models\Server;
use Livewire\Component;
use Str;
class Deploy extends Component
{
public Server $server;
public $proxy_settings = null;
public function start_proxy()
{
if (
$this->server->proxy->last_applied_settings &&
$this->server->proxy->last_saved_settings !== $this->server->proxy->last_applied_settings
) {
$this->emit('saveConfiguration', $server);
}
$activity = resolve(StartProxy::class)($this->server);
$this->emit('newMonitorActivity', $activity->id);
}
public function stop()
{
instant_remote_process([
"docker rm -f coolify-proxy",
], $this->server);
$this->server->proxy->status = 'exited';
$this->server->save();
$this->emit('proxyStatusUpdated');
}
}