mirror of
https://github.com/whyour/qinglong.git
synced 2026-07-17 09:34:31 +08:00
增加自定义hook通知
This commit is contained in:
@@ -58,7 +58,9 @@ const NotificationSetting = ({ data }: any) => {
|
||||
>
|
||||
<Select onChange={notificationModeChange}>
|
||||
{config.notificationModes.map((x) => (
|
||||
<Option value={x.value}>{x.label}</Option>
|
||||
<Option key={x.value} value={x.value}>
|
||||
{x.label}
|
||||
</Option>
|
||||
))}
|
||||
</Select>
|
||||
</Form.Item>
|
||||
@@ -71,7 +73,10 @@ const NotificationSetting = ({ data }: any) => {
|
||||
rules={[{ required: x.required }]}
|
||||
style={{ maxWidth: 400 }}
|
||||
>
|
||||
<Input.TextArea autoSize={true} placeholder={`请输入${x.label}`} />
|
||||
<Input.TextArea
|
||||
autoSize={true}
|
||||
placeholder={x.placeholder || `请输入${x.label}`}
|
||||
/>
|
||||
</Form.Item>
|
||||
))}
|
||||
<Button type="primary" htmlType="submit">
|
||||
|
||||
@@ -92,6 +92,7 @@ export default {
|
||||
{ value: 'pushPlus', label: 'PushPlus' },
|
||||
{ value: 'chat', label: '群辉chat' },
|
||||
{ value: 'email', label: '邮箱' },
|
||||
{ value: 'webhook', label: '自定义通知' },
|
||||
{ value: 'closed', label: '已关闭' },
|
||||
],
|
||||
notificationModeMap: {
|
||||
@@ -222,6 +223,30 @@ export default {
|
||||
{ label: 'emailUser', tip: '邮箱地址', required: true },
|
||||
{ label: 'emailPass', tip: '邮箱SMTP授权码', required: true },
|
||||
],
|
||||
webhook: [
|
||||
{
|
||||
label: 'webhookMethod',
|
||||
tip: '请求方法',
|
||||
required: true,
|
||||
placeholder: '请输入 GET/POST/PUT',
|
||||
},
|
||||
{
|
||||
label: 'webhookUrl',
|
||||
tip: '请求链接',
|
||||
required: true,
|
||||
placeholder: 'https://xxx.cn/api?query=xxx',
|
||||
},
|
||||
{
|
||||
label: 'webhookHeaders',
|
||||
tip: '请求头',
|
||||
placeholder: '{"Custom-Header": "$Header"}',
|
||||
},
|
||||
{
|
||||
label: 'webhookBody',
|
||||
tip: '请求体',
|
||||
placeholder: '{"status": "$STATUS"}',
|
||||
},
|
||||
],
|
||||
},
|
||||
documentTitleMap: {
|
||||
'/login': '登录',
|
||||
|
||||
Reference in New Issue
Block a user