fix copy to clipboard bug

This commit is contained in:
Saeed Vaziry
2024-03-16 23:42:22 +01:00
parent 77d6914cd9
commit 1333acf1ef
11 changed files with 56 additions and 80 deletions

View File

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