Feature: Testen-Button neben der Webhook-URL
Schickt sofort eine Test-Nachricht (inkl. Discord-Ping falls gesetzt) an die EINGETRAGENEN Entwurfs-Werte — funktioniert also schon vor dem Speichern der Einstellungen. Toast meldet Erfolg bzw. verweist bei Fehlschlag auf Hilfe -> Letzte Fehler (dort steht der HTTP-Status/Fehlertext aus notify.ts). Neuer IPC TEST_NOTIFY (main.ts ruft sendNotification direkt), Button im input-row-Muster, deaktiviert solange die URL leer ist.
This commit is contained in:
@@ -6,6 +6,7 @@ import { AppController } from "./app-controller";
|
||||
import { IPC_CHANNELS } from "../shared/ipc";
|
||||
import { getLogFilePath, logger } from "./logger";
|
||||
import { getRecentErrors } from "./error-ring";
|
||||
import { sendNotification } from "./notify";
|
||||
import { APP_NAME } from "./constants";
|
||||
import { extractHttpLinksFromText } from "./utils";
|
||||
import { cleanupStaleSubstDrives, shutdownDaemon } from "./extractor";
|
||||
@@ -629,6 +630,15 @@ function registerIpcHandlers(): void {
|
||||
|
||||
ipcMain.handle(IPC_CHANNELS.GET_RECENT_ERRORS, async () => getRecentErrors());
|
||||
|
||||
ipcMain.handle(IPC_CHANNELS.TEST_NOTIFY, async (_event: IpcMainInvokeEvent, url: string, mention: string) => {
|
||||
validateString(url, "url");
|
||||
return sendNotification(url, {
|
||||
title: "🔔 Test-Benachrichtigung",
|
||||
message: "Webhook funktioniert — Benachrichtigungen kommen hier an.",
|
||||
mention: typeof mention === "string" ? mention : ""
|
||||
});
|
||||
});
|
||||
|
||||
ipcMain.handle(IPC_CHANNELS.GET_TRACE_CONFIG, async () => controller.getTraceConfig());
|
||||
|
||||
ipcMain.handle(IPC_CHANNELS.SET_TRACE_ENABLED, async (_event: IpcMainInvokeEvent, enabled: boolean, note?: string, durationMinutes?: number) => {
|
||||
|
||||
Reference in New Issue
Block a user