forked from p15670423/monkey
UI: Fix AWSInstanceTable.js to show status of run commands
This commit is contained in:
parent
d1d960abc2
commit
3702ecbc8c
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue