Add a live preview thumbnail next to the frame name
Small header thumbnail showing exactly what the frame is currently
displaying -- same widget compositor /frame/image uses, handed back as
a plain PNG (image_pipeline.render_panel/render_placeholder gain an
as_png option) instead of packed native-panel bytes. New session-authed
GET /api/frames/{id}/preview exposes it; click-to-refresh plus a slow
60s poll on the frame header so it doesn't hammer Immich/calendar
sources just for a header thumbnail.
This commit is contained in:
@@ -57,3 +57,20 @@
|
||||
if (e.key === 'Escape') closeEdit();
|
||||
});
|
||||
})();
|
||||
|
||||
// Live "how it's displaying" thumbnail. A real composite render (same
|
||||
// pipeline /frame/image uses), not a cached snapshot, so it's on a slow
|
||||
// poll and also click-to-refresh rather than something tighter like the
|
||||
// 10s device-status poll -- no need to hit Immich/calendar/whiteboard
|
||||
// sources that often just for a header thumbnail.
|
||||
(function () {
|
||||
var thumb = document.getElementById('frame-preview-thumb');
|
||||
if (!thumb || !window.FRAME_BASE_API) return;
|
||||
|
||||
function refresh() {
|
||||
thumb.src = `${window.FRAME_BASE_API}/preview?t=${Date.now()}`;
|
||||
}
|
||||
thumb.addEventListener('click', refresh);
|
||||
refresh();
|
||||
setInterval(refresh, 60000);
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user