Skip to content
Snippets Groups Projects
Commit 39413762 authored by Zoltan Runyo's avatar Zoltan Runyo
Browse files

ICSHWI-8363: REST API clean up (frontend modifications)

parent f8545742
No related branches found
No related tags found
1 merge request!85ICSHWI-8363 REST API clean up
...@@ -9,16 +9,16 @@ export function CommandJobStatus({ awxCommandId, actionType }) { ...@@ -9,16 +9,16 @@ export function CommandJobStatus({ awxCommandId, actionType }) {
useEffect(() => { useEffect(() => {
if (commandJob) { if (commandJob) {
if (!(["successful", "failed"].includes(commandJob.command.status.toLowerCase()))) { if (!(["successful", "failed"].includes(commandJob.status.toLowerCase()))) {
if (commandJob.command.status.toLowerCase() === "running") { if (commandJob.status.toLowerCase() === "running") {
setActiveStep(1); setActiveStep(1);
} }
setTimeout(getCommandJob, 3000); setTimeout(getCommandJob, 3000);
} else { } else {
if (commandJob.command.status.toLowerCase() === "successful") { if (commandJob.status.toLowerCase() === "successful") {
setActiveStep(3); setActiveStep(3);
} }
if (commandJob.command.status.toLowerCase() === "failed") { if (commandJob.status.toLowerCase() === "failed") {
setActiveStep(1); setActiveStep(1);
} }
} }
...@@ -34,7 +34,7 @@ export function CommandJobStatus({ awxCommandId, actionType }) { ...@@ -34,7 +34,7 @@ export function CommandJobStatus({ awxCommandId, actionType }) {
const steps = ['Queued ', 'Running', actionType + ' Completed']; const steps = ['Queued ', 'Running', actionType + ' Completed'];
const isStepFailed = (step) => { const isStepFailed = (step) => {
if (commandJob?.command.status.toLowerCase() === "failed") { if (commandJob?.status.toLowerCase() === "failed") {
return step === activeStep; return step === activeStep;
} }
return false; return false;
......
...@@ -22,12 +22,12 @@ export function DeploymentJobOutput({ awxJobId, update }) { ...@@ -22,12 +22,12 @@ export function DeploymentJobOutput({ awxJobId, update }) {
}, [update, oneMoreIteration, getDeploymentJob]); }, [update, oneMoreIteration, getDeploymentJob]);
const dataReady = () => { const dataReady = () => {
return deploymentJob?.job.started; return deploymentJob?.started;
} }
return( return(
<Container> <Container>
{deploymentJob?.job.started ? {deploymentJob?.started ?
<div style={{ <div style={{
width: "100%", width: "100%",
}}> }}>
...@@ -39,7 +39,7 @@ export function DeploymentJobOutput({ awxJobId, update }) { ...@@ -39,7 +39,7 @@ export function DeploymentJobOutput({ awxJobId, update }) {
<Typography style={{ <Typography style={{
marginLeft: "6px", marginLeft: "6px",
}}> }}>
{deploymentJob?.job.elapsed.toFixed(0)} s {deploymentJob?.elapsed.toFixed(0)} s
</Typography> </Typography>
</div> </div>
<ConsoleOutput <ConsoleOutput
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment