add printer out-of-paper warning and track app.py

Show a yellow warning banner on page load if CUPS reports the printer
is stopped with a paper-related reason (e.g. Media Empty).
This commit is contained in:
Connor Rhodes 2026-05-22 16:24:33 -05:00
parent 01e6cf6300
commit 3cd6d20d13
2 changed files with 151 additions and 1 deletions

View file

@ -26,6 +26,12 @@
<p class="text-sm text-gray-500 mt-1">(Max {{ max_pages }} pages)</p>
</div>
{% if printer_warning %}
<div class="mb-6 p-4 rounded-lg text-sm bg-yellow-100 text-yellow-800" role="alert">
<span class="font-medium">Warning:</span> {{ printer_warning }}
</div>
{% endif %}
{% with messages = get_flashed_messages(with_categories=true) %}
{% if messages %}
<div class="mb-6 space-y-3">
@ -52,7 +58,13 @@
<input id="file-upload" name="file" type="file" class="sr-only" accept=".pdf">
</div>
<div class="mt-8">
<div class="mt-6">
<label for="copies" class="block text-sm font-medium text-gray-700 mb-1">Number of copies</label>
<input id="copies" name="copies" type="number" value="1" min="1" max="{{ max_copies }}"
class="w-24 border border-gray-300 rounded-lg px-3 py-2 text-center text-gray-900 focus:outline-none focus:ring-2 focus:ring-blue-400">
</div>
<div class="mt-6">
<button type="submit" class="w-full bg-blue-600 text-white font-bold py-3 px-4 rounded-lg hover:bg-blue-700 focus:outline-none focus:ring-4 focus:ring-blue-300 transition-all duration-300 transform hover:scale-105">
Print File
</button>