From 20d4048543e18571872852b9032e7f97818247e3 Mon Sep 17 00:00:00 2001 From: lgh <625458956@qq.com> Date: Sat, 21 Feb 2026 00:19:44 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=89=8D=E7=AB=AFType?= =?UTF-8?q?Script=E7=B1=BB=E5=9E=8B=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/ContextManager.vue | 6 +-- frontend/src/components/LLMSettings.vue | 11 +---- frontend/src/components/SignalDashboard.vue | 49 +++++++++++---------- 3 files changed, 30 insertions(+), 36 deletions(-) diff --git a/frontend/src/components/ContextManager.vue b/frontend/src/components/ContextManager.vue index d8cf894..b8c68ed 100644 --- a/frontend/src/components/ContextManager.vue +++ b/frontend/src/components/ContextManager.vue @@ -107,7 +107,7 @@ const extractMetadata = (content: string) => { // 1. Extract Title (First H1 or first non-empty line) const titleMatch = content.match(/^#\s+(.*)/m) - if (titleMatch) { + if (titleMatch && titleMatch[1]) { title = titleMatch[1].trim() } else { const firstLine = lines.find(l => l.trim().length > 0) @@ -136,12 +136,12 @@ const extractMetadata = (content: string) => { // Look for "Core Logic", "Architecture", "Introduction" headers const logicRegex = /##\s*(Core Logic|Architecture|Introduction|About|Features)([\s\S]*?)(##|$)/i const logicMatch = content.match(logicRegex) - if (logicMatch) { + if (logicMatch && logicMatch[2]) { coreLogic = logicMatch[2].trim().substring(0, 300) + (logicMatch[2].length > 300 ? '...' : '') } else { // Fallback: First paragraph after title const paragraphs = content.split(/\n\s*\n/) - if (paragraphs.length > 1) { + if (paragraphs.length > 1 && paragraphs[1]) { coreLogic = paragraphs[1].trim().substring(0, 200) + '...' } } diff --git a/frontend/src/components/LLMSettings.vue b/frontend/src/components/LLMSettings.vue index 44d71ba..990cb79 100644 --- a/frontend/src/components/LLMSettings.vue +++ b/frontend/src/components/LLMSettings.vue @@ -52,7 +52,7 @@ -
+
{{ selectedProvider.desc }} {{ selectedProvider.pricing }}
@@ -63,7 +63,7 @@

连接配置

-
+
h('svg', { viewBox: '0 0 24 24', fill: 'none', stroke: 'cu h('path', { d: 'M21 2l-2 2m-7.61 7.61a5.5 5.5 0 1 1-7.778 7.778 5.5 5.5 0 0 1 7.777-7.777zm0 0L15.5 7.5m0 0l3 3L22 7l-3-3m-3.5 3.5L19 4' }) ]) -const ServerIcon = () => h('svg', { viewBox: '0 0 24 24', fill: 'none', stroke: 'currentColor', 'stroke-width': 1.5 }, [ - h('rect', { x: '2', y: '2', width: '20', height: '8', rx: '2', ry: '2' }), - h('rect', { x: '2', y: '14', width: '20', height: '8', rx: '2', ry: '2' }), - h('line', { x1: '6', y1: '6', x2: '6.01', y2: '6' }), - h('line', { x1: '6', y1: '18', x2: '6.01', y2: '18' }) -]) - // 侧边栏导航 const navItems = [ { key: 'provider', label: '模型服务', icon: CloudIcon }, diff --git a/frontend/src/components/SignalDashboard.vue b/frontend/src/components/SignalDashboard.vue index 90cbb2e..7dd8ee0 100644 --- a/frontend/src/components/SignalDashboard.vue +++ b/frontend/src/components/SignalDashboard.vue @@ -21,11 +21,11 @@
我方 - +
竞品 - +
{{ getLeadTimeText(selectedSignal) }} @@ -134,18 +134,18 @@ 'new-signal-flash': isNewSignal(signal.latestSignal) }" > - + {{ signal.content }} @@ -493,7 +493,7 @@ :percentage="getTaskProgress(task)" :color="getTaskTypeColor(task.type, true)" rail-color="rgba(255,255,255,0.1)" - height="4" + :height="4" :show-indicator="false" style="margin-top: 8px;" :class="{ 'progress-pulse': taskExecuting }" @@ -543,7 +543,7 @@ - +