diff --git a/components/admin_tools.templ b/components/admin_tools.templ index cabe33c..5722e82 100644 --- a/components/admin_tools.templ +++ b/components/admin_tools.templ @@ -653,12 +653,7 @@ templ AdminTools(ctx context.Context, data AdminToolsData) { name="webhook_payload" rows="5" class="form-textarea w-full font-mono text-sm" - placeholder='{ - "event_type": "job_execution", - "job_id": 123, - "job_name": "Test Job", - "status": "completed" -}'> + placeholder='{"event_type": "job_execution","job_id": 123,"job_name": "Test Job","status": "completed"}'>

Leave empty to use default test payload @@ -692,27 +687,27 @@ templ AdminTools(ctx context.Context, data AdminToolsData) {

{
-  "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"
-  }
-}
+ "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" + } + }
@@ -880,28 +875,28 @@ templ AdminTools(ctx context.Context, data AdminToolsData) {

-
{
-  "event_type": "job_execution",
-  "job_id": 123,
-  "job_name": "Daily Backup",
-  "config_id": 456,
-  "config_name": "Backup 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"
-  }
-}
+
{
+							"event_type": "job_execution",
+							"job_id": 123,
+							"job_name": "Daily Backup",
+							"config_id": 456,
+							"config_name": "Backup 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"
+							}
+							}

Authentication

diff --git a/internal/web/handlers/admin_tools_handlers.go b/internal/web/handlers/admin_tools_handlers.go index 2654afe..d4f88ff 100644 --- a/internal/web/handlers/admin_tools_handlers.go +++ b/internal/web/handlers/admin_tools_handlers.go @@ -84,7 +84,10 @@ func (h *Handlers) HandleAdminTools(c *gin.Context) { } } - components.AdminTools(c.Request.Context(), data).Render(c.Request.Context(), c.Writer) + // Create template context with user information + ctx := components.CreateTemplateContext(c) + + components.AdminTools(ctx, data).Render(ctx, c.Writer) } // HandleBackupDatabase handles the backup database request