mailwolt/resources/views/livewire/ui/system/modal/api-key-create-modal.blade.php

67 lines
3.7 KiB
PHP

<div class="mw-modal-frame">
<div class="mw-modal-head">
<div style="display:flex;align-items:center;gap:7px">
<span class="mbx-badge-mute">API Keys</span>
<span style="font-size:12px;color:var(--mw-t3)"> Neuen Key erstellen</span>
</div>
<button wire:click="$dispatch('closeModal')" class="mw-modal-close">
<svg width="13" height="13" viewBox="0 0 13 13" fill="none"><path d="M1 1l11 11M12 1L1 12" stroke="currentColor" stroke-width="1.4" stroke-linecap="round"/></svg>
</button>
</div>
<div class="mw-modal-body">
<div>
<label class="mw-modal-label">Name / Bezeichnung</label>
<input type="text" wire:model.defer="name" class="mw-modal-input" placeholder="z.B. CI-Pipeline, Monitoring">
@error('name') <div class="mw-modal-error">{{ $message }}</div> @enderror
</div>
<div style="margin-top:14px">
<div style="display:flex;align-items:center;justify-content:space-between;margin-bottom:8px">
<label class="mw-modal-label" style="margin:0">Berechtigungen</label>
<button type="button" wire:click="toggleAll"
style="background:none;border:none;font-size:11px;color:var(--mw-v);cursor:pointer;padding:0">
{{ count($selected) === count($scopes) ? 'Alle abwählen' : 'Alle wählen' }}
</button>
</div>
<div style="display:grid;grid-template-columns:1fr 1fr;gap:6px;padding:12px;background:var(--mw-bg4);border:1px solid var(--mw-b2);border-radius:8px">
@foreach($scopes as $key => $label)
<label style="display:flex;align-items:center;gap:7px;cursor:pointer;padding:5px 8px;border-radius:5px;transition:background .1s"
onmouseover="this.style.background='var(--mw-bg3)'"
onmouseout="this.style.background='transparent'">
<input type="checkbox" wire:model="selected" value="{{ $key }}"
style="width:13px;height:13px;flex-shrink:0;accent-color:var(--mw-v)">
<div>
<div style="font-size:11px;color:var(--mw-t2);font-family:monospace;line-height:1.3">{{ $key }}</div>
<div style="font-size:10px;color:var(--mw-t4);line-height:1.3">{{ $label }}</div>
</div>
</label>
@endforeach
</div>
@error('selected') <div class="mw-modal-error">{{ $message }}</div> @enderror
</div>
<div style="margin-top:12px">
<label style="display:flex;align-items:center;gap:10px;cursor:pointer;padding:10px 12px;background:rgba(251,191,36,.05);border:1px solid rgba(251,191,36,.18);border-radius:8px">
<input type="checkbox" wire:model="sandbox" style="width:13px;height:13px;flex-shrink:0;accent-color:#f59e0b">
<div>
<div style="font-size:12px;color:var(--mw-t1);font-weight:500">Sandbox-Modus</div>
<div style="font-size:10.5px;color:var(--mw-t4);margin-top:1px">Schreiboperationen werden simuliert keine Änderungen in der DB.</div>
</div>
</label>
</div>
</div>
<div class="mw-modal-foot">
<button wire:click="$dispatch('closeModal')" class="mw-btn-cancel">Abbrechen</button>
<button wire:click="create" class="mw-btn-primary">
<svg width="11" height="11" viewBox="0 0 14 14" fill="none"><path d="M7 1v12M1 7h12" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/></svg>
Key erstellen
</button>
</div>
</div>