mirror of
https://github.com/whyour/qinglong.git
synced 2026-08-12 19:30:48 +08:00
修复日志滚动逻辑
This commit is contained in:
@@ -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: <ProgressElement percent={percent} />,
|
||||
});
|
||||
} else {
|
||||
modalRef.current = Modal.info({
|
||||
width: 600,
|
||||
maskClosable: false,
|
||||
title: `${title}${percent >= 100 ? '成功' : '中...'}`,
|
||||
title: `${title}${percent >= 100 ? intl.get('成功') : intl.get('中...')}`,
|
||||
centered: true,
|
||||
content: <ProgressElement percent={percent} />,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user