mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-11-14 04:13:41 +08:00
feat: add OpenAI compatible channel (close #2091)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import React, {useEffect, useState} from 'react';
|
||||
import {useTranslation} from 'react-i18next';
|
||||
import {Button, Card, Form, Input, Message,} from 'semantic-ui-react';
|
||||
import {Button, Card, Form, Input, Message} from 'semantic-ui-react';
|
||||
import {useNavigate, useParams} from 'react-router-dom';
|
||||
import {API, copy, getChannelModels, showError, showInfo, showSuccess, verifyJSON,} from '../../helpers';
|
||||
import {CHANNEL_OPTIONS} from '../../constants';
|
||||
@@ -339,6 +339,20 @@ const EditChannel = () => {
|
||||
{inputs.type === 8 && (
|
||||
<Form.Field>
|
||||
<Form.Input
|
||||
required
|
||||
label={t('channel.edit.proxy_url')}
|
||||
name='base_url'
|
||||
placeholder={t('channel.edit.proxy_url_placeholder')}
|
||||
onChange={handleInputChange}
|
||||
value={inputs.base_url}
|
||||
autoComplete='new-password'
|
||||
/>
|
||||
</Form.Field>
|
||||
)}
|
||||
{inputs.type === 50 && (
|
||||
<Form.Field>
|
||||
<Form.Input
|
||||
required
|
||||
label={t('channel.edit.base_url')}
|
||||
name='base_url'
|
||||
placeholder={t('channel.edit.base_url_placeholder')}
|
||||
@@ -637,12 +651,13 @@ const EditChannel = () => {
|
||||
{inputs.type !== 3 &&
|
||||
inputs.type !== 33 &&
|
||||
inputs.type !== 8 &&
|
||||
inputs.type !== 50 &&
|
||||
inputs.type !== 22 && (
|
||||
<Form.Field>
|
||||
<Form.Input
|
||||
label={t('channel.edit.base_url')}
|
||||
label={t('channel.edit.proxy_url')}
|
||||
name='base_url'
|
||||
placeholder={t('channel.edit.base_url_placeholder')}
|
||||
placeholder={t('channel.edit.proxy_url_placeholder')}
|
||||
onChange={handleInputChange}
|
||||
value={inputs.base_url}
|
||||
autoComplete='new-password'
|
||||
|
||||
Reference in New Issue
Block a user