From c9dd244ce4faeee3b509697b44107f9b4c77eb6f Mon Sep 17 00:00:00 2001 From: Dima Arnautov Date: Mon, 18 Nov 2024 13:55:00 +0100 Subject: [PATCH 1/2] fix isNaN issue --- .../ml/public/application/model_management/models_list.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/x-pack/plugins/ml/public/application/model_management/models_list.tsx b/x-pack/plugins/ml/public/application/model_management/models_list.tsx index a717995d4ee14..8c2f44781b37f 100644 --- a/x-pack/plugins/ml/public/application/model_management/models_list.tsx +++ b/x-pack/plugins/ml/public/application/model_management/models_list.tsx @@ -697,8 +697,7 @@ export const ModelsList: FC = ({ <> {downloadState ? ( - (downloadState.downloaded_parts / downloadState.total_parts) * - 100 + (downloadState.downloaded_parts / downloadState.total_parts || -1) * 100 ).toFixed(0) + '%' : '100%'} From 9b759a565b692c5ddf0fe2665f22b0060e8b6c1e Mon Sep 17 00:00:00 2001 From: Dima Arnautov Date: Thu, 21 Nov 2024 16:29:40 +0100 Subject: [PATCH 2/2] add brackets --- .../ml/public/application/model_management/models_list.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/x-pack/plugins/ml/public/application/model_management/models_list.tsx b/x-pack/plugins/ml/public/application/model_management/models_list.tsx index 8c2f44781b37f..d66ab1ab3db16 100644 --- a/x-pack/plugins/ml/public/application/model_management/models_list.tsx +++ b/x-pack/plugins/ml/public/application/model_management/models_list.tsx @@ -697,7 +697,8 @@ export const ModelsList: FC = ({ <> {downloadState ? ( - (downloadState.downloaded_parts / downloadState.total_parts || -1) * 100 + (downloadState.downloaded_parts / (downloadState.total_parts || -1)) * + 100 ).toFixed(0) + '%' : '100%'}