webhook-monitor: include event metadata in displayed details
Show the full event details (type, name) alongside the HTTP request data, organized into 'event' and 'request' sections for clarity.
1 file changed,
+16
−5
web/static/apps/webhook-monitor.js+16 −5
diff --git a/web/static/apps/webhook-monitor.js b/web/static/apps/webhook-monitor.js| index 9dccc4d..078ce00 100644 |
| --- a/web/static/apps/webhook-monitor.js |
| +++ b/web/static/apps/webhook-monitor.js |
| @@ -195,14 +195,25 @@ export const app = defineApp({ |
| const payloadDiv = document.createElement("div"); |
| payloadDiv.className = "webhook-monitor-item-payload"; |
| + |
| + // Organize display into event metadata and request details |
| const reqData = item.request || {}; |
| const display = { |
| - method: reqData.method, |
| - path: reqData.path, |
| - query: reqData.query, |
| - headers: reqData.headers, |
| - body: reqData.body, |
| + event: { |
| + type: item.type, |
| + name: item.name, |
| + }, |
| + request: { |
| + method: reqData.method, |
| + path: reqData.path, |
| + query: reqData.query, |
| + headers: reqData.headers, |
| + body: reqData.body, |
| + }, |
| }; |
| + if (reqData.body_b64) { |
| + display.request.body_b64 = true; |
| + } |
| payloadDiv.textContent = JSON.stringify(display, null, 2); |
| li.append(itemHeader, payloadDiv); |