Add scheduled and event-driven printing with a new web UI
The web server now runs a scheduler over schedules kept in SQLite
(~/.local/share/receipt-maker, outside the clone). A schedule is a
trigger, a receipt made of blocks, and options:
- Triggers: once, recurring (rrule-based, DST-safe), sun times,
reminders before calendar (ICS) events, RSS/JSON watchers, webhooks
with per-schedule secrets.
- Blocks, rendered fresh as one job: templated notes ({date},
{days_until:..}, rotating {choice}, trigger vars), QR, saved images,
random image, calendar agenda, feed headlines, dividers.
- Rules: quiet hours (hold/skip/ignore), daily cap, pause, catch-up
window for missed runs (never replayed), retries on connect failure
only; a mid-job drop (new PrinterDropped) is never resent.
receipt.py renders through composable Blocks (render_note/image/qr are
wrappers, output unchanged). Print history persists, with Print again.
The page moves to web/ with Print (note/image/QR + paper preview),
Schedules (presets, editor with live preview and next runs), History
and Settings tabs.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Receipt Printer</title>
|
||||
<link rel="stylesheet" href="static/app.css">
|
||||
<script type="module" src="static/app.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<header class="top">
|
||||
<h1>Receipt printer</h1>
|
||||
<button id="status" class="pill" title="Check again">checking…</button>
|
||||
</header>
|
||||
<nav class="tabs" aria-label="Sections">
|
||||
<a href="#print">Print</a>
|
||||
<a href="#schedules">Schedules</a>
|
||||
<a href="#history">History</a>
|
||||
<a href="#settings">Settings</a>
|
||||
</nav>
|
||||
<main id="view"></main>
|
||||
<div id="toast" role="status" aria-live="polite"></div>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user