feat(api): manage status pages with themes, custom domains and export
Organizations build pages from their monitors, grouped into sections with public names, choose an accent color, logo and CSS, verify custom domains with a TXT record and export a page as one self-contained HTML file. Assignments scoped to a single status page are honored. Closes #21 Closes #23 Closes #24 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
This commit is contained in:
1 parent
2b72715a9d
commit
a6126b353e
15 files changed
+2382
-228
No files matched your search
@@ -45,6 +45,19 @@
|
||||
set(el.name, el.value.split(",").map((v) => v.trim()).filter(Boolean));
|
||||
else set(el.name, el.value);
|
||||
}
|
||||
// Forms with data-rows="name" send the checked [data-row] elements as an
|
||||
// array of objects built from their [data-field] inputs.
|
||||
if (form.dataset.rows) {
|
||||
out[form.dataset.rows] = [...form.querySelectorAll("[data-row]")]
|
||||
.filter((row) => row.querySelector('[data-field="include"]')?.checked)
|
||||
.map((row) => {
|
||||
const obj = {};
|
||||
for (const f of row.querySelectorAll("[data-field]")) {
|
||||
if (f.dataset.field !== "include") obj[f.dataset.field] = f.value;
|
||||
}
|
||||
return obj;
|
||||
});
|
||||
}
|
||||
return out;
|
||||
};
|
||||
|
||||
@@ -86,7 +99,9 @@
|
||||
totpStep.querySelector("input")?.focus();
|
||||
return;
|
||||
}
|
||||
location.assign(form.dataset.next || location.href);
|
||||
let next = form.dataset.next || location.href;
|
||||
if (form.dataset.nextFrom) next += res.data?.[form.dataset.nextFrom] ?? "";
|
||||
location.assign(next);
|
||||
} catch (err) {
|
||||
showError(form, message(err));
|
||||
} finally {
|
||||
@@ -119,6 +134,7 @@
|
||||
try {
|
||||
await api.post(post.dataset.post);
|
||||
alert(post.dataset.ok);
|
||||
if (post.dataset.reload !== undefined) location.reload();
|
||||
} catch (err) {
|
||||
alert(message(err));
|
||||
} finally {
|
||||
|
||||
Reference in new issue
Block a user