任务详情添加日志列表,更新依赖

This commit is contained in:
whyour
2022-03-05 01:24:52 +08:00
parent 912b4ddb76
commit 810c6ca76c
10 changed files with 235 additions and 11790 deletions
+9 -1
View File
@@ -20,10 +20,12 @@ const CronLogModal = ({
cron,
handleCancel,
visible,
data,
}: {
cron?: any;
visible: boolean;
handleCancel: () => void;
data?: string;
}) => {
const [value, setValue] = useState<string>('启动中...');
const [loading, setLoading] = useState<any>(true);
@@ -97,11 +99,17 @@ const CronLogModal = ({
};
useEffect(() => {
if (cron) {
if (cron && cron.id) {
getCronLog(true);
}
}, [cron]);
useEffect(() => {
if (data) {
setValue(data);
}
}, [data]);
useEffect(() => {
setIsPhone(document.body.clientWidth < 768);
}, []);