feat(alerting): add quiet hours to alert groups
ci / image (pull_request) Successful in 6m35s
ci / test (pull_request) Successful in 7m56s
ci / build (pull_request) Successful in 8m24s
ci / lint (pull_request) Successful in 11m55s

This commit is contained in:
Sebastian Unterschütz committed 2026-11-22 19:18:23 +01:00
1 parent bf529a7711
commit ee3769f578
21 files changed
+1310 -130

No files matched your search

+31
View File
@@ -181,6 +181,37 @@
await api.post("/auth/logout").catch(() => {});
location.assign("/login");
}
const quietAdd = ev.target.closest("[data-quiet-add]");
if (quietAdd) {
const box = quietAdd.closest("[data-quiet-hours]");
const list = box?.querySelector("[data-quiet-list]");
const tpl = box?.querySelector("template[data-quiet-template]");
if (list && tpl) {
const idx = list.querySelectorAll("[data-quiet-row]").length;
const frag = tpl.content.cloneNode(true);
for (const el of frag.querySelectorAll("[name]")) {
el.name = el.name.replace("__INDEX__", String(idx));
}
for (const el of frag.querySelectorAll("input[data-tz-default]")) {
if (!el.value) el.value = Intl.DateTimeFormat().resolvedOptions().timeZone || "UTC";
}
list.appendChild(frag);
}
return;
}
const quietRemove = ev.target.closest("[data-quiet-remove]");
if (quietRemove) {
const list = quietRemove.closest("[data-quiet-list]");
quietRemove.closest("[data-quiet-row]")?.remove();
if (list) {
[...list.querySelectorAll("[data-quiet-row]")].forEach((row, i) => {
for (const el of row.querySelectorAll("[name]")) {
el.name = el.name.replace(/^quiet_hours\.\d+\./, `quiet_hours.${i}.`);
}
});
}
return;
}
if (ev.target.closest("[data-totp-start]")) {
const root = ev.target.closest("[data-totp-setup]");
try {