UI: Fix AWSInstanceTable.js to show status of run commands

This commit is contained in:
vakarisz 2022-05-11 15:15:15 +03:00
parent d1d960abc2
commit 3702ecbc8c
1 changed files with 12 additions and 2 deletions

View File

@ -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 (
<div className="data-table-container">
<CheckboxTable