diff --git a/packages/ui/certd-client/src/components/ai/index.vue b/packages/ui/certd-client/src/components/ai/index.vue index 8bd9c85d..6020f614 100644 --- a/packages/ui/certd-client/src/components/ai/index.vue +++ b/packages/ui/certd-client/src/components/ai/index.vue @@ -123,6 +123,9 @@ onMounted(() => { }); async function openChat(req: { q: string }) { + if (!req.q) { + return; + } chatVisible.value = true; const iframeId = "maxkb-chat"; @@ -132,7 +135,13 @@ async function openChat(req: { q: string }) { throw new Error("iframe not found"); return; } - iframe.contentWindow?.postMessage(req, "*"); + iframe.contentWindow?.postMessage( + { + ...req, + from: "certd", + }, + "*" + ); } defineExpose({ diff --git a/packages/ui/certd-client/src/views/certd/pipeline/pipeline/component/task-view/index.vue b/packages/ui/certd-client/src/views/certd/pipeline/pipeline/component/task-view/index.vue index ebe89e43..64352e03 100644 --- a/packages/ui/certd-client/src/views/certd/pipeline/pipeline/component/task-view/index.vue +++ b/packages/ui/certd-client/src/views/certd/pipeline/pipeline/component/task-view/index.vue @@ -62,8 +62,10 @@ export default { }); function onAiChat() { - debugger; const logs = currentHistory.value?.logs[activeKey.value]; + if (!logs || logs.length === 0) { + return; + } let logText = ""; for (let log of logs) { logText += log + "\n";