diff --git a/src/locales/en-US.json b/src/locales/en-US.json index 1beda10ddda..e2ffe6c87f0 100644 --- a/src/locales/en-US.json +++ b/src/locales/en-US.json @@ -451,5 +451,6 @@ "登录已过期,请重新登录": "Login session has expired, please log in again", "系统日志": "System Logs", "主题": "Theme", - "语言": "Language" + "语言": "Language", + "中...": "ing..." } diff --git a/src/locales/zh-CN.json b/src/locales/zh-CN.json index b58978014f4..44bd65a6b48 100644 --- a/src/locales/zh-CN.json +++ b/src/locales/zh-CN.json @@ -451,5 +451,6 @@ "登录已过期,请重新登录": "登录已过期,请重新登录", "系统日志": "系统日志", "主题": "主题", - "语言": "语言" + "语言": "语言", + "中...": "中..." } diff --git a/src/pages/crontab/logModal.tsx b/src/pages/crontab/logModal.tsx index 0c28c2ff221..de9959920e5 100644 --- a/src/pages/crontab/logModal.tsx +++ b/src/pages/crontab/logModal.tsx @@ -82,12 +82,12 @@ const CronLogModal = ({ handleCancel(); }; - const handleScroll = (e) => { - const sTop = e.target.scrollTop; + const handleScroll: React.UIEventHandler = (e) => { + const sTop = (e.target as HTMLDivElement).scrollTop; if (scrollInfoRef.current.down) { scrollInfoRef.current = { value: sTop, - down: sTop > scrollInfoRef.current.value, + down: sTop > scrollInfoRef.current.value || !sTop, }; } }; @@ -105,6 +105,7 @@ const CronLogModal = ({ useEffect(() => { if (cron && cron.id && visible) { getCronLog(true); + scrollInfoRef.current.down = true; } }, [cron, visible]); diff --git a/src/pages/setting/progress.tsx b/src/pages/setting/progress.tsx index 933f29c29a5..21d8788d624 100644 --- a/src/pages/setting/progress.tsx +++ b/src/pages/setting/progress.tsx @@ -1,3 +1,4 @@ +import intl from 'react-intl-universal'; import { Modal, Progress } from 'antd'; import { useRef } from 'react'; @@ -15,14 +16,14 @@ export default function useProgress(title: string) { const showProgress = (percent: number) => { if (modalRef.current) { modalRef.current.update({ - title: `${title}${percent >= 100 ? '成功' : '中...'}`, + title: `${title}${percent >= 100 ? intl.get('成功') : intl.get('中...')}`, content: , }); } else { modalRef.current = Modal.info({ width: 600, maskClosable: false, - title: `${title}${percent >= 100 ? '成功' : '中...'}`, + title: `${title}${percent >= 100 ? intl.get('成功') : intl.get('中...')}`, centered: true, content: , });