You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.tsx 1.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. import { useTranslate } from '@/hooks/common-hooks';
  2. import { Form, Input } from 'antd';
  3. import { IOperatorForm } from '../../interface';
  4. import DynamicInputVariable from '../components/dynamic-input-variable';
  5. const EmailForm = ({ onValuesChange, form, node }: IOperatorForm) => {
  6. const { t } = useTranslate('flow');
  7. return (
  8. <Form
  9. name="basic"
  10. autoComplete="off"
  11. form={form}
  12. onValuesChange={onValuesChange}
  13. layout={'vertical'}
  14. >
  15. <DynamicInputVariable node={node}></DynamicInputVariable>
  16. {/* SMTP服务器配置 */}
  17. <Form.Item label={t('smtpServer')} name={'smtp_server'}>
  18. <Input placeholder="smtp.example.com" />
  19. </Form.Item>
  20. <Form.Item label={t('smtpPort')} name={'smtp_port'}>
  21. <Input type="number" placeholder="587" />
  22. </Form.Item>
  23. <Form.Item label={t('senderEmail')} name={'email'}>
  24. <Input placeholder="sender@example.com" />
  25. </Form.Item>
  26. <Form.Item label={t('authCode')} name={'password'}>
  27. <Input.Password placeholder="your_password" />
  28. </Form.Item>
  29. <Form.Item label={t('senderName')} name={'sender_name'}>
  30. <Input placeholder="Sender Name" />
  31. </Form.Item>
  32. {/* 动态参数说明 */}
  33. <div style={{ marginBottom: 24 }}>
  34. <h4>{t('dynamicParameters')}</h4>
  35. <div>{t('jsonFormatTip')}</div>
  36. <pre style={{ background: '#f5f5f5', padding: 12, borderRadius: 4 }}>
  37. {`{
  38. "to_email": "recipient@example.com",
  39. "cc_email": "cc@example.com",
  40. "subject": "Email Subject",
  41. "content": "Email Content"
  42. }`}
  43. </pre>
  44. </div>
  45. </Form>
  46. );
  47. };
  48. export default EmailForm;