fix: align task pages with backend task api

This commit is contained in:
zhi
2026-03-16 13:22:19 +00:00
parent 01affdb020
commit 0c5c78a45d
7 changed files with 70 additions and 46 deletions

View File

@@ -25,7 +25,7 @@ export default function DashboardPage() {
<div className="stats-grid">
<div className="stat-card total">
<span className="stat-number">{stats.total_issues}</span>
<span className="stat-number">{stats.total_tasks}</span>
<span className="stat-label">Total Tasks</span>
</div>
{Object.entries(stats.by_status || {}).map(([k, v]) => (
@@ -43,7 +43,7 @@ export default function DashboardPage() {
<div className="bar-row" key={k}>
<span className="bar-label">{k}</span>
<div className="bar" style={{
width: `${Math.max((v / stats.total_issues) * 100, 5)}%`,
width: `${Math.max((v / stats.total_tasks) * 100, 5)}%`,
backgroundColor: priorityColors[k] || '#ccc',
}}>{v}</div>
</div>
@@ -58,13 +58,13 @@ export default function DashboardPage() {
<tr><th>ID</th><th>Title</th><th>Status</th><th>Priority</th><th>Type</th><th>Subtype</th></tr>
</thead>
<tbody>
{(stats.recent_issues || []).map((i) => (
{(stats.recent_tasks || []).map((i) => (
<tr key={i.id}>
<td>#{i.id}</td>
<td><a href={`/tasks/${i.id}`}>{i.title}</a></td>
<td><span className={`badge status-${i.status}`}>{i.status}</span></td>
<td><span className={`badge priority-${i.priority}`}>{i.priority}</span></td>
<td>{i.issue_type}</td><td>{i.issue_subtype || "-"}</td>
<td>{i.task_type}</td><td>{i.task_subtype || "-"}</td>
</tr>
))}
</tbody>