diff --git a/dashboard/src/App.vue b/dashboard/src/App.vue
index af23e75ff..4822d8489 100644
--- a/dashboard/src/App.vue
+++ b/dashboard/src/App.vue
@@ -15,20 +15,31 @@
@@ -713,14 +733,14 @@ const isChristmas = computed(() => {
+
+
+
+
{{ tm("backup.title") }}
{
toastStore.success(tm("common.saved"));
};
+const autoThemeSwitcher = computed({
+ get: () => customizer.autoSwitchTheme,
+ set: (value) => {
+ customizer.SET_AUTO_SYNC(value);
+ if (value) { customizer.APPLY_SYSTEM_THEME() };
+ }
+});
+
const wfr = ref(null);
const migrationDialog = ref(null);
const backupDialog = ref(null);
diff --git a/dashboard/src/views/authentication/auth/LoginPage.vue b/dashboard/src/views/authentication/auth/LoginPage.vue
index 84ce52075..c1f4cbe6d 100644
--- a/dashboard/src/views/authentication/auth/LoginPage.vue
+++ b/dashboard/src/views/authentication/auth/LoginPage.vue
@@ -7,7 +7,6 @@ import { useApiStore } from "@/stores/api";
import { useRouter } from "vue-router";
import { useCustomizerStore } from "@/stores/customizer";
import { useModuleI18n } from "@/i18n/composables";
-import { useTheme } from "vuetify";
const cardVisible = ref(false);
const router = useRouter();
@@ -15,7 +14,6 @@ const authStore = useAuthStore();
const apiStore = useApiStore();
const customizer = useCustomizerStore();
const { tm: t } = useModuleI18n("features/auth");
-const theme = useTheme();
const serverConfigDialog = ref(false);
const apiUrl = ref(apiStore.apiBaseUrl);
@@ -47,12 +45,7 @@ function isCustomPreset(name: string) {
// 主题切换函数
function toggleTheme() {
- const newTheme =
- customizer.uiTheme === "PurpleThemeDark"
- ? "PurpleTheme"
- : "PurpleThemeDark";
- customizer.SET_UI_THEME(newTheme);
- theme.global.name.value = newTheme;
+ customizer.TOGGLE_DARK_MODE();
}
onMounted(() => {
@@ -114,10 +107,10 @@ onMounted(() => {
size="small"
>
- mdi-white-balance-sunny
+ {{ customizer.isDarkTheme ? 'mdi-weather-night' : 'mdi-white-balance-sunny' }}
- {{ t("theme.switchToLight") }}
+ {{ customizer.isDarkTheme ? t('theme.switchToLight') : t('theme.switchToDark') }}