mirror of
https://gh-proxy.org/https://github.com/klinsmaya/SQLBot.git
synced 2026-11-10 02:07:12 +08:00
perf: Optimize DataEase integration with Advanced Assistant
This commit is contained in:
committed by
fit2cloud-chenyw
parent
e626d13971
commit
b9ce9d3ddf
@@ -107,7 +107,10 @@ class HttpService {
|
||||
!!(assistantStore.getType % 2) &&
|
||||
assistantStore.getCertificate
|
||||
) {
|
||||
if (config.method?.toLowerCase() === 'get' && /\/chat\/\d+$/.test(config.url || '')) {
|
||||
if (
|
||||
(config.method?.toLowerCase() === 'get' && /\/chat\/\d+$/.test(config.url || '')) ||
|
||||
config.url?.includes('/system/assistant/ds')
|
||||
) {
|
||||
await assistantStore.refreshCertificate()
|
||||
}
|
||||
config.headers['X-SQLBOT-ASSISTANT-CERTIFICATE'] = btoa(
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script lang="ts" setup>
|
||||
import { onMounted, ref, computed, shallowRef } from 'vue'
|
||||
import { onMounted, ref, computed, shallowRef, onBeforeUnmount, onBeforeMount } from 'vue'
|
||||
import icon_close_outlined from '@/assets/svg/operate/ope-close.svg'
|
||||
import icon_add_outlined from '@/assets/svg/icon_add_outlined.svg'
|
||||
import EmptyBackground from '@/views/dashboard/common/EmptyBackground.vue'
|
||||
@@ -123,12 +123,26 @@ function createChat(datasource: number) {
|
||||
})
|
||||
}
|
||||
|
||||
const drawerHeight = ref(0)
|
||||
const setHeight = () => {
|
||||
drawerHeight.value = document.body.clientHeight - 100
|
||||
console.log(drawerHeight.value)
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
if (props.hidden) {
|
||||
return
|
||||
}
|
||||
})
|
||||
|
||||
onBeforeMount(() => {
|
||||
setHeight()
|
||||
window.addEventListener('resize', setHeight)
|
||||
})
|
||||
onBeforeUnmount(() => {
|
||||
window.removeEventListener('resize', setHeight)
|
||||
})
|
||||
|
||||
const handleAddDatasource = () => {
|
||||
addDrawerRef.value.handleAddDatasource()
|
||||
}
|
||||
@@ -145,7 +159,7 @@ defineExpose({
|
||||
<el-drawer
|
||||
v-model="datasourceConfigVisible"
|
||||
:close-on-click-modal="false"
|
||||
size="calc(100% - 100px)"
|
||||
:size="drawerHeight"
|
||||
modal-class="datasource-drawer-chat"
|
||||
direction="btt"
|
||||
:before-close="beforeClose"
|
||||
|
||||
@@ -57,6 +57,6 @@ onMounted(() => {
|
||||
background: #f7f8fa;
|
||||
box-sizing: border-box;
|
||||
overflow: auto;
|
||||
padding-bottom: 48px;
|
||||
// padding-bottom: 48px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -235,6 +235,6 @@ onBeforeUnmount(() => {
|
||||
background: #f7f8fa;
|
||||
box-sizing: border-box;
|
||||
overflow: auto;
|
||||
padding-bottom: 48px;
|
||||
//padding-bottom: 48px;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user