summaryrefslogtreecommitdiff
path: root/web/app.js
diff options
context:
space:
mode:
Diffstat (limited to 'web/app.js')
-rw-r--r--web/app.js35
1 files changed, 17 insertions, 18 deletions
diff --git a/web/app.js b/web/app.js
index dfe6d4e..21c825a 100644
--- a/web/app.js
+++ b/web/app.js
@@ -435,21 +435,13 @@ export function computeTabBadgeCounts(tasks) {
let interrupted = 0;
let ready = 0;
let running = 0;
- let all = 0;
- const now = Date.now();
- const twentyFourHoursAgo = now - 24 * 60 * 60 * 1000;
for (const t of tasks) {
if (INTERRUPTED_STATES.has(t.state)) interrupted++;
if (t.state === 'READY') ready++;
if (t.state === 'RUNNING') running++;
- if (DONE_STATES.has(t.state)) {
- if (!t.created_at || new Date(t.created_at).getTime() > twentyFourHoursAgo) {
- all++;
- }
- }
}
- return { interrupted, ready, running, all };
+ return { interrupted, ready, running };
}
/**
@@ -682,13 +674,23 @@ function renderReadyPanel(tasks) {
if (!container) return;
const visible = sortTasksByDate(filterReadyTasks(tasks));
renderTasksIntoContainer(visible, container, 'No tasks awaiting review.');
-}
-function renderAllPanel(tasks) {
- const container = document.querySelector('[data-panel="all"] .all-history');
- if (!container) return;
- const visible = sortTasksByDate(filterAllDoneTasks(tasks), true);
- renderTasksIntoContainer(visible, container, 'No completed tasks in the last 24h.');
+ const completedContainer = document.querySelector('[data-panel="ready"] .ready-completed-history');
+ if (!completedContainer) return;
+ const done = sortTasksByDate(filterAllDoneTasks(tasks), true);
+ if (!completedContainer.querySelector('.ready-completed-label')) {
+ const label = document.createElement('h2');
+ label.className = 'ready-completed-label';
+ label.textContent = 'Completed (24h)';
+ completedContainer.prepend(label);
+ }
+ const list = completedContainer.querySelector('.ready-completed-list') || (() => {
+ const el = document.createElement('div');
+ el.className = 'ready-completed-list';
+ completedContainer.appendChild(el);
+ return el;
+ })();
+ renderTasksIntoContainer(done, list, 'No completed tasks in the last 24h.');
}
// ── Run action ────────────────────────────────────────────────────────────────
@@ -1238,9 +1240,6 @@ function renderActiveTab(allTasks) {
});
}
break;
- case 'all':
- renderAllPanel(allTasks);
- break;
case 'stats':
Promise.all([
fetchRecentExecutions(BASE_PATH, fetch),