Merge pull request #927 from QuentinHsu/refactor-system-setting
# Conflicts: # web/src/App.js # web/src/components/ModelSetting.js # web/src/components/PersonalSetting.js # web/src/components/SystemSetting.js # web/src/pages/Channel/EditChannel.js
This commit is contained in:
@@ -40,19 +40,19 @@ const Home = () => {
|
||||
setHomePageContent(content);
|
||||
localStorage.setItem('home_page_content', content);
|
||||
|
||||
// 如果内容是 URL,则发送主题模式
|
||||
if (data.startsWith('https://')) {
|
||||
const iframe = document.querySelector('iframe');
|
||||
if (iframe) {
|
||||
const theme = localStorage.getItem('theme-mode') || 'light';
|
||||
// 测试是否正确传递theme-mode给iframe
|
||||
// console.log('Sending theme-mode to iframe:', theme);
|
||||
iframe.onload = () => {
|
||||
iframe.contentWindow.postMessage({ themeMode: theme }, '*');
|
||||
iframe.contentWindow.postMessage({ lang: i18n.language }, '*');
|
||||
};
|
||||
}
|
||||
// 如果内容是 URL,则发送主题模式
|
||||
if (data.startsWith('https://')) {
|
||||
const iframe = document.querySelector('iframe');
|
||||
if (iframe) {
|
||||
const theme = localStorage.getItem('theme-mode') || 'light';
|
||||
// 测试是否正确传递theme-mode给iframe
|
||||
// console.log('Sending theme-mode to iframe:', theme);
|
||||
iframe.onload = () => {
|
||||
iframe.contentWindow.postMessage({ themeMode: theme }, '*');
|
||||
iframe.contentWindow.postMessage({ lang: i18n.language }, '*');
|
||||
};
|
||||
}
|
||||
}
|
||||
} else {
|
||||
showError(message);
|
||||
setHomePageContent('加载首页内容失败...');
|
||||
@@ -95,7 +95,9 @@ const Home = () => {
|
||||
</span>
|
||||
}
|
||||
>
|
||||
<p>{t('名称')}:{statusState?.status?.system_name}</p>
|
||||
<p>
|
||||
{t('名称')}:{statusState?.status?.system_name}
|
||||
</p>
|
||||
<p>
|
||||
{t('版本')}:
|
||||
{statusState?.status?.version
|
||||
@@ -123,7 +125,9 @@ const Home = () => {
|
||||
Apache-2.0 License
|
||||
</a>
|
||||
</p>
|
||||
<p>{t('启动时间')}:{getStartTimeString()}</p>
|
||||
<p>
|
||||
{t('启动时间')}:{getStartTimeString()}
|
||||
</p>
|
||||
</Card>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
@@ -155,8 +159,8 @@ const Home = () => {
|
||||
<p>
|
||||
{t('OIDC 身份验证')}:
|
||||
{statusState?.status?.oidc === true
|
||||
? t('已启用')
|
||||
: t('未启用')}
|
||||
? t('已启用')
|
||||
: t('未启用')}
|
||||
</p>
|
||||
<p>
|
||||
{t('微信身份验证')}:
|
||||
|
||||
Reference in New Issue
Block a user