mirror of
https://github.com/StarFleetCPTN/GoMFT.git
synced 2026-10-10 08:17:28 +02:00
feat: Expand notification service configuration options
- Added new fields for Pushbullet, Ntfy, Gotify, and Pushover services, including API keys, device identifiers, and message templates. - Updated the notification form to dynamically display existing values for configuration fields. - Enhanced backend handlers to support the retrieval of additional service configuration data. - Improved user experience by ensuring that the form reflects current settings for each notification service type.
This commit is contained in:
1 parent
db1a0ad5f5
commit
f128eff8de
2 files changed
+392
-88
No files matched your search
@@ -1201,28 +1201,77 @@ func (h *Handlers) HandleEditNotificationPage(c *gin.Context) {
|
||||
data := components.NotificationFormData{
|
||||
IsNew: false,
|
||||
NotificationService: &struct {
|
||||
ID uint
|
||||
Name string
|
||||
Description string
|
||||
Type string
|
||||
IsEnabled bool
|
||||
EventTriggers []string
|
||||
RetryPolicy string
|
||||
WebhookURL string
|
||||
Method string
|
||||
Headers string
|
||||
PayloadTemplate string
|
||||
SecretKey string
|
||||
ID uint
|
||||
Name string
|
||||
Description string
|
||||
Type string
|
||||
IsEnabled bool
|
||||
EventTriggers []string
|
||||
RetryPolicy string
|
||||
WebhookURL string
|
||||
Method string
|
||||
Headers string
|
||||
PayloadTemplate string
|
||||
SecretKey string
|
||||
PushbulletAPIKey string
|
||||
PushbulletDeviceID string
|
||||
PushbulletTitleTemplate string
|
||||
PushbulletBodyTemplate string
|
||||
NtfyServer string
|
||||
NtfyTopic string
|
||||
NtfyPriority string
|
||||
NtfyUsername string
|
||||
NtfyPassword string
|
||||
NtfyTitleTemplate string
|
||||
NtfyMessageTemplate string
|
||||
GotifyURL string
|
||||
GotifyToken string
|
||||
GotifyPriority string
|
||||
GotifyTitleTemplate string
|
||||
GotifyMessageTemplate string
|
||||
PushoverAPIToken string
|
||||
PushoverUserKey string
|
||||
PushoverDevice string
|
||||
PushoverPriority string
|
||||
PushoverSound string
|
||||
PushoverTitleTemplate string
|
||||
PushoverMessageTemplate string
|
||||
}{
|
||||
ID: service.ID,
|
||||
Name: service.Name,
|
||||
Description: service.Description,
|
||||
Type: service.Type,
|
||||
IsEnabled: service.IsEnabled,
|
||||
EventTriggers: service.EventTriggers,
|
||||
RetryPolicy: service.RetryPolicy,
|
||||
PayloadTemplate: service.PayloadTemplate,
|
||||
SecretKey: service.SecretKey,
|
||||
ID: service.ID,
|
||||
Name: service.Name,
|
||||
Description: service.Description,
|
||||
Type: service.Type,
|
||||
IsEnabled: service.IsEnabled,
|
||||
EventTriggers: service.EventTriggers,
|
||||
RetryPolicy: service.RetryPolicy,
|
||||
PayloadTemplate: service.PayloadTemplate,
|
||||
SecretKey: service.SecretKey,
|
||||
WebhookURL: service.Config["webhook_url"],
|
||||
Method: service.Config["method"],
|
||||
Headers: service.Config["headers"],
|
||||
PushbulletAPIKey: service.Config["api_key"],
|
||||
PushbulletDeviceID: service.Config["device_iden"],
|
||||
PushbulletTitleTemplate: service.Config["title_template"],
|
||||
PushbulletBodyTemplate: service.Config["body_template"],
|
||||
NtfyServer: service.Config["server"],
|
||||
NtfyTopic: service.Config["topic"],
|
||||
NtfyPriority: service.Config["priority"],
|
||||
NtfyUsername: service.Config["username"],
|
||||
NtfyPassword: service.Config["password"],
|
||||
NtfyTitleTemplate: service.Config["title_template"],
|
||||
NtfyMessageTemplate: service.Config["message_template"],
|
||||
GotifyURL: service.Config["url"],
|
||||
GotifyToken: service.Config["token"],
|
||||
GotifyPriority: service.Config["priority"],
|
||||
GotifyTitleTemplate: service.Config["title_template"],
|
||||
GotifyMessageTemplate: service.Config["message_template"],
|
||||
PushoverAPIToken: service.Config["app_token"],
|
||||
PushoverUserKey: service.Config["user_key"],
|
||||
PushoverDevice: service.Config["device"],
|
||||
PushoverPriority: service.Config["priority"],
|
||||
PushoverSound: service.Config["sound"],
|
||||
PushoverTitleTemplate: service.Config["title_template"],
|
||||
PushoverMessageTemplate: service.Config["message_template"],
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user