mailwolt/resources/views/livewire/ui/nx/mail/alias-list.blade.php

138 lines
7.3 KiB
PHP

<x-slot:breadcrumbParent>Mail</x-slot:breadcrumbParent>
<x-slot:breadcrumb>Aliasse</x-slot:breadcrumb>
<div wire:poll.60s>
<div class="mbx-page-header">
<div class="mbx-page-title">
<svg width="16" height="16" viewBox="0 0 16 16" fill="none">
<path d="M1 8L6 13 15 4" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
Aliasse
<span class="mbx-total-badge">{{ $totalAliases }}</span>
</div>
<div class="mbx-page-actions">
<div class="mbx-search-wrap">
<svg width="13" height="13" viewBox="0 0 13 13" fill="none" style="flex-shrink:0;color:var(--mw-t4)">
<circle cx="5.5" cy="5.5" r="4" stroke="currentColor" stroke-width="1.2"/>
<path d="M9 9l2.5 2.5" stroke="currentColor" stroke-width="1.2" stroke-linecap="round"/>
</svg>
<input
type="text"
wire:model.live.debounce.300ms="search"
class="mbx-search-input"
placeholder="Domain oder Alias suchen …">
</div>
</div>
</div>
@if($domains->count())
<div class="mbx-sections">
@foreach($domains as $domain)
<div class="mbx-section">
<div class="mbx-domain-head">
<div class="mbx-domain-info">
<div class="mbx-domain-icon">
<svg width="13" height="13" viewBox="0 0 14 14" fill="none">
<circle cx="7" cy="7" r="5.5" stroke="currentColor" stroke-width="1.2"/>
<ellipse cx="7" cy="7" rx="2.2" ry="5.5" stroke="currentColor" stroke-width="1.2"/>
<path d="M1.5 5.5h11M1.5 8.5h11" stroke="currentColor" stroke-width="1.2"/>
</svg>
</div>
<span class="mbx-domain-name">{{ $domain->domain }}</span>
<span class="mbx-domain-count">{{ $domain->aliases_count }} Aliasse</span>
@if(!($domain->is_active ?? true))
<span class="mbx-badge-warn">Domain inaktiv</span>
@endif
</div>
<button wire:click="openAliasCreate({{ $domain->id }})" class="mbx-btn-primary">
<svg width="11" height="11" viewBox="0 0 11 11" fill="none">
<path d="M5.5 1v9M1 5.5h9" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>
</svg>
Alias
</button>
</div>
@if($domain->mailAliases->count())
<div class="mbx-table-wrap">
<table class="mbx-table">
<thead>
<tr>
<th class="mbx-th">Alias</th>
<th class="mbx-th">Ziel</th>
<th class="mbx-th" style="width:80px">Typ</th>
<th class="mbx-th" style="width:80px">Status</th>
<th class="mbx-th mbx-th-right" style="width:100px">Aktionen</th>
</tr>
</thead>
<tbody>
@foreach($domain->mailAliases as $alias)
<tr class="mbx-tr {{ !$alias->is_active ? 'mbx-tr-inactive' : '' }}">
<td class="mbx-td">
<div class="mbx-email-cell">
<div class="mbx-email-avatar">{{ strtoupper(substr($alias->local, 0, 1)) }}</div>
<span class="mbx-email-text">{{ $alias->local . '@' . $domain->domain }}</span>
</div>
</td>
<td class="mbx-td mbx-td-muted">
@if($alias->type === 'group' && $alias->group_name)
<span class="als-group-tag">Gruppe: {{ $alias->group_name }}</span>
@else
{{ $alias->destination ?? '—' }}
@endif
</td>
<td class="mbx-td">
@if($alias->type === 'group')
<span class="mbx-badge-mute">Gruppe</span>
@else
<span class="mbx-badge-mute">Einzel</span>
@endif
</td>
<td class="mbx-td">
@if($alias->is_active)
<span class="mbx-badge-ok">Aktiv</span>
@else
<span class="mbx-badge-warn">Inaktiv</span>
@endif
</td>
<td class="mbx-td">
<div class="mbx-actions">
<button wire:click="openAliasEdit({{ $alias->id }})" class="mbx-act-btn" title="Bearbeiten">
<svg width="13" height="13" viewBox="0 0 13 13" fill="none"><path d="M9 2l2 2-6.5 6.5L2 11l.5-2.5L9 2Z" stroke="currentColor" stroke-width="1.2" stroke-linejoin="round"/></svg>
</button>
<button wire:click="openAliasDelete({{ $alias->id }})" class="mbx-act-btn mbx-act-danger" title="Löschen">
<svg width="13" height="13" viewBox="0 0 13 13" fill="none"><path d="M2 3.5h9M5 3.5V2h3v1.5M5.5 6v4M7.5 6v4M3 3.5l.5 7.5h6L10 3.5" stroke="currentColor" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round"/></svg>
</button>
</div>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
@else
<div class="mbx-empty-domain">
Keine Aliasse vorhanden.
<button wire:click="openAliasCreate({{ $domain->id }})" class="mbx-empty-link">Jetzt erstellen</button>
</div>
@endif
</div>
@endforeach
</div>
@else
<div class="mbx-empty-state">
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" style="color:var(--mw-t4);margin-bottom:10px;">
<path d="M2 16L12 26 30 8" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
@if(trim($search))
Keine Ergebnisse für {{ $search }}".
@else
Noch keine Aliasse vorhanden.
@endif
</div>
@endif
</div>