diff --git a/cortex/static/app.js b/cortex/static/app.js
index 7d39400..14d17eb 100644
--- a/cortex/static/app.js
+++ b/cortex/static/app.js
@@ -813,9 +813,39 @@
document.getElementById('mem-short-btn').classList.toggle('mem-on', memShort);
}
+ function formatNextRun(iso) {
+ if (!iso) return 'n/a';
+ const dt = new Date(iso);
+ const now = new Date();
+ const diffMs = dt - now;
+ const diffDays = Math.floor(diffMs / 86400000);
+ const time = dt.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' });
+ if (diffDays === 0) return `today ${time}`;
+ if (diffDays === 1) return `tomorrow ${time}`;
+ return dt.toLocaleDateString([], { month: 'short', day: 'numeric' }) + ' ' + time;
+ }
+
+ async function loadSchedule() {
+ const schedEl = document.getElementById('ctx-schedule');
+ try {
+ const res = await fetch('/distill/status');
+ const d = await res.json();
+ if (!d.enabled || !d.jobs.length) {
+ schedEl.textContent = 'auto-distill disabled';
+ return;
+ }
+ schedEl.innerHTML = d.jobs
+ .map(j => `${j.id.replace('distill_', '').padEnd(6)} → ${formatNextRun(j.next_run)}`)
+ .join('
');
+ } catch {
+ schedEl.textContent = '';
+ }
+ }
+
ctxOpenBtn.addEventListener('click', (e) => {
e.stopPropagation();
ctxPanel.classList.toggle('open');
+ if (ctxPanel.classList.contains('open')) loadSchedule();
});
document.addEventListener('click', (e) => {
diff --git a/cortex/static/index.html b/cortex/static/index.html
index cc628af..1e47385 100644
--- a/cortex/static/index.html
+++ b/cortex/static/index.html
@@ -61,6 +61,7 @@