import { FC } from 'react'; import { Link } from 'react-router-dom'; import { Form, Select, Tag, Tooltip, Switch } from 'antd'; import { QuestionCircleOutlined } from '@ant-design/icons'; import useJson from '@/hooks/useJson'; import { DISABLE_AUTO_COMPLETE, CHAT_AWESOME_JSON } from '@/utils'; interface SwitchOriginProps { name: string; } const SwitchOrigin: FC = ({ name }) => { const { json: list = [] } = useJson(CHAT_AWESOME_JSON); const form = Form.useFormInstance(); const labelName = `(${name === 'main' ? 'Main' : 'SystemTray'})`; const dashboardName = `${name}_dashboard`; const originName = `${name}_origin`; const isEnable = Form.useWatch(dashboardName, form); let urlList = [{ title: 'ChatGPT', url: 'https://chat.openai.com', init: true }]; if (Array.isArray(list)) { urlList = urlList.concat(list); } return ( <> Dashboard {labelName}{' '}

Set Dashboard as the application default window.

If this is enabled, the Switch Origin {labelName}{' '} setting will be invalid.

If you want to add a new URL to the dashboard, add it in the{' '} Awesome menu and make sure it is enabled.

} >
} name={dashboardName} valuePropName="checked" >
Switch Origin {labelName}{' '}

Set a single URL as the application default window.

If you need to set a new URL as the application loading window, please add the URL in the Awesome menu and then select it.

} >
} name={originName} >
); }; export default SwitchOrigin;