diff --git a/server.py b/server.py index 37994b1..0363573 100644 --- a/server.py +++ b/server.py @@ -1045,15 +1045,35 @@ async def run_detail(run_id: str, request: Request): } status_badge = status_colors.get(run.status, "bg-gray-600 text-white") - # Build media HTML for input/output + # Try to get input names from recipe + input_names = {} + recipe_name = run.recipe.replace("recipe:", "") if run.recipe.startswith("recipe:") else run.recipe + for recipe in list_all_recipes(): + if recipe.name == recipe_name: + # Match variable inputs first, then fixed inputs + for i, var_input in enumerate(recipe.variable_inputs): + if i < len(run.inputs): + input_names[run.inputs[i]] = var_input.name + # Fixed inputs follow variable inputs + offset = len(recipe.variable_inputs) + for i, fixed_input in enumerate(recipe.fixed_inputs): + idx = offset + i + if idx < len(run.inputs): + input_names[run.inputs[idx]] = fixed_input.asset + break + + # Build media HTML for inputs and output media_html = "" - has_input = run.inputs and cache_manager.has_content(run.inputs[0]) + available_inputs = [inp for inp in run.inputs if cache_manager.has_content(inp)] has_output = run.status == "completed" and run.output_hash and cache_manager.has_content(run.output_hash) - if has_input or has_output: - media_html = '
Unknown format
' + # Get input name or fall back to "Input N" + input_name = input_names.get(input_hash, f"Input {idx + 1}") media_html += f''' @@ -1088,8 +1110,11 @@ async def run_detail(run_id: str, request: Request): ''' media_html += '