diff --git a/ui/src/api/theme.ts b/ui/src/api/theme.ts index b404df397..6e696e5fd 100644 --- a/ui/src/api/theme.ts +++ b/ui/src/api/theme.ts @@ -6,8 +6,8 @@ const prefix = '/display' /** * 查看外观设置 */ -const getThemeInfo: () => Promise> = () => { - return get(`${prefix}/info`) +const getThemeInfo: (loading?: Ref) => Promise> = (loading) => { + return get(`${prefix}/info`, undefined, loading) } /** diff --git a/ui/src/components/ai-chat/index.vue b/ui/src/components/ai-chat/index.vue index 5a48b655a..d1b51b722 100644 --- a/ui/src/components/ai-chat/index.vue +++ b/ui/src/components/ai-chat/index.vue @@ -136,11 +136,12 @@ @click="sendChatHandle" > - + diff --git a/ui/src/components/index.ts b/ui/src/components/index.ts index 33f111892..87cf7ca69 100644 --- a/ui/src/components/index.ts +++ b/ui/src/components/index.ts @@ -21,6 +21,7 @@ import MdEditor from './markdown/MdEditor.vue' import MdPreview from './markdown/MdPreview.vue' import LogoFull from './logo/LogoFull.vue' import LogoIcon from './logo/LogoIcon.vue' +import SendIcon from './logo/SendIcon.vue' export default { install(app: App) { @@ -46,5 +47,6 @@ export default { app.component(MdEditor.name, MdEditor) app.component(LogoFull.name, LogoFull) app.component(LogoIcon.name, LogoIcon) + app.component(SendIcon.name, SendIcon) } } diff --git a/ui/src/components/logo/SendIcon.vue b/ui/src/components/logo/SendIcon.vue new file mode 100644 index 000000000..933976c0b --- /dev/null +++ b/ui/src/components/logo/SendIcon.vue @@ -0,0 +1,44 @@ + + + diff --git a/ui/src/stores/modules/user.ts b/ui/src/stores/modules/user.ts index fa8c5c9aa..c884f506a 100644 --- a/ui/src/stores/modules/user.ts +++ b/ui/src/stores/modules/user.ts @@ -1,9 +1,10 @@ import { defineStore } from 'pinia' +import { type Ref } from 'vue' import type { User } from '@/api/type/user' + import UserApi from '@/api/user' import ThemeApi from '@/api/theme' import { useElementPlusTheme } from 'use-element-plus-theme' -const { changeTheme } = useElementPlusTheme() export interface userStateTypes { userType: number // 1 系统操作者 2 对话用户 @@ -35,6 +36,7 @@ const useUserStore = defineStore({ return !this.themeInfo?.theme || this.themeInfo?.theme === '#3370FF' }, setTheme(data: any) { + const { changeTheme } = useElementPlusTheme(this.themeInfo?.theme) changeTheme(data?.['theme']) this.themeInfo = data }, @@ -97,8 +99,8 @@ const useUserStore = defineStore({ }) }, - async theme() { - return await ThemeApi.getThemeInfo().then((ok) => { + async theme(loading?: Ref) { + return await ThemeApi.getThemeInfo(loading).then((ok) => { this.setTheme(ok.data) window.document.title = this.themeInfo['title'] || 'MaxKB' // const link = document.querySelector('link[rel="icon"]') as any diff --git a/ui/src/views/application-workflow/index.vue b/ui/src/views/application-workflow/index.vue index 906249748..48542913d 100644 --- a/ui/src/views/application-workflow/index.vue +++ b/ui/src/views/application-workflow/index.vue @@ -56,7 +56,7 @@ :class="enlarge ? 'enlarge' : ''" v-if="showDebug" > -
+

{{ detail?.name || $t('views.application.applicationForm.form.appName.label') }} @@ -94,10 +94,13 @@ import { datetimeFormat } from '@/utils/time' import useStore from '@/stores' import { WorkFlowInstance } from '@/workflow/common/validate' -const { application } = useStore() +const { user, application } = useStore() const router = useRouter() const route = useRoute() +const isDefaultTheme = computed(() => { + return user.isDefaultTheme() +}) const { params: { id } } = route as any diff --git a/ui/src/views/chat/index.vue b/ui/src/views/chat/index.vue index be0631909..43d1d4af3 100644 --- a/ui/src/views/chat/index.vue +++ b/ui/src/views/chat/index.vue @@ -20,7 +20,7 @@ const currentTemplate = computed(() => { if (mode && mode === 'embed') { modeName = 'embed' } else { - modeName = show_history.value ? 'pc' : 'base' + modeName = show_history.value || !user.showXpack() ? 'pc' : 'base' } const name = `/src/views/chat/${modeName}/index.vue` diff --git a/ui/src/views/login/index.vue b/ui/src/views/login/index.vue index e30ea0940..694886d5e 100644 --- a/ui/src/views/login/index.vue +++ b/ui/src/views/login/index.vue @@ -1,5 +1,5 @@