chore: settings

This commit is contained in:
lencx
2023-01-23 10:56:07 +08:00
parent 84a29d7cda
commit d5df706b47
7 changed files with 76 additions and 20 deletions

View File

@@ -1,9 +1,10 @@
import { FC } from 'react';
import { Form, Select, Tag } from 'antd';
import { Link } from 'react-router-dom';
import { Form, Select, Tag, Tooltip } from 'antd';
import { QuestionCircleOutlined } from '@ant-design/icons';
import useJson from '@/hooks/useJson';
import { DISABLE_AUTO_COMPLETE, CHAT_CONF_JSON, CHAT_AWESOME_JSON } from '@/utils';
import { DISABLE_AUTO_COMPLETE, CHAT_AWESOME_JSON } from '@/utils';
interface SwitchOriginProps {
name: string;
}
@@ -13,13 +14,27 @@ const SwitchOrigin: FC<SwitchOriginProps> = ({ name }) => {
return (
<Form.Item
label={<span>Switch Origin ({name === 'origin' ? 'Main' : 'SystemTray'})</span>}
label={
<span>
Switch Origin ({name === 'origin' ? 'Main' : 'SystemTray'}){' '}
<Tooltip
title={
<div>
If you need to set a new URL as the application loading window, please add the URL
in the <Link to="/">Awesome</Link> menu and then select it.
</div>
}
>
<QuestionCircleOutlined style={{ color: '#1677ff' }} />
</Tooltip>
</span>
}
name={name}
>
<Select showSearch {...DISABLE_AUTO_COMPLETE} optionLabelProp="url">
{[{ title: 'ChatGPT', url: 'https://chat.openai.com' }, ...list].map((i) => (
<Select.Option key={i.url} label={i.title} value={i.url}>
<Tag color="geekblue">{i.title}</Tag> {i.url}
<Select.Option key={i.url} label={i.title} value={i.url} title={i.url}>
<Tag color={i.title === 'ChatGPT' ? 'orange' : 'geekblue'}>{i.title}</Tag> {i.url}
</Select.Option>
))}
</Select>