Display recorder system highlights
This commit is contained in:
+15
-1
@@ -66,6 +66,7 @@
|
||||
.legend .rec::before { background: var(--accent); }
|
||||
.legend .gap::before { background: #2a2a2a; border: 1px solid #444; }
|
||||
.legend .highlight::before { background: #ffd43b; }
|
||||
.legend .system::before { background: #a87900; }
|
||||
.highlights { margin-top: 18px; background: var(--surface); border-radius: 8px; padding: 14px 16px; }
|
||||
.highlights h2 { font-size: 14px; font-weight: 500; margin-bottom: 10px; }
|
||||
.highlight-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
|
||||
@@ -160,7 +161,7 @@
|
||||
<canvas id="timeline"></canvas>
|
||||
</div>
|
||||
<div class="hours" id="hours"></div>
|
||||
<div class="legend"><span class="rec">Recorded</span><span class="highlight">Highlight</span><span class="gap">No recording</span></div>
|
||||
<div class="legend"><span class="rec">Recorded</span><span class="highlight">Highlight</span><span class="system">System highlight</span><span class="gap">No recording</span></div>
|
||||
</div>
|
||||
|
||||
<section class="highlights">
|
||||
@@ -198,6 +199,7 @@
|
||||
let zoom = 1;
|
||||
let focus = 43200;
|
||||
let highlights = [];
|
||||
let systemHighlights = [];
|
||||
let highlightStart = null;
|
||||
let highlightEnd = null;
|
||||
let encodingWasRunning = false;
|
||||
@@ -316,6 +318,11 @@
|
||||
list.append(row);
|
||||
});
|
||||
}
|
||||
async function loadSystemHighlights() {
|
||||
const response = await fetch(`/api/system-highlights?date=${dateSelect.value}`);
|
||||
systemHighlights = await response.json();
|
||||
drawTimeline();
|
||||
}
|
||||
document.querySelector("#mark-start").onclick = () => setMark("start");
|
||||
document.querySelector("#mark-end").onclick = () => setMark("end");
|
||||
document.querySelector("#save-highlight").onclick = async () => {
|
||||
@@ -398,6 +405,12 @@
|
||||
const r = (item.end - winStart) / winSize * w;
|
||||
if (r > 0 && l < w) ctx.fillRect(Math.max(0, l), 0, Math.min(w, r) - Math.max(0, l), 56);
|
||||
});
|
||||
ctx.fillStyle = "#a87900";
|
||||
systemHighlights.forEach(item => {
|
||||
const l = (item.start - winStart) / winSize * w;
|
||||
const r = (item.end - winStart) / winSize * w;
|
||||
if (r > 0 && l < w) ctx.fillRect(Math.max(0, l), 0, Math.min(w, r) - Math.max(0, l), 56);
|
||||
});
|
||||
// hour lines
|
||||
ctx.strokeStyle = "rgba(255,255,255,.08)";
|
||||
for (let h = Math.ceil(winStart / 3600); h < winEnd / 3600; h++) {
|
||||
@@ -449,6 +462,7 @@
|
||||
scrubFill.style.width = "0%";
|
||||
drawTimeline();
|
||||
loadHighlights();
|
||||
loadSystemHighlights();
|
||||
if (!date && d.dates[0]) loadDate(d.dates[0]);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user