feat(alerting): add quiet hours to alert groups
This commit is contained in:
1 parent
bf529a7711
commit
ee3769f578
21 files changed
+1310
-130
No files matched your search
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user