diff --git a/dashboard/src/assets/images/icon-no-shadow.svg b/dashboard/src/assets/images/icon-no-shadow.svg new file mode 100644 index 000000000..4268e03e2 --- /dev/null +++ b/dashboard/src/assets/images/icon-no-shadow.svg @@ -0,0 +1 @@ +
\ No newline at end of file diff --git a/dashboard/src/components/chat/Chat.vue b/dashboard/src/components/chat/Chat.vue index 082fa7af2..955797cbd 100644 --- a/dashboard/src/components/chat/Chat.vue +++ b/dashboard/src/components/chat/Chat.vue @@ -242,6 +242,7 @@ import ProviderModelSelector from '@/components/chat/ProviderModelSelector.vue'; import MessageList from '@/components/chat/MessageList.vue'; import 'highlight.js/styles/github.css'; import { useToast } from '@/utils/toast'; +import { useTheme } from 'vuetify'; export default { name: 'ChatPage', @@ -258,10 +259,12 @@ export default { }, setup() { const { t } = useI18n(); const { tm } = useModuleI18n('features/chat'); + const theme = useTheme(); return { t, tm, + theme, router, ref }; @@ -427,6 +430,7 @@ export default { const customizer = useCustomizerStore(); const newTheme = customizer.uiTheme === 'PurpleTheme' ? 'PurpleThemeDark' : 'PurpleTheme'; customizer.SET_UI_THEME(newTheme); + this.theme.global.name.value = newTheme; }, // 切换侧边栏折叠状态 toggleSidebar() { diff --git a/dashboard/src/components/shared/Logo.vue b/dashboard/src/components/shared/Logo.vue index 90196a903..5a2bfa90c 100644 --- a/dashboard/src/components/shared/Logo.vue +++ b/dashboard/src/components/shared/Logo.vue @@ -70,10 +70,6 @@ const formatTitle = (title: string) => { transition: transform 0.3s ease; } -.logo-image img:hover { - transform: scale(1.05); -} - .logo-text { display: flex; flex-direction: column; diff --git a/dashboard/src/i18n/locales/en-US/features/auth.json b/dashboard/src/i18n/locales/en-US/features/auth.json index 6e397a43e..5c44558a0 100644 --- a/dashboard/src/i18n/locales/en-US/features/auth.json +++ b/dashboard/src/i18n/locales/en-US/features/auth.json @@ -2,6 +2,7 @@ "login": "Login", "username": "Username", "password": "Password", + "defaultHint": "Default username and password: astrbot", "logo": { "title": "AstrBot Dashboard", "subtitle": "Welcome" diff --git a/dashboard/src/i18n/locales/zh-CN/features/auth.json b/dashboard/src/i18n/locales/zh-CN/features/auth.json index 41c510309..d6da99943 100644 --- a/dashboard/src/i18n/locales/zh-CN/features/auth.json +++ b/dashboard/src/i18n/locales/zh-CN/features/auth.json @@ -2,8 +2,9 @@ "login": "登录", "username": "用户名", "password": "密码", + "defaultHint": "默认账户和密码均为:astrbot", "logo": { - "title": "AstrBot 仪表盘", + "title": "AstrBot WebUI", "subtitle": "欢迎使用" }, "theme": { diff --git a/dashboard/src/layouts/full/vertical-header/VerticalHeader.vue b/dashboard/src/layouts/full/vertical-header/VerticalHeader.vue index f30dc2383..20340976f 100644 --- a/dashboard/src/layouts/full/vertical-header/VerticalHeader.vue +++ b/dashboard/src/layouts/full/vertical-header/VerticalHeader.vue @@ -10,6 +10,7 @@ import { useCommonStore } from '@/stores/common'; import MarkdownIt from 'markdown-it'; import { useI18n } from '@/i18n/composables'; import { router } from '@/router'; +import { useTheme } from 'vuetify'; // 配置markdown-it,默认安全设置 const md = new MarkdownIt({ @@ -20,6 +21,7 @@ const md = new MarkdownIt({ }); const customizer = useCustomizerStore(); +const theme = useTheme(); const { t } = useI18n(); let dialog = ref(false); let accountWarning = ref(false) @@ -276,7 +278,9 @@ function updateDashboard() { } function toggleDarkMode() { - customizer.SET_UI_THEME(customizer.uiTheme === 'PurpleThemeDark' ? 'PurpleTheme' : 'PurpleThemeDark'); + const newTheme = customizer.uiTheme === 'PurpleThemeDark' ? 'PurpleTheme' : 'PurpleThemeDark'; + customizer.SET_UI_THEME(newTheme); + theme.global.name.value = newTheme; } getVersion(); diff --git a/dashboard/src/main.ts b/dashboard/src/main.ts index 5c7b8c096..958eded22 100644 --- a/dashboard/src/main.ts +++ b/dashboard/src/main.ts @@ -18,24 +18,38 @@ setupI18n().then(() => { const app = createApp(App); app.use(router); - app.use(createPinia()); + const pinia = createPinia(); + app.use(pinia); app.use(print); app.use(VueApexCharts); app.use(vuetify); app.use(confirmPlugin); app.mount('#app'); + + // 挂载后同步 Vuetify 主题 + import('./stores/customizer').then(({ useCustomizerStore }) => { + const customizer = useCustomizerStore(pinia); + vuetify.theme.global.name.value = customizer.uiTheme; + }); }).catch(error => { console.error('❌ 新i18n系统初始化失败:', error); // 即使i18n初始化失败,也要挂载应用(使用回退机制) const app = createApp(App); app.use(router); - app.use(createPinia()); + const pinia = createPinia(); + app.use(pinia); app.use(print); app.use(VueApexCharts); app.use(vuetify); app.use(confirmPlugin); app.mount('#app'); + + // 挂载后同步 Vuetify 主题 + import('./stores/customizer').then(({ useCustomizerStore }) => { + const customizer = useCustomizerStore(pinia); + vuetify.theme.global.name.value = customizer.uiTheme; + }); }); diff --git a/dashboard/src/views/authentication/auth/LoginPage.vue b/dashboard/src/views/authentication/auth/LoginPage.vue index c634cdd92..c647dc8e5 100644 --- a/dashboard/src/views/authentication/auth/LoginPage.vue +++ b/dashboard/src/views/authentication/auth/LoginPage.vue @@ -1,24 +1,25 @@ diff --git a/dashboard/src/views/authentication/authForms/AuthLogin.vue b/dashboard/src/views/authentication/authForms/AuthLogin.vue index 4416f3988..0fcfcd26d 100644 --- a/dashboard/src/views/authentication/authForms/AuthLogin.vue +++ b/dashboard/src/views/authentication/authForms/AuthLogin.vue @@ -1,9 +1,8 @@