Initial commit

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-26 22:27:27 -08:00
parent 4387f6df92
commit 492e1fd68f
32 changed files with 2608 additions and 0 deletions

74
nginx/html/summary.html Normal file
View File

@@ -0,0 +1,74 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Summary — Eggtracker</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>Eggtracker</span></a>
<ul class="nav-links">
<li><a href="/">Dashboard</a></li>
<li><a href="/log">Log Eggs</a></li>
<li><a href="/history">History</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"></script>
<script src="/js/summary.js"></script>
</body>
</html>