Add the Alert tickets settings page, and show each alert's ticket on the Alerts page

Settings -> Alert tickets: switch it on, choose the osTicket integration (only ones with a ticket API
set up can be chosen), who the tickets come from, help topic and priority, which severities and kinds,
how long a problem must last, when many become one summary ticket, how long a return counts as the
same problem, and what to do about problems already there. Buttons to send a test ticket and to check
now, and a line saying what the last check did. Server messages (a missing integration, a refused key)
are shown as they are.

The Alerts page shows "Ticket #123" on an alert that has one, linking to it in osTicket, and a Ticket
column in the CSV export.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
bobbanandClaude Sonnet 5.5 committed 2026-10-07 23:41:46 +02:00
1 parent 467d1a1a06
commit 96c93ef924
6 files changed
+372 -2

No files matched your search

+16 -2
View File
@@ -73,8 +73,8 @@ export default function Alerts(_props: { user: CurrentUser }) {
function exportCsv() {
downloadCsv(
"alerts.csv",
["Severity", "Category", "Source", "Alert", "Silenced"],
(sorted ?? []).map((a) => [SEVERITY[a.severity].label, CATEGORY_LABELS[a.category], a.source, a.message, a.silenced ? "yes" : "no"]),
["Severity", "Category", "Source", "Alert", "Silenced", "Ticket"],
(sorted ?? []).map((a) => [SEVERITY[a.severity].label, CATEGORY_LABELS[a.category], a.source, a.message, a.silenced ? "yes" : "no", a.ticket ? (a.ticket.number ?? "opened") : ""]),
);
}
@@ -222,6 +222,20 @@ export default function Alerts(_props: { user: CurrentUser }) {
silenced
</span>
)}
{a.ticket &&
(() => {
const label = a.ticket.number ? `Ticket #${a.ticket.number}` : "Ticket opened";
const title = a.ticket.grouped ? "Part of one ticket that covers several problems that appeared together" : "A ticket was opened for this in osTicket";
return a.ticket.url ? (
<a className="badge bg-blue-lt text-blue ms-2" href={a.ticket.url} target="_blank" rel="noopener noreferrer" title={title}>
{label}
</a>
) : (
<span className="badge bg-blue-lt text-blue ms-2" title={title}>
{label}
</span>
);
})()}
</td>
</tr>
))}