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

247 lines
14 KiB
PHP

<x-slot:breadcrumbParent>Domains</x-slot:breadcrumbParent>
<x-slot:breadcrumb>Übersicht</x-slot:breadcrumb>
@php
$_wmSub = config('mailwolt.domain.webmail');
$_wmBase = config('mailwolt.domain.base');
$_wmUrl = ($_wmSub && $_wmBase)
? 'https://'.$_wmSub.'.'.$_wmBase.'/inbox'
: url('/webmail/inbox');
@endphp
<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">
<circle cx="8" cy="8" r="6.5" stroke="currentColor" stroke-width="1.3"/>
<ellipse cx="8" cy="8" rx="2.5" ry="6.5" stroke="currentColor" stroke-width="1.3"/>
<path d="M1.5 6h13M1.5 10h13" stroke="currentColor" stroke-width="1.3"/>
</svg>
Domains
<span class="mbx-total-badge">{{ $total }}</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 suchen …">
</div>
</div>
</div>
{{-- System Domain --}}
@if($systemDomain)
<div class="mbx-sections">
<div class="mbx-section">
<div class="mbx-domain-head">
<div class="mbx-domain-info">
<span class="dom-system-label">System</span>
<span class="mbx-domain-count">{{ $systemDomain->domain }}</span>
</div>
</div>
<div class="mbx-table-wrap">
<table class="mbx-table">
<thead>
<tr>
<th class="mbx-th">Domain</th>
<th class="mbx-th">Status</th>
<th class="mbx-th" style="width:100px">Postfächer</th>
<th class="mbx-th" style="width:80px">Aliasse</th>
<th class="mbx-th" style="width:70px">DKIM</th>
<th class="mbx-th mbx-th-right" style="width:90px">Aktionen</th>
</tr>
</thead>
<tbody>
<tr class="mbx-tr mbx-tr-system">
<td class="mbx-td">
<div style="display:flex;align-items:center;gap:8px;">
<div class="dom-icon" style="color:var(--mw-v2);background:var(--mw-vbg);border-color:var(--mw-vbd);flex-shrink:0;">
<svg width="12" height="12" 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="dom-name">{{ $systemDomain->domain }}</span>
</div>
</td>
<td class="mbx-td">
@if($systemDomain->is_active)
<span class="mbx-badge-ok">Aktiv</span>
@else
<span class="mbx-badge-warn">Inaktiv</span>
@endif
</td>
<td class="mbx-td mbx-td-muted">{{ $systemDomain->mailboxes_count ?? 0 }}</td>
<td class="mbx-td mbx-td-muted">{{ $systemDomain->aliases_count ?? 0 }}</td>
<td class="mbx-td">
@if($systemDomain->dkimKeys?->isNotEmpty())
<span class="mbx-badge-ok">OK</span>
@else
<span class="mbx-badge-mute"></span>
@endif
</td>
<td class="mbx-td">
<div class="mbx-actions">
<a href="{{ $_wmUrl }}" target="_blank" class="mbx-act-btn" title="Webmail öffnen">
<svg width="13" height="13" viewBox="0 0 14 14" fill="none"><rect x=".5" y="2.5" width="13" height="9" rx="1.5" stroke="currentColor" stroke-width="1.2"/><path d=".5 5l6.5 4 6.5-4" stroke="currentColor" stroke-width="1.2" stroke-linecap="round"/></svg>
</a>
<button wire:click="openDns({{ $systemDomain->id }})" class="mbx-act-btn" title="DNS-Assistent">
<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"/><path d="M4.5 9.5C5 8 6 7 7 7s2 1 2.5 2.5" stroke="currentColor" stroke-width="1.1" stroke-linecap="round"/><circle cx="7" cy="4.5" r=".7" fill="currentColor"/></svg>
</button>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
@endif
{{-- User Domains --}}
@if($domains->count())
<div class="mbx-sections" style="{{ $systemDomain ? 'margin-top:14px' : '' }}">
<div class="mbx-section">
<div class="mbx-domain-head">
<div class="mbx-domain-info">
<span class="mbx-badge-mute">User</span>
<span class="mbx-domain-count">{{ $total }} {{ Str::plural('Domain', $total) }}</span>
</div>
<button wire:click="openCreate" 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>
Domain
</button>
</div>
<div class="mbx-table-wrap">
<table class="mbx-table">
<thead>
<tr>
<th class="mbx-th">Domain</th>
<th class="mbx-th">Status</th>
<th class="mbx-th" style="width:100px">Postfächer</th>
<th class="mbx-th" style="width:80px">Aliasse</th>
<th class="mbx-th" style="width:70px">DKIM</th>
<th class="mbx-th" style="width:90px">Max. Postf.</th>
<th class="mbx-th mbx-th-right" style="width:170px">Aktionen</th>
</tr>
</thead>
<tbody>
@foreach($domains as $d)
<tr class="mbx-tr {{ !$d->is_active ? 'mbx-tr-inactive' : '' }}">
<td class="mbx-td">
<div style="display:flex;align-items:center;gap:8px;min-width:0">
<div class="dom-icon">
<svg width="12" height="12" 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>
<div style="min-width:0">
<div class="dom-name">{{ $d->domain }}</div>
@if(!empty($d->description))
<div class="dom-desc">{{ Str::limit($d->description, 50) }}</div>
@endif
@if(count($d->visible_tags))
<div style="display:flex;gap:4px;margin-top:4px;flex-wrap:wrap">
@foreach($d->visible_tags as $tag)
<span class="dom-tag" style="background:{{ $tag['bg'] ?? 'var(--mw-bg4)' }};border-color:{{ $tag['border'] ?? 'var(--mw-b2)' }};color:{{ $tag['color'] ?? 'var(--mw-t3)' }}">
{{ $tag['label'] ?? '' }}
</span>
@endforeach
@if($d->extra_tags > 0)
<span class="dom-tag">+{{ $d->extra_tags }}</span>
@endif
</div>
@endif
</div>
</div>
</td>
<td class="mbx-td">
@if($d->is_active)
<span class="mbx-badge-ok">Aktiv</span>
@else
<span class="mbx-badge-warn">Inaktiv</span>
@endif
</td>
<td class="mbx-td mbx-td-muted">
{{ $d->mailboxes_count }}
@if($d->max_mailboxes > 0)
<span style="color:var(--mw-t4);font-size:10px"> / {{ $d->max_mailboxes }}</span>
@endif
</td>
<td class="mbx-td mbx-td-muted">
{{ $d->aliases_count }}
@if($d->max_aliases > 0)
<span style="color:var(--mw-t4);font-size:10px"> / {{ $d->max_aliases }}</span>
@endif
</td>
<td class="mbx-td">
@if($d->dns_verified)
<span class="mbx-badge-ok">OK</span>
@else
<span class="mbx-badge-mute"></span>
@endif
</td>
<td class="mbx-td mbx-td-muted">
{{ $d->max_mailboxes ?: '∞' }}
</td>
<td class="mbx-td">
<div class="mbx-actions">
<a href="{{ $_wmUrl }}" target="_blank" class="mbx-act-btn" title="Webmail öffnen">
<svg width="13" height="13" viewBox="0 0 14 14" fill="none"><rect x=".5" y="2.5" width="13" height="9" rx="1.5" stroke="currentColor" stroke-width="1.2"/><path d="M.5 5l6.5 4 6.5-4" stroke="currentColor" stroke-width="1.2" stroke-linecap="round"/></svg>
</a>
<button wire:click="openDns({{ $d->id }})" class="mbx-act-btn" title="DNS-Assistent">
<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"/><path d="M4.5 9.5C5 8 6 7 7 7s2 1 2.5 2.5" stroke="currentColor" stroke-width="1.1" stroke-linecap="round"/><circle cx="7" cy="4.5" r=".7" fill="currentColor"/></svg>
</button>
<button wire:click="openEdit({{ $d->id }})" class="mbx-act-btn" title="Bearbeiten">
<svg width="13" height="13" viewBox="0 0 14 14" fill="none"><path d="M9.5 2.5l2 2-7 7H2.5v-2l7-7Z" stroke="currentColor" stroke-width="1.2" stroke-linejoin="round"/></svg>
</button>
<button wire:click="openLimits({{ $d->id }})" class="mbx-act-btn" title="Limits">
<svg width="13" height="13" viewBox="0 0 14 14" fill="none"><path d="M2 4h10M4 7h6M6 10h2" stroke="currentColor" stroke-width="1.2" stroke-linecap="round"/></svg>
</button>
<button wire:click="openDelete({{ $d->id }})" class="mbx-act-btn mbx-act-danger" title="Löschen">
<svg width="13" height="13" viewBox="0 0 14 14" fill="none"><path d="M2 4h10M5 4V2.5h4V4M5.5 6.5v4M8.5 6.5v4M3.5 4l.5 8h6l.5-8" stroke="currentColor" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round"/></svg>
</button>
</div>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
@else
<div class="mbx-empty-state">
<svg width="28" height="28" viewBox="0 0 28 28" fill="none" style="color:var(--mw-t4);margin-bottom:8px">
<circle cx="14" cy="14" r="11" stroke="currentColor" stroke-width="1.3"/>
<ellipse cx="14" cy="14" rx="4.5" ry="11" stroke="currentColor" stroke-width="1.3"/>
<path d="M3 11h22M3 17h22" stroke="currentColor" stroke-width="1.3"/>
</svg>
@if($search !== '')
Keine Domain gefunden für {{ $search }}"
@else
Noch keine Domains vorhanden.
<button wire:click="openCreate" class="mbx-btn-primary" style="margin-top:12px">Domain hinzufügen</button>
@endif
</div>
@endif
</div>