diff --git a/frontend/src/api/chat.ts b/frontend/src/api/chat.ts index 71c8b25f..cd561fc4 100644 --- a/frontend/src/api/chat.ts +++ b/frontend/src/api/chat.ts @@ -300,8 +300,10 @@ export class ChatLogHistoryItem { duration?: number | undefined total_tokens?: number | undefined operate?: string | undefined + operate_key?: string | undefined local_operation?: boolean | undefined error?: boolean | undefined + message?: any constructor() constructor( @@ -311,7 +313,8 @@ export class ChatLogHistoryItem { total_tokens: number | undefined, operate: string | undefined, local_operation: boolean | undefined, - error: boolean | undefined + error: boolean | undefined, + message: any | undefined ) constructor( start_time?: Date | string, @@ -320,15 +323,18 @@ export class ChatLogHistoryItem { total_tokens?: number | undefined, operate?: string | undefined, local_operation?: boolean | undefined, - error?: boolean | undefined + error?: boolean | undefined, + message?: any | undefined ) { this.start_time = getDate(start_time) this.finish_time = getDate(finish_time) this.duration = duration this.total_tokens = total_tokens + this.operate_key = operate this.operate = t('chat.log.' + operate) this.local_operation = !!local_operation this.error = !!error + this.message = message } } @@ -373,7 +379,8 @@ const toChatLogHistoryItem = (data?: any): any | undefined => { data.total_tokens, data.operate, data.local_operation, - data.error + data.error, + data.message ) } diff --git a/frontend/src/i18n/en.json b/frontend/src/i18n/en.json index c49eb119..319406c4 100644 --- a/frontend/src/i18n/en.json +++ b/frontend/src/i18n/en.json @@ -767,7 +767,16 @@ "FILTER_CUSTOM_PROMPT": "Match Custom Prompts", "EXECUTE_SQL": "Execute SQL", "GENERATE_PICTURE": "Generate Picture" - } + }, + "log_system": "Conversation Template", + "log_question": "Current Question", + "log_answer": "AI Response", + "log_history": "History", + "find_term_title": "Matched {0} terms", + "find_sql_sample_title": "Matched {0} SQL examples", + "find_custom_prompt_title": "Matched {0} custom prompts", + "query_count_title": "Found {0} data entries", + "generate_picture_success": "Image generated" }, "about": { "title": "About", diff --git a/frontend/src/i18n/ko-KR.json b/frontend/src/i18n/ko-KR.json index 24c072d9..5fd57dfc 100644 --- a/frontend/src/i18n/ko-KR.json +++ b/frontend/src/i18n/ko-KR.json @@ -767,7 +767,16 @@ "FILTER_CUSTOM_PROMPT": "사용자 정의 프롬프트 매칭", "EXECUTE_SQL": "SQL 실행", "GENERATE_PICTURE": "이미지 생성" - } + }, + "log_system": "대화 템플릿", + "log_question": "현재 질문", + "log_answer": "AI 응답", + "log_history": "기록", + "find_term_title": "{0}개의 용어 매칭됨", + "find_sql_sample_title": "{0}개의 SQL 예시 매칭됨", + "find_custom_prompt_title": "{0}개의 사용자 정의 프롬프트 매칭됨", + "query_count_title": "{0}개의 데이터 항목 발견됨", + "generate_picture_success": "이미지가 생성되었습니다" }, "about": { "title": "정보", diff --git a/frontend/src/i18n/zh-CN.json b/frontend/src/i18n/zh-CN.json index 643e10c6..8e380683 100644 --- a/frontend/src/i18n/zh-CN.json +++ b/frontend/src/i18n/zh-CN.json @@ -767,7 +767,16 @@ "FILTER_CUSTOM_PROMPT": "匹配自定义提示词", "EXECUTE_SQL": "执行 SQL", "GENERATE_PICTURE": "生成图片" - } + }, + "log_system": "对话模板", + "log_question": "本次提问", + "log_answer": "AI 回答", + "log_history": "历史记录", + "find_term_title":"匹配到 {0} 个术语", + "find_sql_sample_title":"匹配到 {0} 个SQL示例", + "find_custom_prompt_title":"匹配到 {0} 个自定义提示词", + "query_count_title":"查询到 {0} 条数据", + "generate_picture_success":"已生成图片" }, "about": { "title": "关于", diff --git a/frontend/src/views/chat/ExecutionDetails.vue b/frontend/src/views/chat/ExecutionDetails.vue index e00ebd48..a6545d5f 100644 --- a/frontend/src/views/chat/ExecutionDetails.vue +++ b/frontend/src/views/chat/ExecutionDetails.vue @@ -8,6 +8,13 @@ import icon_alarm_clock_colorful from '@/assets/svg/icon_alarm-clock_colorful.sv import { chatApi, type ChatLogHistory } from '@/api/chat.ts' import { useI18n } from 'vue-i18n' import { debounce } from 'lodash-es' +import LogTerm from './execution-component/LogTerm.vue' +import LogSQLSample from './execution-component/LogSQLSample.vue' +import LogCustomPrompt from './execution-component/LogCustomPrompt.vue' +import LogDataQuery from './execution-component/LogDataQuery.vue' +import LogChooseTable from './execution-component/LogChooseTable.vue' +import LogGeneratePicture from './execution-component/LogGeneratePicture.vue' +import LogWithAi from '@/views/chat/execution-component/LogWithAi.vue' const { t } = useI18n() const logHistory = ref({}) @@ -76,13 +83,8 @@ defineExpose({
{{ t('parameter.execution_details') }}
-
-
+
+
@@ -104,7 +106,15 @@ defineExpose({
-
+
+ + + + + + + +
@@ -175,13 +185,13 @@ defineExpose({ } 100% { - height: 504px; + min-height: 54px; } } &:has(.expand) { - height: 504px; - animation: expand 0.5s; + min-height: 54px; + //animation: expand 0.5s; } .shrink { diff --git a/frontend/src/views/chat/execution-component/BaseContent.vue b/frontend/src/views/chat/execution-component/BaseContent.vue new file mode 100644 index 00000000..b706516c --- /dev/null +++ b/frontend/src/views/chat/execution-component/BaseContent.vue @@ -0,0 +1,14 @@ + + + + + diff --git a/frontend/src/views/chat/execution-component/LogChooseTable.vue b/frontend/src/views/chat/execution-component/LogChooseTable.vue new file mode 100644 index 00000000..2ec12334 --- /dev/null +++ b/frontend/src/views/chat/execution-component/LogChooseTable.vue @@ -0,0 +1,73 @@ + + + + + diff --git a/frontend/src/views/chat/execution-component/LogCustomPrompt.vue b/frontend/src/views/chat/execution-component/LogCustomPrompt.vue new file mode 100644 index 00000000..7c9b972b --- /dev/null +++ b/frontend/src/views/chat/execution-component/LogCustomPrompt.vue @@ -0,0 +1,85 @@ + + + + + diff --git a/frontend/src/views/chat/execution-component/LogDataQuery.vue b/frontend/src/views/chat/execution-component/LogDataQuery.vue new file mode 100644 index 00000000..9f224cc4 --- /dev/null +++ b/frontend/src/views/chat/execution-component/LogDataQuery.vue @@ -0,0 +1,78 @@ + + + + + diff --git a/frontend/src/views/chat/execution-component/LogGeneratePicture.vue b/frontend/src/views/chat/execution-component/LogGeneratePicture.vue new file mode 100644 index 00000000..b6da23fb --- /dev/null +++ b/frontend/src/views/chat/execution-component/LogGeneratePicture.vue @@ -0,0 +1,79 @@ + + + + + diff --git a/frontend/src/views/chat/execution-component/LogSQLSample.vue b/frontend/src/views/chat/execution-component/LogSQLSample.vue new file mode 100644 index 00000000..e83b3dff --- /dev/null +++ b/frontend/src/views/chat/execution-component/LogSQLSample.vue @@ -0,0 +1,93 @@ + + + + + diff --git a/frontend/src/views/chat/execution-component/LogTerm.vue b/frontend/src/views/chat/execution-component/LogTerm.vue new file mode 100644 index 00000000..24084de5 --- /dev/null +++ b/frontend/src/views/chat/execution-component/LogTerm.vue @@ -0,0 +1,89 @@ + + + + + diff --git a/frontend/src/views/chat/execution-component/LogWithAi.vue b/frontend/src/views/chat/execution-component/LogWithAi.vue new file mode 100644 index 00000000..95087d13 --- /dev/null +++ b/frontend/src/views/chat/execution-component/LogWithAi.vue @@ -0,0 +1,140 @@ + + + + +