This commit is contained in:
Andras Bacsai 2023-05-16 12:50:00 +02:00
parent ce265e1f91
commit dedcc80501
3 changed files with 33 additions and 34 deletions

View File

@ -22,7 +22,7 @@ public function __invoke(Server $server, bool $reset = false)
$docker_compose_yml_base64 = base64_encode($final_output); $docker_compose_yml_base64 = base64_encode($final_output);
$server->extra_attributes->last_saved_proxy_settings = Str::of($docker_compose_yml_base64)->pipe('md5')->value; $server->extra_attributes->last_saved_proxy_settings = Str::of($docker_compose_yml_base64)->pipe('md5')->value;
$server->save(); $server->save();
if (is_null($output)) { if (is_null($output) || $reset) {
instantRemoteProcess([ instantRemoteProcess([
"mkdir -p $proxy_path", "mkdir -p $proxy_path",
"echo '$docker_compose_yml_base64' | base64 -d > $proxy_path/docker-compose.yml", "echo '$docker_compose_yml_base64' | base64 -d > $proxy_path/docker-compose.yml",

View File

@ -3,13 +3,13 @@
'message' => 'Are you sure you want to delete this?', 'message' => 'Are you sure you want to delete this?',
'action' => 'delete', 'action' => 'delete',
]) ])
<div x-cloak x-show="{{ $show }}" x-transition.opacity class="fixed inset-0 bg-slate-900/75"></div> <div x-cloak x-show="{{ $show }}" x-transition.opacity class="fixed inset-0 bg-coolgray-100/75"></div>
<div x-cloak x-show="{{ $show }}" x-transition class="fixed inset-0 z-50 flex items-center justify-center"> <div x-cloak x-show="{{ $show }}" x-transition class="fixed inset-0 z-50 top-20">
<div @click.away="{{ $show }} = false" class="w-screen h-20 max-w-xl mx-auto bg-black rounded-lg"> <div @click.away="{{ $show }} = false" class="w-screen max-w-xl mx-auto rounded-lg shadow-xl bg-coolgray-200">
<div class="flex flex-col items-center justify-center h-full"> <div class="flex flex-col items-center justify-center h-full p-4">
<div class="pb-5 text-white">{{ $message }}</div> <div class="pb-5 text-xs text-white">{{ $message }}</div>
<div> <div class="text-xs">
<x-inputs.button isWarning wire:click='{{ $action }}'> <x-inputs.button isWarning wire:click='{{ $action }}' x-on:click="{{ $show }} = false">
Yes Yes
</x-inputs.button> </x-inputs.button>
<x-inputs.button x-on:click="{{ $show }} = false">No</x-inputs.button> <x-inputs.button x-on:click="{{ $show }} = false">No</x-inputs.button>

View File

@ -13,6 +13,9 @@
$server->extra_attributes->last_applied_proxy_settings && $server->extra_attributes->last_applied_proxy_settings &&
$server->extra_attributes->last_saved_proxy_settings !== $server->extra_attributes->last_applied_proxy_settings) $server->extra_attributes->last_saved_proxy_settings !== $server->extra_attributes->last_applied_proxy_settings)
<div class="text-red-500">Configuration out of sync.</div> <div class="text-red-500">Configuration out of sync.</div>
<x-inputs.button isBold wire:click="installProxy">
Reconfigure
</x-inputs.button>
@endif @endif
@if ($server->extra_attributes->proxy_status !== 'running') @if ($server->extra_attributes->proxy_status !== 'running')
<x-inputs.button isBold wire:click="installProxy"> <x-inputs.button isBold wire:click="installProxy">
@ -22,33 +25,29 @@
<x-inputs.button isWarning x-on:click.prevent="stopProxy = true">Stop <x-inputs.button isWarning x-on:click.prevent="stopProxy = true">Stop
</x-inputs.button> </x-inputs.button>
@endif @endif
<span x-data="{ showConfiguration: false }"> <div class="py-4">
<x-inputs.button isBold x-on:click.prevent="showConfiguration = !showConfiguration">Show
Configuration
</x-inputs.button>
<div class="pt-4">
<livewire:activity-monitor /> <livewire:activity-monitor />
</div> </div>
<template x-if="showConfiguration">
<div x-init="$wire.checkProxySettingsInSync"> <div x-init="$wire.checkProxySettingsInSync">
<h3>Configuration</h3>
<div wire:loading wire:target="checkProxySettingsInSync"> <div wire:loading wire:target="checkProxySettingsInSync">
<x-proxy.loading /> <x-proxy.loading />
</div> </div>
@isset($proxy_settings) @isset($proxy_settings)
<h3>Configuration</h3>
@if ($selectedProxy->value === 'TRAEFIK_V2')
<h4>traefik.conf</h4>
<form wire:submit.prevent='saveConfiguration'> <form wire:submit.prevent='saveConfiguration'>
<div class="pb-2"> <x-inputs.input noDirty type="textarea" wire:model.defer="proxy_settings" rows="30" />
<div class="pt-2">
<x-inputs.button isBold>Save</x-inputs.button> <x-inputs.button isBold>Save</x-inputs.button>
<x-inputs.button wire:click.prevent="resetProxy"> <x-inputs.button wire:click.prevent="resetProxy">
Reset Configuration Reset Configuration
</x-inputs.button> </x-inputs.button>
</div> </div>
<textarea wire:model.defer="proxy_settings" class="w-full" rows="30"></textarea>
</form> </form>
@endif
@endisset @endisset
</div> </div>
</template>
</span>
</div> </div>
@else @else
<select wire:model="selectedProxy"> <select wire:model="selectedProxy">