diff --git a/web/src/components/ChatComponent.vue b/web/src/components/ChatComponent.vue index 0943c333..8fc760e6 100644 --- a/web/src/components/ChatComponent.vue +++ b/web/src/components/ChatComponent.vue @@ -122,7 +122,7 @@ 知识图谱 @@ -786,6 +786,7 @@ watch( text-align: left; word-wrap: break-word; margin: 0; + max-width: 100%; padding-bottom: 0; padding-top: 16px; padding-left: 0; @@ -821,10 +822,10 @@ watch( max-width: 900px; margin: 0 auto; padding: 0.25rem 0.5rem; - border: 2px solid #E5E5E5; + border: 2px solid var(--gray-200); border-radius: 1rem; - background: #fcfdfd; - transition: background 0.3s, box-shadow 0.3s; + background: var(--gray-50); + transition: background, border 0.3s, box-shadow 0.3s; &:focus-within { border: 2px solid var(--main-500); background: white; @@ -1068,6 +1069,7 @@ watch( } .message-md { + max-width: 100%; h1, h2, h3, h4, h5, h6 { font-size: 1rem; } diff --git a/web/src/layouts/AppLayout.vue b/web/src/layouts/AppLayout.vue index c6f61ca0..48b41abd 100644 --- a/web/src/layouts/AppLayout.vue +++ b/web/src/layouts/AppLayout.vue @@ -35,6 +35,10 @@ const layoutSettings = reactive({ useTopBar: false, // 是否使用顶栏 }) +// Add state for GitHub stars +const githubStars = ref(0) +const isLoadingStars = ref(false) + const getRemoteConfig = () => { configStore.refreshConfig() } @@ -46,9 +50,24 @@ const getRemoteDatabase = () => { databaseStore.refreshDatabase() } +// Fetch GitHub stars count +const fetchGithubStars = async () => { + try { + isLoadingStars.value = true + const response = await fetch('https://api.github.com/repos/xerrors/Yuxi-Know') + const data = await response.json() + githubStars.value = data.stargazers_count + } catch (error) { + console.error('Error fetching GitHub stars:', error) + } finally { + isLoadingStars.value = false + } +} + onMounted(() => { getRemoteConfig() getRemoteDatabase() + fetchGithubStars() // Fetch GitHub stars on mount }) // 打印当前页面的路由信息,使用 vue3 的 setup composition API @@ -114,8 +133,11 @@ console.log(route)
@@ -231,6 +253,30 @@ div.header, #app-router-view { background-color: transparent; border: 1px solid transparent; } + + .github-link { + display: flex; + flex-direction: column; + align-items: center; + color: inherit; + } + + .github-stars { + display: flex; + align-items: center; + font-size: 12px; + margin-top: 4px; + + .star-icon { + color: #f0a742; + font-size: 12px; + margin-right: 2px; + } + + .star-count { + font-weight: 600; + } + } } &.setting { @@ -389,7 +435,6 @@ div.header, #app-router-view { font-size: 15px; } - &.github, &.setting { padding: 8px 12px; @@ -406,11 +451,21 @@ div.header, #app-router-view { &.github { a { display: flex; - justify-content: center; align-items: center; } + + .github-stars { + display: flex; + align-items: center; + margin-left: 6px; + + .star-icon { + color: #f0a742; + font-size: 14px; + margin-right: 2px; + } + } } } } - - + \ No newline at end of file