feat: able to add chat page link now (close #70)

This commit is contained in:
JustSong
2023-06-17 23:51:56 +08:00
parent ba89abedf0
commit d97640374c
7 changed files with 73 additions and 17 deletions

View File

@@ -34,6 +34,7 @@ const SystemSetting = () => {
ModelRatio: '',
GroupRatio: '',
TopUpLink: '',
ChatLink: '',
AutomaticDisableChannelEnabled: '',
ChannelDisableThreshold: 0,
LogConsumeEnabled: ''
@@ -109,7 +110,8 @@ const SystemSetting = () => {
name === 'PreConsumedQuota' ||
name === 'ModelRatio' ||
name === 'GroupRatio' ||
name === 'TopUpLink'
name === 'TopUpLink' ||
name === 'ChatLink'
) {
setInputs((inputs) => ({ ...inputs, [name]: value }));
} else {
@@ -155,6 +157,9 @@ const SystemSetting = () => {
if (originInputs['TopUpLink'] !== inputs.TopUpLink) {
await updateOption('TopUpLink', inputs.TopUpLink);
}
if (originInputs['ChatLink'] !== inputs.ChatLink) {
await updateOption('ChatLink', inputs.ChatLink);
}
};
const submitSMTP = async () => {
@@ -360,6 +365,15 @@ const SystemSetting = () => {
min='0'
placeholder='例如100'
/>
<Form.Input
label='聊天页面链接'
name='ChatLink'
onChange={handleInputChange}
autoComplete='new-password'
value={inputs.ChatLink}
type='link'
placeholder='例如 ChatGPT Next Web 的部署地址'
/>
</Form.Group>
<Form.Group widths='equal'>
<Form.TextArea