Skip to content

Commit

Permalink
Merge pull request #33 from so1s/SO1S-501
Browse files Browse the repository at this point in the history
SO1S-501 모델 업로드시 LinearProgress 애니메이션 처리
  • Loading branch information
NEM-NE authored Nov 16, 2022
2 parents 0042698 + 22255fa commit 5b40710
Show file tree
Hide file tree
Showing 2 changed files with 10 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
5 changes: 5 additions & 0 deletions src/pages/models/create-update-base.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
RadioGroup,
FormControlLabel,
Radio,
LinearProgress,
} from '@mui/material';
import { useAtom } from 'jotai';
import { ReactNode, useRef, useState } from 'react';
Expand Down Expand Up @@ -38,6 +39,7 @@ const CreateUpdateModelBase: React.FC<ICreateUpdateBaseParams> = ({
const [library, setLibrary] = useState<string>('tensorflow');
const [file, setFile] = useState<File | null>(null);
const [deviceType, setDeviceType] = useState<ModelType>('cpu');
const [isUploading, setIsUploading] = useState(false);

const modelNameRef = useRef<HTMLInputElement>(null);
const inputShapeRef = useRef<HTMLInputElement>(null);
Expand Down Expand Up @@ -110,6 +112,8 @@ const CreateUpdateModelBase: React.FC<ICreateUpdateBaseParams> = ({

const submitMode = type === 'create' ? 'post' : 'put';

setIsUploading(true);

const data = await createModelOrAddModelMetadata(
{
name: items['모델 이름'] ?? '',
Expand Down Expand Up @@ -265,6 +269,7 @@ const CreateUpdateModelBase: React.FC<ICreateUpdateBaseParams> = ({
))}
</Select>
</FormControl>
{isUploading && <LinearProgress color="primary" />}
</div>
</ActionCard>
);
Expand Down

0 comments on commit 5b40710

Please sign in to comment.