feat: add Matrix chat notification support (#211)
Implements native Matrix notification channel support, allowing users to receive service alerts in any Matrix room via the Client-Server API. Changes: - server/service-operation/notification/matrix.go: new Matrix service implementing the NotificationService interface (PUT /_matrix/client/v3/...) - server/service-operation/notification/types.go: add MatrixHomeserver, MatrixRoomID, MatrixAccessToken fields to AlertConfiguration - server/service-operation/notification/manager.go: register MatrixService - server/pb_migrations/1772200000_updated_alert_configurations_matrix.js: PocketBase migration adding matrix fields and notification_type value - application: Matrix option in channel dialog with homeserver/room/token fields, tab filter, list display, type definitions and translations (en, km) - application/public/upload/notification/matrix.png: Matrix channel icon
This commit is contained in:
@@ -7,7 +7,7 @@ export interface AlertConfiguration {
|
||||
collectionId?: string;
|
||||
collectionName?: string;
|
||||
service_id: string;
|
||||
notification_type: "telegram" | "discord" | "slack" | "signal" | "google_chat" | "email" | "ntfy" | "pushover" | "notifiarr" | "gotify" | "webhook";
|
||||
notification_type: "telegram" | "discord" | "slack" | "signal" | "google_chat" | "email" | "ntfy" | "pushover" | "notifiarr" | "gotify" | "webhook" | "matrix";
|
||||
telegram_chat_id?: string;
|
||||
discord_webhook_url?: string;
|
||||
signal_number?: string;
|
||||
@@ -34,6 +34,9 @@ export interface AlertConfiguration {
|
||||
server_url?: string;
|
||||
webhook_url?: string;
|
||||
webhook_payload_template?: string;
|
||||
matrix_homeserver?: string;
|
||||
matrix_room_id?: string;
|
||||
matrix_access_token?: string;
|
||||
}
|
||||
|
||||
export const alertConfigService = {
|
||||
@@ -105,8 +108,13 @@ export const alertConfigService = {
|
||||
} else if (config.notification_type === "webhook") {
|
||||
cleanConfig.webhook_url = config.webhook_url || "";
|
||||
cleanConfig.webhook_payload_template = config.webhook_payload_template || "";
|
||||
|
||||
}
|
||||
|
||||
} else if (config.notification_type === "matrix") {
|
||||
cleanConfig.matrix_homeserver = config.matrix_homeserver || "";
|
||||
cleanConfig.matrix_room_id = config.matrix_room_id || "";
|
||||
cleanConfig.matrix_access_token = config.matrix_access_token || "";
|
||||
|
||||
}
|
||||
const result = await pb.collection('alert_configurations').create(cleanConfig);
|
||||
|
||||
toast({
|
||||
|
||||
Reference in New Issue
Block a user