Skip to content

Commit

Permalink
Merge pull request #8 from choitaedong2/model_utility
Browse files Browse the repository at this point in the history
update model utility
  • Loading branch information
0-wook authored Nov 28, 2023
2 parents 2ec8369 + 9005c39 commit f52414e
Show file tree
Hide file tree
Showing 8 changed files with 335 additions and 449 deletions.
14 changes: 0 additions & 14 deletions app/user-web/src/api/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,6 @@ function getMetadatas() {
return axios.get("/metadata").then((response) => response.data.data);
}

function getFeatureSelectionContent() {
return axios
.get("/data/feature-selection.json")
.then((response) => response.data);
}

function getNavigationContent() {
return axios
.get("/data/data-navigation-content.json")
.then((response) => response.data);
}

// 사용자별 모델학습결과 리스트
function getModelLearningResult() {
const headers = {};
Expand Down Expand Up @@ -88,8 +76,6 @@ function getConzonImputatedData(conzonId, conzonDate) {

export {
getMetadatas,
getFeatureSelectionContent,
getNavigationContent,
getModelLearningResult,
getUserInfo,
deleteModelLearningResult,
Expand Down
23 changes: 23 additions & 0 deletions app/user-web/src/api/s3.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
import axios from "axios";

export async function getPreSignedUrl(filename) {
return axios.get(`/url/presigned?filename=${filename}`).then((response) => ({
uploadUrl: response.data.uploadUrl,
downloadUrl: response.data.downloadUrl,
}));
}

export async function uploadFileToS3(preSignedUrl, file, setUploadPercent) {
return axios.put(preSignedUrl, file, {
withCredentials: true,
headers: {
"Content-Type": "multipart/form-data",
},
onUploadProgress: function (progressEvent) {
const percentCompleted = Math.round(
(progressEvent.loaded * 100) / progressEvent.total
);

setUploadPercent(percentCompleted);
},
});
}

export async function deleteFileFromS3(keys) {
return axios.post(`/files`, keys);
}
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,8 @@ const ModelLearningContent = () => {
const [selectedRow, setSelectedRow] = useState(false);

// step2
const [anyTargetVariableChecked, setAnyTargetVariableChecked] = useState(
false
);
const [anyTargetVariableChecked, setAnyTargetVariableChecked] =
useState(false);

// step3
const [anyTargetVariableUsed, setAnyTargetVariableUsed] = useState(false);
Expand All @@ -193,9 +192,8 @@ const ModelLearningContent = () => {
LearnModelRequestReducer,
INIT_LEARN_MODEL_REQUEST
);
const [allLearnModelRequestFilled, setAllLearnModelRequestFilled] = useState(
true
);
const [allLearnModelRequestFilled, setAllLearnModelRequestFilled] =
useState(true);

useEffect(() => {
setDownloadUrl(downloadUrl);
Expand Down

This file was deleted.

Loading

0 comments on commit f52414e

Please sign in to comment.