From 3702ecbc8c4327b60f8cd0df155f4b5b97347f9e Mon Sep 17 00:00:00 2001 From: vakarisz Date: Wed, 11 May 2022 15:15:15 +0300 Subject: [PATCH] UI: Fix AWSInstanceTable.js to show status of run commands --- .../RunMonkeyPage/RunOnAWS/AWSInstanceTable.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/monkey/monkey_island/cc/ui/src/components/pages/RunMonkeyPage/RunOnAWS/AWSInstanceTable.js b/monkey/monkey_island/cc/ui/src/components/pages/RunMonkeyPage/RunOnAWS/AWSInstanceTable.js index cf792f7b8..f9e90831e 100644 --- a/monkey/monkey_island/cc/ui/src/components/pages/RunMonkeyPage/RunOnAWS/AWSInstanceTable.js +++ b/monkey/monkey_island/cc/ui/src/components/pages/RunMonkeyPage/RunOnAWS/AWSInstanceTable.js @@ -70,10 +70,11 @@ function AWSInstanceTable(props) { let color = 'inherit'; if (r) { let instId = r.original.instance_id; + let runResult = getRunResults(instId); if (isSelected(instId)) { color = '#ffed9f'; - } else if (Object.prototype.hasOwnProperty.call(props.results, instId)) { - color = props.results[instId] ? '#00f01b' : '#f00000' + } else if (runResult) { + color = runResult.status === "error" ? '#f00000' : '#00f01b' } } @@ -82,6 +83,15 @@ function AWSInstanceTable(props) { }; } + function getRunResults(instanceId) { + for(let result of props.results){ + if (result.instance_id === instanceId){ + return result + } + } + return false + } + return (