This commit is contained in:
lda committed 2025-12-17 21:48:28 +07:00
1 parent f746eaa220
commit 83731d9a83
4 files changed
+141 -35

No files matched your search

+37 -6
View File
@@ -4,23 +4,54 @@
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Queue Reader</title>
<link rel="stylesheet" href="{{ url_for('static', path='style.css') }}">
<link
rel="stylesheet"
href="{{ url_for('static', path='style.css') }}"
/>
</head>
<body>
{% from 'macros.html' import magic_link %} {% if current_link %}
<p>{{ magic_link(current_link, current_link, "a") }}</p>
<button id="b">skip/fw</button> {{ queue_length }}
<div class="card">
<h2>Current Link</h2>
<p>{{ magic_link(current_link, current_link, "a") }}</p>
<div class="qrcode" id="current-qr"></div>
<div class="actions" style="margin-top: 20px">
<button id="b" class="btn">Skip / Next</button>
</div>
<p style="margin-top: 10px; font-size: 0.8rem; color: #666">
{{ queue_length }} items remaining
</p>
</div>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/qrcode.js"></script>
<script>
// QR Code generation
new QRCode(document.getElementById("current-qr"), {
text: "{{ current_link }}",
correctLevel: QRCode.CorrectLevel.L,
width: 256,
height: 256,
});
// Skip button logic
document.getElementById("b").addEventListener("click", async () => {
await fetch("/r", { method: "GET", redirect: "manual" });
await fetch("/r", { redirect: "manual" });
setTimeout(() => {
window.location.reload();
});
});
</script>
{% else %}
<p>no. go add some to <a href="/queuein">queuein</a></p>
<button onclick="location.reload();">reload</button>
<div class="card">
<h2>Queue Empty</h2>
<p>No links in the queue. Go add some!</p>
<div class="actions">
<a href="/queuein" class="btn">Add Links</a>
<button onclick="location.reload();" class="btn">Reload</button>
</div>
</div>
{% endif %}
</body>
</html>