diff --git a/src/components/widgets/TreeNodeInfo.vue b/src/components/widgets/TreeNodeInfo.vue index f7f3a0ea2..dfb2ef401 100644 --- a/src/components/widgets/TreeNodeInfo.vue +++ b/src/components/widgets/TreeNodeInfo.vue @@ -74,11 +74,12 @@ import { Component, Vue, Prop } from 'vue-property-decorator' import { Getter } from 'vuex-class' import { findSubTopics, findFullTopicPath, isPayloadEmpty } from '@/utils/topicTree' import Prism from 'prismjs' +import { jsonStringify, jsonParse } from '@/utils/jsonUtils' @Component export default class TreeNodeInfo extends Vue { - @Prop() private node!: TopicTreeData - @Prop() private treeData!: TopicTreeData[] + @Prop() private node!: TopicTreeNode + @Prop() private treeData!: TopicTreeNode[] @Getter('currentTheme') private currentTheme!: Theme @@ -89,7 +90,7 @@ export default class TreeNodeInfo extends Vue { get latestMessage(): string { const message = this.node.latestMessage || '' if (this.payloadFormat === 'json') { - return JSON.stringify(JSON.parse(message.toString()), null, 2) + return jsonStringify(jsonParse(message.toString()), null, 2) } return message.toString() } @@ -127,11 +128,11 @@ export default class TreeNodeInfo extends Vue { return fullHost } - private getSubTopics(node: TopicTreeData): string[] { + private getSubTopics(node: TopicTreeNode): string[] { return findSubTopics(node) } - private getFullTopicPath(node: TopicTreeData): string { + private getFullTopicPath(node: TopicTreeNode): string { const fullPath = findFullTopicPath(this.treeData, node.id) if (!fullPath) return node.label return fullPath diff --git a/src/components/widgets/TreeView.vue b/src/components/widgets/TreeView.vue index a5978627b..612c2b8b3 100644 --- a/src/components/widgets/TreeView.vue +++ b/src/components/widgets/TreeView.vue @@ -36,9 +36,9 @@