feat: Enhance notification services with delete confirmation dialog

- Added a confirmation dialog for deleting notification services to prevent accidental deletions.
- Updated the notifications management interface to include improved delete button functionality.
- Enhanced JavaScript event handling for delete requests, providing user feedback on success and error scenarios.
- Refactored notification service deletion logic to ensure accurate tracking and messaging during deletion operations.
This commit is contained in:
StarFleetCPTN committed 2025-03-26 06:26:39 -07:00
1 parent 8e1321d251
commit db1a0ad5f5
4 files changed
+190 -24

No files matched your search

+2 -6
View File
@@ -74,12 +74,6 @@ func (h *Handlers) HandleCreateNotificationService(c *gin.Context) {
description := c.PostForm("description")
isEnabled := c.PostForm("is_enabled") == "on"
// print the form data
fmt.Println("name", name)
fmt.Println("serviceType", serviceType)
fmt.Println("description", description)
fmt.Println("isEnabled", isEnabled)
// Validate required fields
if name == "" || serviceType == "" {
// Return to notifications page with error message
@@ -727,6 +721,8 @@ func (h *Handlers) HandleTestNotification(c *gin.Context) {
config["priority"] = c.PostForm("gotify_priority")
config["title"] = c.PostForm("gotify_title_template")
fmt.Println("config", config)
// Validate required fields
if config["url"] == "" || config["token"] == "" {
c.JSON(http.StatusBadRequest, gin.H{"success": false, "message": "Gotify Server URL and Application Token are required"})