mailwolt/resources/views/livewire/ui/v2/mail/mailbox-list.blade.php

155 lines
8.5 KiB
PHP

<div wire:poll.60s>
{{-- Page Header --}}
<div class="mbx-page-header">
<div class="mbx-page-title">
<svg width="16" height="16" viewBox="0 0 16 16" fill="none">
<rect x=".5" y="2.5" width="15" height="11" rx="1.8" stroke="currentColor" stroke-width="1.3"/>
<path d="M.5 5.5l7.5 5 7.5-5" stroke="currentColor" stroke-width="1.3" stroke-linecap="round"/>
</svg>
Postfächer
<span class="mbx-total-badge">{{ $totalMailboxes }}</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 Postfach suchen …">
</div>
<button
wire:click="updateMailboxStats"
class="mbx-btn-mute"
title="Statistiken aktualisieren">
<svg width="13" height="13" viewBox="0 0 13 13" fill="none"><path d="M11.5 6.5A5 5 0 1 1 8 2" stroke="currentColor" stroke-width="1.3" stroke-linecap="round"/><path d="M8 .5l2.5 2L8 4" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"/></svg>
Aktualisieren
</button>
</div>
</div>
{{-- Domain Sections --}}
@if($domains->count())
<div class="mbx-sections">
@foreach($domains as $domain)
<div class="mbx-section">
{{-- Domain Header --}}
<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->mail_users_count }} Postfächer</span>
@if(!($domain->is_active ?? true))
<span class="mbx-badge-warn">Domain inaktiv</span>
@endif
</div>
<button
wire:click="openMailboxCreate({{ $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>
Postfach
</button>
</div>
{{-- Mailbox Table --}}
@if(count($domain->prepared_mailboxes))
<div class="mbx-table-wrap">
<table class="mbx-table">
<thead>
<tr>
<th class="mbx-th">E-Mail</th>
<th class="mbx-th">Status</th>
<th class="mbx-th" style="width:90px">Quota</th>
<th class="mbx-th" style="width:160px">Auslastung</th>
<th class="mbx-th" style="width:80px">E-Mails</th>
<th class="mbx-th mbx-th-right" style="width:130px">Aktionen</th>
</tr>
</thead>
<tbody>
@foreach($domain->prepared_mailboxes as $u)
<tr class="mbx-tr {{ !$u['is_effective_active'] ? 'mbx-tr-inactive' : '' }}">
<td class="mbx-td">
<div class="mbx-email-cell">
<div class="mbx-email-avatar">{{ strtoupper(substr($u['localpart'], 0, 1)) }}</div>
<span class="mbx-email-text">{{ $u['localpart'] }}@{{ $domain->domain }}</span>
</div>
</td>
<td class="mbx-td">
@if($u['is_effective_active'])
<span class="mbx-badge-ok">Aktiv</span>
@elseif($u['inactive_reason'])
<span class="mbx-badge-warn">{{ $u['inactive_reason'] }}</span>
@else
<span class="mbx-badge-mute">Inaktiv</span>
@endif
</td>
<td class="mbx-td mbx-td-muted">{{ $u['quota_mb'] }} MiB</td>
<td class="mbx-td">
<div class="mbx-quota-wrap">
<div class="mbx-quota-bar {{ $u['bar_class'] }} {{ !$u['is_effective_active'] ? 'mbx-bar-dim' : '' }}">
<div class="mbx-quota-fill" style="width:{{ $u['usage_percent'] }}%"></div>
</div>
<span class="mbx-quota-pct">{{ $u['usage_percent'] }}%</span>
</div>
</td>
<td class="mbx-td mbx-td-muted">{{ number_format($u['message_count']) }}</td>
<td class="mbx-td">
<div class="mbx-actions">
<button
wire:click="openMailboxEdit({{ $u['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="openMailboxDelete({{ $u['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 Postfächer vorhanden.
<button wire:click="openMailboxCreate({{ $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;">
<rect x="1" y="5" width="30" height="22" rx="3" stroke="currentColor" stroke-width="1.5"/>
<path d="M1 10l15 10 15-10" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>
</svg>
@if(trim($search))
Keine Ergebnisse für {{ $search }}".
@else
Noch keine Postfächer vorhanden.
@endif
</div>
@endif
</div>