From 74277593ce41c9a0f143eae446f31062554c1f7e Mon Sep 17 00:00:00 2001 From: ulleo Date: Fri, 22 May 2026 16:18:19 +0800 Subject: [PATCH] feat: Add parameter configuration to hide show SQL button & hide execute log in chat --- frontend/src/i18n/en.json | 4 ++-- frontend/src/i18n/ko-KR.json | 4 ++-- frontend/src/i18n/zh-CN.json | 4 ++-- frontend/src/i18n/zh-TW.json | 4 ++-- frontend/src/stores/chatConfig.ts | 24 +++++++++---------- frontend/src/views/chat/ChatTokenTime.vue | 2 +- .../src/views/chat/chat-block/ChartBlock.vue | 2 +- frontend/src/views/system/parameter/index.vue | 12 +++++----- 8 files changed, 28 insertions(+), 28 deletions(-) diff --git a/frontend/src/i18n/en.json b/frontend/src/i18n/en.json index f8a42025..3bc95e67 100644 --- a/frontend/src/i18n/en.json +++ b/frontend/src/i18n/en.json @@ -71,8 +71,8 @@ "platform_user_roles": "Third-Party Platform User Roles", "excessive_data_volume": "Disabling the 1000-row data limit may cause system lag due to excessive data volume.", "sqlbot_name": "Data Query Assistant Name", - "hide_sql": "Hide Show SQL Button", - "hide_log": "Hide Execution Log", + "show_sql": "Show SQL Button", + "show_log": "Show Execution Log", "prompt": "Prompt", "disabling_successfully": "Disabling Successfully", "closed_by_default": "In the Question Count window, control whether the model thinking process is expanded or closed by default.", diff --git a/frontend/src/i18n/ko-KR.json b/frontend/src/i18n/ko-KR.json index 8c988192..f0d3cf63 100644 --- a/frontend/src/i18n/ko-KR.json +++ b/frontend/src/i18n/ko-KR.json @@ -71,8 +71,8 @@ "platform_user_roles": "타사 플랫폼 사용자 역할", "excessive_data_volume": "1,000행 데이터 제한을 비활성화하면 과도한 데이터 양으로 인해 시스템 지연이 발생할 수 있습니다.", "sqlbot_name": "데이터 질의 도우미 이름", - "hide_sql": "SQL 표시 버튼 숨기기", - "hide_log": "실행 로그 숨기기", + "show_sql": "SQL 버튼 표시", + "show_log": "실행 로그 표시", "prompt": "프롬프트", "disabling_successfully": "비활성화 완료", "closed_by_default": "질문 수 창에서 모델 사고 프로세스를 기본적으로 확장할지 또는 닫을지 여부를 제어합니다.", diff --git a/frontend/src/i18n/zh-CN.json b/frontend/src/i18n/zh-CN.json index abbdd63c..fda9d25f 100644 --- a/frontend/src/i18n/zh-CN.json +++ b/frontend/src/i18n/zh-CN.json @@ -71,8 +71,8 @@ "platform_user_roles": "第三方平台用户角色", "excessive_data_volume": "关闭1000行的数据限制后,数据量过大,可能会造成系统卡顿", "sqlbot_name": "问数小助手名称", - "hide_sql": "隐藏展示SQL按钮", - "hide_log": "隐藏执行日志", + "show_sql": "显示展示SQL按钮", + "show_log": "显示执行日志", "prompt": "提示", "disabling_successfully": "关闭成功", "closed_by_default": "在问数窗口中,控制模型思考过程默认展开或者关闭", diff --git a/frontend/src/i18n/zh-TW.json b/frontend/src/i18n/zh-TW.json index 94668749..87b71cd5 100644 --- a/frontend/src/i18n/zh-TW.json +++ b/frontend/src/i18n/zh-TW.json @@ -71,8 +71,8 @@ "platform_user_roles": "第三方平台使用者角色", "excessive_data_volume": "關閉1000列的資料限制後,資料量過大,可能會造成系統卡頓", "sqlbot_name": "問數小助手名稱", - "hide_sql": "隱藏展示SQL按鈕", - "hide_log": "隱藏執行日誌", + "show_sql": "顯示展示SQL按鈕", + "show_log": "顯示執行日誌", "prompt": "提示", "disabling_successfully": "關閉成功", "closed_by_default": "在問數視窗中,控制模型思考過程預設展開或者關閉", diff --git a/frontend/src/stores/chatConfig.ts b/frontend/src/stores/chatConfig.ts index 95ea9538..d9eb3950 100644 --- a/frontend/src/stores/chatConfig.ts +++ b/frontend/src/stores/chatConfig.ts @@ -7,8 +7,8 @@ interface ChatConfig { sqlbot_name: string expand_thinking_block: boolean limit_rows: boolean - hide_sql: boolean - hide_log: boolean + show_sql: boolean + show_log: boolean } export const chatConfigStore = defineStore('chatConfigStore', { @@ -17,8 +17,8 @@ export const chatConfigStore = defineStore('chatConfigStore', { sqlbot_name: 'SQLBot', expand_thinking_block: false, limit_rows: true, - hide_sql: false, - hide_log: false, + show_sql: true, + show_log: true, } }, getters: { @@ -28,11 +28,11 @@ export const chatConfigStore = defineStore('chatConfigStore', { getExpandThinkingBlock(): boolean { return this.expand_thinking_block }, - getHideSQL(): boolean { - return this.hide_sql + getShowSQL(): boolean { + return this.show_sql }, - getHideLog(): boolean { - return this.hide_log + getShowLog(): boolean { + return this.show_log }, getLimitRows(): boolean { return this.limit_rows @@ -46,11 +46,11 @@ export const chatConfigStore = defineStore('chatConfigStore', { if (item.pkey === 'chat.expand_thinking_block') { this.expand_thinking_block = formatArg(item.pval) } - if (item.pkey === 'chat.hide_sql') { - this.hide_sql = formatArg(item.pval) + if (item.pkey === 'chat.show_sql') { + this.show_sql = formatArg(item.pval) } - if (item.pkey === 'chat.hide_log') { - this.hide_log = formatArg(item.pval) + if (item.pkey === 'chat.show_log') { + this.show_log = formatArg(item.pval) } if (item.pkey === 'chat.limit_rows') { this.limit_rows = formatArg(item.pval) diff --git a/frontend/src/views/chat/ChatTokenTime.vue b/frontend/src/views/chat/ChatTokenTime.vue index 14832cd9..8fdee2cc 100644 --- a/frontend/src/views/chat/ChatTokenTime.vue +++ b/frontend/src/views/chat/ChatTokenTime.vue @@ -9,7 +9,7 @@ const props = defineProps<{ totalTokens?: number | undefined }>() const chatConfig = useChatConfigStore() -const showLogBtn = !chatConfig.getHideLog +const showLogBtn = chatConfig.getShowLog const executionDetailsRef = ref() function getLogList() { executionDetailsRef.value.getLogList(props.recordId) diff --git a/frontend/src/views/chat/chat-block/ChartBlock.vue b/frontend/src/views/chat/chat-block/ChartBlock.vue index 6174734e..b544b739 100644 --- a/frontend/src/views/chat/chat-block/ChartBlock.vue +++ b/frontend/src/views/chat/chat-block/ChartBlock.vue @@ -29,7 +29,7 @@ import { chatApi } from '@/api/chat' import { useChatConfigStore } from '@/stores/chatConfig.ts' const chatConfig = useChatConfigStore() -const showSQLBtn = !chatConfig.getHideSQL +const showSQLBtn = chatConfig.getShowSQL const props = withDefaults( defineProps<{ recordId?: number diff --git a/frontend/src/views/system/parameter/index.vue b/frontend/src/views/system/parameter/index.vue index 10dcd87d..d5570127 100644 --- a/frontend/src/views/system/parameter/index.vue +++ b/frontend/src/views/system/parameter/index.vue @@ -12,8 +12,8 @@ const state = reactive({ 'chat.sqlbot_name': 'SQLBot', 'chat.expand_thinking_block': false, 'chat.limit_rows': false, - 'chat.hide_sql': false, - 'chat.hide_log': false, + 'chat.show_sql': false, + 'chat.show_log': false, }), }) provide('parameterForm', state.parameterForm) @@ -153,18 +153,18 @@ onMounted(() => {
- {{ t('parameter.hide_sql') }} + {{ t('parameter.show_sql') }}
- +
- {{ t('parameter.hide_log') }} + {{ t('parameter.show_log') }}
- +