fix: 修复 Job 扩缩副本任务明细错误的问题

This commit is contained in:
GraceWalk
2022-09-13 14:31:45 +08:00
parent 83f7f5468b
commit c9b4d45a64
3 changed files with 17 additions and 7 deletions

View File

@@ -61,9 +61,11 @@ const columns: any = [
const totalSize = r.totalSize ? Number(Utils.formatAssignSize(t, 'MB')) : 0;
return (
<div className="message-size">
<Tooltip title={(movedSize > 0 && totalSize > 0 ? (movedSize / totalSize) * 100 : 0) + '%'}>
<Tooltip
title={(movedSize === 0 && totalSize === 0 ? 100 : movedSize > 0 && totalSize > 0 ? (movedSize / totalSize) * 100 : 0) + '%'}
>
<Progress
percent={movedSize > 0 && totalSize > 0 ? (movedSize / totalSize) * 100 : 0}
percent={movedSize === 0 && totalSize === 0 ? 100 : movedSize > 0 && totalSize > 0 ? (movedSize / totalSize) * 100 : 0}
strokeColor="#556EE6"
trailColor="#ECECF1"
showInfo={false}

View File

@@ -314,9 +314,13 @@ export const getTaskDetailsColumns = (arg?: any) => {
const totalSize = r.totalSize ? Number(Utils.formatAssignSize(t, 'MB')) : 0;
return (
<div className="message-size">
<Tooltip title={(movedSize > 0 && totalSize > 0 ? (movedSize / totalSize) * 100 : 0) + '%'}>
<Tooltip
title={
(r.success === r.total && r.total > 0 ? 100 : movedSize > 0 && totalSize > 0 ? (movedSize / totalSize) * 100 : 0) + '%'
}
>
<Progress
percent={movedSize > 0 && totalSize > 0 ? (movedSize / totalSize) * 100 : 0}
percent={r.success === r.total && r.total > 0 ? 100 : movedSize > 0 && totalSize > 0 ? (movedSize / totalSize) * 100 : 0}
strokeColor="#556EE6"
showInfo={false}
/>
@@ -438,9 +442,13 @@ export const getMoveBalanceColumns = (arg?: any) => {
const totalSize = r.totalSize ? Number(Utils.formatAssignSize(t, 'MB')) : 0;
return (
<div className="message-size">
<Tooltip title={(movedSize > 0 && totalSize > 0 ? (movedSize / totalSize) * 100 : 0) + '%'}>
<Tooltip
title={
(r.success === r.total && r.total > 0 ? 100 : movedSize > 0 && totalSize > 0 ? (movedSize / totalSize) * 100 : 0) + '%'
}
>
<Progress
percent={movedSize > 0 && totalSize > 0 ? (movedSize / totalSize) * 100 : 0}
percent={r.success === r.total && r.total > 0 ? 100 : movedSize > 0 && totalSize > 0 ? (movedSize / totalSize) * 100 : 0}
strokeColor="#556EE6"
showInfo={false}
/>

View File

@@ -209,7 +209,7 @@ const JobsList: React.FC = (props: any) => {
tableProps={{
tableId: 'jobs_list',
showHeader: false,
rowKey: 'jobs_list',
rowKey: 'id',
loading: loading,
columns: getJobsListColumns({ onDelete, setViewProgress }),
dataSource: data,