## React SPA Dashboard - React 19 + Vite 7 + Tailwind CSS 4 + Recharts 2 SPA 구축 - Dashboard (배치현황/시스템메트릭/캐시/처리량) + JobMonitor (이력조회/Step상세) - i18n 다국어(ko/en) 시스템, Light/Dark 테마 CSS 토큰 전환 - frontend-maven-plugin 1.15.1 (mvn package 시 자동 빌드) - WebViewController SPA forward + context-path /signal-batch - 레거시 HTML 48개 파일 전체 삭제 ## 안전 배포 - VesselBatchScheduler @PreDestroy: 신규 Job 차단 + 실행 중 Job 완료 대기 - server.shutdown=graceful, timeout-per-shutdown-phase=3m - deploy.yml: 활성 Job 3초 연속 확인 후 stop → 교체 → start - signal-batch.service TimeoutStopSec 60→180 - scripts/deploy.sh: 수동 배포용 안전 스크립트 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
49 lines
1.2 KiB
TypeScript
49 lines
1.2 KiB
TypeScript
import type { ReactNode } from 'react'
|
|
|
|
interface MetricCardProps {
|
|
title: string
|
|
value: string | number
|
|
subtitle?: string
|
|
icon?: ReactNode
|
|
trend?: 'up' | 'down' | 'neutral'
|
|
trendValue?: string
|
|
}
|
|
|
|
export default function MetricCard({
|
|
title,
|
|
value,
|
|
subtitle,
|
|
icon,
|
|
trend,
|
|
trendValue,
|
|
}: MetricCardProps) {
|
|
return (
|
|
<div className="sb-card">
|
|
<div className="flex items-start justify-between">
|
|
<div>
|
|
<div className="sb-card-header">{title}</div>
|
|
<div className="sb-card-value">{value}</div>
|
|
</div>
|
|
{icon && (
|
|
<div className="rounded-lg bg-surface-hover p-2 text-muted">
|
|
{icon}
|
|
</div>
|
|
)}
|
|
</div>
|
|
{(subtitle || trendValue) && (
|
|
<div className="sb-card-footer flex items-center gap-2">
|
|
{trendValue && (
|
|
<span className={
|
|
trend === 'up' ? 'text-success' :
|
|
trend === 'down' ? 'text-danger' : 'text-muted'
|
|
}>
|
|
{trend === 'up' ? '\u2191' : trend === 'down' ? '\u2193' : ''} {trendValue}
|
|
</span>
|
|
)}
|
|
{subtitle && <span>{subtitle}</span>}
|
|
</div>
|
|
)}
|
|
</div>
|
|
)
|
|
}
|