dsfdsf
This commit is contained in:
@@ -136,57 +136,62 @@ if ($primaryId === '') {
|
||||
'title' => 'Pi-hole Instanzen',
|
||||
'description' => 'Pi-hole Instanzen hinzufuegen, bearbeiten und loeschen.',
|
||||
]) ?>
|
||||
<div class="card">
|
||||
<div style="display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap;">
|
||||
<h1 style="margin:0;">Instanzen</h1>
|
||||
<div style="display:flex; gap:10px; flex-wrap:wrap;">
|
||||
<button class="cta-button" type="button" data-instance-new>+ Neue Instanz</button>
|
||||
<div class="module-flow">
|
||||
<section class="module-box">
|
||||
<div class="module-box-head">
|
||||
<div>
|
||||
<h2 class="module-box-title">Instanzen</h2>
|
||||
<p>Pi-hole Instanzen hinzufuegen, bearbeiten und loeschen.</p>
|
||||
</div>
|
||||
<div style="display:flex; gap:10px; flex-wrap:wrap;">
|
||||
<button class="module-button module-button--primary" type="button" data-instance-new>+ Neue Instanz</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if ($error): ?>
|
||||
<div class="card notice-card" style="margin-top:1rem; border-color:#ffb4a8; background:#fff5f3; color:#7a2114;">
|
||||
<?= e($error) ?>
|
||||
</div>
|
||||
<?php elseif ($notice): ?>
|
||||
<div class="card notice-card" style="margin-top:1rem; border-color:var(--accent-2);">
|
||||
<?= e($notice) ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="pihole-instance-grid" style="margin-top:1rem;">
|
||||
<?php if (!$instances): ?>
|
||||
<div class="card" style="padding:16px;">Keine Instanzen vorhanden.</div>
|
||||
<?php else: ?>
|
||||
<?php foreach ($instances as $instance): ?>
|
||||
<div class="card pihole-instance-card"
|
||||
data-instance-id="<?= e((string)$instance['id']) ?>"
|
||||
data-name="<?= e((string)($instance['name'] ?? '')) ?>"
|
||||
data-url="<?= e((string)($instance['url'] ?? '')) ?>"
|
||||
data-primary="<?= !empty($instance['is_primary']) ? '1' : '0' ?>">
|
||||
<div class="pihole-instance-header">
|
||||
<div>
|
||||
<strong><?= e((string)($instance['name'] ?? '')) ?></strong>
|
||||
<div class="muted">ID: <?= e((string)($instance['id'] ?? '')) ?></div>
|
||||
<div class="muted">URL: <?= e((string)($instance['url'] ?? '')) ?></div>
|
||||
</div>
|
||||
<?php if (!empty($instance['is_primary']) || $instance['id'] === $primaryId): ?>
|
||||
<span class="pihole-status">Primaer</span>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div class="pihole-card-actions">
|
||||
<button class="nav-link" type="button" data-instance-edit>Bearbeiten</button>
|
||||
<button class="nav-link" type="button" data-instance-test>Test Verbindung</button>
|
||||
<form method="post" onsubmit="return confirm('Instanz wirklich loeschen?')">
|
||||
<input type="hidden" name="delete_id" value="<?= e((string)($instance['id'] ?? '')) ?>">
|
||||
<button class="nav-link" type="submit">Loeschen</button>
|
||||
</form>
|
||||
</div>
|
||||
<div class="pihole-test-result" data-instance-result></div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
<?php if ($error): ?>
|
||||
<div class="setup-db-message setup-db-message--error" style="margin-top:16px;">
|
||||
<?= e($error) ?>
|
||||
</div>
|
||||
<?php elseif ($notice): ?>
|
||||
<div class="setup-db-message setup-db-message--success" style="margin-top:16px;">
|
||||
<?= e($notice) ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<div class="module-box-grid module-box-grid--panels" style="margin-top:16px;">
|
||||
<?php if (!$instances): ?>
|
||||
<div class="module-box-soft">Keine Instanzen vorhanden.</div>
|
||||
<?php else: ?>
|
||||
<?php foreach ($instances as $instance): ?>
|
||||
<div class="module-box-soft pihole-instance-card"
|
||||
data-instance-id="<?= e((string)$instance['id']) ?>"
|
||||
data-name="<?= e((string)($instance['name'] ?? '')) ?>"
|
||||
data-url="<?= e((string)($instance['url'] ?? '')) ?>"
|
||||
data-primary="<?= !empty($instance['is_primary']) ? '1' : '0' ?>">
|
||||
<div class="pihole-instance-header">
|
||||
<div>
|
||||
<strong><?= e((string)($instance['name'] ?? '')) ?></strong>
|
||||
<div class="muted">ID: <?= e((string)($instance['id'] ?? '')) ?></div>
|
||||
<div class="muted">URL: <?= e((string)($instance['url'] ?? '')) ?></div>
|
||||
</div>
|
||||
<?php if (!empty($instance['is_primary']) || $instance['id'] === $primaryId): ?>
|
||||
<span class="pihole-status">Primaer</span>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div class="pihole-card-actions">
|
||||
<button class="module-button module-button--secondary module-button--small" type="button" data-instance-edit>Bearbeiten</button>
|
||||
<button class="module-button module-button--secondary module-button--small" type="button" data-instance-test>Test Verbindung</button>
|
||||
<form method="post" onsubmit="return confirm('Instanz wirklich loeschen?')">
|
||||
<input type="hidden" name="delete_id" value="<?= e((string)($instance['id'] ?? '')) ?>">
|
||||
<button class="module-button module-button--secondary module-button--small" type="submit">Loeschen</button>
|
||||
</form>
|
||||
</div>
|
||||
<div class="pihole-test-result" data-instance-result></div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<div class="modal" data-instance-modal aria-hidden="true">
|
||||
|
||||
Reference in New Issue
Block a user