update
This commit is contained in:
parent
1a70447b53
commit
eb455551c2
@ -5,7 +5,7 @@ services:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
image: tradus-web:1.4
|
||||
image: tradus-web:1.5
|
||||
container_name: tradus-web
|
||||
ports:
|
||||
- '6000:80'
|
||||
|
||||
@ -1,19 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, nextTick, computed, onMounted, watch } from 'vue'
|
||||
import { useUserStore } from '../stores/user'
|
||||
import { marked } from 'marked'
|
||||
|
||||
// 配置 marked
|
||||
marked.setOptions({
|
||||
async: false,
|
||||
gfm: true,
|
||||
breaks: true,
|
||||
})
|
||||
|
||||
// 渲染 Markdown
|
||||
const renderMarkdown = (content: string) => {
|
||||
return `<div class="markdown-body">${marked.parse(content)}</div>`
|
||||
}
|
||||
|
||||
// 定义Agent类型
|
||||
interface Agent {
|
||||
@ -459,7 +446,7 @@ const getInitial = (nickname: string) => {
|
||||
isTyping && typingMessageIndex === index && message.role === 'assistant',
|
||||
}"
|
||||
>
|
||||
<div v-html="renderMarkdown(message.content)"></div>
|
||||
{{ message.content }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -768,7 +755,8 @@ const getInitial = (nickname: string) => {
|
||||
white-space: pre-wrap;
|
||||
box-sizing: border-box;
|
||||
background-clip: padding-box;
|
||||
line-height: 1.4;
|
||||
line-height: 1.6;
|
||||
letter-spacing: 0.3px;
|
||||
}
|
||||
|
||||
.message-content.typing :deep(.markdown-body) {
|
||||
@ -788,7 +776,8 @@ const getInitial = (nickname: string) => {
|
||||
|
||||
/* 确保markdown内容正确显示 */
|
||||
:deep(.markdown-body) {
|
||||
display: inline;
|
||||
color: inherit;
|
||||
line-height: inherit;
|
||||
}
|
||||
|
||||
.user-message .message-content {
|
||||
@ -816,6 +805,7 @@ const getInitial = (nickname: string) => {
|
||||
border: 1px solid rgba(var(--color-accent-rgb), 0.15);
|
||||
font-size: 0.95rem;
|
||||
max-width: 600px;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
/* 调整思考消息的间距 */
|
||||
@ -935,63 +925,19 @@ const getInitial = (nickname: string) => {
|
||||
}
|
||||
|
||||
:deep(.markdown-body) {
|
||||
color: var(--color-text-primary);
|
||||
line-height: 1.4;
|
||||
color: inherit;
|
||||
line-height: inherit;
|
||||
}
|
||||
|
||||
:deep(.markdown-body p) {
|
||||
margin: 0;
|
||||
line-height: 1.4;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
:deep(.markdown-body p:last-child) {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
:deep(.markdown-body p:first-child) {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
:deep(.markdown-body h1),
|
||||
:deep(.markdown-body h2),
|
||||
:deep(.markdown-body h3),
|
||||
:deep(.markdown-body h4),
|
||||
:deep(.markdown-body h5),
|
||||
:deep(.markdown-body h6) {
|
||||
margin: 0.4em 0 0.2em 0;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
:deep(.markdown-body pre) {
|
||||
margin: 0.3em 0;
|
||||
padding: 0.5em;
|
||||
background-color: var(--color-bg-secondary);
|
||||
border: 1px solid var(--color-border);
|
||||
border-radius: var(--border-radius);
|
||||
}
|
||||
|
||||
:deep(.markdown-body blockquote) {
|
||||
margin: 0.3em 0;
|
||||
padding: 0.3em 0.8em;
|
||||
background-color: var(--color-bg-secondary);
|
||||
border-left: 4px solid var(--color-accent);
|
||||
}
|
||||
|
||||
:deep(.markdown-body ul),
|
||||
:deep(.markdown-body ol) {
|
||||
margin: 0.2em 0;
|
||||
padding-left: 1.2em;
|
||||
}
|
||||
|
||||
:deep(.markdown-body li) {
|
||||
margin: 0;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
:deep(.markdown-body li > p) {
|
||||
line-height: inherit;
|
||||
display: inline;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
:deep(.markdown-body p:not(:last-child)) {
|
||||
display: block;
|
||||
margin-bottom: 0.75em;
|
||||
}
|
||||
|
||||
/* 修改 Agent 选择器样式 */
|
||||
@ -1189,7 +1135,7 @@ const getInitial = (nickname: string) => {
|
||||
}
|
||||
|
||||
.user-message :deep(.markdown-body) {
|
||||
color: white;
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
.user-message :deep(.markdown-body pre) {
|
||||
@ -1203,12 +1149,12 @@ const getInitial = (nickname: string) => {
|
||||
}
|
||||
|
||||
.user-message :deep(.markdown-body a) {
|
||||
color: white;
|
||||
color: inherit;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.user-message :deep(.markdown-body code) {
|
||||
color: white;
|
||||
color: inherit;
|
||||
background-color: rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user