Feat/notifications alerts (#52)

* feat: notifications backend & creation

* feat: assign notification to backup schedule

* refactor: status dot one component

* chore(notification-details): remove refetchInterval
This commit is contained in:
Nico
2025-11-22 14:58:21 +01:00
committed by GitHub
parent 043f73ea87
commit 6c30e7e357
37 changed files with 3940 additions and 172 deletions

View File

@@ -0,0 +1,29 @@
import type { NotificationConfig } from "~/schemas/notifications";
import { buildEmailShoutrrrUrl } from "./email";
import { buildSlackShoutrrrUrl } from "./slack";
import { buildDiscordShoutrrrUrl } from "./discord";
import { buildGotifyShoutrrrUrl } from "./gotify";
import { buildNtfyShoutrrrUrl } from "./ntfy";
import { buildCustomShoutrrrUrl } from "./custom";
export function buildShoutrrrUrl(config: NotificationConfig): string {
switch (config.type) {
case "email":
return buildEmailShoutrrrUrl(config);
case "slack":
return buildSlackShoutrrrUrl(config);
case "discord":
return buildDiscordShoutrrrUrl(config);
case "gotify":
return buildGotifyShoutrrrUrl(config);
case "ntfy":
return buildNtfyShoutrrrUrl(config);
case "custom":
return buildCustomShoutrrrUrl(config);
default: {
// TypeScript exhaustiveness check
const _exhaustive: never = config;
throw new Error(`Unsupported notification type: ${(_exhaustive as NotificationConfig).type}`);
}
}
}