|
@@ -67,6 +67,8 @@ function type2secretPrompt(type) {
|
|
|
return '按照如下格式输入:Ak|Sk|Region';
|
|
return '按照如下格式输入:Ak|Sk|Region';
|
|
|
case 50:
|
|
case 50:
|
|
|
return '按照如下格式输入: AccessKey|SecretKey';
|
|
return '按照如下格式输入: AccessKey|SecretKey';
|
|
|
|
|
+ case 51:
|
|
|
|
|
+ return '按照如下格式输入: Access Key ID|Secret Access Key';
|
|
|
default:
|
|
default:
|
|
|
return '请输入渠道对应的鉴权密钥';
|
|
return '请输入渠道对应的鉴权密钥';
|
|
|
}
|
|
}
|
|
@@ -449,10 +451,6 @@ const EditChannel = (props) => {
|
|
|
</Title>
|
|
</Title>
|
|
|
</Space>
|
|
</Space>
|
|
|
}
|
|
}
|
|
|
- headerStyle={{
|
|
|
|
|
- borderBottom: '1px solid var(--semi-color-border)',
|
|
|
|
|
- padding: '24px'
|
|
|
|
|
- }}
|
|
|
|
|
bodyStyle={{ padding: '0' }}
|
|
bodyStyle={{ padding: '0' }}
|
|
|
visible={props.visible}
|
|
visible={props.visible}
|
|
|
width={isMobile() ? '100%' : 600}
|
|
width={isMobile() ? '100%' : 600}
|
|
@@ -461,7 +459,6 @@ const EditChannel = (props) => {
|
|
|
<Space>
|
|
<Space>
|
|
|
<Button
|
|
<Button
|
|
|
theme="solid"
|
|
theme="solid"
|
|
|
- className="!rounded-full"
|
|
|
|
|
onClick={submit}
|
|
onClick={submit}
|
|
|
icon={<IconSave />}
|
|
icon={<IconSave />}
|
|
|
>
|
|
>
|
|
@@ -469,7 +466,6 @@ const EditChannel = (props) => {
|
|
|
</Button>
|
|
</Button>
|
|
|
<Button
|
|
<Button
|
|
|
theme="light"
|
|
theme="light"
|
|
|
- className="!rounded-full"
|
|
|
|
|
type="primary"
|
|
type="primary"
|
|
|
onClick={handleCancel}
|
|
onClick={handleCancel}
|
|
|
icon={<IconClose />}
|
|
icon={<IconClose />}
|
|
@@ -483,7 +479,7 @@ const EditChannel = (props) => {
|
|
|
onCancel={() => handleCancel()}
|
|
onCancel={() => handleCancel()}
|
|
|
>
|
|
>
|
|
|
<Spin spinning={loading}>
|
|
<Spin spinning={loading}>
|
|
|
- <div className="p-6">
|
|
|
|
|
|
|
+ <div className="p-2">
|
|
|
<Card className="!rounded-2xl shadow-sm border-0 mb-6">
|
|
<Card className="!rounded-2xl shadow-sm border-0 mb-6">
|
|
|
{/* Header: Basic Info */}
|
|
{/* Header: Basic Info */}
|
|
|
<div className="flex items-center mb-2">
|
|
<div className="flex items-center mb-2">
|
|
@@ -509,7 +505,6 @@ const EditChannel = (props) => {
|
|
|
filter
|
|
filter
|
|
|
searchPosition='dropdown'
|
|
searchPosition='dropdown'
|
|
|
placeholder={t('请选择渠道类型')}
|
|
placeholder={t('请选择渠道类型')}
|
|
|
- className="!rounded-lg"
|
|
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
@@ -524,7 +519,6 @@ const EditChannel = (props) => {
|
|
|
}}
|
|
}}
|
|
|
value={inputs.name}
|
|
value={inputs.name}
|
|
|
autoComplete='new-password'
|
|
autoComplete='new-password'
|
|
|
- className="!rounded-lg"
|
|
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
@@ -541,7 +535,6 @@ const EditChannel = (props) => {
|
|
|
value={inputs.key}
|
|
value={inputs.key}
|
|
|
autosize={{ minRows: 6, maxRows: 6 }}
|
|
autosize={{ minRows: 6, maxRows: 6 }}
|
|
|
autoComplete='new-password'
|
|
autoComplete='new-password'
|
|
|
- className="!rounded-lg"
|
|
|
|
|
/>
|
|
/>
|
|
|
) : (
|
|
) : (
|
|
|
<>
|
|
<>
|
|
@@ -570,7 +563,6 @@ const EditChannel = (props) => {
|
|
|
autosize={{ minRows: 10 }}
|
|
autosize={{ minRows: 10 }}
|
|
|
value={inputs.key}
|
|
value={inputs.key}
|
|
|
autoComplete='new-password'
|
|
autoComplete='new-password'
|
|
|
- className="!rounded-lg font-mono"
|
|
|
|
|
/>
|
|
/>
|
|
|
) : (
|
|
) : (
|
|
|
<Input
|
|
<Input
|
|
@@ -582,7 +574,6 @@ const EditChannel = (props) => {
|
|
|
}}
|
|
}}
|
|
|
value={inputs.key}
|
|
value={inputs.key}
|
|
|
autoComplete='new-password'
|
|
autoComplete='new-password'
|
|
|
- className="!rounded-lg"
|
|
|
|
|
/>
|
|
/>
|
|
|
)}
|
|
)}
|
|
|
</>
|
|
</>
|
|
@@ -631,7 +622,6 @@ const EditChannel = (props) => {
|
|
|
</Text>
|
|
</Text>
|
|
|
</div>
|
|
</div>
|
|
|
}
|
|
}
|
|
|
- className='!rounded-lg'
|
|
|
|
|
/>
|
|
/>
|
|
|
)}
|
|
)}
|
|
|
|
|
|
|
@@ -650,7 +640,6 @@ const EditChannel = (props) => {
|
|
|
onChange={(value) => handleInputChange('base_url', value)}
|
|
onChange={(value) => handleInputChange('base_url', value)}
|
|
|
value={inputs.base_url}
|
|
value={inputs.base_url}
|
|
|
autoComplete='new-password'
|
|
autoComplete='new-password'
|
|
|
- className="!rounded-lg"
|
|
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
|
<div>
|
|
<div>
|
|
@@ -661,7 +650,6 @@ const EditChannel = (props) => {
|
|
|
onChange={(value) => handleInputChange('other', value)}
|
|
onChange={(value) => handleInputChange('other', value)}
|
|
|
value={inputs.other}
|
|
value={inputs.other}
|
|
|
autoComplete='new-password'
|
|
autoComplete='new-password'
|
|
|
- className="!rounded-lg"
|
|
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
|
</>
|
|
</>
|
|
@@ -682,7 +670,6 @@ const EditChannel = (props) => {
|
|
|
onChange={(value) => handleInputChange('base_url', value)}
|
|
onChange={(value) => handleInputChange('base_url', value)}
|
|
|
value={inputs.base_url}
|
|
value={inputs.base_url}
|
|
|
autoComplete='new-password'
|
|
autoComplete='new-password'
|
|
|
- className="!rounded-lg"
|
|
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
|
</>
|
|
</>
|
|
@@ -705,7 +692,6 @@ const EditChannel = (props) => {
|
|
|
onChange={(value) => handleInputChange('base_url', value)}
|
|
onChange={(value) => handleInputChange('base_url', value)}
|
|
|
value={inputs.base_url}
|
|
value={inputs.base_url}
|
|
|
autoComplete='new-password'
|
|
autoComplete='new-password'
|
|
|
- className="!rounded-lg"
|
|
|
|
|
/>
|
|
/>
|
|
|
<Text type="tertiary" className="mt-1 text-xs">
|
|
<Text type="tertiary" className="mt-1 text-xs">
|
|
|
{t('对于官方渠道,new-api已经内置地址,除非是第三方代理站点或者Azure的特殊接入地址,否则不需要填写')}
|
|
{t('对于官方渠道,new-api已经内置地址,除非是第三方代理站点或者Azure的特殊接入地址,否则不需要填写')}
|
|
@@ -722,7 +708,6 @@ const EditChannel = (props) => {
|
|
|
onChange={(value) => handleInputChange('base_url', value)}
|
|
onChange={(value) => handleInputChange('base_url', value)}
|
|
|
value={inputs.base_url}
|
|
value={inputs.base_url}
|
|
|
autoComplete='new-password'
|
|
autoComplete='new-password'
|
|
|
- className="!rounded-lg"
|
|
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
|
)}
|
|
)}
|
|
@@ -738,7 +723,6 @@ const EditChannel = (props) => {
|
|
|
onChange={(value) => handleInputChange('base_url', value)}
|
|
onChange={(value) => handleInputChange('base_url', value)}
|
|
|
value={inputs.base_url}
|
|
value={inputs.base_url}
|
|
|
autoComplete='new-password'
|
|
autoComplete='new-password'
|
|
|
- className="!rounded-lg"
|
|
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
|
)}
|
|
)}
|
|
@@ -773,7 +757,6 @@ const EditChannel = (props) => {
|
|
|
value={inputs.models}
|
|
value={inputs.models}
|
|
|
autoComplete='new-password'
|
|
autoComplete='new-password'
|
|
|
optionList={modelOptions}
|
|
optionList={modelOptions}
|
|
|
- className="!rounded-lg"
|
|
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
@@ -781,14 +764,12 @@ const EditChannel = (props) => {
|
|
|
<Button
|
|
<Button
|
|
|
type='primary'
|
|
type='primary'
|
|
|
onClick={() => handleInputChange('models', basicModels)}
|
|
onClick={() => handleInputChange('models', basicModels)}
|
|
|
- className="!rounded-lg"
|
|
|
|
|
>
|
|
>
|
|
|
{t('填入相关模型')}
|
|
{t('填入相关模型')}
|
|
|
</Button>
|
|
</Button>
|
|
|
<Button
|
|
<Button
|
|
|
type='secondary'
|
|
type='secondary'
|
|
|
onClick={() => handleInputChange('models', fullModels)}
|
|
onClick={() => handleInputChange('models', fullModels)}
|
|
|
- className="!rounded-lg"
|
|
|
|
|
>
|
|
>
|
|
|
{t('填入所有模型')}
|
|
{t('填入所有模型')}
|
|
|
</Button>
|
|
</Button>
|
|
@@ -796,7 +777,6 @@ const EditChannel = (props) => {
|
|
|
<Button
|
|
<Button
|
|
|
type='tertiary'
|
|
type='tertiary'
|
|
|
onClick={() => fetchUpstreamModelList('models')}
|
|
onClick={() => fetchUpstreamModelList('models')}
|
|
|
- className="!rounded-lg"
|
|
|
|
|
>
|
|
>
|
|
|
{t('获取模型列表')}
|
|
{t('获取模型列表')}
|
|
|
</Button>
|
|
</Button>
|
|
@@ -804,7 +784,6 @@ const EditChannel = (props) => {
|
|
|
<Button
|
|
<Button
|
|
|
type='warning'
|
|
type='warning'
|
|
|
onClick={() => handleInputChange('models', [])}
|
|
onClick={() => handleInputChange('models', [])}
|
|
|
- className="!rounded-lg"
|
|
|
|
|
>
|
|
>
|
|
|
{t('清除所有模型')}
|
|
{t('清除所有模型')}
|
|
|
</Button>
|
|
</Button>
|
|
@@ -822,7 +801,6 @@ const EditChannel = (props) => {
|
|
|
showError(t('复制失败'));
|
|
showError(t('复制失败'));
|
|
|
}
|
|
}
|
|
|
}}
|
|
}}
|
|
|
- className="!rounded-lg"
|
|
|
|
|
>
|
|
>
|
|
|
{t('复制所有模型')}
|
|
{t('复制所有模型')}
|
|
|
</Button>
|
|
</Button>
|
|
@@ -846,7 +824,6 @@ const EditChannel = (props) => {
|
|
|
placeholder={t('输入自定义模型名称')}
|
|
placeholder={t('输入自定义模型名称')}
|
|
|
value={customModel}
|
|
value={customModel}
|
|
|
onChange={(value) => setCustomModel(value.trim())}
|
|
onChange={(value) => setCustomModel(value.trim())}
|
|
|
- className="!rounded-lg"
|
|
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
@@ -862,7 +839,6 @@ const EditChannel = (props) => {
|
|
|
autosize
|
|
autosize
|
|
|
value={inputs.model_mapping}
|
|
value={inputs.model_mapping}
|
|
|
autoComplete='new-password'
|
|
autoComplete='new-password'
|
|
|
- className="!rounded-lg font-mono"
|
|
|
|
|
/>
|
|
/>
|
|
|
<Text
|
|
<Text
|
|
|
className="!text-semi-color-primary cursor-pointer mt-1 block"
|
|
className="!text-semi-color-primary cursor-pointer mt-1 block"
|
|
@@ -879,7 +855,6 @@ const EditChannel = (props) => {
|
|
|
placeholder={t('不填则为模型列表第一个')}
|
|
placeholder={t('不填则为模型列表第一个')}
|
|
|
onChange={(value) => handleInputChange('test_model', value)}
|
|
onChange={(value) => handleInputChange('test_model', value)}
|
|
|
value={inputs.test_model}
|
|
value={inputs.test_model}
|
|
|
- className="!rounded-lg"
|
|
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -913,7 +888,6 @@ const EditChannel = (props) => {
|
|
|
value={inputs.groups}
|
|
value={inputs.groups}
|
|
|
autoComplete='new-password'
|
|
autoComplete='new-password'
|
|
|
optionList={groupOptions}
|
|
optionList={groupOptions}
|
|
|
- className="!rounded-lg"
|
|
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
@@ -926,7 +900,6 @@ const EditChannel = (props) => {
|
|
|
onChange={(value) => handleInputChange('other', value)}
|
|
onChange={(value) => handleInputChange('other', value)}
|
|
|
value={inputs.other}
|
|
value={inputs.other}
|
|
|
autoComplete='new-password'
|
|
autoComplete='new-password'
|
|
|
- className="!rounded-lg"
|
|
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
|
)}
|
|
)}
|
|
@@ -947,7 +920,6 @@ const EditChannel = (props) => {
|
|
|
onChange={(value) => handleInputChange('other', value)}
|
|
onChange={(value) => handleInputChange('other', value)}
|
|
|
value={inputs.other}
|
|
value={inputs.other}
|
|
|
autoComplete='new-password'
|
|
autoComplete='new-password'
|
|
|
- className="!rounded-lg font-mono"
|
|
|
|
|
/>
|
|
/>
|
|
|
<Text
|
|
<Text
|
|
|
className="!text-semi-color-primary cursor-pointer mt-1 block"
|
|
className="!text-semi-color-primary cursor-pointer mt-1 block"
|
|
@@ -967,7 +939,6 @@ const EditChannel = (props) => {
|
|
|
onChange={(value) => handleInputChange('other', value)}
|
|
onChange={(value) => handleInputChange('other', value)}
|
|
|
value={inputs.other}
|
|
value={inputs.other}
|
|
|
autoComplete='new-password'
|
|
autoComplete='new-password'
|
|
|
- className="!rounded-lg"
|
|
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
|
)}
|
|
)}
|
|
@@ -981,7 +952,6 @@ const EditChannel = (props) => {
|
|
|
onChange={(value) => handleInputChange('other', value)}
|
|
onChange={(value) => handleInputChange('other', value)}
|
|
|
value={inputs.other}
|
|
value={inputs.other}
|
|
|
autoComplete='new-password'
|
|
autoComplete='new-password'
|
|
|
- className="!rounded-lg"
|
|
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
|
)}
|
|
)}
|
|
@@ -995,7 +965,6 @@ const EditChannel = (props) => {
|
|
|
onChange={(value) => handleInputChange('other', value)}
|
|
onChange={(value) => handleInputChange('other', value)}
|
|
|
value={inputs.other}
|
|
value={inputs.other}
|
|
|
autoComplete='new-password'
|
|
autoComplete='new-password'
|
|
|
- className="!rounded-lg"
|
|
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
|
)}
|
|
)}
|
|
@@ -1008,7 +977,6 @@ const EditChannel = (props) => {
|
|
|
onChange={(value) => handleInputChange('tag', value)}
|
|
onChange={(value) => handleInputChange('tag', value)}
|
|
|
value={inputs.tag}
|
|
value={inputs.tag}
|
|
|
autoComplete='new-password'
|
|
autoComplete='new-password'
|
|
|
- className="!rounded-lg"
|
|
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
@@ -1027,7 +995,6 @@ const EditChannel = (props) => {
|
|
|
}}
|
|
}}
|
|
|
value={inputs.priority}
|
|
value={inputs.priority}
|
|
|
autoComplete='new-password'
|
|
autoComplete='new-password'
|
|
|
- className="!rounded-lg"
|
|
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
@@ -1046,7 +1013,6 @@ const EditChannel = (props) => {
|
|
|
}}
|
|
}}
|
|
|
value={inputs.weight}
|
|
value={inputs.weight}
|
|
|
autoComplete='new-password'
|
|
autoComplete='new-password'
|
|
|
- className="!rounded-lg"
|
|
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
@@ -1062,7 +1028,6 @@ const EditChannel = (props) => {
|
|
|
autosize
|
|
autosize
|
|
|
value={inputs.setting}
|
|
value={inputs.setting}
|
|
|
autoComplete='new-password'
|
|
autoComplete='new-password'
|
|
|
- className="!rounded-lg font-mono"
|
|
|
|
|
/>
|
|
/>
|
|
|
<div className="flex gap-2 mt-1">
|
|
<div className="flex gap-2 mt-1">
|
|
|
<Text
|
|
<Text
|
|
@@ -1101,7 +1066,6 @@ const EditChannel = (props) => {
|
|
|
autosize
|
|
autosize
|
|
|
value={inputs.param_override}
|
|
value={inputs.param_override}
|
|
|
autoComplete='new-password'
|
|
autoComplete='new-password'
|
|
|
- className="!rounded-lg font-mono"
|
|
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
@@ -1113,7 +1077,6 @@ const EditChannel = (props) => {
|
|
|
placeholder={t('请输入组织org-xxx')}
|
|
placeholder={t('请输入组织org-xxx')}
|
|
|
onChange={(value) => handleInputChange('openai_organization', value)}
|
|
onChange={(value) => handleInputChange('openai_organization', value)}
|
|
|
value={inputs.openai_organization}
|
|
value={inputs.openai_organization}
|
|
|
- className="!rounded-lg"
|
|
|
|
|
/>
|
|
/>
|
|
|
<Text type="tertiary" className="mt-1 text-xs">
|
|
<Text type="tertiary" className="mt-1 text-xs">
|
|
|
{t('组织,可选,不填则为默认组织')}
|
|
{t('组织,可选,不填则为默认组织')}
|
|
@@ -1146,7 +1109,6 @@ const EditChannel = (props) => {
|
|
|
autosize
|
|
autosize
|
|
|
value={inputs.status_code_mapping}
|
|
value={inputs.status_code_mapping}
|
|
|
autoComplete='new-password'
|
|
autoComplete='new-password'
|
|
|
- className="!rounded-lg font-mono"
|
|
|
|
|
/>
|
|
/>
|
|
|
<Text
|
|
<Text
|
|
|
className="!text-semi-color-primary cursor-pointer mt-1 block"
|
|
className="!text-semi-color-primary cursor-pointer mt-1 block"
|