diff --git a/dashboard/index.html b/dashboard/index.html index f71608a69..367bec27b 100644 --- a/dashboard/index.html +++ b/dashboard/index.html @@ -8,7 +8,7 @@ AstrBot - 仪表盘 diff --git a/dashboard/package.json b/dashboard/package.json index 35c248ad2..a643c65f2 100644 --- a/dashboard/package.json +++ b/dashboard/package.json @@ -14,22 +14,26 @@ }, "dependencies": { "@guolao/vue-monaco-editor": "^1.5.4", + "@mdit/plugin-katex": "^0.24.1", "@tiptap/starter-kit": "2.1.7", "@tiptap/vue-3": "2.1.7", "apexcharts": "3.42.0", "axios": ">=1.6.2 <1.10.0 || >1.10.0 <2.0.0", "axios-mock-adapter": "^1.22.0", "chance": "1.1.11", - "d3": "^7.9.0", "date-fns": "2.30.0", "highlight.js": "^11.11.1", "js-md5": "^0.8.3", + "katex": "^0.16.27", "lodash": "4.17.21", - "marked": "^15.0.7", - "markdown-it": "^14.1.0", - "pinyin-pro": "^3.26.0", + "markstream-vue": "0.0.3-beta.7", + "mermaid": "^11.12.2", "pinia": "2.1.6", + "pinyin-pro": "^3.26.0", "remixicon": "3.5.0", + "shiki": "^3.20.0", + "stream-markdown": "^0.0.11", + "stream-monaco": "^0.0.8", "vee-validate": "4.11.3", "vite-plugin-vuetify": "1.0.2", "vue": "3.3.4", @@ -44,7 +48,6 @@ "@mdi/font": "7.2.96", "@rushstack/eslint-patch": "1.3.3", "@types/chance": "1.1.3", - "@types/markdown-it": "^14.1.2", "@types/node": "^20.5.7", "@vitejs/plugin-vue": "4.3.3", "@vue/eslint-config-prettier": "8.0.0", diff --git a/dashboard/src/assets/images/xmas-hat.png b/dashboard/src/assets/images/xmas-hat.png new file mode 100644 index 000000000..f1e469dce Binary files /dev/null and b/dashboard/src/assets/images/xmas-hat.png differ diff --git a/dashboard/src/components/chat/Chat.vue b/dashboard/src/components/chat/Chat.vue index a73bad4d1..dcc52d4a5 100644 --- a/dashboard/src/components/chat/Chat.vue +++ b/dashboard/src/components/chat/Chat.vue @@ -34,13 +34,23 @@
-
+
+ +
+
Hello, I'm AstrBot ⭐
@@ -139,6 +149,7 @@ const isMobile = ref(false); const mobileMenuOpen = ref(false); const imagePreviewDialog = ref(false); const previewImageUrl = ref(''); +const isLoadingMessages = ref(false); // 使用 composables const { @@ -295,7 +306,14 @@ async function handleSelectConversation(sessionIds: string[]) { // 清除引用状态 clearReply(); - await getSessionMsg(sessionIds[0], router); + // 开始加载消息 + isLoadingMessages.value = true; + + try { + await getSessionMsg(sessionIds[0], router); + } finally { + isLoadingMessages.value = false; + } nextTick(() => { messageList.value?.scrollToBottom(); @@ -540,6 +558,7 @@ onBeforeUnmount(() => { justify-content: center; align-items: center; flex-direction: column; + position: relative; } .welcome-title { @@ -547,6 +566,12 @@ onBeforeUnmount(() => { margin-bottom: 16px; } +.loading-overlay-welcome { + display: flex; + justify-content: center; + align-items: center; +} + .bot-name { font-weight: 700; margin-left: 8px; diff --git a/dashboard/src/components/chat/ConversationSidebar.vue b/dashboard/src/components/chat/ConversationSidebar.vue index b3af11f50..c7e948ae5 100644 --- a/dashboard/src/components/chat/ConversationSidebar.vue +++ b/dashboard/src/components/chat/ConversationSidebar.vue @@ -113,8 +113,19 @@ {{ chatboxMode ? tm('actions.exitFullscreen') : tm('actions.fullscreen') }} + + + + + {{ tm('actions.providerConfig') }} +
+ + +
@@ -124,6 +135,7 @@ import { useI18n, useModuleI18n } from '@/i18n/composables'; import type { Session } from '@/composables/useSessions'; import LanguageSwitcher from '@/components/shared/LanguageSwitcher.vue'; import StyledMenu from '@/components/shared/StyledMenu.vue'; +import ProviderConfigDialog from '@/components/chat/ProviderConfigDialog.vue'; interface Props { sessions: Session[]; @@ -151,6 +163,7 @@ const { t } = useI18n(); const { tm } = useModuleI18n('features/chat'); const sidebarCollapsed = ref(true); +const showProviderConfigDialog = ref(false); // 从 localStorage 读取侧边栏折叠状态 const savedCollapsedState = localStorage.getItem('sidebarCollapsed'); diff --git a/dashboard/src/components/chat/MessageList.vue b/dashboard/src/components/chat/MessageList.vue index 6495760b9..c1dd5d614 100644 --- a/dashboard/src/components/chat/MessageList.vue +++ b/dashboard/src/components/chat/MessageList.vue @@ -1,7 +1,11 @@