diff --git a/packages/nc-gui/components/webhook/CallLog.vue b/packages/nc-gui/components/webhook/CallLog.vue index 1fdf3c0a43..fd1aaa540a 100644 --- a/packages/nc-gui/components/webhook/CallLog.vue +++ b/packages/nc-gui/components/webhook/CallLog.vue @@ -38,13 +38,31 @@ async function loadHookLogs(page = currentPage, limit = currentLimit) { offset: limit * (page - 1), limit, }) - hookLogs.value = list + hookLogs.value = parseHookLog(list) totalRows = pageInfo.totalRows ?? 0 } catch (e: any) { message.error(await extractSdkResponseErrorMsg(e)) } } +function parseHookLog(hookLogs: any) { + for (const hookLog of hookLogs) { + if (hookLog?.response) { + hookLog.response = parseProp(hookLog.response) + } + if (hookLog?.response?.config?.data) { + hookLog.response.config.data = parseProp(hookLog.response.config.data) + } + if (hookLog?.payload) { + hookLog.payload = parseProp(hookLog.payload) + } + if (hookLog?.notification) { + hookLog.notification = parseProp(hookLog.notification) + } + } + return hookLogs +} + onBeforeMount(async () => { if (showLogs.value) { await loadHookLogs(currentPage, currentLimit) @@ -86,52 +104,53 @@ onBeforeMount(async () => {
{{ hookLog.type }}: records.{{ hookLog.event }}.{{ hookLog.operation }} ({{ timeAgo(hookLog.created_at) }})
-
- {{ parseProp(hookLog.response).status }} - {{ parseProp(hookLog.response).statusText }} -
+
ERROR
OK
+
+ {{ hookLog.response?.status }} + {{ hookLog.response?.statusText || (hookLog.response?.status === 200 ? 'OK' : 'ERROR') }} +
- {{ parseProp(hookLog.payload).method }} + {{ hookLog.payload.method }} - {{ parseProp(hookLog.payload).path }} + {{ hookLog.payload.path }}
-
-
+
+ {{ hookLog.error_message }} +
+ +
+
Request
-
{{ parseProp(hookLog.response).config.headers }}
+
{{ hookLog.response.config.headers }}
-
+
Response
-
{{ parseProp(hookLog.response).headers }}
+
{{ hookLog.response.headers }}
-
+
Payload
-
{{ parseProp(parseProp(hookLog.response).config.data) }}
+
{{ hookLog.response.config.data }}
- -
-
- {{ hookLog.error_message }} -
-
+
+
Payload
-
{{ parseProp(hookLog.payload) }}
+
{{ hookLog.payload }}