mirror of
				https://github.com/whyour/qinglong.git
				synced 2025-10-31 08:56:06 +08:00 
			
		
		
		
	修复更新cron , fix #32
This commit is contained in:
		
							parent
							
								
									17c50d0c9e
								
							
						
					
					
						commit
						947a753610
					
				|  | @ -48,7 +48,7 @@ export default class CronService { | ||||||
|     const doc = await this.get(_id); |     const doc = await this.get(_id); | ||||||
|     const tab = new Crontab({ ...doc, ...other }); |     const tab = new Crontab({ ...doc, ...other }); | ||||||
|     tab.saved = false; |     tab.saved = false; | ||||||
|     const newDoc = await this.update(tab); |     const newDoc = await this.updateDb(tab); | ||||||
|     await this.set_crontab(); |     await this.set_crontab(); | ||||||
|     return newDoc; |     return newDoc; | ||||||
|   } |   } | ||||||
|  |  | ||||||
|  | @ -13,6 +13,7 @@ const CookieModal = ({ | ||||||
|   handleCancel: (needUpdate?: boolean) => void; |   handleCancel: (needUpdate?: boolean) => void; | ||||||
| }) => { | }) => { | ||||||
|   const [form] = Form.useForm(); |   const [form] = Form.useForm(); | ||||||
|  |   const [loading, setLoading] = useState(false); | ||||||
| 
 | 
 | ||||||
|   const handleOk = async (values: any) => { |   const handleOk = async (values: any) => { | ||||||
|     const cookies = values.value |     const cookies = values.value | ||||||
|  | @ -29,6 +30,7 @@ const CookieModal = ({ | ||||||
|     if (flag) { |     if (flag) { | ||||||
|       return; |       return; | ||||||
|     } |     } | ||||||
|  |     setLoading(true); | ||||||
|     const method = cookie ? 'put' : 'post'; |     const method = cookie ? 'put' : 'post'; | ||||||
|     const payload = cookie ? { value: cookies[0], _id: cookie._id } : cookies; |     const payload = cookie ? { value: cookies[0], _id: cookie._id } : cookies; | ||||||
|     const { code, data } = await request[method](`${config.apiPrefix}cookies`, { |     const { code, data } = await request[method](`${config.apiPrefix}cookies`, { | ||||||
|  | @ -43,6 +45,7 @@ const CookieModal = ({ | ||||||
|         message: data, |         message: data, | ||||||
|       }); |       }); | ||||||
|     } |     } | ||||||
|  |     setLoading(false); | ||||||
|     handleCancel(data); |     handleCancel(data); | ||||||
|   }; |   }; | ||||||
| 
 | 
 | ||||||
|  | @ -66,6 +69,7 @@ const CookieModal = ({ | ||||||
|           }); |           }); | ||||||
|       }} |       }} | ||||||
|       onCancel={() => handleCancel()} |       onCancel={() => handleCancel()} | ||||||
|  |       confirmLoading={loading} | ||||||
|       destroyOnClose |       destroyOnClose | ||||||
|     > |     > | ||||||
|       <Form |       <Form | ||||||
|  |  | ||||||
|  | @ -14,8 +14,10 @@ const CronModal = ({ | ||||||
|   handleCancel: (needUpdate?: boolean) => void; |   handleCancel: (needUpdate?: boolean) => void; | ||||||
| }) => { | }) => { | ||||||
|   const [form] = Form.useForm(); |   const [form] = Form.useForm(); | ||||||
|  |   const [loading, setLoading] = useState(false); | ||||||
| 
 | 
 | ||||||
|   const handleOk = async (values: any) => { |   const handleOk = async (values: any) => { | ||||||
|  |     setLoading(true); | ||||||
|     const method = cron ? 'put' : 'post'; |     const method = cron ? 'put' : 'post'; | ||||||
|     const payload = { ...values }; |     const payload = { ...values }; | ||||||
|     if (cron) { |     if (cron) { | ||||||
|  | @ -33,6 +35,7 @@ const CronModal = ({ | ||||||
|         message: data, |         message: data, | ||||||
|       }); |       }); | ||||||
|     } |     } | ||||||
|  |     setLoading(false); | ||||||
|     handleCancel(data); |     handleCancel(data); | ||||||
|   }; |   }; | ||||||
| 
 | 
 | ||||||
|  | @ -60,6 +63,7 @@ const CronModal = ({ | ||||||
|           }); |           }); | ||||||
|       }} |       }} | ||||||
|       onCancel={() => handleCancel()} |       onCancel={() => handleCancel()} | ||||||
|  |       confirmLoading={loading} | ||||||
|       destroyOnClose |       destroyOnClose | ||||||
|     > |     > | ||||||
|       <Form form={form} layout="vertical" name="form_in_modal" preserve={false}> |       <Form form={form} layout="vertical" name="form_in_modal" preserve={false}> | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 whyour
						whyour