feat: add secure Pi-hole DNS management
Container-Image veröffentlichen / container (push) Has been cancelled
Container-Image veröffentlichen / container (push) Has been cancelled
This commit is contained in:
1 parent
1a6b4d0939
commit
1c32ca0671
18 files changed
+2159
-34
No files matched your search
@@ -179,6 +179,25 @@
|
||||
});
|
||||
}
|
||||
|
||||
for (const form of document.querySelectorAll('[data-dirty-form]')) {
|
||||
const submit = form.querySelector('[data-dirty-submit]');
|
||||
if (!submit) continue;
|
||||
const state = () => new URLSearchParams(new FormData(form)).toString();
|
||||
const initialState = state();
|
||||
const syncDirtyState = () => {
|
||||
const dirty = state() !== initialState;
|
||||
submit.disabled = !dirty;
|
||||
submit.setAttribute('aria-disabled', String(!dirty));
|
||||
};
|
||||
form.addEventListener('input', syncDirtyState);
|
||||
form.addEventListener('change', syncDirtyState);
|
||||
form.addEventListener('submit', (event) => {
|
||||
syncDirtyState();
|
||||
if (submit.disabled) event.preventDefault();
|
||||
});
|
||||
syncDirtyState();
|
||||
}
|
||||
|
||||
const copyButtons = document.querySelectorAll('[data-copy-target]');
|
||||
for (const button of copyButtons) {
|
||||
button.addEventListener('click', async () => {
|
||||
|
||||
@@ -234,6 +234,33 @@ h3 { margin-bottom: 2px; font-size: 14px; line-height: 1.35; }
|
||||
.archive-row small { margin-top: 2px; color: var(--muted); font-family: var(--mono); font-size: 9px; }
|
||||
.admin-actions-grid { margin-top: 18px; }
|
||||
|
||||
.pihole-kicker { color: #a4121a; }
|
||||
.button-pihole { border-color: #a4121a; background: #a4121a; color: #fff; }
|
||||
.button-pihole:hover { border-color: #861016; background: #861016; color: #fff; }
|
||||
.button-pihole:disabled, .button-pihole:disabled:hover { border-color: var(--line); background: #e8edf2; color: #8995a3; box-shadow: none; }
|
||||
.button-pihole:focus-visible { outline: 3px solid rgba(164,18,26,.2); outline-offset: 2px; }
|
||||
.pihole-summary { border-top: 3px solid #a4121a; }
|
||||
.target-row.pihole-target-row { border-left-color: #b9c3ce; }
|
||||
.target-row.pihole-target-row.is-active { border-left-color: #a4121a; }
|
||||
.target-status.pihole-on { background: #a4121a; box-shadow: 0 0 0 3px rgba(164,18,26,.1); }
|
||||
.pihole-status-pill { background: #fff0f1; color: #98131b; }
|
||||
.pihole-switch input:checked + span { background: #a4121a; }
|
||||
.pihole-record-form { gap: 6px; }
|
||||
.pihole-record-form label:not(.switch) { gap: 2px; }
|
||||
.pihole-record-form .form-grid { gap: 8px; align-items: start; }
|
||||
.pihole-record-form .toggle-row { min-height: 24px; }
|
||||
.pihole-record-form input { min-height: 43px; }
|
||||
.pihole-record-save { min-height: 36px; justify-self: start; padding-inline: 11px; font-size: 11px; }
|
||||
.pihole-target-row .edit-inner { gap: 10px; padding-block: 11px; }
|
||||
.pihole-action-grid { grid-template-columns: repeat(2, minmax(0,1fr)); margin-top: 14px; }
|
||||
.pihole-connection-error { margin-bottom: 18px; padding: 12px; border: 1px solid #efc7ce; border-left: 3px solid #a4121a; border-radius: var(--radius-sm); background: #fff8f9; }
|
||||
.pihole-connection-error strong { color: var(--danger); font-size: 11px; }
|
||||
.pihole-connection-error p { margin: 3px 0 0; color: #865764; font-size: 10px; overflow-wrap: anywhere; }
|
||||
.pihole-connect-panel { max-width: 720px; margin-top: 20px; border-top: 3px solid #a4121a; scroll-margin-top: 18px; }
|
||||
.pihole-api-badge { padding: 4px 7px; border-radius: 4px; background: #fff0f1; color: #98131b; font-family: var(--mono); font-size: 9px; font-weight: 800; }
|
||||
.pihole-empty { margin-bottom: 18px; }
|
||||
.pihole-empty-icon { border-color: #e4b7ba; background: #fff2f3; color: #9d1018; }
|
||||
|
||||
.stacked-form { display: grid; gap: 13px; }
|
||||
.wide-form { width: 100%; max-width: 850px; }
|
||||
.settings-form { display: grid; gap: 12px; }
|
||||
@@ -268,6 +295,9 @@ input:focus, textarea:focus, select:focus { border-color: var(--accent); box-sha
|
||||
.switch input:checked + span { background: var(--success); }
|
||||
.switch input:checked + span::after { transform: translateX(12px); }
|
||||
.switch input:focus-visible + span { outline: 3px solid rgba(37,99,235,.2); outline-offset: 2px; }
|
||||
.switch.pihole-switch > span { width: 32px; height: 20px; }
|
||||
.switch.pihole-switch > span::after { top: 4px; left: 4px; width: 12px; height: 12px; }
|
||||
.switch.pihole-switch input:checked + span::after { transform: translateX(12px); }
|
||||
.switch-disabled { color: var(--muted); opacity: .65; }
|
||||
.action-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); gap: 12px; }
|
||||
.info-box { display: grid; grid-template-columns: 150px 1fr; gap: 12px; padding: 11px 12px; border: 1px solid #bfd1e8; border-radius: 6px; background: #f2f7fd; font-size: 10px; }
|
||||
@@ -321,7 +351,7 @@ input:focus, textarea:focus, select:focus { border-color: var(--accent); box-sha
|
||||
.access-target small { color: var(--muted); font-size: 8px; }
|
||||
.access-manage-switch { white-space: nowrap; }
|
||||
|
||||
.error-summary-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; margin-bottom: 12px; }
|
||||
.error-summary-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; margin-bottom: 12px; }
|
||||
.error-summary-grid article { display: flex; align-items: center; justify-content: space-between; padding: 13px 15px; border: 1px solid #efc7ce; border-radius: var(--radius-sm); background: #fff8f9; }
|
||||
.error-summary-grid span { color: #865764; font-family: var(--mono); font-size: 9px; text-transform: uppercase; }
|
||||
.error-summary-grid strong { color: var(--danger); font-size: 20px; }
|
||||
@@ -349,6 +379,7 @@ input:focus, textarea:focus, select:focus { border-color: var(--accent); box-sha
|
||||
.dashboard-grid, .split-grid { grid-template-columns: 1fr; }
|
||||
.edit-inner { grid-template-columns: 1fr; }
|
||||
.settings-mode-grid { grid-template-columns: 1fr; }
|
||||
.pihole-action-grid { grid-template-columns: 1fr; }
|
||||
}
|
||||
|
||||
@media (max-width: 720px) {
|
||||
@@ -388,6 +419,7 @@ input:focus, textarea:focus, select:focus { border-color: var(--accent); box-sha
|
||||
.error-summary-grid { grid-template-columns: 1fr; }
|
||||
.error-item { grid-template-columns: 26px minmax(0,1fr); }
|
||||
.error-item > a { grid-column: 2; }
|
||||
.pihole-action-grid { grid-template-columns: 1fr; }
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
|
||||
Reference in new issue
Block a user