package list import ( "context" "fmt" "github.com/starfleetcptn/gomft/components" "github.com/starfleetcptn/gomft/components/notifications/dialog" "github.com/starfleetcptn/gomft/components/notifications/types" ) // List renders the notification services list page. templ List(ctx context.Context, data types.SettingsNotificationsData) { @components.LayoutWithContext("Notification Services", ctx) {
if data.SuccessMessage != "" { } if data.ErrorMessage != "" { }

Notification Services

Add Notification Service
if len(data.NotificationServices) == 0 {

No notification services configured

Add a notification service to receive alerts for job events.

Add First Notification Service
} else {
    for _, service := range data.NotificationServices {
  • if service.Type == "email" {
    } else if service.Type == "webhook" {
    } else { // Default icon
    }

    { service.Name }

    { service.Description }

    @dialog.NotificationDialog( fmt.Sprintf("delete-notification-dialog-%d", service.ID), "Delete Notification Service", fmt.Sprintf("Are you sure you want to delete the notification service '%s'? This cannot be undone.", service.Name), "text-white bg-red-700 hover:bg-red-800 focus:ring-4 focus:ring-red-300 font-medium rounded-lg text-sm px-5 py-2.5 dark:bg-red-600 dark:hover:bg-red-700 focus:outline-none dark:focus:ring-red-800", "Delete", "delete", service.ID, service.Name, )
    if service.IsEnabled { Active } else { Disabled } { service.Type } if len(service.EventTriggers) > 0 && service.Type == "webhook" { { fmt.Sprintf("%d triggers", len(service.EventTriggers)) } } if service.SuccessCount > 0 || service.FailureCount > 0 { { fmt.Sprintf("%d/%d", service.SuccessCount, service.SuccessCount + service.FailureCount) } }
    if service.Type == "webhook" {
    Events: if len(service.EventTriggers) == 0 { None } else { for i, trigger := range service.EventTriggers { if i > 0 { , } { trigger } } }
    Retry: if service.RetryPolicy == "" { Default } else { { service.RetryPolicy } }
    } else {

    Last sent: if service.SuccessCount > 0 { "Recently" } else { "Never" }

    }
  • }
}

Notification services allow the system to send alerts for job events such as completion, errors, or when jobs start.

@dialog.DialogScripts() } // Script call removed for now }