mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-05-13 16:27:33 +00:00
fix: Formatted display of json content type(Compatible with illegal json)
This commit is contained in:
parent
f9f81ff560
commit
cd16c1322d
@ -23,9 +23,7 @@ limitations under the License. -->
|
|||||||
class="content mb-10"
|
class="content mb-10"
|
||||||
:readonly="true"
|
:readonly="true"
|
||||||
v-else-if="item.label === 'content'"
|
v-else-if="item.label === 'content'"
|
||||||
:value="
|
:value="contentFormat(item.label)"
|
||||||
currentLog.contentType === 'JSON' ? formatJson(JSON.parse(currentLog[item.label])) : currentLog[item.label]
|
|
||||||
"
|
|
||||||
/>
|
/>
|
||||||
<span v-else-if="item.label === 'tags'" class="g-sm-8 mb-10">
|
<span v-else-if="item.label === 'tags'" class="g-sm-8 mb-10">
|
||||||
<div v-for="(d, index) in logTags" :key="index">{{ d }}</div>
|
<div v-for="(d, index) in logTags" :key="index">{{ d }}</div>
|
||||||
@ -56,6 +54,16 @@ limitations under the License. -->
|
|||||||
return `${d.key} = ${d.value}`;
|
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];
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.content {
|
.content {
|
||||||
|
Loading…
Reference in New Issue
Block a user