mirror of
https://gh-proxy.org/https://github.com/klinsmaya/SQLBot.git
synced 2026-11-08 01:06:59 +08:00
feat: Add parameter configuration to hide show SQL button & hide execute log in chat
This commit is contained in:
@@ -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.",
|
||||
|
||||
@@ -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": "질문 수 창에서 모델 사고 프로세스를 기본적으로 확장할지 또는 닫을지 여부를 제어합니다.",
|
||||
|
||||
@@ -71,6 +71,8 @@
|
||||
"platform_user_roles": "第三方平台用户角色",
|
||||
"excessive_data_volume": "关闭1000行的数据限制后,数据量过大,可能会造成系统卡顿",
|
||||
"sqlbot_name": "问数小助手名称",
|
||||
"hide_sql": "隐藏展示SQL按钮",
|
||||
"hide_log": "隐藏执行日志",
|
||||
"prompt": "提示",
|
||||
"disabling_successfully": "关闭成功",
|
||||
"closed_by_default": "在问数窗口中,控制模型思考过程默认展开或者关闭",
|
||||
|
||||
@@ -71,6 +71,8 @@
|
||||
"platform_user_roles": "第三方平台使用者角色",
|
||||
"excessive_data_volume": "關閉1000列的資料限制後,資料量過大,可能會造成系統卡頓",
|
||||
"sqlbot_name": "問數小助手名稱",
|
||||
"hide_sql": "隱藏展示SQL按鈕",
|
||||
"hide_log": "隱藏執行日誌",
|
||||
"prompt": "提示",
|
||||
"disabling_successfully": "關閉成功",
|
||||
"closed_by_default": "在問數視窗中,控制模型思考過程預設展開或者關閉",
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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() {
|
||||
<span>{{ $t('parameter.tokens_required') }} {{ totalTokens }}</span>
|
||||
<span style="margin-left: 12px">{{ $t('parameter.time_execution') }} {{ duration }} s</span>
|
||||
|
||||
<div class="detail" @click="getLogList">
|
||||
<div v-if="showLogBtn" class="detail" @click="getLogList">
|
||||
<el-icon style="margin-right: 4px" size="16">
|
||||
<icon_logs_outlined></icon_logs_outlined>
|
||||
</el-icon>
|
||||
|
||||
@@ -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(
|
||||
</el-tooltip>
|
||||
</div>
|
||||
|
||||
<div v-if="message?.record?.sql">
|
||||
<div v-if="message?.record?.sql && showSQLBtn">
|
||||
<el-tooltip effect="dark" :offset="8" :content="t('chat.show_sql')" placement="top">
|
||||
<el-button class="tool-btn" text @click="showSql">
|
||||
<el-icon size="16">
|
||||
|
||||
@@ -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(() => {
|
||||
<el-input v-model="state.parameterForm['chat.sqlbot_name']" />
|
||||
</div>
|
||||
</div>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<div class="card-item">
|
||||
<div class="label">
|
||||
{{ t('parameter.model_thinking_process') }}
|
||||
@@ -140,6 +144,24 @@ onMounted(() => {
|
||||
</div>
|
||||
</div>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<div class="card-item">
|
||||
<div class="label">
|
||||
{{ t('parameter.hide_sql') }}
|
||||
</div>
|
||||
<div class="value">
|
||||
<el-switch v-model="state.parameterForm['chat.hide_sql']" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-item" style="margin-left: 16px">
|
||||
<div class="label">
|
||||
{{ t('parameter.hide_log') }}
|
||||
</div>
|
||||
<div class="value">
|
||||
<el-switch v-model="state.parameterForm['chat.hide_log']" />
|
||||
</div>
|
||||
</div>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<div class="card-item">
|
||||
<div class="label">
|
||||
|
||||
Reference in New Issue
Block a user