Files
yolkbook/nginx/html/summary.html
derekc aa12648228 Add multi-user auth, admin panel, and timezone support; rename to Yolkbook
- Rename app from Eggtracker to Yolkbook throughout
- Add JWT-based authentication (python-jose, passlib/bcrypt)
- Add users table; all data tables gain user_id FK for full data isolation
- Super admin credentials sourced from ADMIN_USERNAME/ADMIN_PASSWORD env vars,
  synced on every startup; orphaned rows auto-assigned to admin post-migration
- Login page with self-registration; JWT stored in localStorage (30-day expiry)
- Admin panel (/admin): list users, reset passwords, disable/enable, delete,
  and impersonate (Login As) with Return to Admin banner
- Settings modal (gear icon in nav): timezone selector and change password
- Timezone stored per-user; stats date windows computed in user's timezone;
  date input setToday() respects user timezone via Intl API
- migrate_v2.sql for existing single-user installs
- Auto-migration adds timezone column to users on startup
- Updated README with full setup, auth, admin, and migration docs

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-17 23:19:29 -07:00

76 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="/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?v=3"></script>
<script src="/js/auth.js?v=3"></script>
<script src="/js/summary.js?v=2"></script>
</body>
</html>