checkpoint

This commit is contained in:
2025-11-07 09:03:25 +00:00
parent 562b33dff9
commit 58c83f6140
5 changed files with 274 additions and 11 deletions

View File

@@ -8,7 +8,7 @@
:root { --bg: #0f172a; --card: #111827; --text: #e5e7eb; --muted:#94a3b8; --accent:#22d3ee; --ok:#4ade80; }
* { box-sizing: border-box; }
body { margin:0; font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif; background: var(--bg); color: var(--text); }
.container { max-width: 960px; margin: 0 auto; padding: 24px; }
.container { margin: 0 auto; padding: 24px; }
h1 { font-size: 1.75rem; margin: 0 0 8px; }
p { color: var(--muted); margin-top: 0; }
.card { background: var(--card); border: 1px solid #1f2937; border-radius: 10px; padding: 16px; }
@@ -31,7 +31,7 @@
<body>
<div class="container">
<h1>Satisfactory Production Calculator</h1>
<p>Compute buildings and raw inputs for a target output rate (items per minute). Data set includes a few early-game default recipes; you can extend it in <code>main.py</code>.</p>
<p>Compute buildings and raw inputs for a target output rate (items per minute).</p>
<form class="card" method="get">
<div class="row">
@@ -48,6 +48,7 @@
<input id="rate" name="rate" type="number" step="0.01" min="0" value="{{ selected_rate }}" required>
</div>
</div>
<div class="mt">
<button type="submit">Calculate</button>
</div>
@@ -78,6 +79,42 @@
<p class="pill">No raw resources required (target is a raw resource).</p>
{% endif %}
{% if overrides_ui and overrides_ui|length > 0 %}
<h3 class="mt">Recipe overrides</h3>
<form method="get" class="card" style="background: transparent; border:0; padding:0;">
<input type="hidden" name="item" value="{{ selected_item }}">
<input type="hidden" name="rate" value="{{ selected_rate }}">
{% if selected_recipe %}<input type="hidden" name="recipe" value="{{ selected_recipe }}">{% endif %}
<table>
<thead>
<tr>
<th>Item</th>
<th>Override recipe</th>
</tr>
</thead>
<tbody>
{% for ov in overrides_ui %}
<tr>
<td>{{ ov.item_name }}</td>
<td>
<select name="recipe_for_{{ ov.slug }}">
<option value="" {% if not ov.selected %}selected{% endif %}>Auto-select best</option>
{% for opt in ov.options %}
<option value="{{ opt.name }}" {% if ov.selected and opt.name==ov.selected %}selected{% endif %}>{{ opt.name }} ({{ opt.building }})</option>
{% endfor %}
</select>
</td>
</tr>
{% endfor %}
</tbody>
</table>
<div class="mt">
<button type="submit">Recalculate</button>
<a href="{{ reset_query }}" class="pill" style="margin-left:8px; display:inline-block; text-decoration:none;">Reset overrides</a>
</div>
</form>
{% endif %}
<h3 class="mt">Production steps</h3>
{% if result.steps %}
<table>