diff --git a/src/main/java/com/hlab/yanalyst/domain/shortform/dto/ShortformDtos.java b/src/main/java/com/hlab/yanalyst/domain/shortform/dto/ShortformDtos.java index c6953cf..1a0984d 100644 --- a/src/main/java/com/hlab/yanalyst/domain/shortform/dto/ShortformDtos.java +++ b/src/main/java/com/hlab/yanalyst/domain/shortform/dto/ShortformDtos.java @@ -36,11 +36,12 @@ public final class ShortformDtos { public record JobDetail(Long id, String youtubeUrl, String videoId, String title, String status, LocalDateTime createdAt, LocalDateTime completedAt, - List clips) { + String rawOutput, List clips) { public static JobDetail from(ShortformJob job) { return new JobDetail(job.getId(), job.getYoutubeUrl(), job.getVideoId(), job.getTitle(), job.getStatus().name(), job.getCreatedAt(), - job.getCompletedAt(), job.getClips().stream().map(ClipDto::from).toList()); + job.getCompletedAt(), job.getRawOutput(), + job.getClips().stream().map(ClipDto::from).toList()); } } } diff --git a/src/main/resources/templates/shortform.html b/src/main/resources/templates/shortform.html index 06777b4..2503730 100644 --- a/src/main/resources/templates/shortform.html +++ b/src/main/resources/templates/shortform.html @@ -103,16 +103,24 @@ async function toggleJob(id, el) { if (el.classList.contains('open')) { el.classList.remove('open'); return; } const detail = await api('/api/shortform/jobs/' + id); - el.querySelector('.sf-clips').innerHTML = detail.clips.length + const toolbar = `
+ + +
`; + el.querySelector('.sf-clips').innerHTML = toolbar + (detail.clips.length ? detail.clips.map(clipHtml).join('') - : '

저장된 클립이 없습니다. 결과 붙여넣기 또는 "숏폼 큐 돌려줘"로 채우세요.

'; + : '

저장된 클립이 없습니다. 결과 붙여넣기 또는 "숏폼 큐 돌려줘"로 채우세요.

'); el.classList.add('open'); el.querySelectorAll('[data-copy]').forEach(btn => { + const label = btn.dataset.label || 'capcut2 JSON 복사'; btn.onclick = (e) => { e.stopPropagation(); navigator.clipboard.writeText(decodeURIComponent(btn.dataset.copy)); btn.textContent = '복사됨!'; - setTimeout(() => btn.textContent = 'capcut2 JSON 복사', 1200); + setTimeout(() => btn.textContent = label, 1200); }; }); }