From 660e5ad101e41dffa94c5775491108f359cd8359 Mon Sep 17 00:00:00 2001 From: MHSanaei Date: Wed, 21 Feb 2024 15:32:18 +0330 Subject: [dark] change message by theme Co-Authored-By: Alireza Ahmadi --- web/html/common/head.html | 1 + web/html/xui/component/themeSwitch.html | 5 +++++ web/html/xui/settings.html | 22 +++++++++++----------- 3 files changed, 17 insertions(+), 11 deletions(-) (limited to 'web/html') diff --git a/web/html/common/head.html b/web/html/common/head.html index 6ae7247c..9d7919b6 100644 --- a/web/html/common/head.html +++ b/web/html/common/head.html @@ -38,4 +38,5 @@ {{ .host }}-{{ i18n .title}} +
{{end}} \ No newline at end of file diff --git a/web/html/xui/component/themeSwitch.html b/web/html/xui/component/themeSwitch.html index 3bc1ad7d..9ca080d9 100644 --- a/web/html/xui/component/themeSwitch.html +++ b/web/html/xui/component/themeSwitch.html @@ -21,6 +21,7 @@ this.isDarkTheme = !this.isDarkTheme; localStorage.setItem('dark-mode', this.isDarkTheme); document.querySelector('body').setAttribute('class', this.isDarkTheme ? 'dark' : 'light') + document.getElementById('message').className = themeSwitcher.currentTheme; }, }; } @@ -31,6 +32,10 @@ props: [], template: `{{template "component/themeSwitchTemplate"}}`, data: () => ({ themeSwitcher }), + mounted() { + this.$message.config({getContainer: () => document.getElementById('message')}); + document.getElementById('message').className = themeSwitcher.currentTheme; + } }); {{end}} \ No newline at end of file diff --git a/web/html/xui/settings.html b/web/html/xui/settings.html index c6edc506..62c53379 100644 --- a/web/html/xui/settings.html +++ b/web/html/xui/settings.html @@ -95,23 +95,23 @@ - - - + + + {{ i18n "pages.settings.save" }} {{ i18n "pages.settings.restartPanel" }} -