diff --git a/src/locales/en-US.ts b/src/locales/en-US.ts index 97cdd8cc01..bd7802173c 100644 --- a/src/locales/en-US.ts +++ b/src/locales/en-US.ts @@ -48,6 +48,8 @@ export default { deleteMessageConfirm: 'Are you sure to delete this message?', deleteHistoryConfirm: 'Are you sure to clear this history?', clearHistoryConfirm: 'Are you sure to clear chat history?', + preview: 'Preview', + showRawText: 'Show as raw text', }, setting: { setting: 'Setting', diff --git a/src/locales/zh-CN.ts b/src/locales/zh-CN.ts index 2053407ba0..2f798f4938 100644 --- a/src/locales/zh-CN.ts +++ b/src/locales/zh-CN.ts @@ -48,6 +48,8 @@ export default { deleteMessageConfirm: '是否删除此消息?', deleteHistoryConfirm: '确定删除此记录?', clearHistoryConfirm: '确定清空聊天记录?', + preview: '预览', + showRawText: '显示原文', }, setting: { setting: '设置', diff --git a/src/locales/zh-TW.ts b/src/locales/zh-TW.ts index 07e8c7ebe0..e4b26458c0 100644 --- a/src/locales/zh-TW.ts +++ b/src/locales/zh-TW.ts @@ -48,6 +48,8 @@ export default { deleteMessageConfirm: '是否刪除此訊息?', deleteHistoryConfirm: '確定刪除此紀錄?', clearHistoryConfirm: '確定清除紀錄?', + preview: '預覽', + showRawText: '顯示原文', }, setting: { setting: '設定', diff --git a/src/views/chat/components/Message/Text.vue b/src/views/chat/components/Message/Text.vue index f273443032..61a11dbcd6 100644 --- a/src/views/chat/components/Message/Text.vue +++ b/src/views/chat/components/Message/Text.vue @@ -12,6 +12,7 @@ interface Props { error?: boolean text?: string loading?: boolean + asRawText?: boolean } const props = defineProps() @@ -43,13 +44,14 @@ const wrapClass = computed(() => { isMobile.value ? 'p-2' : 'px-3 py-2', props.inversion ? 'bg-[#d2f9d1]' : 'bg-[#f4f6f8]', props.inversion ? 'dark:bg-[#a1dc95]' : 'dark:bg-[#1e1e20]', + props.inversion ? 'message-request' : 'message-reply', { 'text-red-500': props.error }, ] }) const text = computed(() => { const value = props.text ?? '' - if (!props.inversion) + if (!props.asRawText) return mdi.render(value) return value }) @@ -68,7 +70,10 @@ defineExpose({ textRef }) diff --git a/src/views/chat/components/Message/index.vue b/src/views/chat/components/Message/index.vue index 0d462e923a..d625a8a7be 100644 --- a/src/views/chat/components/Message/index.vue +++ b/src/views/chat/components/Message/index.vue @@ -1,5 +1,5 @@