feat: 사이트 검사 동시 검사 수 설정 추가

- 기본값 2→4로 변경, 사용자가 [1, 2, 4, 8] 중 선택 가능
- 백엔드: concurrency 파라미터 추가 (API → 서비스 → Semaphore)
- 프론트: 드롭다운에 "동시 검사 수" 옵션 UI 추가

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
jungwoo choi
2026-02-13 17:44:22 +09:00
parent c440f1c332
commit 1e50b72fd8
6 changed files with 48 additions and 9 deletions

View File

@ -18,6 +18,9 @@ const MAX_PAGES_OPTIONS = [10, 20, 50, 0] as const;
/** 크롤링 깊이 옵션 */
const MAX_DEPTH_OPTIONS = [1, 2, 3] as const;
/** 동시 검사 수 옵션 */
const CONCURRENCY_OPTIONS = [1, 2, 4, 8] as const;
export function UrlInputForm() {
const [url, setUrl] = useState("");
const [error, setError] = useState<string | null>(null);
@ -26,6 +29,7 @@ export function UrlInputForm() {
const [showSiteOptions, setShowSiteOptions] = useState(false);
const [maxPages, setMaxPages] = useState<number>(20);
const [maxDepth, setMaxDepth] = useState<number>(2);
const [concurrency, setConcurrency] = useState<number>(4);
const router = useRouter();
const { setInspection } = useInspectionStore();
const { setSiteInspection } = useSiteInspectionStore();
@ -101,7 +105,8 @@ export function UrlInputForm() {
const response = await api.startSiteInspection(
trimmedUrl,
maxPages,
maxDepth
maxDepth,
concurrency
);
setSiteInspection(response.site_inspection_id, trimmedUrl);
router.push(
@ -225,7 +230,7 @@ export function UrlInputForm() {
</div>
{/* 크롤링 깊이 */}
<div className="mb-4">
<div className="mb-3">
<label className="text-xs text-muted-foreground mb-1.5 block">
</label>
@ -250,6 +255,32 @@ export function UrlInputForm() {
</div>
</div>
{/* 동시 검사 수 */}
<div className="mb-4">
<label className="text-xs text-muted-foreground mb-1.5 block">
</label>
<div className="flex gap-2">
{CONCURRENCY_OPTIONS.map((option) => (
<Button
key={option}
type="button"
variant={
concurrency === option ? "default" : "outline"
}
size="sm"
className={cn(
"flex-1",
concurrency === option && "pointer-events-none"
)}
onClick={() => setConcurrency(option)}
>
{option}
</Button>
))}
</div>
</div>
{/* 사이트 검사 시작 버튼 */}
<Button
type="button"

View File

@ -157,7 +157,8 @@ class ApiClient {
async startSiteInspection(
url: string,
maxPages?: number,
maxDepth?: number
maxDepth?: number,
concurrency?: number
): Promise<StartSiteInspectionResponse> {
return this.request("/api/site-inspections", {
method: "POST",
@ -165,6 +166,7 @@ class ApiClient {
url,
max_pages: maxPages,
max_depth: maxDepth,
concurrency: concurrency,
}),
});
}