feat: Add parameter configuration to hide show SQL button & hide execute log in chat

This commit is contained in:
ulleo
2026-05-22 16:19:17 +08:00
committed by ulleo
parent 99308c9467
commit a78b30dfb9
8 changed files with 28 additions and 28 deletions
+2 -2
View File
@@ -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.",
+2 -2
View File
@@ -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": "질문 수 창에서 모델 사고 프로세스를 기본적으로 확장할지 또는 닫을지 여부를 제어합니다.",
+2 -2
View File
@@ -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": "在问数窗口中,控制模型思考过程默认展开或者关闭",
+2 -2
View File
@@ -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": "在問數視窗中,控制模型思考過程預設展開或者關閉",
+12 -12
View File
@@ -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)
+1 -1
View File
@@ -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)
@@ -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
@@ -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(() => {
<el-row>
<div class="card-item">
<div class="label">
{{ t('parameter.hide_sql') }}
{{ t('parameter.show_sql') }}
</div>
<div class="value">
<el-switch v-model="state.parameterForm['chat.hide_sql']" />
<el-switch v-model="state.parameterForm['chat.show_sql']" />
</div>
</div>
<div class="card-item" style="margin-left: 16px">
<div class="label">
{{ t('parameter.hide_log') }}
{{ t('parameter.show_log') }}
</div>
<div class="value">
<el-switch v-model="state.parameterForm['chat.hide_log']" />
<el-switch v-model="state.parameterForm['chat.show_log']" />
</div>
</div>
</el-row>