mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-23 06:46:09 +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 tab = new Crontab({ ...doc, ...other });
|
||||
tab.saved = false;
|
||||
const newDoc = await this.update(tab);
|
||||
const newDoc = await this.updateDb(tab);
|
||||
await this.set_crontab();
|
||||
return newDoc;
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@ const CookieModal = ({
|
|||
handleCancel: (needUpdate?: boolean) => void;
|
||||
}) => {
|
||||
const [form] = Form.useForm();
|
||||
const [loading, setLoading] = useState(false);
|
||||
|
||||
const handleOk = async (values: any) => {
|
||||
const cookies = values.value
|
||||
|
@ -29,6 +30,7 @@ const CookieModal = ({
|
|||
if (flag) {
|
||||
return;
|
||||
}
|
||||
setLoading(true);
|
||||
const method = cookie ? 'put' : 'post';
|
||||
const payload = cookie ? { value: cookies[0], _id: cookie._id } : cookies;
|
||||
const { code, data } = await request[method](`${config.apiPrefix}cookies`, {
|
||||
|
@ -43,6 +45,7 @@ const CookieModal = ({
|
|||
message: data,
|
||||
});
|
||||
}
|
||||
setLoading(false);
|
||||
handleCancel(data);
|
||||
};
|
||||
|
||||
|
@ -66,6 +69,7 @@ const CookieModal = ({
|
|||
});
|
||||
}}
|
||||
onCancel={() => handleCancel()}
|
||||
confirmLoading={loading}
|
||||
destroyOnClose
|
||||
>
|
||||
<Form
|
||||
|
|
|
@ -14,8 +14,10 @@ const CronModal = ({
|
|||
handleCancel: (needUpdate?: boolean) => void;
|
||||
}) => {
|
||||
const [form] = Form.useForm();
|
||||
const [loading, setLoading] = useState(false);
|
||||
|
||||
const handleOk = async (values: any) => {
|
||||
setLoading(true);
|
||||
const method = cron ? 'put' : 'post';
|
||||
const payload = { ...values };
|
||||
if (cron) {
|
||||
|
@ -33,6 +35,7 @@ const CronModal = ({
|
|||
message: data,
|
||||
});
|
||||
}
|
||||
setLoading(false);
|
||||
handleCancel(data);
|
||||
};
|
||||
|
||||
|
@ -60,6 +63,7 @@ const CronModal = ({
|
|||
});
|
||||
}}
|
||||
onCancel={() => handleCancel()}
|
||||
confirmLoading={loading}
|
||||
destroyOnClose
|
||||
>
|
||||
<Form form={form} layout="vertical" name="form_in_modal" preserve={false}>
|
||||
|
|
Loading…
Reference in New Issue
Block a user