temporary fix for proxy
This commit is contained in:
parent
e89868c692
commit
c287276d0e
@ -16,10 +16,7 @@ public function __invoke(Server $server, bool $reset = false)
|
||||
|
||||
if ($reset || is_null($proxy_configuration)) {
|
||||
$proxy_configuration = Str::of(generate_default_proxy_configuration($server))->trim()->value;
|
||||
resolve(SaveConfigurationSync::class)($server, $proxy_configuration);
|
||||
return $proxy_configuration;
|
||||
}
|
||||
|
||||
return $proxy_configuration;
|
||||
}
|
||||
}
|
||||
|
@ -7,11 +7,12 @@
|
||||
|
||||
class SaveConfigurationSync
|
||||
{
|
||||
public function __invoke(Server $server, string $configuration)
|
||||
public function __invoke(Server $server)
|
||||
{
|
||||
try {
|
||||
$proxy_settings = resolve(CheckConfigurationSync::class)($server, true);
|
||||
$proxy_path = get_proxy_path();
|
||||
$docker_compose_yml_base64 = base64_encode($configuration);
|
||||
$docker_compose_yml_base64 = base64_encode($proxy_settings);
|
||||
|
||||
$server->proxy->last_saved_settings = Str::of($docker_compose_yml_base64)->pipe('md5')->value;
|
||||
$server->save();
|
||||
|
@ -48,7 +48,7 @@ public function select_proxy($proxy_type)
|
||||
public function submit()
|
||||
{
|
||||
try {
|
||||
resolve(SaveConfigurationSync::class)($this->server, $this->proxy_settings);
|
||||
resolve(SaveConfigurationSync::class)($this->server);
|
||||
|
||||
$this->server->proxy->redirect_url = $this->redirect_url;
|
||||
$this->server->save();
|
||||
|
@ -22,7 +22,7 @@ public function startProxy()
|
||||
$this->server->proxy->last_applied_settings &&
|
||||
$this->server->proxy->last_saved_settings !== $this->server->proxy->last_applied_settings
|
||||
) {
|
||||
resolve(SaveConfigurationSync::class)($this->server, $this->proxy_settings);
|
||||
resolve(SaveConfigurationSync::class)($this->server);
|
||||
}
|
||||
|
||||
$activity = resolve(StartProxy::class)($this->server);
|
||||
|
16
app/Http/Livewire/Server/Proxy/Modal.php
Normal file
16
app/Http/Livewire/Server/Proxy/Modal.php
Normal file
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Livewire\Server\Proxy;
|
||||
|
||||
use App\Models\Server;
|
||||
use Livewire\Component;
|
||||
|
||||
class Modal extends Component
|
||||
{
|
||||
public Server $server;
|
||||
|
||||
public function proxyStatusUpdated()
|
||||
{
|
||||
$this->emit('proxyStatusUpdated');
|
||||
}
|
||||
}
|
@ -1,4 +1,5 @@
|
||||
<div class="pb-6">
|
||||
<livewire:server.proxy.modal :server="$server" />
|
||||
<div class="flex items-center gap-2">
|
||||
<h1>Server</h1>
|
||||
@if ($server->settings->is_reachable)
|
||||
|
@ -1,16 +1,6 @@
|
||||
<div>
|
||||
@if ($server->isFunctional())
|
||||
@if (data_get($server,'proxy.type'))
|
||||
<x-modal submitWireAction="proxyStatusUpdated" modalId="startProxy">
|
||||
<x-slot:modalBody>
|
||||
<livewire:activity-monitor header="Proxy Startup Logs" />
|
||||
</x-slot:modalBody>
|
||||
<x-slot:modalSubmit>
|
||||
<x-forms.button onclick="startProxy.close()" type="submit">
|
||||
Close
|
||||
</x-forms.button>
|
||||
</x-slot:modalSubmit>
|
||||
</x-modal>
|
||||
<div x-init="$wire.loadProxyConfiguration">
|
||||
@if ($selectedProxy === 'TRAEFIK_V2')
|
||||
<form wire:submit.prevent='submit'>
|
||||
|
12
resources/views/livewire/server/proxy/modal.blade.php
Normal file
12
resources/views/livewire/server/proxy/modal.blade.php
Normal file
@ -0,0 +1,12 @@
|
||||
<div>
|
||||
<x-modal submitWireAction="proxyStatusUpdated" modalId="startProxy">
|
||||
<x-slot:modalBody>
|
||||
<livewire:activity-monitor header="Proxy Startup Logs" />
|
||||
</x-slot:modalBody>
|
||||
<x-slot:modalSubmit>
|
||||
<x-forms.button onclick="startProxy.close()" type="submit">
|
||||
Close
|
||||
</x-forms.button>
|
||||
</x-slot:modalSubmit>
|
||||
</x-modal>
|
||||
</div>
|
@ -1,3 +1,4 @@
|
||||
|
||||
<div class="flex gap-2" x-init="$wire.getProxyStatus">
|
||||
@if ($server->proxy->status === 'running')
|
||||
<x-status.running text="Proxy Running" />
|
||||
|
Loading…
Reference in New Issue
Block a user