From 7935d86075a195c4fe5c3cb9c030f8c02870d046 Mon Sep 17 00:00:00 2001 From: KimKyuHoi Date: Fri, 15 Nov 2024 15:54:44 +0900 Subject: [PATCH 1/7] =?UTF-8?q?env:=20deploy=ED=8C=8C=EC=9D=BC=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 20fa14b..c0baa21 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -2,7 +2,7 @@ name: Deploy to Amazon S3 on: push: - branches: ['week11'] + branches: ['Master'] env: AWS_REGION: ap-northeast-2 From be586968664c8c2b381278b6cdb5b709ab313b75 Mon Sep 17 00:00:00 2001 From: KimKyuHoi Date: Fri, 15 Nov 2024 15:55:19 +0900 Subject: [PATCH 2/7] =?UTF-8?q?fix:=20api=20=ED=8C=8C=EC=9D=BC=20=EC=9D=B4?= =?UTF-8?q?=EB=8F=99=20=EB=B0=8F=20=EA=B2=BD=EB=A1=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../apis/{ => form}/postConvertForm.api.ts | 0 .../apis/{ => form}/postValidateUrl.api.ts | 0 src/pages/auto/apis/index.ts | 21 +++++++------ .../apis/{ => progress}/fetchTaskStatus.ts | 0 .../{ => select}/fetchSelectHighLight.api.ts | 0 .../{ => select}/fetchVideoExtract.api.ts | 4 +-- .../postHighlightSelection.api.ts | 30 ++++--------------- 7 files changed, 19 insertions(+), 36 deletions(-) rename src/pages/auto/apis/{ => form}/postConvertForm.api.ts (100%) rename src/pages/auto/apis/{ => form}/postValidateUrl.api.ts (100%) rename src/pages/auto/apis/{ => progress}/fetchTaskStatus.ts (100%) rename src/pages/auto/apis/{ => select}/fetchSelectHighLight.api.ts (100%) rename src/pages/auto/apis/{ => select}/fetchVideoExtract.api.ts (57%) rename src/pages/auto/apis/{ => select}/postHighlightSelection.api.ts (54%) diff --git a/src/pages/auto/apis/postConvertForm.api.ts b/src/pages/auto/apis/form/postConvertForm.api.ts similarity index 100% rename from src/pages/auto/apis/postConvertForm.api.ts rename to src/pages/auto/apis/form/postConvertForm.api.ts diff --git a/src/pages/auto/apis/postValidateUrl.api.ts b/src/pages/auto/apis/form/postValidateUrl.api.ts similarity index 100% rename from src/pages/auto/apis/postValidateUrl.api.ts rename to src/pages/auto/apis/form/postValidateUrl.api.ts diff --git a/src/pages/auto/apis/index.ts b/src/pages/auto/apis/index.ts index b564cf8..1786b12 100644 --- a/src/pages/auto/apis/index.ts +++ b/src/pages/auto/apis/index.ts @@ -1,12 +1,15 @@ -export { postValidateUrl } from './postValidateUrl.api'; -export type { ValidateUrlProps, UrlOnlyProps } from './postValidateUrl.api'; -export { postConvertForm } from './postConvertForm.api'; -export { useFetchTaskStatus } from './fetchTaskStatus'; -export { fetchSelectHighlight } from './fetchSelectHighLight.api'; -export type { fetchSelectHighlightResponseProps } from './fetchSelectHighLight.api'; -export { postHighlightSelection } from './postHighlightSelection.api'; +export { postValidateUrl } from './form/postValidateUrl.api'; +export type { + ValidateUrlProps, + UrlOnlyProps, +} from './form/postValidateUrl.api'; +export { postConvertForm } from './form/postConvertForm.api'; +export { useFetchTaskStatus } from './progress/fetchTaskStatus'; +export { fetchSelectHighlight } from './select/fetchSelectHighLight.api'; +export type { fetchSelectHighlightResponseProps } from './select/fetchSelectHighLight.api'; +export { postHighlightSelection } from './select/postHighlightSelection.api'; export type { hightlightSelectionRequestProps, hightlightSelectionResponseProps, -} from './postHighlightSelection.api'; -export { fetchVideoExtract } from './fetchVideoExtract.api'; +} from './select/postHighlightSelection.api'; +export { fetchVideoExtract } from './select/fetchVideoExtract.api'; diff --git a/src/pages/auto/apis/fetchTaskStatus.ts b/src/pages/auto/apis/progress/fetchTaskStatus.ts similarity index 100% rename from src/pages/auto/apis/fetchTaskStatus.ts rename to src/pages/auto/apis/progress/fetchTaskStatus.ts diff --git a/src/pages/auto/apis/fetchSelectHighLight.api.ts b/src/pages/auto/apis/select/fetchSelectHighLight.api.ts similarity index 100% rename from src/pages/auto/apis/fetchSelectHighLight.api.ts rename to src/pages/auto/apis/select/fetchSelectHighLight.api.ts diff --git a/src/pages/auto/apis/fetchVideoExtract.api.ts b/src/pages/auto/apis/select/fetchVideoExtract.api.ts similarity index 57% rename from src/pages/auto/apis/fetchVideoExtract.api.ts rename to src/pages/auto/apis/select/fetchVideoExtract.api.ts index 50df926..c73f690 100644 --- a/src/pages/auto/apis/fetchVideoExtract.api.ts +++ b/src/pages/auto/apis/select/fetchVideoExtract.api.ts @@ -1,9 +1,9 @@ -import { fetchFastInstance } from '@/apis/instance'; +import { fetchInstance } from '@/apis/instance'; const fetchVideoExtractPath = (videoId: number) => `/api/videos/${videoId}/extract`; export const fetchVideoExtract = async (videoId: number) => { - const response = await fetchFastInstance.get(fetchVideoExtractPath(videoId)); + const response = await fetchInstance.get(fetchVideoExtractPath(videoId)); return response.data; }; diff --git a/src/pages/auto/apis/postHighlightSelection.api.ts b/src/pages/auto/apis/select/postHighlightSelection.api.ts similarity index 54% rename from src/pages/auto/apis/postHighlightSelection.api.ts rename to src/pages/auto/apis/select/postHighlightSelection.api.ts index 7d2e458..a84f315 100644 --- a/src/pages/auto/apis/postHighlightSelection.api.ts +++ b/src/pages/auto/apis/select/postHighlightSelection.api.ts @@ -2,43 +2,23 @@ import { fetchFastInstance } from '@/apis'; export type hightlightSelectionRequestProps = { index: number; - fileName: string; - title: string; - memberId: number; - categoryId: number; + task_id: string; }; -// export type PythonDTO = { -// url: string; -// email: string; -// title: string; -// memberId: number; -// categoryId: number; -// }; - export type hightlightSelectionResponseProps = { - videoId: number; - thumbnail: string; - title: string; - memberId: number; - createdAt: Date; + message: string; + video_id: number; }; const postHighlightSelectionPath = () => '/select-highlight'; export const postHighlightSelection = async ({ index, - fileName, - title, - memberId, - categoryId, + task_id, }: hightlightSelectionRequestProps): Promise => { const response = await fetchFastInstance.post(postHighlightSelectionPath(), { index, - fileName, - title, - memberId, - categoryId, + task_id, }); return response.data; From 80ff785572faba59793eb00d494433e6240d09bd Mon Sep 17 00:00:00 2001 From: KimKyuHoi Date: Fri, 15 Nov 2024 15:55:44 +0900 Subject: [PATCH 3/7] =?UTF-8?q?feat:=20progressView=20=EB=B0=8F=20finalVIe?= =?UTF-8?q?w=20=EC=98=88=EC=99=B8=20=EC=83=81=ED=99=A9=20=EC=B2=98?= =?UTF-8?q?=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/auto/components/final/FinalView.tsx | 70 ++++++++----------- .../auto/components/loading/ProgressView.tsx | 8 +++ 2 files changed, 39 insertions(+), 39 deletions(-) diff --git a/src/pages/auto/components/final/FinalView.tsx b/src/pages/auto/components/final/FinalView.tsx index aa11f90..331bcee 100644 --- a/src/pages/auto/components/final/FinalView.tsx +++ b/src/pages/auto/components/final/FinalView.tsx @@ -2,7 +2,7 @@ import { useState } from 'react'; import styled from 'styled-components'; -import { Button } from '@/components'; +import { Button, Spinner } from '@/components'; import { fetchVideoExtract, postHighlightSelection } from '@/pages/auto/apis'; import { InitBtn } from '@/pages/auto/components'; @@ -11,19 +11,10 @@ import ConvertShorts from './ConvertShorts'; const FinalView = () => { const [selectedIndex, setSelectedIndex] = useState(null); + const [isLoading, setIsLoading] = useState(false); - const [categoryId, setCategoryId] = useState(null); - const [titles, setTitle] = useState(null); - - const handleSelectVideo = ( - index: number, - - title: string, - category_id: number - ) => { + const handleSelectVideo = (index: number) => { setSelectedIndex(index); - setCategoryId(category_id); - setTitle(title); }; const handleUpload = async () => { @@ -32,44 +23,45 @@ const FinalView = () => { return; } - const memberId = parseInt(sessionStorage.getItem('member_id') ?? '0', 10); - const title = titles ?? ''; - - // const pythonDto = { - // url: sessionStorage.getItem('initialUrl') ?? '', - // email, - // title, - // memberId, - // categoryId: categoryId ?? 0, - // }; - + setIsLoading(true); try { - // console.log({ index: selectedIndex, s3Url: selectedUrl, pythonDto }); const response = await postHighlightSelection({ index: selectedIndex, - fileName: sessionStorage.getItem('task_id') ?? '', - title, - memberId, - categoryId: categoryId ?? 0, + task_id: sessionStorage.getItem('task_id') ?? '', }); - const videoId = response.videoId; - console.log('Video ID:', videoId); + alert('비디오 업로드 중입니다. 잠시만 기다려주세요.'); - // videoId로 다운로드 URL 받기 - const extractResponse = await fetchVideoExtract(videoId); // videoId를 string으로 변환하여 전달 + const videoId = response.video_id; + console.log('Video ID:', videoId); - // URL을 통해 비디오 다운로드 (예시) - const link = document.createElement('a'); - link.href = extractResponse; - link.download = 'video.mp4'; - link.click(); + // // Presigned URL을 통해 다운로드 링크 가져오기 + const downloadUrl = await fetchVideoExtract(videoId); + if (!downloadUrl) { + throw new Error('Failed to fetch video download URL'); + } + + console.log('Download URL:', downloadUrl); + // 새로운 창에서 다운로드 + const downloadWindow = window.open('', '_blank'); + if (!downloadWindow) { + alert('팝업 차단이 되어 있는 것 같습니다. 팝업 차단을 해제해주세요.'); + return; + } + + // 새로운 창에서 다운로드를 위한 태그 생성 + const anchor = downloadWindow.document.createElement('a'); + anchor.href = downloadUrl; + anchor.target = '_self'; // 새 창 내에서 동작하도록 설정 + anchor.download = 'video.mp4'; // 다운로드 파일명 설정 + anchor.click(); alert('비디오 업로드 성공'); - console.log('Response:', response); } catch (error) { console.error('Error uploading video:', error); alert('업로드 중 오류가 발생했습니다.'); + } finally { + setIsLoading(false); // 로딩 완료 } }; @@ -78,7 +70,7 @@ const FinalView = () => { diff --git a/src/pages/auto/components/loading/ProgressView.tsx b/src/pages/auto/components/loading/ProgressView.tsx index 606a4e8..5b97055 100644 --- a/src/pages/auto/components/loading/ProgressView.tsx +++ b/src/pages/auto/components/loading/ProgressView.tsx @@ -27,6 +27,11 @@ const ProgressView = ({ sessionStorage.setItem('status', 'completed'); setProcessState('final'); clearInterval(pollingInterval); + } else if (refetchedData?.status === 'failed') { + sessionStorage.setItem('status', 'failed'); + alert('데이터 추출에 실패했습니다. 다시 시도해주세요.'); + setProcessState('initial'); + clearInterval(pollingInterval); } else { sessionStorage.setItem('status', refetchedData?.status ?? ''); updateProgressBar(refetchedData?.status ?? ''); @@ -65,6 +70,9 @@ const ProgressView = ({ case 'completed': setProgress(100); break; + case 'failed': + setProgress(0); + break; default: break; } From 4c729520c4248ca26bfdd5f038fbba994dbc6d07 Mon Sep 17 00:00:00 2001 From: KimKyuHoi Date: Fri, 15 Nov 2024 15:55:52 +0900 Subject: [PATCH 4/7] =?UTF-8?q?remove:=20=ED=8C=8C=EC=9D=BC=20=EC=A0=9C?= =?UTF-8?q?=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/styles/.gitkeep | 0 src/types/.gitkeep | 0 2 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 src/styles/.gitkeep delete mode 100644 src/types/.gitkeep diff --git a/src/styles/.gitkeep b/src/styles/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/src/types/.gitkeep b/src/types/.gitkeep deleted file mode 100644 index e69de29..0000000 From 4b48694e72093e68a5c24ba61ad2a46204b50ef6 Mon Sep 17 00:00:00 2001 From: KimKyuHoi Date: Fri, 15 Nov 2024 15:56:04 +0900 Subject: [PATCH 5/7] =?UTF-8?q?fix:=20instance=20timeout=20=EC=8B=9C?= =?UTF-8?q?=EA=B0=84=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apis/instance/Instance.api.ts | 2 +- src/apis/instance/InstanceFast.api.ts | 55 ++------------------------- 2 files changed, 4 insertions(+), 53 deletions(-) diff --git a/src/apis/instance/Instance.api.ts b/src/apis/instance/Instance.api.ts index 24d3918..05c1f32 100644 --- a/src/apis/instance/Instance.api.ts +++ b/src/apis/instance/Instance.api.ts @@ -17,7 +17,7 @@ const baseURL = isMSWEnvironment ? 'http://localhost:5173' : `${BASE_URL}`; export const createInstance = (config: AxiosRequestConfig): AxiosInstance => { const instance = axios.create({ - timeout: 5000, + timeout: 10000, ...config, baseURL, headers: { diff --git a/src/apis/instance/InstanceFast.api.ts b/src/apis/instance/InstanceFast.api.ts index ef888d0..5e2a846 100644 --- a/src/apis/instance/InstanceFast.api.ts +++ b/src/apis/instance/InstanceFast.api.ts @@ -1,12 +1,10 @@ import axios from 'axios'; import type { AxiosInstance, - AxiosRequestConfig, - InternalAxiosRequestConfig, + AxiosRequestConfig, // InternalAxiosRequestConfig, } from 'axios'; -import { postReissue } from '@/apis/auth'; - +// import { postReissue } from '@/apis/auth'; import { BASE_FAST_URL } from '@/constants/URI'; const isMSWEnvironment = import.meta.env.VITE_RUN_MSW === 'true'; @@ -19,7 +17,7 @@ export const createFastInstance = ( config: AxiosRequestConfig ): AxiosInstance => { const instance = axios.create({ - timeout: 5000, + timeout: 15000, withCredentials: true, ...config, baseURL: fastBaseURL, @@ -30,53 +28,6 @@ export const createFastInstance = ( }, }); - instance.interceptors.request.use( - (config: InternalAxiosRequestConfig) => { - const accessToken = localStorage.getItem('accessToken'); - const isReissueRequest = config.url?.includes('/api/reissue'); - - if (accessToken && !isReissueRequest) { - config.headers['Authorization'] = `Bearer ${accessToken}`; - } - - return config; - }, - (error: unknown) => Promise.reject(error) - ); - - // console.log(instance.interceptors.response); - - instance.interceptors.response.use( - (response) => response, - async (error) => { - const { config, response } = error; - if (response.status === 401) { - const refreshToken = localStorage.getItem('refreshToken'); - // console.log('Refresh token:', refreshToken); - if (refreshToken) { - try { - const data = await postReissue({ refreshToken }); - console.log('Reissue success:', data); - - localStorage.setItem('accessToken', data.access_token); - localStorage.setItem('refreshToken', data.refresh_token); - - config.headers['Authorization'] = `Bearer ${data.access_token}`; - return axios(config); - } catch (reissueError) { - // console.log('Reissue failed:', reissueError); - return Promise.reject(reissueError); - } - } else { - console.error('No refresh token found'); - return Promise.reject(error); - } - } - - return Promise.reject(error); - } - ); - return instance; }; From ed063fe23de21081233bab6b10c4833ff0f9a52d Mon Sep 17 00:00:00 2001 From: KimKyuHoi Date: Fri, 15 Nov 2024 16:02:59 +0900 Subject: [PATCH 6/7] =?UTF-8?q?feat:=20index.html=20=ED=8C=8C=EC=9D=BC=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 4 ++-- public/Logo.png | Bin 0 -> 4038 bytes 2 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 public/Logo.png diff --git a/index.html b/index.html index e4b78ea..e03f420 100644 --- a/index.html +++ b/index.html @@ -2,9 +2,9 @@ - + - Vite + React + TS + TALKAK
diff --git a/public/Logo.png b/public/Logo.png new file mode 100644 index 0000000000000000000000000000000000000000..b1a583d549e6f02628890adee9f885cc63a00c5a GIT binary patch literal 4038 zcmV;%4>|COP)z1^@s6?0*Z<00009a7bBm000&x z000&x0ZCFM@Bjb+0drDELIAGL9O(c600d`2O+f$vv5yP984+9>7^ zh+tnC8XO4;429=OKtW>z5(SpM?|!{IWIUc9_xH}uo{uy#_AcJ>o$s7E_ndR@A=*t- z91G%D6Gy-1$1QPO7Dqt-iN_h|uwH@lsV%4Jp8=kv1Ap^3@erWP z<21P^AbG>#<9upMK$B^q)5kiwfAp^@o==k)WnQ6yZ^wft#^CL@-(LIWmtUyeZpS}c znVOnf+1lDVfAr|lh|HKLwVS5-$tRyIFD)%KhySl>`Fv_ig9bhxBY61mA$|Gfm-O`M z)A&cT{eHjGXf$r!y?fWx&z&PhHa9otXmEX+4$h~xu&7f&*x!BkUHZpOVIdb+S65Gy zJ|B=GckbNDd&$Q6)RqP@d-(IuKk4Spn^`X{384j49hTPC*4TAS0Z~W9?BUyQzfHO! zF-`I4zj5#0y{bIjnlE0wU^gTMM16&rJ-`k5>8GEvUJ8U?yId6uDb9u6#}p9t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Me`-hKDooqbMdFpn{+OpJw{nv6F4{r(LhY^m-7Y^n7K z#o=vvk^xn!U3ks>IwG@wfsgmduVL2?9cydEiHcs?Py zbl9?;-o z{yXtmk+6mV>a+=l1SBYOnHuko1NB84s6#QDsOa!k^nKZ&B=g_t>aWE;|>vy_EK zJh*@x!_V%D&sJS*dac!JIh{?S)DtmanfF?19~X;yLv>8Dwh5m2&yt|Q zM&h%(GM}9QPYUPROFRY8NvrIA7W*N-EL~L`lW1#eYtMTp-crXP)`?A3X!qj~O?Y;S zbX@i=k+Dv&Nc;BfJ7=?pcNs-v0x`L4P9!lVxvn6KI)gZv@3UV?j(~9CuI%5xf61qq sv*0mdjKE}#m|b8@cw88UVd}#F0i9-Lkijm@MgRZ+07*qoM6N<$g0*p{zW@LL literal 0 HcmV?d00001 From a143b311a63f76ac610ab4b385d9ec75eac24ef6 Mon Sep 17 00:00:00 2001 From: KimKyuHoi Date: Fri, 15 Nov 2024 16:05:41 +0900 Subject: [PATCH 7/7] =?UTF-8?q?feat:=20=EC=97=85=EB=A1=9C=EB=93=9C=20?= =?UTF-8?q?=EC=9D=B4=ED=9B=84=20=ED=99=94=EB=A9=B4=20=EA=B2=BD=EB=A1=9C=20?= =?UTF-8?q?=EC=B4=88=EA=B8=B0=ED=99=94=EB=A9=B4=20=EC=9D=B4=EB=8F=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/auto/components/final/FinalView.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/pages/auto/components/final/FinalView.tsx b/src/pages/auto/components/final/FinalView.tsx index 331bcee..f4ff54f 100644 --- a/src/pages/auto/components/final/FinalView.tsx +++ b/src/pages/auto/components/final/FinalView.tsx @@ -6,12 +6,14 @@ import { Button, Spinner } from '@/components'; import { fetchVideoExtract, postHighlightSelection } from '@/pages/auto/apis'; import { InitBtn } from '@/pages/auto/components'; +import { useProcessContext } from '@/pages/auto/provider'; import ConvertShorts from './ConvertShorts'; const FinalView = () => { const [selectedIndex, setSelectedIndex] = useState(null); const [isLoading, setIsLoading] = useState(false); + const { setProcessState } = useProcessContext(); const handleSelectVideo = (index: number) => { setSelectedIndex(index); @@ -56,7 +58,9 @@ const FinalView = () => { anchor.download = 'video.mp4'; // 다운로드 파일명 설정 anchor.click(); - alert('비디오 업로드 성공'); + alert('비디오 업로드 성공, 초기화면으로 이동합니다.'); + setProcessState('initial'); + window.location.href = '/'; } catch (error) { console.error('Error uploading video:', error); alert('업로드 중 오류가 발생했습니다.');