11<script setup lang="ts">
22import { getCurrentWebviewWindow } from ' @tauri-apps/api/webviewWindow'
3- import { Flex } from ' ant-design-vue'
3+ import { Flex , Spin } from ' ant-design-vue'
44import { computed , ref , watch } from ' vue'
55import { useI18n } from ' vue-i18n'
66
@@ -14,13 +14,15 @@ import UpdateApp from '@/components/update-app/index.vue'
1414import { useTray } from ' @/composables/useTray'
1515import { useAppStore } from ' @/stores/app'
1616import { useGeneralStore } from ' @/stores/general'
17+ import { useModelStore } from ' @/stores/model'
1718import { isMac } from ' @/utils/platform'
1819
1920useTray ()
2021const appStore = useAppStore ()
2122const current = ref (0 )
2223const { t } = useI18n ()
2324const generalStore = useGeneralStore ()
25+ const modelStore = useModelStore ()
2426const appWindow = getCurrentWebviewWindow ()
2527
2628watch (() => generalStore .appearance .language , () => {
@@ -57,52 +59,59 @@ const menus = computed(() => [
5759 </script >
5860
5961<template >
60- <Flex class =" h-screen" >
61- <div
62- class =" h-full w-30 flex flex-col items-center gap-4 overflow-auto dark:(bg-color-3 bg-none) bg-gradient-from-primary-1 bg-gradient-to-black/1 bg-gradient-linear"
63- :class =" [isMac ? 'pt-8' : 'pt-4']"
64- data-tauri-drag-region
65- >
66- <div class =" flex flex-col items-center gap-2" >
67- <div class =" b b-color-2 rounded-2xl b-solid" >
68- <img
69- class =" size-15"
70- data-tauri-drag-region
71- src =" /logo.png"
72- >
73- </div >
62+ <UpdateApp />
7463
75- <span class =" font-bold" >{{ appStore.name }}</span >
76- </div >
64+ <Spin
65+ class =" max-h-unset!"
66+ size =" large"
67+ :spinning =" !modelStore.modelReady"
68+ :tip =" t('pages.main.hints.switching')"
69+ >
70+ <Flex class =" h-screen" >
71+ <div
72+ class =" h-full w-30 flex flex-col items-center gap-4 overflow-auto dark:(bg-color-3 bg-none) bg-gradient-from-primary-1 bg-gradient-to-black/1 bg-gradient-linear"
73+ :class =" [isMac ? 'pt-8' : 'pt-4']"
74+ data-tauri-drag-region
75+ >
76+ <div class =" flex flex-col items-center gap-2" >
77+ <div class =" b b-color-2 rounded-2xl b-solid" >
78+ <img
79+ class =" size-15"
80+ data-tauri-drag-region
81+ src =" /logo.png"
82+ >
83+ </div >
84+
85+ <span class =" font-bold" >{{ appStore.name }}</span >
86+ </div >
7787
78- <div class =" flex flex-col gap-2" >
79- <div
80- v-for =" (item, index) in menus"
81- :key =" item.label"
82- class =" size-20 flex flex-col cursor-pointer items-center justify-center gap-2 rounded-lg hover:bg-color-7 dark:text-color-2 text-color-3 transition"
83- :class =" { 'bg-color-2! text-primary-5 dark:text-primary-7 font-bold dark:bg-color-8!': current === index }"
84- @click =" current = index"
85- >
88+ <div class =" flex flex-col gap-2" >
8689 <div
87- class =" size-8"
88- :class =" item.icon"
89- />
90+ v-for =" (item, index) in menus"
91+ :key =" item.label"
92+ class =" size-20 flex flex-col cursor-pointer items-center justify-center gap-2 rounded-lg hover:bg-color-7 dark:text-color-2 text-color-3 transition"
93+ :class =" { 'bg-color-2! text-primary-5 dark:text-primary-7 font-bold dark:bg-color-8!': current === index }"
94+ @click =" current = index"
95+ >
96+ <div
97+ class =" size-8"
98+ :class =" item.icon"
99+ />
90100
91- <span >{{ item.label }}</span >
101+ <span >{{ item.label }}</span >
102+ </div >
92103 </div >
93104 </div >
94- </div >
95-
96- <div
97- v-for =" (item, index) in menus"
98- v-show =" current === index"
99- :key =" item.label"
100- class =" flex-1 overflow-auto bg-color-8 dark:bg-color-2 p-4"
101- data-tauri-drag-region
102- >
103- <component :is =" item.component" />
104- </div >
105- </Flex >
106105
107- <UpdateApp />
106+ <div
107+ v-for =" (item, index) in menus"
108+ v-show =" current === index"
109+ :key =" item.label"
110+ class =" flex-1 overflow-auto bg-color-8 dark:bg-color-2 p-4"
111+ data-tauri-drag-region
112+ >
113+ <component :is =" item.component" />
114+ </div >
115+ </Flex >
116+ </Spin >
108117</template >
0 commit comments