Skip to content

Commit 538bbc4

Browse files
perf: Assistant header display name
1 parent 86b6415 commit 538bbc4

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

backend/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "sqlbot"
3-
version = "1.0.0"
3+
version = "1.0.1"
44
description = ""
55
requires-python = ">=3.10,<3.13"
66
dependencies = [

frontend/public/assistant.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
const getChatContainerHtml = (data) => {
6969
return `
7070
<div id="sqlbot-assistant-chat-container">
71-
<iframe id="sqlbot-assistant-chat-iframe-${data.id}" allow="microphone;clipboard-read 'src'; clipboard-write 'src'" src="${data.domain_url}/#/assistant?id=${data.id}&online=${!!data.online}"></iframe>
71+
<iframe id="sqlbot-assistant-chat-iframe-${data.id}" allow="microphone;clipboard-read 'src'; clipboard-write 'src'" src="${data.domain_url}/#/assistant?id=${data.id}&online=${!!data.online}&name=${encodeURIComponent(data.name)}"></iframe>
7272
<div class="sqlbot-assistant-operate">
7373
<div class="sqlbot-assistant-closeviewport sqlbot-assistant-viewportnone">
7474
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none">
@@ -460,7 +460,7 @@
460460
}
461461
const data = res.data
462462
const config_json = data.configuration
463-
let tempData = Object.assign(defaultData, { id, domain_url })
463+
let tempData = Object.assign(defaultData, { id, domain_url, name: data.name })
464464
if (config_json) {
465465
const config = JSON.parse(config_json)
466466
if (config) {

frontend/src/views/embedded/index.vue

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<icon_sidebar_outlined></icon_sidebar_outlined>
66
</el-icon>
77
<img :src="LOGO" class="logo" width="30px" height="30px" alt="" />
8-
<span class="tite">{{ $t('embedded.intelligent_customer_service') }}</span>
8+
<span class="tite">{{ assistantName || $t('embedded.intelligent_customer_service') }}</span>
99

1010
<el-tooltip effect="dark" :content="$t('embedded.new_conversation')" placement="top">
1111
<el-icon class="new-chat" size="20" @click="createChat">
@@ -31,7 +31,7 @@ import { useAssistantStore } from '@/stores/assistant'
3131
3232
const assistantStore = useAssistantStore()
3333
const route = useRoute()
34-
34+
const assistantName = ref('')
3535
const chatRef = ref()
3636
3737
const createChat = () => {
@@ -100,6 +100,11 @@ onBeforeMount(async () => {
100100
}
101101
const online = route.query.online
102102
setFormatOnline(online)
103+
104+
let name = route.query.name
105+
if (name) {
106+
assistantName.value = decodeURIComponent(name.toString())
107+
}
103108
const now = Date.now()
104109
assistantStore.setFlag(now)
105110
assistantStore.setId(assistantId?.toString() || '')

0 commit comments

Comments
 (0)