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';
|
let color = 'inherit';
|
||||||
if (r) {
|
if (r) {
|
||||||
let instId = r.original.instance_id;
|
let instId = r.original.instance_id;
|
||||||
|
let runResult = getRunResults(instId);
|
||||||
if (isSelected(instId)) {
|
if (isSelected(instId)) {
|
||||||
color = '#ffed9f';
|
color = '#ffed9f';
|
||||||
} else if (Object.prototype.hasOwnProperty.call(props.results, instId)) {
|
} else if (runResult) {
|
||||||
color = props.results[instId] ? '#00f01b' : '#f00000'
|
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 (
|
return (
|
||||||
<div className="data-table-container">
|
<div className="data-table-container">
|
||||||
<CheckboxTable
|
<CheckboxTable
|
||||||
|
|
Loading…
Reference in New Issue