- models.py: add UniqueConstraint(user_id, date) to flock_history so duplicate flock entries for the same day are rejected at the DB level - main.py: v2.3 migration applies the new unique constraint to existing installs at startup - login.html: update register form minlength and placeholder from 6 to 10 characters to match backend; add specific 429 error message so rate- limited users see "Too many attempts — please wait a minute" instead of a generic failure - auth.js: update settings modal password input minlength from 6 to 10 - summary.js: fix CSV export truncation — pass limit=10000 so users with more than 500 days of data get a complete export; read chart border color from --green CSS variable instead of hardcoded hex - All HTML files: bump JS version params to ?v=4 so browsers discard cached copies of files changed across recent sessions (api.js, auth.js, dashboard.js, history.js, log.js, flock.js, budget.js, summary.js, admin.js) - .env.example: add password strength guidance for MySQL and admin vars Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
75 lines
2.7 KiB
HTML
75 lines
2.7 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Summary — Yolkbook</title>
|
|
<link rel="icon" href="/favicon.svg" type="image/svg+xml">
|
|
<link rel="stylesheet" href="/css/style.css">
|
|
</head>
|
|
<body>
|
|
<nav class="nav">
|
|
<a class="nav-brand" href="/">🥚 <span>Yolkbook</span></a>
|
|
<ul class="nav-links">
|
|
<li><a href="/">Dashboard</a></li>
|
|
<li><a href="/log">Log Eggs</a></li>
|
|
<li><a href="/flock">Flock</a></li>
|
|
<li><a href="/budget">Budget</a></li>
|
|
<li><a href="/summary">Summary</a></li>
|
|
</ul>
|
|
</nav>
|
|
|
|
<main class="container">
|
|
<h1>Monthly Summary</h1>
|
|
|
|
<div id="msg" class="message"></div>
|
|
|
|
<div class="section-header" style="margin-bottom:1rem;">
|
|
<span></span>
|
|
<div style="display:flex;gap:0.5rem;">
|
|
<button class="btn btn-ghost btn-sm" onclick="exportCSV()">Download CSV</button>
|
|
<button class="btn btn-ghost btn-sm" onclick="document.getElementById('csv-import-input').click()">Import CSV</button>
|
|
<input type="file" id="csv-import-input" accept=".csv" style="display:none"
|
|
onchange="handleImportFile(this)">
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Bar chart -->
|
|
<div class="card">
|
|
<h2>Monthly Egg Totals</h2>
|
|
<p id="chart-no-data" class="text-muted" style="display:none; padding:1.5rem 0; text-align:center;">No egg data yet.</p>
|
|
<div id="chart-wrap">
|
|
<canvas id="monthly-chart" height="90"></canvas>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Monthly breakdown table -->
|
|
<div class="table-wrap">
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Month</th>
|
|
<th>Total Eggs</th>
|
|
<th>Days Logged</th>
|
|
<th>Avg / Day</th>
|
|
<th>Flock</th>
|
|
<th>Avg / Hen / Day</th>
|
|
<th>Feed Cost</th>
|
|
<th>Cost / Egg</th>
|
|
<th>Cost / Dozen</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody id="summary-body">
|
|
<tr class="empty-row"><td colspan="9">Loading…</td></tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</main>
|
|
|
|
<script src="https://cdn.jsdelivr.net/npm/chart.js@4.4.0/dist/chart.umd.min.js"></script>
|
|
<script src="/js/api.js?v=4"></script>
|
|
<script src="/js/auth.js?v=4"></script>
|
|
<script src="/js/summary.js?v=4"></script>
|
|
</body>
|
|
</html>
|