fix: correct dashboard freshness wiring

This commit is contained in:
2026-04-06 20:45:41 +09:00
parent 6596090677
commit 441f590989
2 changed files with 13 additions and 10 deletions

View File

@@ -218,15 +218,18 @@ export class DashboardService {
const freshness: FreshnessMeta = {
generatedAt: new Date().toISOString(),
activityLatestAt: activities[0]?.createdAt?.toISOString() ?? null,
sistersLatestAt: sisters
.map((sister) => sister.lastSeen)
.filter((value): value is Date => value instanceof Date)
.sort((a, b) => b.getTime() - a.getTime())[0]
?.toISOString() ?? null,
qaDocLatestAt: board
.filter((item) => item.category === 'qa-log')
.map((item) => item.time)
.sort((a, b) => new Date(b).getTime() - new Date(a).getTime())[0] ?? null,
sistersLatestAt:
sisters
.map((sister) => sister.lastSeen)
.filter((value): value is Date => value instanceof Date)
.sort((a, b) => b.getTime() - a.getTime())[0]
?.toISOString() ?? null,
qaDocLatestAt:
board
.filter((item) => item.category === 'DOC-DERIVED')
.map((item) => item.time)
.sort((a, b) => new Date(b).getTime() - new Date(a).getTime())[0] ??
null,
};
return {

View File

@@ -1197,7 +1197,7 @@ export default function DashboardPage() {
<InfraCard key={card.title}>
<InfraTitle>{card.title}</InfraTitle>
<InfraMeta>{card.meta}</InfraMeta>
<EventTag $tone={card.title === 'Gateway / Runtime' && connected ? 'ok' : card.detail.includes('없음') ? 'default' : 'active'}>{card.detail}</EventTag>
<EventTag $tone={card.title === 'Runtime' && connected ? 'ok' : card.detail.startsWith('NO ') ? 'default' : 'active'}>{card.detail}</EventTag>
</InfraCard>
))}
</InfraMap>