diff --git a/components/admin_tools.templ b/components/admin_tools.templ index e5a0a4e..cabe33c 100644 --- a/components/admin_tools.templ +++ b/components/admin_tools.templ @@ -39,6 +39,10 @@ type AdminToolsData struct { EmailTestSuccess *bool EmailTestMessage string SmtpServer string + WebhookTestSuccess *bool + WebhookTestMessage string + WebhookStatusCode int + WebhookResponse string } // Dialog component for confirmation dialogs @@ -561,6 +565,160 @@ templ AdminTools(ctx context.Context, data AdminToolsData) { + +
+
+
+

+ + Webhook Notification Testing +

+
+
+

+ Test webhook notifications by sending a sample job execution payload to your webhook endpoint. +

+ +
+
+
+ +
+
+ +
+ +
+
+ +
+ +
+
+ +
+ +
+

+ + Used to sign webhook payloads (X-Hub-Signature-256 header) +

+
+ +
+ +
+
+ +
+ +
+

+ + Additional HTTP headers as JSON +

+
+ +
+ + +

+ + Leave empty to use default test payload +

+
+ +
+ +
+
+
+ + + + + +
+

+ + Default Webhook Test Payload +

+
+
{
+  "event_type": "job_execution",
+  "job_id": 123,
+  "job_name": "Test Job",
+  "config_id": 456,
+  "config_name": "Test Config",
+  "status": "completed",
+  "start_time": "2023-06-18T15:30:45Z",
+  "end_time": "2023-06-18T15:35:12Z",
+  "duration_seconds": 267,
+  "history_id": 789,
+  "bytes_transferred": 1048576,
+  "files_transferred": 5,
+  "source": {
+    "type": "local",
+    "path": "/path/to/source"
+  },
+  "destination": {
+    "type": "s3",
+    "path": "bucket/path"
+  }
+}
+
+
+
+
+
+
@BackupsList(data) @@ -1169,3 +1327,68 @@ script fadeInAnimation() { document.head.appendChild(style); } } + +// WebhookTestToast is a component for showing webhook test results +templ WebhookTestToast(success bool, message string, statusCode int, responseBody string) { +
+
+
+ if success { + + } else { + + } +
+
+

+ if success { + Webhook Sent Successfully + } else { + Webhook Sending Failed + } +

+
+ { message } +
+ + +
+
Status Code: { fmt.Sprint(statusCode) }
+ if responseBody != "" { +
+
Response:
+
+
{ responseBody }
+
+
+ } +
+
+
+ +
+
+
+}