feat: show input media in UI
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
26
server.py
26
server.py
@@ -370,9 +370,19 @@ async def ui_runs():
|
||||
</div>
|
||||
''')
|
||||
|
||||
# Show input hash
|
||||
# Show input
|
||||
if run.inputs:
|
||||
html_parts.append(f'<div class="hash">Input: {run.inputs[0][:32]}...</div>')
|
||||
input_hash = run.inputs[0]
|
||||
html_parts.append(f'<div class="hash">Input: {input_hash[:32]}...</div>')
|
||||
input_cache_path = CACHE_DIR / input_hash
|
||||
if input_cache_path.exists():
|
||||
input_media_type = detect_media_type(input_cache_path)
|
||||
html_parts.append('<div class="media-container">')
|
||||
if input_media_type == "video":
|
||||
html_parts.append(f'<video src="/cache/{input_hash}" controls muted loop style="max-height:200px;"></video>')
|
||||
elif input_media_type == "image":
|
||||
html_parts.append(f'<img src="/cache/{input_hash}" alt="input" style="max-height:200px;">')
|
||||
html_parts.append('</div>')
|
||||
|
||||
# Show output if completed
|
||||
if run.status == "completed" and run.output_hash:
|
||||
@@ -439,7 +449,17 @@ async def ui_run_detail(run_id: str):
|
||||
'''
|
||||
|
||||
if run.inputs:
|
||||
html += f'<div class="hash">Input: {run.inputs[0][:32]}...</div>'
|
||||
input_hash = run.inputs[0]
|
||||
html += f'<div class="hash">Input: {input_hash[:32]}...</div>'
|
||||
input_cache_path = CACHE_DIR / input_hash
|
||||
if input_cache_path.exists():
|
||||
input_media_type = detect_media_type(input_cache_path)
|
||||
html += '<div class="media-container">'
|
||||
if input_media_type == "video":
|
||||
html += f'<video src="/cache/{input_hash}" controls muted loop style="max-height:200px;"></video>'
|
||||
elif input_media_type == "image":
|
||||
html += f'<img src="/cache/{input_hash}" alt="input" style="max-height:200px;">'
|
||||
html += '</div>'
|
||||
|
||||
if run.status == "completed" and run.output_hash:
|
||||
cache_path = CACHE_DIR / run.output_hash
|
||||
|
||||
Reference in New Issue
Block a user