fsdfdsf
This commit is contained in:
@@ -233,6 +233,53 @@
|
|||||||
gap: 6px;
|
gap: 6px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.pihole-instance-form {
|
||||||
|
margin-top: 16px;
|
||||||
|
display: grid;
|
||||||
|
gap: 18px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pihole-instance-form-grid {
|
||||||
|
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||||
|
align-items: start;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pihole-form-field-wide {
|
||||||
|
grid-column: 1 / -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pihole-checkbox-field {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 10px;
|
||||||
|
min-height: 44px;
|
||||||
|
padding: 10px 12px;
|
||||||
|
border: 1px solid var(--line);
|
||||||
|
border-radius: 12px;
|
||||||
|
background: rgba(255, 255, 255, 0.5);
|
||||||
|
font-weight: 600;
|
||||||
|
color: var(--text);
|
||||||
|
}
|
||||||
|
|
||||||
|
.pihole-checkbox-field input {
|
||||||
|
width: 18px;
|
||||||
|
height: 18px;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pihole-modal-card {
|
||||||
|
width: min(760px, 96vw);
|
||||||
|
padding: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pihole-modal-actions {
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
|
gap: 10px;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
padding-top: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
.icon-button {
|
.icon-button {
|
||||||
border: 1px solid var(--line);
|
border: 1px solid var(--line);
|
||||||
background: var(--panel);
|
background: var(--panel);
|
||||||
@@ -284,4 +331,8 @@
|
|||||||
.pihole-inline input {
|
.pihole-inline input {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.pihole-instance-form-grid {
|
||||||
|
grid-template-columns: 1fr;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -69,6 +69,9 @@
|
|||||||
const openModal = () => {
|
const openModal = () => {
|
||||||
modal.classList.add('is-open');
|
modal.classList.add('is-open');
|
||||||
modal.setAttribute('aria-hidden', 'false');
|
modal.setAttribute('aria-hidden', 'false');
|
||||||
|
if (idInput) {
|
||||||
|
window.setTimeout(() => idInput.focus(), 20);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const closeModal = () => {
|
const closeModal = () => {
|
||||||
@@ -104,6 +107,21 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (cancelBtn) {
|
if (cancelBtn) {
|
||||||
cancelBtn.addEventListener('click', () => resetForm());
|
cancelBtn.addEventListener('click', () => {
|
||||||
|
resetForm();
|
||||||
|
closeModal();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
modal.addEventListener('click', (event) => {
|
||||||
|
if (event.target === modal) {
|
||||||
|
closeModal();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
document.addEventListener('keydown', (event) => {
|
||||||
|
if (event.key === 'Escape' && modal.classList.contains('is-open')) {
|
||||||
|
closeModal();
|
||||||
|
}
|
||||||
|
});
|
||||||
})();
|
})();
|
||||||
|
|||||||
@@ -372,17 +372,21 @@ if ($primaryId === '') {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="modal" data-instance-modal aria-hidden="true">
|
<div class="modal" data-instance-modal aria-hidden="true">
|
||||||
<div class="modal-card">
|
<div class="modal-card pihole-modal-card" role="dialog" aria-modal="true" aria-labelledby="pihole-instance-modal-title">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<strong data-instance-modal-title>Neue Instanz</strong>
|
<div>
|
||||||
<button class="icon-button" type="button" data-instance-close>×</button>
|
<strong id="pihole-instance-modal-title" data-instance-modal-title>Neue Instanz</strong>
|
||||||
|
<div class="muted">Pi-hole Host anlegen oder bestehende Instanz bearbeiten.</div>
|
||||||
</div>
|
</div>
|
||||||
<form method="post" class="form-grid" style="margin-top:.75rem;" data-instance-form>
|
<button class="icon-button" type="button" data-instance-close aria-label="Modal schliessen">×</button>
|
||||||
|
</div>
|
||||||
|
<form method="post" class="pihole-instance-form" data-instance-form>
|
||||||
<input type="hidden" name="current_id" value="">
|
<input type="hidden" name="current_id" value="">
|
||||||
<label class="form-field">
|
<div class="form-grid pihole-instance-form-grid">
|
||||||
|
<label class="form-field pihole-form-field-wide">
|
||||||
<span class="muted">ID</span>
|
<span class="muted">ID</span>
|
||||||
<input type="text" name="instance_id" placeholder="z.B. pihole-main" required>
|
<input type="text" name="instance_id" placeholder="z.B. pihole-main" required>
|
||||||
<small class="muted">Die ID muss eindeutig sein und wird zum internen Speichern verwendet.</small>
|
<small class="muted">Die ID muss eindeutig sein und wird nur intern verwendet.</small>
|
||||||
</label>
|
</label>
|
||||||
<label class="form-field">
|
<label class="form-field">
|
||||||
<span class="muted">Name</span>
|
<span class="muted">Name</span>
|
||||||
@@ -392,17 +396,19 @@ if ($primaryId === '') {
|
|||||||
<span class="muted">URL</span>
|
<span class="muted">URL</span>
|
||||||
<input type="text" name="url" placeholder="http://pi-hole.local" required>
|
<input type="text" name="url" placeholder="http://pi-hole.local" required>
|
||||||
</label>
|
</label>
|
||||||
<label class="form-field">
|
<label class="form-field pihole-form-field-wide">
|
||||||
<span class="muted">Passwort / App-Passwort (leer lassen = unveraendert)</span>
|
<span class="muted">Passwort / App-Passwort</span>
|
||||||
<input type="password" name="password" placeholder="Pi-hole Passwort oder App-Passwort" autocomplete="new-password">
|
<input type="password" name="password" placeholder="Pi-hole Passwort oder App-Passwort" autocomplete="new-password">
|
||||||
|
<small class="muted">Beim Bearbeiten leer lassen, um das gespeicherte Passwort unveraendert zu lassen.</small>
|
||||||
</label>
|
</label>
|
||||||
<label class="form-field" style="align-items:center;">
|
<label class="pihole-checkbox-field">
|
||||||
<span class="muted">Als Primaer verwenden</span>
|
|
||||||
<input type="checkbox" name="is_primary" value="1">
|
<input type="checkbox" name="is_primary" value="1">
|
||||||
|
<span>Als Primaer verwenden</span>
|
||||||
</label>
|
</label>
|
||||||
<div style="display:flex; gap:10px; flex-wrap:wrap;">
|
</div>
|
||||||
|
<div class="pihole-modal-actions">
|
||||||
<button class="cta-button" type="submit" data-instance-submit>Speichern</button>
|
<button class="cta-button" type="submit" data-instance-submit>Speichern</button>
|
||||||
<button class="nav-link" type="button" data-instance-cancel>Zuruecksetzen</button>
|
<button class="nav-link" type="button" data-instance-cancel>Abbrechen</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user