chore: tray

This commit is contained in:
lencx
2023-01-25 01:52:37 +08:00
parent 221287bbd5
commit 9ba3357a58
6 changed files with 50 additions and 53 deletions

View File

@@ -74,16 +74,18 @@ const SwitchOrigin: FC<SwitchOriginProps> = ({ name }) => {
name={originName}
>
<Select disabled={isEnable} showSearch {...DISABLE_AUTO_COMPLETE} optionLabelProp="url">
{[{ title: 'ChatGPT', url: 'https://chat.openai.com' }, ...list].map((i, idx) => (
<Select.Option
key={`${idx}_${i.url}`}
label={i.title}
value={i.url}
title={`${i.title}: ${i.url}`}
>
<Tag color={i.title === 'ChatGPT' ? 'orange' : 'geekblue'}>{i.title}</Tag> {i.url}
</Select.Option>
))}
{[{ title: 'ChatGPT', url: 'https://chat.openai.com', init: true }, ...list].map(
(i, idx) => (
<Select.Option
key={`${idx}_${i.url}`}
label={i.title}
value={i.url}
title={`${i.title}${i.init ? '(Built-in)' : ''}: ${i.url}`}
>
<Tag color={i.init ? 'orange' : 'geekblue'}>{i.title}</Tag> {i.url}
</Select.Option>
),
)}
</Select>
</Form.Item>
</>

View File

@@ -39,7 +39,7 @@ const AwesomeForm: ForwardRefRenderFunction<FormProps, AwesomeFormProps> = ({ re
<Form.Item
label="URL"
name="url"
rules={[{ required: true, message: 'Please enter the URL' }]}
rules={[{ required: true, message: 'Please enter the URL' }, { type: 'url' }]}
>
<Input placeholder="Please enter the URL" {...DISABLE_AUTO_COMPLETE} />
</Form.Item>