diff --git a/ui/index.html b/ui/index.html index 4e8168e01..c9c08e222 100644 --- a/ui/index.html +++ b/ui/index.html @@ -9,5 +9,13 @@
+ + diff --git a/ui/public/embeb.js b/ui/public/embeb.js index d80a03090..9811e7b89 100644 --- a/ui/public/embeb.js +++ b/ui/public/embeb.js @@ -1,6 +1,6 @@ - function embedChatbot() { - const t = window.maxkbChatConfig - if (t && t.token&&t.protocol&&t.host) { +function embedChatbot() { + const t = window.maxkbChatConfig + if (t && t.token && t.protocol && t.host) { icon = ` @@ -24,53 +24,54 @@ - `; - chat_button = document.createElement("div"); - chat_button.style = - "position: fixed;bottom: 40px;right: 20px;cursor: pointer;"; - chat_button.innerHTML = icon; - - chat_container = document.createElement("div"); - chat_container.id = "chat_container"; - chat_container.style.cssText = `z-index:10000;position: relative; + ` + chat_button = document.createElement('div') + chat_button.style = 'position: fixed;bottom: 30px;right: 0;cursor: pointer;' + chat_button.innerHTML = icon + + chat_container = document.createElement('div') + chat_container.id = 'chat_container' + chat_container.style.cssText = `z-index:10000;position: relative; width: 420px; height: 600px; - border: none; - border-radius: 7px 7px 7px 7px; - position: fixed;bottom: 40px;right: 20px`; - chat_container.style["display"] = "none"; - - chat = document.createElement("iframe"); + border-radius: 8px; + border: 1px solid var(--N300, #DEE0E3); + background: linear-gradient(188deg, rgba(235, 241, 255, 0.20) 39.6%, rgba(231, 249, 255, 0.20) 94.3%), #EFF0F1; + box-shadow: 0px 4px 8px 0px rgba(31, 35, 41, 0.10); + position: fixed;bottom: 20px;right: 45px;overflow: hidden;` + chat_container.style['display'] = 'none' - chat.src = `${window.maxkbChatConfig.protocol}//${window.maxkbChatConfig.host}/ui/chat/${window.maxkbChatConfig.token}`; - chat.id = "chat"; - chat_container.append(chat); - chat.style.cssText = `border: none;height:100%;width:100%`; - - close_button = document.createElement("div"); - - close_button.innerHTML = ` + chat = document.createElement('iframe') + + chat.src = `${window.maxkbChatConfig.protocol}//${window.maxkbChatConfig.host}/ui/chat/${window.maxkbChatConfig.token}` + chat.id = 'chat' + chat_container.append(chat) + chat.style.cssText = `border: none;height:100%;width:100%` + + close_button = document.createElement('div') + + close_button.innerHTML = ` - `; - close_button.style.cssText = `position: absolute; - top: 10px; + ` + close_button.style.cssText = `position: absolute; + top: 15px; right: 10px; cursor: pointer; - `; - close_button.onclick = () => { - chat_container.style["display"] = "none"; - chat_button.style["display"] = "block"; - }; - - chat_container.append(close_button); - document.body.append(chat_container); - - chat_button.onclick = ($event) => { - chat_container.style["display"] = "block"; - chat_button.style["display"] = "none"; - }; - sty=document.createElement("style") - sty.innerText=` #chat_container { + ` + close_button.onclick = () => { + chat_container.style['display'] = 'none' + chat_button.style['display'] = 'block' + } + + chat_container.append(close_button) + document.body.append(chat_container) + + chat_button.onclick = ($event) => { + chat_container.style['display'] = 'block' + chat_button.style['display'] = 'block' + } + sty = document.createElement('style') + sty.innerText = ` #chat_container { animation: appear .4s ease-in-out; } @keyframes appear { @@ -81,9 +82,10 @@ to { height: 600px; } - }` - document.head.append(sty) - document.body.append(chat_button); - } else console.error('invalid parameter') - } + } + ` + document.head.append(sty) + document.body.append(chat_button) + } else console.error('invalid parameter') +} window.onload = embedChatbot diff --git a/ui/src/assets/login.jpg b/ui/src/assets/login.jpg new file mode 100644 index 000000000..49ca5c3f3 Binary files /dev/null and b/ui/src/assets/login.jpg differ diff --git a/ui/src/assets/login.png b/ui/src/assets/login.png deleted file mode 100644 index 31e45d615..000000000 Binary files a/ui/src/assets/login.png and /dev/null differ diff --git a/ui/src/components/ai-chat/index.vue b/ui/src/components/ai-chat/index.vue index b5697dde3..d478a924a 100644 --- a/ui/src/components/ai-chat/index.vue +++ b/ui/src/components/ai-chat/index.vue @@ -135,7 +135,6 @@ import applicationApi from '@/api/application' import { ChatManagement, type chatType } from '@/api/type/application' import { randomId } from '@/utils/utils' import useStore from '@/stores' -import { MdPreview } from 'md-editor-v3' import MdRenderer from '@/components/markdown-renderer/MdRenderer.vue' defineOptions({ name: 'AiChat' }) const route = useRoute() diff --git a/ui/src/components/login-layout/index.vue b/ui/src/components/login-layout/index.vue index 3aab70c1b..120ed6815 100644 --- a/ui/src/components/login-layout/index.vue +++ b/ui/src/components/login-layout/index.vue @@ -39,7 +39,7 @@ onMounted(() => { height: 100vh; .login-image { - background: url(@/assets/login.png) no-repeat; + background: url(@/assets/login.jpg) no-repeat; background-size: 100% 100%; width: 100%; height: 100%; diff --git a/ui/src/components/markdown-renderer/MdRenderer.vue b/ui/src/components/markdown-renderer/MdRenderer.vue index bc15c6da4..2d3eb3a86 100644 --- a/ui/src/components/markdown-renderer/MdRenderer.vue +++ b/ui/src/components/markdown-renderer/MdRenderer.vue @@ -3,7 +3,8 @@ ref="editorRef" editorId="preview-only" :modelValue="item" - v-for="item in md_view_list" + v-for="(item, index) in md_view_list" + :key="index" />