import { html, nothing } from 'lit'; import { LightElement } from '../../lib/base.js'; import { formatDate, formatDuration } from './utils.js'; export class TaskHistorySection extends LightElement { static properties = { _runs: { state: true }, _error: { state: true }, _loading: { state: true }, _expanded: { state: true }, }; constructor() { super(); this._runs = []; this._error = null; this._loading = false; this._expanded = null; } async load() { this._error = null; this._loading = true; try { const res = await fetch('/api/cron/runs'); if (!res.ok) throw new Error(`HTTP ${res.status}`); this._runs = await res.json(); } catch (e) { this._error = e.message; } finally { this._loading = false; } } _statusClass(status) { return { completed: 'success', failed: 'danger', cancelled: 'warning' }[status] ?? 'secondary'; } _toggleExpand(id) { this._expanded = this._expanded === id ? null : id; } _renderRow(run) { const isExpanded = this._expanded === run.id; return html`
${run.final_response}Loading…
No completed runs yet.
| Status | Task | Agent | Completed | Duration |
|---|