mirror of
https://github.com/headporter81/ss-front-react.git
synced 2026-12-06 07:41:11 +09:00
feat : 업로드 조각 3개 동시 전송, 조각 진행(n/전체) 표시, 실패 시 조각 번호·원인 표시
SpecialSource Frontend (React) CD / deploy (push) Successful in 17s
SpecialSource Frontend (React) CD / deploy (push) Successful in 17s
https가 아닌 주소에서도 동작하도록 업로드 id 생성 대체 구현. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
8c63189028
commit
9a8ee17075
2 files changed
+81
-23
No files matched your search
@@ -1,5 +1,5 @@
|
||||
import { useState, type FormEvent } from "react";
|
||||
import { createMediaPost, uploadMediaFiles } from "../api";
|
||||
import { createMediaPost, uploadMediaFiles, type UploadProgress } from "../api";
|
||||
import type { MediaPost, MediaQuery } from "../types";
|
||||
import DatePicker from "./DatePicker";
|
||||
import { MoreSentinel } from "./PostList";
|
||||
@@ -33,7 +33,7 @@ const EMPTY_SEARCH = { q: "", from: "", to: "" };
|
||||
export default function MediaList(props: Props) {
|
||||
const { posts, total, last, onMore, categories, query, token, onSelect, onQuery, onCreated, onError } = props;
|
||||
const [busy, setBusy] = useState(false);
|
||||
const [uploaded, setUploaded] = useState<number | null>(null); // 업로드 중이면 보낸 비율(%)
|
||||
const [uploaded, setUploaded] = useState<UploadProgress | null>(null); // 업로드 중이면 진행 상황
|
||||
const tabs = [{ key: null, name: "전체" }, ...categories.map((c) => ({ key: c, name: c })), { key: "", name: "미분류" }];
|
||||
const searching = query.q || query.from || query.to;
|
||||
|
||||
@@ -115,7 +115,11 @@ export default function MediaList(props: Props) {
|
||||
<input name="title" className={styles.wide} placeholder="비우면 영상·파일 제목으로" maxLength={500} />
|
||||
</label>
|
||||
<button type="submit" disabled={busy}>
|
||||
{uploaded !== null ? `업로드 ${bar(uploaded, 10)}` : busy ? "요청중..." : "등록"}
|
||||
{uploaded !== null
|
||||
? `업로드 ${bar(uploaded.percent, 10)} · 조각 ${uploaded.done}/${uploaded.total}`
|
||||
: busy
|
||||
? "요청중..."
|
||||
: "등록"}
|
||||
</button>
|
||||
</form>
|
||||
<hr className={styles.rule} />
|
||||
|
||||
Reference in new issue
Block a user