mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-10-18 17:51:28 +00:00
feat: add Account ID input field for specific channel type and prevent potential bug with undefined key
This commit is contained in:
@@ -207,6 +207,9 @@ const EditChannel = () => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let localInputs = { ...inputs };
|
let localInputs = { ...inputs };
|
||||||
|
if (localInputs.key === 'undefined|undefined|undefined') {
|
||||||
|
localInputs.key = ''; // prevent potential bug
|
||||||
|
}
|
||||||
if (localInputs.base_url && localInputs.base_url.endsWith('/')) {
|
if (localInputs.base_url && localInputs.base_url.endsWith('/')) {
|
||||||
localInputs.base_url = localInputs.base_url.slice(
|
localInputs.base_url = localInputs.base_url.slice(
|
||||||
0,
|
0,
|
||||||
@@ -622,6 +625,21 @@ const EditChannel = () => {
|
|||||||
/>
|
/>
|
||||||
</Form.Field>
|
</Form.Field>
|
||||||
))}
|
))}
|
||||||
|
{inputs.type === 37 && (
|
||||||
|
<Form.Field>
|
||||||
|
<Form.Input
|
||||||
|
label='Account ID'
|
||||||
|
name='user_id'
|
||||||
|
required
|
||||||
|
placeholder={
|
||||||
|
'请输入 Account ID,例如:d8d7c61dbc334c32d3ced580e4bf42b4'
|
||||||
|
}
|
||||||
|
onChange={handleConfigChange}
|
||||||
|
value={config.user_id}
|
||||||
|
autoComplete=''
|
||||||
|
/>
|
||||||
|
</Form.Field>
|
||||||
|
)}
|
||||||
{inputs.type !== 33 && !isEdit && (
|
{inputs.type !== 33 && !isEdit && (
|
||||||
<Form.Checkbox
|
<Form.Checkbox
|
||||||
checked={batch}
|
checked={batch}
|
||||||
|
Reference in New Issue
Block a user