diff --git a/shell/task.sh b/shell/task.sh index 52445b51ec7..570a53322fd 100755 --- a/shell/task.sh +++ b/shell/task.sh @@ -5,7 +5,7 @@ dir_shell=$QL_DIR/shell . $dir_shell/share.sh . $dir_shell/api.sh -trap "single_hanle" 2 3 20 15 14 +trap "single_hanle" 2 3 20 15 14 19 1 single_hanle() { eval handle_task_after "$@" "$cmd" exit 1 diff --git a/src/layouts/index.less b/src/layouts/index.less index 5735c0dec88..da85cf7ebab 100644 --- a/src/layouts/index.less +++ b/src/layouts/index.less @@ -24,6 +24,10 @@ body { -webkit-overflow-scrolling: touch; } +.ant-modal-header { + padding-right: 54px; +} + .ant-modal-body { max-height: calc(80vh - 110px); max-height: calc(80vh - var(--vh-offset, 110px)); diff --git a/src/pages/crontab/logModal.tsx b/src/pages/crontab/logModal.tsx index 13ebe028735..58927c11976 100644 --- a/src/pages/crontab/logModal.tsx +++ b/src/pages/crontab/logModal.tsx @@ -1,6 +1,14 @@ import intl from 'react-intl-universal'; import React, { useEffect, useRef, useState } from 'react'; -import { Modal, message, Input, Form, Statistic, Button } from 'antd'; +import { + Modal, + message, + Input, + Form, + Statistic, + Button, + Typography, +} from 'antd'; import { request } from '@/utils/http'; import config from '@/utils/config'; import { @@ -50,10 +58,15 @@ const CronLogModal = ({ const hasNext = Boolean( log && !logEnded(log) && !log.includes('任务未运行'), ); + if (!hasNext && !logEnded(value) && value !== intl.get('启动中...')) { + setTimeout(() => { + autoScroll(); + }); + } setExecuting(hasNext); if (hasNext) { - autoScroll(); setTimeout(() => { + autoScroll(); getCronLog(); }, 2000); } @@ -88,18 +101,20 @@ const CronLogModal = ({ if (scrollInfoRef.current.down) { scrollInfoRef.current = { value: sTop, - down: sTop > scrollInfoRef.current.value || !sTop, + down: sTop - scrollInfoRef.current.value > -5 || !sTop, }; } }; const titleElement = () => { return ( - <> +