simplify firewal protocol select confusion

This commit is contained in:
Saeed Vaziry 2024-03-16 23:52:27 +01:00
parent 46d320561e
commit f0c4fc4812
2 changed files with 16 additions and 4 deletions

View File

@ -14,14 +14,21 @@
<x-input-label for="pk"> <x-input-label for="pk">
{{ __("Public Key") }} {{ __("Public Key") }}
</x-input-label> </x-input-label>
<x-input-label class="cursor-pointer" x-data="{ copied: false }"> <x-input-label
class="cursor-pointer"
x-data="{ copied: false }"
id="public-key"
data-public-key="{{ $server->public_key }}"
>
<div x-show="copied" class="flex items-center"> <div x-show="copied" class="flex items-center">
{{ __("Copied") }} {{ __("Copied") }}
</div> </div>
<div <div
x-show="!copied" x-show="!copied"
x-on:click=" x-on:click="
window.copyToClipboard('{{ $server->public_key }}') window.copyToClipboard(
document.getElementById('public-key').getAttribute('data-public-key'),
)
copied = true copied = true
setTimeout(() => { setTimeout(() => {
copied = false copied = false

View File

@ -18,7 +18,12 @@ class="rounded-sm border-l-4 border-yellow-500 bg-yellow-100 px-4 py-3 text-yell
<x-input-label for="pk"> <x-input-label for="pk">
{{ __("Run this command on your server as root user") }} {{ __("Run this command on your server as root user") }}
</x-input-label> </x-input-label>
<x-input-label class="cursor-pointer" x-data="{ copied: false }"> <x-input-label
class="cursor-pointer"
x-data="{ copied: false }"
id="public-key"
data-clipboard="mkdir -p /root/.ssh && touch /root/.ssh/authorized_keys && echo '{{ $key }}' >> /root/.ssh/authorized_keys"
>
<div x-show="copied" class="flex items-center"> <div x-show="copied" class="flex items-center">
{{ __("Copied") }} {{ __("Copied") }}
</div> </div>
@ -26,7 +31,7 @@ class="rounded-sm border-l-4 border-yellow-500 bg-yellow-100 px-4 py-3 text-yell
x-show="!copied" x-show="!copied"
x-on:click=" x-on:click="
window.copyToClipboard( window.copyToClipboard(
'mkdir -p /root/.ssh && touch /root/.ssh/authorized_keys && echo \'{{ $key }}\' >> /root/.ssh/authorized_keys', document.getElementById('public-key').getAttribute('data-clipboard'),
) )
copied = true copied = true
setTimeout(() => { setTimeout(() => {