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
571301ad
authored
Aug 10, 2025
by
Calcium-Ion
Committed by
GitHub
Aug 10, 2025
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1541 from QuantumNous/fluent-read
feat: added "流畅阅读" (FluentRead) as a new chat provider option.
parents
abee65c1
991a09f4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
18 deletions
+31
-18
setting/chat.go
+3
-0
web/src/components/layout/SiderBar.js
+8
-0
web/src/components/table/tokens/index.jsx
+20
-18
No files found.
setting/chat.go
View file @
571301ad
...
...
@@ -13,6 +13,9 @@ var Chats = []map[string]string{
"Cherry Studio"
:
"cherrystudio://providers/api-keys?v=1&data={cherryConfig}"
,
},
{
"流畅阅读"
:
"fluentread"
,
},
{
"Lobe Chat 官方示例"
:
"https://chat-preview.lobehub.com/?settings={
\"
keyVaults
\"
:{
\"
openai
\"
:{
\"
apiKey
\"
:
\"
{key}
\"
,
\"
baseURL
\"
:
\"
{address}/v1
\"
}}}"
,
},
{
...
...
web/src/components/layout/SiderBar.js
View file @
571301ad
...
...
@@ -201,12 +201,20 @@ const SiderBar = ({ onNavigate = () => { } }) => {
if
(
Array
.
isArray
(
chats
))
{
let
chatItems
=
[];
for
(
let
i
=
0
;
i
<
chats
.
length
;
i
++
)
{
let
shouldSkip
=
false
;
let
chat
=
{};
for
(
let
key
in
chats
[
i
])
{
let
link
=
chats
[
i
][
key
];
if
(
typeof
link
!==
'string'
)
continue
;
// 确保链接是字符串
if
(
link
.
startsWith
(
'fluent'
))
{
shouldSkip
=
true
;
break
;
// 跳过 Fluent Read
}
chat
.
text
=
key
;
chat
.
itemKey
=
'chat'
+
i
;
chat
.
to
=
'/console/chat/'
+
i
;
}
if
(
shouldSkip
||
!
chat
.
text
)
continue
;
// 避免推入空项
chatItems
.
push
(
chat
);
}
setChatItems
(
chatItems
);
...
...
web/src/components/table/tokens/index.jsx
View file @
571301ad
...
...
@@ -88,27 +88,27 @@ function TokensPage() {
function
openFluentNotification
(
key
)
{
const
{
t
}
=
latestRef
.
current
;
const
SUPPRESS_KEY
=
'fluent_notify_suppressed'
;
if
(
localStorage
.
getItem
(
SUPPRESS_KEY
)
===
'1'
)
return
;
if
(
modelOptions
.
length
===
0
)
{
// fire-and-forget; a later effect will refresh the notice content
loadModels
()
}
if
(
!
key
&&
localStorage
.
getItem
(
SUPPRESS_KEY
)
===
'1'
)
return
;
const
container
=
document
.
getElementById
(
'fluent-new-api-container'
);
if
(
!
container
)
{
Toast
.
warning
(
t
(
'未检测到 Fluent
容器
,请确认扩展已启用'
));
Toast
.
warning
(
t
(
'未检测到 Fluent
Read(流畅阅读)
,请确认扩展已启用'
));
return
;
}
setPrefillKey
(
key
||
''
);
setFluentNoticeOpen
(
true
);
if
(
modelOptions
.
length
===
0
)
{
// fire-and-forget; a later effect will refresh the notice content
loadModels
()
}
Notification
.
info
({
id
:
'fluent-detected'
,
title
:
t
(
'检测到 Fluent(流畅阅读)'
),
title
:
t
(
'检测到 Fluent
Read
(流畅阅读)'
),
content
:
(
<
div
>
<
div
style=
{
{
marginBottom
:
8
}
}
>
{
prefillK
ey
?
t
(
'
已检测到 Fluent 扩展,已从操作中指定密钥,将使用该密钥进行填充。请选择模型后继续
。'
)
:
t
(
'
已检测到 Fluent 扩展,请
选择模型后可一键填充当前选中令牌(或本页第一个令牌)。'
)
}
{
k
ey
?
t
(
'
请选择模型
。'
)
:
t
(
'选择模型后可一键填充当前选中令牌(或本页第一个令牌)。'
)
}
</
div
>
<
div
style=
{
{
marginBottom
:
8
}
}
>
<
Select
...
...
@@ -124,15 +124,17 @@ function TokensPage() {
</
div
>
<
Space
>
<
Button
theme=
"solid"
type=
"primary"
onClick=
{
handlePrefillToFluent
}
>
{
t
(
'一键填充到 Fluent'
)
}
</
Button
>
<
Button
type=
"warning"
onClick=
{
()
=>
{
localStorage
.
setItem
(
SUPPRESS_KEY
,
'1'
);
Notification
.
close
(
'fluent-detected'
);
Toast
.
info
(
t
(
'已关闭后续提醒'
));
}
}
>
{
t
(
'不再提醒'
)
}
{
t
(
'一键填充到 FluentRead'
)
}
</
Button
>
{
!
key
&&
(
<
Button
type=
"warning"
onClick=
{
()
=>
{
localStorage
.
setItem
(
SUPPRESS_KEY
,
'1'
);
Notification
.
close
(
'fluent-detected'
);
Toast
.
info
(
t
(
'已关闭后续提醒'
));
}
}
>
{
t
(
'不再提醒'
)
}
</
Button
>
)
}
<
Button
type=
"tertiary"
onClick=
{
()
=>
Notification
.
close
(
'fluent-detected'
)
}
>
{
t
(
'关闭'
)
}
</
Button
>
...
...
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