Skip to content

Commit

Permalink
支持智谱AI大模型
Browse files Browse the repository at this point in the history
  • Loading branch information
classfang committed Apr 30, 2024
1 parent e083f0e commit e09d41b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 8 deletions.
11 changes: 5 additions & 6 deletions src/renderer/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const arcoDesignLocales = {
}
const data = reactive({
isLoad: false,
isWelcomeFinish: false,
sidebarConfig: [
{
name: 'chat',
Expand Down Expand Up @@ -81,7 +81,7 @@ const data = reactive({
] as { name: PageName; icon: string }[],
alivePages: ['chat'] as PageName[]
})
const { isLoad, sidebarConfig, alivePages } = toRefs(data)
const { isWelcomeFinish, sidebarConfig, alivePages } = toRefs(data)
// 主题设置监听
let stopDarkThemeListener: any = null
Expand Down Expand Up @@ -162,9 +162,8 @@ onMounted(() => {
locale.value = settingStore.app.locale
// 刷新 dayKey,用于更具日期自动刷新组件
systemStore.startDayKeyInterval()
// 显示主界面,防止夜间主题从白色闪烁到黑色
// 延迟监听加载状态
setTimeout(() => {
data.isLoad = true
watchLoading()
}, 3000)
})
Expand All @@ -173,8 +172,8 @@ onMounted(() => {
<template>
<a-config-provider :locale="arcoDesignLocal">
<!-- 欢迎页 -->
<WelcomePage v-if="!isLoad" />
<div class="app fade-in-from" :class="{ 'fade-in-to': isLoad }">
<WelcomePage v-if="!isWelcomeFinish" v-model:finish="isWelcomeFinish" />
<div class="app fade-in-from" :class="{ 'fade-in-to': isWelcomeFinish }">
<!-- 侧边栏 -->
<div class="app-sidebar drag-area">
<div :class="{ 'app-sidebar-avatar-macos': getPlatform().isMacOS }">
Expand Down
18 changes: 16 additions & 2 deletions src/renderer/src/components/views/welcome-page/WelcomePage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,20 @@ import AssistantAvatar from '@renderer/components/avatar/AssistantAvatar.vue'
import { simulateThreadWait } from '@renderer/utils/thread-util'
import { nextTick, onMounted, reactive, toRefs } from 'vue'
const finish = defineModel<boolean>('finish', { default: () => false })
const data = reactive({
providers: ['OpenAI', 'Ollama', 'Gemini', 'Tongyi', 'ERNIE', 'Spark', 'Tiangong', 'MoonshotAI'],
providers: [
'OpenAI',
'Ollama',
'Gemini',
'ZhipuAI',
'Tongyi',
'ERNIE',
'Spark',
'Tiangong',
'MoonshotAI'
],
providerShowIndex: -1
})
const { providers, providerShowIndex } = toRefs(data)
Expand All @@ -16,6 +28,8 @@ onMounted(() => {
await simulateThreadWait(200)
providerShowIndex.value++
}
await simulateThreadWait(2000)
finish.value = true
})
})
</script>
Expand Down Expand Up @@ -48,7 +62,7 @@ onMounted(() => {
justify-content: center;
.provider-list {
width: calc(50px * 4 + 40px * 3);
width: calc(50px * 5 + 40px * 4);
display: flex;
flex-wrap: wrap;
gap: 40px;
Expand Down

0 comments on commit e09d41b

Please sign in to comment.