diff --git a/src/views/dashboard/related/log/LogTable/LogDetail.vue b/src/views/dashboard/related/log/LogTable/LogDetail.vue index e65d8954..6d4cc704 100644 --- a/src/views/dashboard/related/log/LogTable/LogDetail.vue +++ b/src/views/dashboard/related/log/LogTable/LogDetail.vue @@ -23,9 +23,7 @@ limitations under the License. --> class="content mb-10" :readonly="true" v-else-if="item.label === 'content'" - :value=" - currentLog.contentType === 'JSON' ? formatJson(JSON.parse(currentLog[item.label])) : currentLog[item.label] - " + :value="contentFormat(item.label)" />
{{ d }}
@@ -56,6 +54,16 @@ limitations under the License. --> return `${d.key} = ${d.value}`; }); }); + + function contentFormat(label: string) { + try { + return props.currentLog.contentType === "JSON" + ? formatJson(JSON.parse(props.currentLog[label])) + : props.currentLog[label]; + } catch (e) { + return props.currentLog[label]; + } + }