mirror of
https://github.com/nicotsx/ironmount.git
synced 2025-12-10 12:10:51 +01:00
* feat: notifications backend & creation * feat: assign notification to backup schedule * refactor: status dot one component * chore(notification-details): remove refetchInterval
16 lines
474 B
TypeScript
16 lines
474 B
TypeScript
import type { NotificationConfig } from "~/schemas/notifications";
|
|
|
|
export function buildGotifyShoutrrrUrl(config: Extract<NotificationConfig, { type: "gotify" }>): string {
|
|
const url = new URL(config.serverUrl);
|
|
const hostname = url.hostname;
|
|
const port = url.port ? `:${url.port}` : "";
|
|
|
|
let shoutrrrUrl = `gotify://${hostname}${port}/${config.token}`;
|
|
|
|
if (config.priority !== undefined) {
|
|
shoutrrrUrl += `?priority=${config.priority}`;
|
|
}
|
|
|
|
return shoutrrrUrl;
|
|
}
|