Skip to content

Commit 24be9de

Browse files
committed
chore: update copy
1 parent 5b349ef commit 24be9de

File tree

11 files changed

+60
-60
lines changed

11 files changed

+60
-60
lines changed

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ _✨ 通过标准的 OpenAI API 格式访问所有的大模型,开箱即用
8787
5. 支持**多机部署**[详见此处](#多机部署)
8888
6. 支持**令牌管理**,设置令牌的过期时间和额度。
8989
7. 支持**兑换码管理**,支持批量生成和导出兑换码,可使用兑换码为账户进行充值。
90-
8. 支持**通道管理**批量创建通道
90+
8. 支持**渠道管理**批量创建渠道
9191
9. 支持**用户分组**以及**渠道分组**,支持为不同分组设置不同的倍率。
9292
10. 支持渠道**设置模型列表**
9393
11. 支持**查看额度明细**
@@ -421,16 +421,16 @@ https://openai.justsong.cn
421421
+ 检查你的接口地址和 API Key 有没有填对。
422422
+ 检查是否启用了 HTTPS,浏览器会拦截 HTTPS 域名下的 HTTP 请求。
423423
6. 报错:`当前分组负载已饱和,请稍后再试`
424-
+ 上游通道 429 了。
424+
+ 上游渠道 429 了。
425425
7. 升级之后我的数据会丢失吗?
426426
+ 如果使用 MySQL,不会。
427427
+ 如果使用 SQLite,需要按照我所给的部署命令挂载 volume 持久化 one-api.db 数据库文件,否则容器重启后数据会丢失。
428428
8. 升级之前数据库需要做变更吗?
429429
+ 一般情况下不需要,系统将在初始化的时候自动调整。
430430
+ 如果需要的话,我会在更新日志中说明,并给出脚本。
431431
9. 手动修改数据库后报错:`数据库一致性已被破坏,请联系管理员`
432-
+ 这是检测到 ability 表里有些记录的通道 id 是不存在的,这大概率是因为你删了 channel 表里的记录但是没有同步在 ability 表里清理无效的通道
433-
+ 对于每一个通道,其所支持的模型都需要有一个专门的 ability 表的记录,表示该通道支持该模型
432+
+ 这是检测到 ability 表里有些记录的渠道 id 是不存在的,这大概率是因为你删了 channel 表里的记录但是没有同步在 ability 表里清理无效的渠道
433+
+ 对于每一个渠道,其所支持的模型都需要有一个专门的 ability 表的记录,表示该渠道支持该模型
434434

435435
## 相关项目
436436
* [FastGPT](https://github.com/labring/FastGPT): 基于 LLM 大语言模型的知识库问答系统

controller/channel-test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ func testChannels(notify bool, scope string) error {
197197
testAllChannelsRunning = false
198198
testAllChannelsLock.Unlock()
199199
if notify {
200-
err := message.Notify(message.ByAll, "通道测试完成", "", "通道测试完成,如果没有收到禁用通知,说明所有通道都正常")
200+
err := message.Notify(message.ByAll, "渠道测试完成", "", "渠道测试完成,如果没有收到禁用通知,说明所有渠道都正常")
201201
if err != nil {
202202
logger.SysError(fmt.Sprintf("failed to send email: %s", err.Error()))
203203
}

i18n/en.json

+17-17
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
"确认删除": "Confirm Delete",
99
"确认绑定": "Confirm Binding",
1010
"您正在删除自己的帐户,将清空所有数据且不可恢复": "You are deleting your account, all data will be cleared and unrecoverable.",
11-
"\"通道「%s」(#%d)已被禁用\"": "\"Channel %s (#%d) has been disabled\"",
12-
"通道「%s」(#%d)已被禁用,原因:%s": "Channel %s (#%d) has been disabled, reason: %s",
11+
"\"渠道「%s」(#%d)已被禁用\"": "\"Channel %s (#%d) has been disabled\"",
12+
"渠道「%s」(#%d)已被禁用,原因:%s": "Channel %s (#%d) has been disabled, reason: %s",
1313
"测试已在运行中": "Test is already running",
1414
"响应时间 %.2fs 超过阈值 %.2fs": "Response time %.2fs exceeds threshold %.2fs",
15-
"通道测试完成": "Channel test completed",
16-
"通道测试完成,如果没有收到禁用通知,说明所有通道都正常": "Channel test completed, if you have not received the disable notification, it means that all channels are normal",
15+
"渠道测试完成": "Channel test completed",
16+
"渠道测试完成,如果没有收到禁用通知,说明所有渠道都正常": "Channel test completed, if you have not received the disable notification, it means that all channels are normal",
1717
"无法连接至 GitHub 服务器,请稍后重试!": "Unable to connect to GitHub server, please try again later!",
1818
"返回值非法,用户字段为空,请稍后重试!": "The return value is illegal, the user field is empty, please try again later!",
1919
"管理员未开启通过 GitHub 登录以及注册": "The administrator did not turn on login and registration via GitHub",
@@ -119,11 +119,11 @@
119119
" 个月 ": " M ",
120120
" 年 ": " y ",
121121
"未测试": "Not tested",
122-
"通道 ${name} 测试成功,耗时 ${time.toFixed(2)} 秒。": "Channel ${name} test succeeded, time consumed ${time.toFixed(2)} s.",
123-
"已成功开始测试所有通道,请刷新页面查看结果。": "All channels have been successfully tested, please refresh the page to view the results.",
124-
"已成功开始测试所有已启用通道,请刷新页面查看结果。": "All enabled channels have been successfully tested, please refresh the page to view the results.",
125-
"通道 ${name} 余额更新成功!": "Channel ${name} balance updated successfully!",
126-
"已更新完毕所有已启用通道余额!": "The balance of all enabled channels has been updated!",
122+
"渠道 ${name} 测试成功,耗时 ${time.toFixed(2)} 秒。": "Channel ${name} test succeeded, time consumed ${time.toFixed(2)} s.",
123+
"已成功开始测试所有渠道,请刷新页面查看结果。": "All channels have been successfully tested, please refresh the page to view the results.",
124+
"已成功开始测试所有已启用渠道,请刷新页面查看结果。": "All enabled channels have been successfully tested, please refresh the page to view the results.",
125+
"渠道 ${name} 余额更新成功!": "Channel ${name} balance updated successfully!",
126+
"已更新完毕所有已启用渠道余额!": "The balance of all enabled channels has been updated!",
127127
"搜索渠道的 ID,名称和密钥 ...": "Search for channel ID, name and key ...",
128128
"名称": "Name",
129129
"分组": "Group",
@@ -141,9 +141,9 @@
141141
"启用": "Enable",
142142
"编辑": "Edit",
143143
"添加新的渠道": "Add a new channel",
144-
"测试所有通道": "Test all channels",
145-
"测试所有已启用通道": "Test all enabled channels",
146-
"更新所有已启用通道余额": "Update the balance of all enabled channels",
144+
"测试所有渠道": "Test all channels",
145+
"测试所有已启用渠道": "Test all enabled channels",
146+
"更新所有已启用渠道余额": "Update the balance of all enabled channels",
147147
"刷新": "Refresh",
148148
"处理中...": "Processing...",
149149
"绑定成功!": "Binding succeeded!",
@@ -207,11 +207,11 @@
207207
"监控设置": "Monitoring Settings",
208208
"最长响应时间": "Longest Response Time",
209209
"单位秒": "Unit in seconds",
210-
"当运行通道全部测试时": "When all operating channels are tested",
211-
"超过此时间将自动禁用通道": "Channels will be automatically disabled if this time is exceeded",
210+
"当运行渠道全部测试时": "When all operating channels are tested",
211+
"超过此时间将自动禁用渠道": "Channels will be automatically disabled if this time is exceeded",
212212
"额度提醒阈值": "Quota reminder threshold",
213213
"低于此额度时将发送邮件提醒用户": "Email will be sent to remind users when the quota is below this",
214-
"失败时自动禁用通道": "Automatically disable the channel when it fails",
214+
"失败时自动禁用渠道": "Automatically disable the channel when it fails",
215215
"保存监控设置": "Save Monitoring Settings",
216216
"额度设置": "Quota Settings",
217217
"新用户初始额度": "Initial quota for new users",
@@ -405,7 +405,7 @@
405405
"镜像": "Mirror",
406406
"请输入镜像站地址,格式为:https://domain.com,可不填,不填则使用渠道默认值": "Please enter the mirror site address, the format is: https://domain.com, it can be left blank, if left blank, the default value of the channel will be used",
407407
"模型": "Model",
408-
"请选择该通道所支持的模型": "Please select the model supported by the channel",
408+
"请选择该渠道所支持的模型": "Please select the model supported by the channel",
409409
"填入基础模型": "Fill in the basic model",
410410
"填入所有模型": "Fill in all models",
411411
"清除所有模型": "Clear all models",
@@ -515,7 +515,7 @@
515515
"请输入自定义渠道的 Base URL": "Please enter the Base URL of the custom channel",
516516
"Homepage URL 填": "Fill in the Homepage URL",
517517
"Authorization callback URL 填": "Fill in the Authorization callback URL",
518-
"请为通道命名": "Please name the channel",
518+
"请为渠道命名": "Please name the channel",
519519
"此项可选,用于修改请求体中的模型名称,为一个 JSON 字符串,键为请求中模型名称,值为要替换的模型名称,例如:": "This is optional, used to modify the model name in the request body, it's a JSON string, the key is the model name in the request, and the value is the model name to be replaced, for example:",
520520
"模型重定向": "Model redirection",
521521
"请输入渠道对应的鉴权密钥": "Please enter the authentication key corresponding to the channel",

monitor/channel.go

+7-7
Original file line numberDiff line numberDiff line change
@@ -31,25 +31,25 @@ func notifyRootUser(subject string, content string) {
3131
func DisableChannel(channelId int, channelName string, reason string) {
3232
model.UpdateChannelStatusById(channelId, common.ChannelStatusAutoDisabled)
3333
logger.SysLog(fmt.Sprintf("channel #%d has been disabled: %s", channelId, reason))
34-
subject := fmt.Sprintf("通道「%s」(#%d)已被禁用", channelName, channelId)
35-
content := fmt.Sprintf("通道「%s」(#%d)已被禁用,原因:%s", channelName, channelId, reason)
34+
subject := fmt.Sprintf("渠道「%s」(#%d)已被禁用", channelName, channelId)
35+
content := fmt.Sprintf("渠道「%s」(#%d)已被禁用,原因:%s", channelName, channelId, reason)
3636
notifyRootUser(subject, content)
3737
}
3838

3939
func MetricDisableChannel(channelId int, successRate float64) {
4040
model.UpdateChannelStatusById(channelId, common.ChannelStatusAutoDisabled)
4141
logger.SysLog(fmt.Sprintf("channel #%d has been disabled due to low success rate: %.2f", channelId, successRate*100))
42-
subject := fmt.Sprintf("通道 #%d 已被禁用", channelId)
43-
content := fmt.Sprintf("该渠道在最近 %d 次调用中成功率为 %.2f%%,低于阈值 %.2f%%,因此被系统自动禁用。",
44-
config.MetricQueueSize, successRate*100, config.MetricSuccessRateThreshold*100)
42+
subject := fmt.Sprintf("渠道 #%d 已被禁用", channelId)
43+
content := fmt.Sprintf("该渠道(#%d)在最近 %d 次调用中成功率为 %.2f%%,低于阈值 %.2f%%,因此被系统自动禁用。",
44+
channelId, config.MetricQueueSize, successRate*100, config.MetricSuccessRateThreshold*100)
4545
notifyRootUser(subject, content)
4646
}
4747

4848
// EnableChannel enable & notify
4949
func EnableChannel(channelId int, channelName string) {
5050
model.UpdateChannelStatusById(channelId, common.ChannelStatusEnabled)
5151
logger.SysLog(fmt.Sprintf("channel #%d has been enabled", channelId))
52-
subject := fmt.Sprintf("通道「%s」(#%d)已被启用", channelName, channelId)
53-
content := fmt.Sprintf("通道「%s」(#%d)已被启用", channelName, channelId)
52+
subject := fmt.Sprintf("渠道「%s」(#%d)已被启用", channelName, channelId)
53+
content := fmt.Sprintf("渠道「%s」(#%d)已被启用", channelName, channelId)
5454
notifyRootUser(subject, content)
5555
}

web/air/src/components/ChannelsTable.js

+13-13
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ const ChannelsTable = () => {
437437
if (success) {
438438
record.response_time = time * 1000;
439439
record.test_time = Date.now() / 1000;
440-
showInfo(`通道 ${record.name} 测试成功,耗时 ${time.toFixed(2)} 秒。`);
440+
showInfo(`渠道 ${record.name} 测试成功,耗时 ${time.toFixed(2)} 秒。`);
441441
} else {
442442
showError(message);
443443
}
@@ -447,7 +447,7 @@ const ChannelsTable = () => {
447447
const res = await API.get(`/api/channel/test?scope=${scope}`);
448448
const { success, message } = res.data;
449449
if (success) {
450-
showInfo('已成功开始测试通道,请刷新页面查看结果。');
450+
showInfo('已成功开始测试渠道,请刷新页面查看结果。');
451451
} else {
452452
showError(message);
453453
}
@@ -470,7 +470,7 @@ const ChannelsTable = () => {
470470
if (success) {
471471
record.balance = balance;
472472
record.balance_updated_time = Date.now() / 1000;
473-
showInfo(`通道 ${record.name} 余额更新成功!`);
473+
showInfo(`渠道 ${record.name} 余额更新成功!`);
474474
} else {
475475
showError(message);
476476
}
@@ -481,7 +481,7 @@ const ChannelsTable = () => {
481481
const res = await API.get(`/api/channel/update_balance`);
482482
const { success, message } = res.data;
483483
if (success) {
484-
showInfo('已更新完毕所有已启用通道余额!');
484+
showInfo('已更新完毕所有已启用渠道余额!');
485485
} else {
486486
showError(message);
487487
}
@@ -490,7 +490,7 @@ const ChannelsTable = () => {
490490

491491
const batchDeleteChannels = async () => {
492492
if (selectedChannels.length === 0) {
493-
showError('请先选择要删除的通道!');
493+
showError('请先选择要删除的渠道!');
494494
return;
495495
}
496496
setLoading(true);
@@ -501,7 +501,7 @@ const ChannelsTable = () => {
501501
const res = await API.post(`/api/channel/batch`, { ids: ids });
502502
const { success, message, data } = res.data;
503503
if (success) {
504-
showSuccess(`已删除 ${data} 个通道!`);
504+
showSuccess(`已删除 ${data} 个渠道!`);
505505
await refresh();
506506
} else {
507507
showError(message);
@@ -513,7 +513,7 @@ const ChannelsTable = () => {
513513
const res = await API.post(`/api/channel/fix`);
514514
const { success, message, data } = res.data;
515515
if (success) {
516-
showSuccess(`已修复 ${data} 个通道!`);
516+
showSuccess(`已修复 ${data} 个渠道!`);
517517
await refresh();
518518
} else {
519519
showError(message);
@@ -633,7 +633,7 @@ const ChannelsTable = () => {
633633
onConfirm={() => { testChannels("all") }}
634634
position={isMobile() ? 'top' : 'left'}
635635
>
636-
<Button theme="light" type="warning" style={{ marginRight: 8 }}>测试所有通道</Button>
636+
<Button theme="light" type="warning" style={{ marginRight: 8 }}>测试所有渠道</Button>
637637
</Popconfirm>
638638
<Popconfirm
639639
title="确定?"
@@ -648,16 +648,16 @@ const ChannelsTable = () => {
648648
okType={'secondary'}
649649
onConfirm={updateAllChannelsBalance}
650650
>
651-
<Button theme="light" type="secondary" style={{ marginRight: 8 }}>更新所有已启用通道余额</Button>
651+
<Button theme="light" type="secondary" style={{ marginRight: 8 }}>更新所有已启用渠道余额</Button>
652652
</Popconfirm> */}
653653
<Popconfirm
654-
title="确定是否要删除禁用通道?"
654+
title="确定是否要删除禁用渠道?"
655655
content="此修改将不可逆"
656656
okType={'danger'}
657657
onConfirm={deleteAllDisabledChannels}
658658
position={isMobile() ? 'top' : 'left'}
659659
>
660-
<Button theme="light" type="danger" style={{ marginRight: 8 }}>删除禁用通道</Button>
660+
<Button theme="light" type="danger" style={{ marginRight: 8 }}>删除禁用渠道</Button>
661661
</Popconfirm>
662662

663663
<Button theme="light" type="primary" style={{ marginRight: 8 }} onClick={refresh}>刷新</Button>
@@ -673,15 +673,15 @@ const ChannelsTable = () => {
673673
setEnableBatchDelete(v);
674674
}}></Switch>
675675
<Popconfirm
676-
title="确定是否要删除所选通道?"
676+
title="确定是否要删除所选渠道?"
677677
content="此修改将不可逆"
678678
okType={'danger'}
679679
onConfirm={batchDeleteChannels}
680680
disabled={!enableBatchDelete}
681681
position={'top'}
682682
>
683683
<Button disabled={!enableBatchDelete} theme="light" type="danger"
684-
style={{ marginRight: 8 }}>删除所选通道</Button>
684+
style={{ marginRight: 8 }}>删除所选渠道</Button>
685685
</Popconfirm>
686686
<Popconfirm
687687
title="确定是否要修复数据库一致性?"

web/air/src/components/OperationSetting.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ const OperationSetting = () => {
261261
value={inputs.ChannelDisableThreshold}
262262
type='number'
263263
min='0'
264-
placeholder='单位秒,当运行通道全部测试时,超过此时间将自动禁用通道'
264+
placeholder='单位秒,当运行渠道全部测试时,超过此时间将自动禁用渠道'
265265
/>
266266
<Form.Input
267267
label='额度提醒阈值'
@@ -277,13 +277,13 @@ const OperationSetting = () => {
277277
<Form.Group inline>
278278
<Form.Checkbox
279279
checked={inputs.AutomaticDisableChannelEnabled === 'true'}
280-
label='失败时自动禁用通道'
280+
label='失败时自动禁用渠道'
281281
name='AutomaticDisableChannelEnabled'
282282
onChange={handleInputChange}
283283
/>
284284
<Form.Checkbox
285285
checked={inputs.AutomaticEnableChannelEnabled === 'true'}
286-
label='成功时自动启用通道'
286+
label='成功时自动启用渠道'
287287
name='AutomaticEnableChannelEnabled'
288288
onChange={handleInputChange}
289289
/>

web/berry/src/views/Channel/component/TableRow.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ export default function ChannelTableRow({
9393
test_time: Date.now() / 1000,
9494
response_time: time * 1000,
9595
});
96-
showInfo(`通道 ${item.name} 测试成功,耗时 ${time.toFixed(2)} 秒。`);
96+
showInfo(`渠道 ${item.name} 测试成功,耗时 ${time.toFixed(2)} 秒。`);
9797
}
9898
};
9999

@@ -243,9 +243,9 @@ export default function ChannelTableRow({
243243
</Popover>
244244

245245
<Dialog open={openDelete} onClose={handleDeleteClose}>
246-
<DialogTitle>删除通道</DialogTitle>
246+
<DialogTitle>删除渠道</DialogTitle>
247247
<DialogContent>
248-
<DialogContentText>是否删除通道 {item.name}</DialogContentText>
248+
<DialogContentText>是否删除渠道 {item.name}</DialogContentText>
249249
</DialogContent>
250250
<DialogActions>
251251
<Button onClick={handleDeleteClose}>关闭</Button>

web/berry/src/views/Channel/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ export default function ChannelPage() {
135135
const res = await API.get(`/api/channel/test`);
136136
const { success, message } = res.data;
137137
if (success) {
138-
showInfo('已成功开始测试所有通道,请刷新页面查看结果。');
138+
showInfo('已成功开始测试所有渠道,请刷新页面查看结果。');
139139
} else {
140140
showError(message);
141141
}
@@ -159,7 +159,7 @@ export default function ChannelPage() {
159159
const res = await API.get(`/api/channel/update_balance`);
160160
const { success, message } = res.data;
161161
if (success) {
162-
showInfo('已更新完毕所有已启用通道余额!');
162+
showInfo('已更新完毕所有已启用渠道余额!');
163163
} else {
164164
showError(message);
165165
}

web/berry/src/views/Setting/component/OperationSetting.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ const OperationSetting = () => {
371371
value={inputs.ChannelDisableThreshold}
372372
onChange={handleInputChange}
373373
label="最长响应时间"
374-
placeholder="单位秒,当运行通道全部测试时,超过此时间将自动禁用通道"
374+
placeholder="单位秒,当运行渠道全部测试时,超过此时间将自动禁用渠道"
375375
disabled={loading}
376376
/>
377377
</FormControl>
@@ -392,7 +392,7 @@ const OperationSetting = () => {
392392
</FormControl>
393393
</Stack>
394394
<FormControlLabel
395-
label="失败时自动禁用通道"
395+
label="失败时自动禁用渠道"
396396
control={
397397
<Checkbox
398398
checked={inputs.AutomaticDisableChannelEnabled === "true"}
@@ -402,7 +402,7 @@ const OperationSetting = () => {
402402
}
403403
/>
404404
<FormControlLabel
405-
label="成功时自动启用通道"
405+
label="成功时自动启用渠道"
406406
control={
407407
<Checkbox
408408
checked={inputs.AutomaticEnableChannelEnabled === "true"}

0 commit comments

Comments
 (0)