|
| 1 | +<div> |
| 2 | + {{-- Button in der Topbar --}} |
| 3 | + <button |
| 4 | + wire:click="openModal" |
| 5 | + title="{{ __('filament/env-editor.button_tooltip') }}" |
| 6 | + class="flex items-center justify-center w-9 h-9 rounded-lg border-none cursor-pointer bg-transparent text-gray-400 hover:bg-gray-100 hover:text-primary-500 dark:text-gray-500 dark:hover:bg-white/5 dark:hover:text-primary-400 transition-colors duration-150" |
| 7 | + > |
| 8 | + <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="w-5 h-5"> |
| 9 | + <path fill-rule="evenodd" d="M12 1.5a5.25 5.25 0 0 0-5.25 5.25v3a3 3 0 0 0-3 3v6.75a3 3 0 0 0 3 3h10.5a3 3 0 0 0 3-3v-6.75a3 3 0 0 0-3-3v-3c0-2.9-2.35-5.25-5.25-5.25Zm3.75 8.25v-3a3.75 3.75 0 1 0-7.5 0v3h7.5Z" clip-rule="evenodd" /> |
| 10 | + </svg> |
| 11 | + </button> |
| 12 | + |
| 13 | + {{-- Password Confirmation Modal --}} |
| 14 | + @if($showPasswordModal) |
| 15 | + <div |
| 16 | + x-data |
| 17 | + x-init="$nextTick(() => $el.querySelector('[data-modal-backdrop]').focus())" |
| 18 | + class="fixed inset-0 z-[9998] flex items-center justify-center p-4" |
| 19 | + > |
| 20 | + <div |
| 21 | + data-modal-backdrop |
| 22 | + wire:click="closePasswordModal" |
| 23 | + tabindex="-1" |
| 24 | + class="absolute inset-0 bg-black/50 backdrop-blur-sm" |
| 25 | + ></div> |
| 26 | + |
| 27 | + <div |
| 28 | + role="dialog" |
| 29 | + aria-modal="true" |
| 30 | + class="relative z-10 w-full max-w-sm rounded-2xl bg-white dark:bg-gray-900 border border-gray-200 dark:border-white/10 shadow-2xl p-7" |
| 31 | + @keydown.escape.window="$wire.closePasswordModal()" |
| 32 | + > |
| 33 | + <form wire:submit="confirmPassword"> |
| 34 | + <div class="flex items-center gap-3.5 mb-4"> |
| 35 | + <div class="flex-shrink-0 flex items-center justify-center w-11 h-11 rounded-xl bg-primary-500/10 dark:bg-primary-400/10"> |
| 36 | + <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="w-5 h-5 text-primary-500 dark:text-primary-400"> |
| 37 | + <path fill-rule="evenodd" d="M12 1.5a5.25 5.25 0 0 0-5.25 5.25v3a3 3 0 0 0-3 3v6.75a3 3 0 0 0 3 3h10.5a3 3 0 0 0 3-3v-6.75a3 3 0 0 0-3-3v-3c0-2.9-2.35-5.25-5.25-5.25Zm3.75 8.25v-3a3.75 3.75 0 1 0-7.5 0v3h7.5Z" clip-rule="evenodd" /> |
| 38 | + </svg> |
| 39 | + </div> |
| 40 | + <div> |
| 41 | + <h2 class="m-0 text-base font-bold text-gray-900 dark:text-white">{{ __('filament/env-editor.password_modal_title') }}</h2> |
| 42 | + <p class="mt-0.5 text-xs text-gray-500 dark:text-gray-400">{{ __('filament/env-editor.password_modal_subtitle') }}</p> |
| 43 | + </div> |
| 44 | + </div> |
| 45 | + |
| 46 | + <div class="mb-5"> |
| 47 | + <input |
| 48 | + type="password" |
| 49 | + wire:model="password" |
| 50 | + autofocus |
| 51 | + placeholder="{{ __('filament/env-editor.password_placeholder') }}" |
| 52 | + class="w-full rounded-lg border border-gray-300 dark:border-white/10 bg-white dark:bg-gray-800 px-3 py-2 text-sm text-gray-900 dark:text-white focus:outline-none focus:ring-2 focus:ring-primary-500" |
| 53 | + /> |
| 54 | + @if($passwordError) |
| 55 | + <p class="mt-2 text-xs text-red-500">{{ $passwordError }}</p> |
| 56 | + @endif |
| 57 | + </div> |
| 58 | + |
| 59 | + <div class="flex flex-wrap gap-3 justify-end"> |
| 60 | + <button |
| 61 | + type="button" |
| 62 | + wire:click="closePasswordModal" |
| 63 | + class="px-4 py-2 rounded-lg border border-gray-300 dark:border-white/10 bg-transparent text-gray-700 dark:text-gray-300 text-sm font-medium cursor-pointer hover:bg-gray-50 dark:hover:bg-white/5 transition-colors" |
| 64 | + > |
| 65 | + {{ __('filament/env-editor.cancel') }} |
| 66 | + </button> |
| 67 | + <button |
| 68 | + type="submit" |
| 69 | + wire:loading.attr="disabled" |
| 70 | + class="px-5 py-2 rounded-lg border-none bg-primary-600 hover:bg-primary-700 text-white text-sm font-semibold cursor-pointer transition-colors disabled:opacity-60" |
| 71 | + > |
| 72 | + {{ __('filament/env-editor.confirm_password') }} |
| 73 | + </button> |
| 74 | + </div> |
| 75 | + </form> |
| 76 | + </div> |
| 77 | + </div> |
| 78 | + @endif |
| 79 | + |
| 80 | + {{-- Editor Modal --}} |
| 81 | + @if($showEditorModal) |
| 82 | + <div |
| 83 | + x-data |
| 84 | + x-init="$nextTick(() => $el.querySelector('[data-modal-backdrop]').focus())" |
| 85 | + class="fixed inset-0 z-[9998] flex items-center justify-center p-4" |
| 86 | + > |
| 87 | + <div |
| 88 | + data-modal-backdrop |
| 89 | + wire:click="closeEditorModal" |
| 90 | + tabindex="-1" |
| 91 | + class="absolute inset-0 bg-black/50 backdrop-blur-sm" |
| 92 | + ></div> |
| 93 | + |
| 94 | + <div |
| 95 | + role="dialog" |
| 96 | + aria-modal="true" |
| 97 | + class="relative z-10 w-full max-w-2xl rounded-2xl bg-white dark:bg-gray-900 border border-gray-200 dark:border-white/10 shadow-2xl p-7" |
| 98 | + @keydown.escape.window="$wire.closeEditorModal()" |
| 99 | + > |
| 100 | + <div class="flex items-center gap-3.5 mb-4"> |
| 101 | + <div class="flex-shrink-0 flex items-center justify-center w-11 h-11 rounded-xl bg-primary-500/10 dark:bg-primary-400/10"> |
| 102 | + <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="w-5 h-5 text-primary-500 dark:text-primary-400"> |
| 103 | + <path fill-rule="evenodd" d="M12 1.5a5.25 5.25 0 0 0-5.25 5.25v3a3 3 0 0 0-3 3v6.75a3 3 0 0 0 3 3h10.5a3 3 0 0 0 3-3v-6.75a3 3 0 0 0-3-3v-3c0-2.9-2.35-5.25-5.25-5.25Zm3.75 8.25v-3a3.75 3.75 0 1 0-7.5 0v3h7.5Z" clip-rule="evenodd" /> |
| 104 | + </svg> |
| 105 | + </div> |
| 106 | + <div> |
| 107 | + <h2 class="m-0 text-base font-bold text-gray-900 dark:text-white">{{ __('filament/env-editor.editor_modal_title') }}</h2> |
| 108 | + <p class="mt-0.5 text-xs text-gray-500 dark:text-gray-400">{{ __('filament/env-editor.editor_modal_subtitle') }}</p> |
| 109 | + </div> |
| 110 | + </div> |
| 111 | + |
| 112 | + <textarea |
| 113 | + wire:model="content" |
| 114 | + rows="18" |
| 115 | + spellcheck="false" |
| 116 | + autocomplete="off" |
| 117 | + class="w-full rounded-lg border border-gray-300 dark:border-white/10 bg-gray-50 dark:bg-gray-950 px-3 py-2 text-xs font-mono leading-relaxed text-gray-900 dark:text-gray-100 focus:outline-none focus:ring-2 focus:ring-primary-500 resize-y" |
| 118 | + ></textarea> |
| 119 | + |
| 120 | + <p class="mt-3 mb-5 text-xs text-gray-500 dark:text-gray-400"> |
| 121 | + {{ __('filament/env-editor.cache_hint') }} |
| 122 | + </p> |
| 123 | + |
| 124 | + <div class="flex flex-wrap gap-3 justify-end"> |
| 125 | + <button |
| 126 | + wire:click="closeEditorModal" |
| 127 | + class="px-4 py-2 rounded-lg border border-gray-300 dark:border-white/10 bg-transparent text-gray-700 dark:text-gray-300 text-sm font-medium cursor-pointer hover:bg-gray-50 dark:hover:bg-white/5 transition-colors" |
| 128 | + > |
| 129 | + {{ __('filament/env-editor.cancel') }} |
| 130 | + </button> |
| 131 | + <button |
| 132 | + wire:click="save" |
| 133 | + wire:loading.attr="disabled" |
| 134 | + class="px-5 py-2 rounded-lg border-none bg-primary-600 hover:bg-primary-700 text-white text-sm font-semibold cursor-pointer flex items-center gap-1.5 transition-colors disabled:opacity-60" |
| 135 | + > |
| 136 | + <span wire:loading.remove wire:target="save">{{ __('filament/env-editor.save') }}</span> |
| 137 | + <span wire:loading wire:target="save" class="flex items-center gap-1.5"> |
| 138 | + <svg class="w-3.5 h-3.5 animate-spin" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"> |
| 139 | + <circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle> |
| 140 | + <path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"></path> |
| 141 | + </svg> |
| 142 | + {{ __('filament/env-editor.save') }} |
| 143 | + </span> |
| 144 | + </button> |
| 145 | + </div> |
| 146 | + </div> |
| 147 | + </div> |
| 148 | + @endif |
| 149 | +</div> |
0 commit comments