From 8a6d555da1426eb618caba473eb482ac5daaab0a Mon Sep 17 00:00:00 2001 From: Kirigaya <1193466151@qq.com> Date: Thu, 3 Jul 2025 19:15:53 +0800 Subject: [PATCH] support self-check --- .../auto-detector/diagram-item-record.vue | 86 ++++++++++++------- 1 file changed, 54 insertions(+), 32 deletions(-) diff --git a/renderer/src/components/main-panel/tool/auto-detector/diagram-item-record.vue b/renderer/src/components/main-panel/tool/auto-detector/diagram-item-record.vue index 5b860d9..7da1eb6 100644 --- a/renderer/src/components/main-panel/tool/auto-detector/diagram-item-record.vue +++ b/renderer/src/components/main-panel/tool/auto-detector/diagram-item-record.vue @@ -5,29 +5,31 @@ {{ props.dataView.status }}
{{ props.dataView.tool.description }}
- +
- Function -
{{ props.dataView.function.name }}
- Arguments -
{{ formatJson(props.dataView.function.arguments) }}
+
Function
+
{{ props.dataView.function.name }}
-
- Result - -
{{ props.dataView.result }}
-
{{ formatJson(props.dataView.result) }}
-
+
+ Arguments + +
+ +
+ Result + +
{{ props.dataView.result }}
+
{{ formatJson(props.dataView.result) }}
+
@@ -41,6 +43,8 @@ import type { PropType } from 'vue'; import type { NodeDataView } from './diagram'; +import JsonRender from '@/components/json-render/index.vue'; + const props = defineProps({ dataView: { type: Object as PropType, @@ -61,7 +65,7 @@ function formatJson(obj: any) { .diagram-item-record { padding: 14px 18px; border-radius: 8px; - box-shadow: 0 1px 4px rgba(0,0,0,0.04); + box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04); font-size: 15px; max-width: 300px; word-break: break-all; @@ -87,11 +91,26 @@ function formatJson(obj: any) { margin-left: 8px; text-transform: capitalize; } -.item-status.running { color: #2196f3; } -.item-status.success { color: #43a047; } -.item-status.error { color: #e53935; } -.item-status.waiting { color: #aaa; } -.item-status.default { color: #888; } + +.item-status.running { + color: #2196f3; +} + +.item-status.success { + color: #43a047; +} + +.item-status.error { + color: #e53935; +} + +.item-status.waiting { + color: #aaa; +} + +.item-status.default { + color: #888; +} .item-desc { margin-bottom: 8px; @@ -108,11 +127,6 @@ function formatJson(obj: any) { .item-json { border-radius: 4px; padding: 6px 10px; - font-size: 13px; - font-family: var(--code-font-family, monospace); - margin: 2px 0 8px 0; - white-space: pre-wrap; - word-break: break-all; } .item-result { @@ -122,6 +136,14 @@ function formatJson(obj: any) { .result-block { margin-bottom: 6px; border-radius: .5em; - background-color: rgba(245, 108, 108, 0.3); + margin: 5px 0; +} + +.result-block.error { + background-color: rgba(245, 108, 108, 0.5); +} + +.result-block.success { + background-color: rgba(67, 160, 71, 0.5); } \ No newline at end of file