Skip to content

Commit

Permalink
feat: show linear progress bar when deployment upload
Browse files Browse the repository at this point in the history
  • Loading branch information
NEM-NE committed Nov 16, 2022
1 parent 0eb5603 commit 22255fa
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/pages/deployments/create-update-base.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
FormControlLabel,
Radio,
Slider,
LinearProgress,
} from '@mui/material';
import { pipe } from 'fp-ts/lib/function';
import { useAtom } from 'jotai';
Expand Down Expand Up @@ -57,6 +58,7 @@ const CreateUpdateDeploymentBase: React.FC<ICreateUpdateBaseParams> = ({
const standardValueRef = useRef<HTMLInputElement>(null);
const [replicaRange, setReplicaRange] = useState<number[]>([1, 4]);
const [radioValue, setRadioValue] = useState<ScalingToggleMode>('REPLICAS');
const [isUploading, setIsUploading] = useState(false);

const handleChangeModel = (
event: SelectChangeEvent<number>,
Expand Down Expand Up @@ -133,6 +135,8 @@ const CreateUpdateDeploymentBase: React.FC<ICreateUpdateBaseParams> = ({
maxReplicas: replicaRange[1],
};

setIsUploading(true);

const data = await createDeploymentOrPut(
{
name: itemsWithValues['Deployment Name'] as string,
Expand Down Expand Up @@ -405,6 +409,7 @@ const CreateUpdateDeploymentBase: React.FC<ICreateUpdateBaseParams> = ({
/>
)}
</div>
{isUploading && <LinearProgress color="primary" />}
</ActionCard>
);
};
Expand Down

0 comments on commit 22255fa

Please sign in to comment.