From ec3e7a401fdae296d17ff50cde653b59eff3c22e Mon Sep 17 00:00:00 2001 From: ulleo Date: Fri, 8 May 2026 17:41:20 +0800 Subject: [PATCH] feat: Add parameter configuration to hide show SQL button & hide execute log in chat --- frontend/src/i18n/en.json | 2 ++ frontend/src/i18n/ko-KR.json | 2 ++ frontend/src/i18n/zh-CN.json | 2 ++ frontend/src/i18n/zh-TW.json | 2 ++ frontend/src/stores/chatConfig.ts | 16 ++++++++++++++ frontend/src/views/chat/ChatTokenTime.vue | 6 +++-- .../src/views/chat/chat-block/ChartBlock.vue | 5 ++++- frontend/src/views/system/parameter/index.vue | 22 +++++++++++++++++++ 8 files changed, 54 insertions(+), 3 deletions(-) diff --git a/frontend/src/i18n/en.json b/frontend/src/i18n/en.json index bbef575a6..f8a420250 100644 --- a/frontend/src/i18n/en.json +++ b/frontend/src/i18n/en.json @@ -71,6 +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", "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 1190576d2..8c988192e 100644 --- a/frontend/src/i18n/ko-KR.json +++ b/frontend/src/i18n/ko-KR.json @@ -71,6 +71,8 @@ "platform_user_roles": "타사 플랫폼 사용자 역할", "excessive_data_volume": "1,000행 데이터 제한을 비활성화하면 과도한 데이터 양으로 인해 시스템 지연이 발생할 수 있습니다.", "sqlbot_name": "데이터 질의 도우미 이름", + "hide_sql": "SQL 표시 버튼 숨기기", + "hide_log": "실행 로그 숨기기", "prompt": "프롬프트", "disabling_successfully": "비활성화 완료", "closed_by_default": "질문 수 창에서 모델 사고 프로세스를 기본적으로 확장할지 또는 닫을지 여부를 제어합니다.", diff --git a/frontend/src/i18n/zh-CN.json b/frontend/src/i18n/zh-CN.json index f1c66c372..abbdd63c0 100644 --- a/frontend/src/i18n/zh-CN.json +++ b/frontend/src/i18n/zh-CN.json @@ -71,6 +71,8 @@ "platform_user_roles": "第三方平台用户角色", "excessive_data_volume": "关闭1000行的数据限制后,数据量过大,可能会造成系统卡顿", "sqlbot_name": "问数小助手名称", + "hide_sql": "隐藏展示SQL按钮", + "hide_log": "隐藏执行日志", "prompt": "提示", "disabling_successfully": "关闭成功", "closed_by_default": "在问数窗口中,控制模型思考过程默认展开或者关闭", diff --git a/frontend/src/i18n/zh-TW.json b/frontend/src/i18n/zh-TW.json index aae542822..94668749f 100644 --- a/frontend/src/i18n/zh-TW.json +++ b/frontend/src/i18n/zh-TW.json @@ -71,6 +71,8 @@ "platform_user_roles": "第三方平台使用者角色", "excessive_data_volume": "關閉1000列的資料限制後,資料量過大,可能會造成系統卡頓", "sqlbot_name": "問數小助手名稱", + "hide_sql": "隱藏展示SQL按鈕", + "hide_log": "隱藏執行日誌", "prompt": "提示", "disabling_successfully": "關閉成功", "closed_by_default": "在問數視窗中,控制模型思考過程預設展開或者關閉", diff --git a/frontend/src/stores/chatConfig.ts b/frontend/src/stores/chatConfig.ts index 13eb98fec..95ea95388 100644 --- a/frontend/src/stores/chatConfig.ts +++ b/frontend/src/stores/chatConfig.ts @@ -7,6 +7,8 @@ interface ChatConfig { sqlbot_name: string expand_thinking_block: boolean limit_rows: boolean + hide_sql: boolean + hide_log: boolean } export const chatConfigStore = defineStore('chatConfigStore', { @@ -15,6 +17,8 @@ export const chatConfigStore = defineStore('chatConfigStore', { sqlbot_name: 'SQLBot', expand_thinking_block: false, limit_rows: true, + hide_sql: false, + hide_log: false, } }, getters: { @@ -24,6 +28,12 @@ export const chatConfigStore = defineStore('chatConfigStore', { getExpandThinkingBlock(): boolean { return this.expand_thinking_block }, + getHideSQL(): boolean { + return this.hide_sql + }, + getHideLog(): boolean { + return this.hide_log + }, getLimitRows(): boolean { return this.limit_rows }, @@ -36,6 +46,12 @@ 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.hide_log') { + this.hide_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 958ee6c9c..14832cd90 100644 --- a/frontend/src/views/chat/ChatTokenTime.vue +++ b/frontend/src/views/chat/ChatTokenTime.vue @@ -2,12 +2,14 @@ import { ref } from 'vue' import icon_logs_outlined from '@/assets/svg/icon_logs_outlined.svg' import ExecutionDetails from './ExecutionDetails.vue' +import { useChatConfigStore } from '@/stores/chatConfig.ts' const props = defineProps<{ recordId?: number duration?: number | undefined totalTokens?: number | undefined }>() - +const chatConfig = useChatConfigStore() +const showLogBtn = !chatConfig.getHideLog const executionDetailsRef = ref() function getLogList() { executionDetailsRef.value.getLogList(props.recordId) @@ -19,7 +21,7 @@ function getLogList() { {{ $t('parameter.tokens_required') }} {{ totalTokens }} {{ $t('parameter.time_execution') }} {{ duration }} s -
+
diff --git a/frontend/src/views/chat/chat-block/ChartBlock.vue b/frontend/src/views/chat/chat-block/ChartBlock.vue index 93e525b66..7787c1ae5 100644 --- a/frontend/src/views/chat/chat-block/ChartBlock.vue +++ b/frontend/src/views/chat/chat-block/ChartBlock.vue @@ -26,7 +26,10 @@ import { useAssistantStore } from '@/stores/assistant' import AddViewDashboard from '@/views/dashboard/common/AddViewDashboard.vue' import html2canvas from 'html2canvas' import { chatApi } from '@/api/chat' +import { useChatConfigStore } from '@/stores/chatConfig.ts' +const chatConfig = useChatConfigStore() +const showSQLBtn = !chatConfig.getHideSQL const props = withDefaults( defineProps<{ recordId?: number @@ -420,7 +423,7 @@ watch(
-
+
diff --git a/frontend/src/views/system/parameter/index.vue b/frontend/src/views/system/parameter/index.vue index a1b48b1d5..49ebc0fa3 100644 --- a/frontend/src/views/system/parameter/index.vue +++ b/frontend/src/views/system/parameter/index.vue @@ -12,6 +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, }), }) provide('parameterForm', state.parameterForm) @@ -105,6 +107,8 @@ onMounted(() => {
+ +
{{ t('parameter.model_thinking_process') }} @@ -140,6 +144,24 @@ onMounted(() => {
+ +
+
+ {{ t('parameter.hide_sql') }} +
+
+ +
+
+
+
+ {{ t('parameter.hide_log') }} +
+
+ +
+
+