Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
new-api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
30a4f9ed
authored
Dec 16, 2024
by
Calcium-Ion
Committed by
GitHub
Dec 16, 2024
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #628 from Calcium-Ion/pr482-merge
merge 428
parents
cd6b3296
d0d8f6eb
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
1 deletions
+28
-1
README.md
+1
-0
web/src/components/HeaderBar.js
+14
-1
web/src/pages/Home/index.js
+13
-0
No files found.
README.md
View file @
30a4f9ed
...
@@ -64,6 +64,7 @@
...
@@ -64,6 +64,7 @@
13.
🎵 添加
[
Suno API
](
https://github.com/Suno-API/Suno-API
)
接口支持,
[
对接文档
](
Suno.md
)
13.
🎵 添加
[
Suno API
](
https://github.com/Suno-API/Suno-API
)
接口支持,
[
对接文档
](
Suno.md
)
14.
🔄 支持Rerank模型,目前兼容Cohere和Jina,可接入Dify,
[
对接文档
](
Rerank.md
)
14.
🔄 支持Rerank模型,目前兼容Cohere和Jina,可接入Dify,
[
对接文档
](
Rerank.md
)
15.
⚡
**[OpenAI Realtime API](https://platform.openai.com/docs/guides/realtime/integration)**
- 支持OpenAI的Realtime API,支持Azure渠道
15.
⚡
**[OpenAI Realtime API](https://platform.openai.com/docs/guides/realtime/integration)**
- 支持OpenAI的Realtime API,支持Azure渠道
16.
支持使用路由/chat2link 进入聊天界面
## 模型支持
## 模型支持
此版本额外支持以下模型:
此版本额外支持以下模型:
...
...
web/src/components/HeaderBar.js
View file @
30a4f9ed
...
@@ -14,6 +14,7 @@ import {
...
@@ -14,6 +14,7 @@ import {
IconHelpCircle
,
IconHelpCircle
,
IconHome
,
IconHome
,
IconHomeStroked
,
IconIndentLeft
,
IconHomeStroked
,
IconIndentLeft
,
IconComment
,
IconKey
,
IconMenu
,
IconKey
,
IconMenu
,
IconNoteMoneyStroked
,
IconNoteMoneyStroked
,
IconPriceTag
,
IconPriceTag
,
...
@@ -87,16 +88,27 @@ const HeaderBar = () => {
...
@@ -87,16 +88,27 @@ const HeaderBar = () => {
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
theme
===
'dark'
)
{
if
(
theme
===
'dark'
)
{
document
.
body
.
setAttribute
(
'theme-mode'
,
'dark'
);
document
.
body
.
setAttribute
(
'theme-mode'
,
'dark'
);
}
else
{
document
.
body
.
removeAttribute
(
'theme-mode'
);
}
// 发送当前主题模式给子页面
const
iframe
=
document
.
querySelector
(
'iframe'
);
if
(
iframe
)
{
iframe
.
contentWindow
.
postMessage
({
themeMode
:
theme
},
'*'
);
}
}
if
(
isNewYear
)
{
if
(
isNewYear
)
{
console
.
log
(
'Happy New Year!'
);
console
.
log
(
'Happy New Year!'
);
}
}
},
[]);
},
[
theme
]);
useEffect
(()
=>
{
useEffect
(()
=>
{
const
handleLanguageChanged
=
(
lng
)
=>
{
const
handleLanguageChanged
=
(
lng
)
=>
{
setCurrentLang
(
lng
);
setCurrentLang
(
lng
);
const
iframe
=
document
.
querySelector
(
'iframe'
);
if
(
iframe
)
{
iframe
.
contentWindow
.
postMessage
({
lang
:
lng
},
'*'
);
}
};
};
i18n
.
on
(
'languageChanged'
,
handleLanguageChanged
);
i18n
.
on
(
'languageChanged'
,
handleLanguageChanged
);
...
@@ -125,6 +137,7 @@ const HeaderBar = () => {
...
@@ -125,6 +137,7 @@ const HeaderBar = () => {
pricing
:
'/pricing'
,
pricing
:
'/pricing'
,
detail
:
'/detail'
,
detail
:
'/detail'
,
home
:
'/'
,
home
:
'/'
,
chat
:
'/chat'
,
};
};
return
(
return
(
<
div
onClick
=
{(
e
)
=>
{
<
div
onClick
=
{(
e
)
=>
{
...
...
web/src/pages/Home/index.js
View file @
30a4f9ed
...
@@ -39,6 +39,19 @@ const Home = () => {
...
@@ -39,6 +39,19 @@ const Home = () => {
}
}
setHomePageContent
(
content
);
setHomePageContent
(
content
);
localStorage
.
setItem
(
'home_page_content'
,
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
},
'*'
);
};
}
}
}
else
{
}
else
{
showError
(
message
);
showError
(
message
);
setHomePageContent
(
'加载首页内容失败...'
);
setHomePageContent
(
'加载首页内容失败...'
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment