From 5de10662a7b16d9c2007fb08050ed480866f7eae Mon Sep 17 00:00:00 2001 From: leedano Date: Thu, 9 Apr 2026 18:13:10 +0900 Subject: [PATCH 1/7] =?UTF-8?q?feat(design):=20HNS=C2=B7=EC=82=AC=EA=B1=B4?= =?UTF-8?q?=EC=82=AC=EA=B3=A0=C2=B7=ED=99=95=EC=82=B0=EC=98=88=EC=B8=A1?= =?UTF-8?q?=C2=B7SCAT=C2=B7=EA=B8=B0=EC=83=81=20=ED=83=AD=20=EB=94=94?= =?UTF-8?q?=EC=9E=90=EC=9D=B8=20=EC=8B=9C=EC=8A=A4=ED=85=9C=20=ED=86=A0?= =?UTF-8?q?=ED=81=B0=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/RELEASE-NOTES.md | 2 + .../src/common/components/map/MapView.tsx | 6 +- frontend/src/common/styles/components.css | 16 + .../src/tabs/hns/components/HNSLeftPanel.tsx | 2 +- .../src/tabs/hns/components/HNSRightPanel.tsx | 6 +- frontend/src/tabs/hns/components/HNSView.tsx | 88 ++- .../components/DischargeZonePanel.tsx | 100 ++-- .../components/IncidentsLeftPanel.tsx | 32 +- .../components/IncidentsRightPanel.tsx | 130 ++-- .../incidents/components/IncidentsView.tsx | 553 +++++++++++------- .../tabs/prediction/components/LeftPanel.tsx | 2 +- .../prediction/components/OilSpillView.tsx | 278 +++++---- .../tabs/prediction/components/RightPanel.tsx | 6 +- .../src/tabs/scat/components/PreScatView.tsx | 92 ++- .../tabs/scat/components/ScatLeftPanel.tsx | 8 +- frontend/src/tabs/scat/components/ScatMap.tsx | 2 +- .../tabs/scat/components/ScatRightPanel.tsx | 4 +- .../weather/components/WeatherMapControls.tsx | 2 +- .../weather/components/WeatherMapOverlay.tsx | 39 +- .../weather/components/WeatherRightPanel.tsx | 154 ++--- .../tabs/weather/components/WeatherView.tsx | 46 +- 21 files changed, 917 insertions(+), 651 deletions(-) diff --git a/docs/RELEASE-NOTES.md b/docs/RELEASE-NOTES.md index 5bb6047..d88decc 100644 --- a/docs/RELEASE-NOTES.md +++ b/docs/RELEASE-NOTES.md @@ -4,6 +4,8 @@ ## [Unreleased] +## [2026-04-09] + ### 추가 - 디자인 시스템 Float 카탈로그 추가 (Modal / Dropdown / Overlay / Toast) - 디자인 시스템 폰트/색상 토큰을 전 탭 컴포넌트에 전면 적용 (admin, aerial, assets, board, hns, incidents, prediction, reports, rescue, scat, weather) diff --git a/frontend/src/common/components/map/MapView.tsx b/frontend/src/common/components/map/MapView.tsx index 9ab297a..578ed71 100755 --- a/frontend/src/common/components/map/MapView.tsx +++ b/frontend/src/common/components/map/MapView.tsx @@ -1458,19 +1458,19 @@ function MapControls({ center, zoom }: { center: [number, number]; zoom: number
diff --git a/frontend/src/common/styles/components.css b/frontend/src/common/styles/components.css index 0bd81c1..38faee2 100644 --- a/frontend/src/common/styles/components.css +++ b/frontend/src/common/styles/components.css @@ -30,6 +30,22 @@ background: transparent; } + /* ═══ Incidents 사고 팝업 ✕ 버튼 — 라이트 지도 기준 검은색 고정 ═══ */ + .incident-popup .maplibregl-popup-close-button { + color: #1a1d21; + background: transparent; + width: 16px; + height: 16px; + font-size: 16px; + line-height: 16px; + top: 6px; + right: 6px; + } + .incident-popup .maplibregl-popup-close-button:hover { + color: #000; + background: transparent; + } + /* ═══ Scrollbar ═══ */ .scrollbar-thin { scrollbar-width: thin; diff --git a/frontend/src/tabs/hns/components/HNSLeftPanel.tsx b/frontend/src/tabs/hns/components/HNSLeftPanel.tsx index 97d3094..82b7a9d 100755 --- a/frontend/src/tabs/hns/components/HNSLeftPanel.tsx +++ b/frontend/src/tabs/hns/components/HNSLeftPanel.tsx @@ -219,7 +219,7 @@ export function HNSLeftPanel({ }; return ( -
+
{/* Scrollable Content */}
-
+
+
📊
예측 실행 후 결과가 표시됩니다
@@ -58,7 +58,7 @@ export function HNSRightPanel({ : 'ALOHA'; return ( -
+
{/* Header */}
diff --git a/frontend/src/tabs/hns/components/HNSView.tsx b/frontend/src/tabs/hns/components/HNSView.tsx index bfe59fb..4a49115 100755 --- a/frontend/src/tabs/hns/components/HNSView.tsx +++ b/frontend/src/tabs/hns/components/HNSView.tsx @@ -262,6 +262,8 @@ function DispersionTimeSlider({ export function HNSView() { const { activeSubTab, setActiveSubTab } = useSubMenu('hns'); const { user } = useAuthStore(); + const [leftCollapsed, setLeftCollapsed] = useState(false); + const [rightCollapsed, setRightCollapsed] = useState(false); const [incidentCoord, setIncidentCoord] = useState<{ lon: number; lat: number } | null>(null); const [isSelectingLocation, setIsSelectingLocation] = useState(false); const [isRunningPrediction, setIsRunningPrediction] = useState(false); @@ -890,22 +892,66 @@ export function HNSView() {
{/* Left Panel - 분석 목록일 때는 숨김 */} {activeSubTab === 'analysis' && ( - setIsSelectingLocation(true)} - onRunPrediction={handleRunPrediction} - isRunningPrediction={isRunningPrediction} - onParamsChange={handleParamsChange} - onReset={handleReset} - loadedParams={loadedParams} - /> +
+ setIsSelectingLocation(true)} + onRunPrediction={handleRunPrediction} + isRunningPrediction={isRunningPrediction} + onParamsChange={handleParamsChange} + onReset={handleReset} + loadedParams={loadedParams} + /> +
)} {/* Center - Map/Content Area */}
+ {/* Left panel toggle button */} + {activeSubTab === 'analysis' && ( + + )} + + {/* Right panel toggle button */} + {activeSubTab === 'analysis' && ( + + )} + {activeSubTab === 'list' ? ( @@ -942,14 +988,16 @@ export function HNSView() { {/* Right Panel - 분석 목록일 때는 숨김 */} {activeSubTab === 'analysis' && ( - setRecalcModalOpen(true)} - onOpenReport={handleOpenReport} - onSave={handleSave} - /> +
+ setRecalcModalOpen(true)} + onOpenReport={handleOpenReport} + onSave={handleSave} + /> +
)} {/* HNS 재계산 모달 */} diff --git a/frontend/src/tabs/incidents/components/DischargeZonePanel.tsx b/frontend/src/tabs/incidents/components/DischargeZonePanel.tsx index d47f56a..6afccdd 100644 --- a/frontend/src/tabs/incidents/components/DischargeZonePanel.tsx +++ b/frontend/src/tabs/incidents/components/DischargeZonePanel.tsx @@ -1,4 +1,7 @@ import { useState } from 'react'; +import { DndContext } from '@dnd-kit/core'; +import { useDraggable } from '@dnd-kit/core'; +import type { DragEndEvent } from '@dnd-kit/core'; /** * 해양환경관리법 제22조 기반 선박 발생 오염물 배출 규정 @@ -100,33 +103,30 @@ const RULES: DischargeRule[] = [ ]; const ZONE_LABELS = ['~3해리', '3~12해리', '12~25해리', '25~50해리', '50해리+']; -const ZONE_COLORS = ['#ef4444', '#f97316', '#eab308', '#22c55e', '#64748b']; +const ZONE_COLORS = [ + 'var(--color-danger)', + 'var(--color-warning)', + 'var(--color-caution)', + 'var(--color-success)', + 'var(--fg-disabled)', +]; function StatusBadge({ status }: { status: Status }) { if (status === 'forbidden') return ( 배출불가 ); - if (status === 'allowed') - return ( - - 배출가능 - - ); return ( - - 조건부 + + {status === 'allowed' ? '배출가능' : '조건부'} ); } @@ -139,15 +139,36 @@ interface DischargeZonePanelProps { onClose: () => void; } -export function DischargeZonePanel({ +export function DischargeZonePanel(props: DischargeZonePanelProps) { + const [offset, setOffset] = useState({ x: 0, y: 0 }); + + function handleDragEnd(event: DragEndEvent) { + setOffset((prev) => ({ x: prev.x + event.delta.x, y: prev.y + event.delta.y })); + } + + return ( + + + + ); +} + +function DraggablePanel({ lat, lon, distanceNm, zoneIndex, onClose, -}: DischargeZonePanelProps) { + offset, +}: DischargeZonePanelProps & { offset: { x: number; y: number } }) { const zoneIdx = zoneIndex; const [expandedCat, setExpandedCat] = useState(null); + const { attributes, listeners, setNodeRef, transform } = useDraggable({ + id: 'discharge-panel', + }); + + const tx = offset.x + (transform?.x ?? 0); + const ty = offset.y + (transform?.y ?? 0); const categories = [...new Set(RULES.map((r) => r.category))]; @@ -161,22 +182,33 @@ export function DischargeZonePanel({ border: '1px solid var(--stroke-default)', boxShadow: '0 16px 48px rgba(0,0,0,0.5)', backdropFilter: 'blur(12px)', + transform: `translate(${tx}px, ${ty}px)`, }} > - {/* Header */} + {/* Header — drag handle */}
-
🚢 오염물 배출 규정
+
🚢 오염물 배출 규정
해양환경관리법 제22조
- + e.stopPropagation()} + className="text-title-3 cursor-pointer text-fg-sub hover:text-fg" + style={{ pointerEvents: 'all' }} + > ✕
@@ -194,10 +226,7 @@ export function DischargeZonePanel({
영해기선 거리 - + {distanceNm.toFixed(1)} NM
@@ -206,12 +235,10 @@ export function DischargeZonePanel({ {ZONE_LABELS.map((label, i) => (
r.category === cat); const isExpanded = expandedCat === cat; const allForbidden = catRules.every((r) => r.zones[zoneIdx] === 'forbidden'); - const allAllowed = catRules.every((r) => r.zones[zoneIdx] === 'allowed'); - const summaryColor = allForbidden ? '#ef4444' : allAllowed ? '#22c55e' : '#eab308'; + const summaryColor = allForbidden ? 'var(--color-danger)' : 'var(--fg-sub)'; return (
@@ -245,11 +271,11 @@ export function DischargeZonePanel({
- {cat} + {cat}
- - {allForbidden ? '전체 불가' : allAllowed ? '전체 가능' : '항목별 상이'} + + {allForbidden ? '전체 불가' : '허용'} {isExpanded ? '▾' : '▸'}
@@ -268,7 +294,7 @@ export function DischargeZonePanel({ borderRadius: 4, }} > - {rule.item} + {rule.item}
))} diff --git a/frontend/src/tabs/incidents/components/IncidentsLeftPanel.tsx b/frontend/src/tabs/incidents/components/IncidentsLeftPanel.tsx index ef73bcc..cfe263f 100755 --- a/frontend/src/tabs/incidents/components/IncidentsLeftPanel.tsx +++ b/frontend/src/tabs/incidents/components/IncidentsLeftPanel.tsx @@ -250,11 +250,11 @@ export function IncidentsLeftPanel({ /> {(inc.mediaCount ?? 0) > 0 && ( )}
diff --git a/frontend/src/tabs/incidents/components/IncidentsRightPanel.tsx b/frontend/src/tabs/incidents/components/IncidentsRightPanel.tsx index 9b10f34..c23570a 100755 --- a/frontend/src/tabs/incidents/components/IncidentsRightPanel.tsx +++ b/frontend/src/tabs/incidents/components/IncidentsRightPanel.tsx @@ -50,31 +50,8 @@ interface AnalysisItem { checked: boolean; } -/* ── 카테고리별 고유 색상 (목록 순서 인덱스 기반 — 중복 없음) ── */ -const CATEGORY_PALETTE: [number, number, number][] = [ - [239, 68, 68], // red - [249, 115, 22], // orange - [234, 179, 8], // yellow - [132, 204, 22], // lime - [20, 184, 166], // teal - [6, 182, 212], // cyan - [59, 130, 246], // blue - [99, 102, 241], // indigo - [168, 85, 247], // purple - [236, 72, 153], // pink - [244, 63, 94], // rose - [16, 185, 129], // emerald - [14, 165, 233], // sky - [139, 92, 246], // violet - [217, 119, 6], // amber - [45, 212, 191], // turquoise -]; - -function getCategoryColor(index: number): [number, number, number] { - return CATEGORY_PALETTE[index % CATEGORY_PALETTE.length]; -} - -/* ── 카테고리 → 이모지 매핑 (prediction LeftPanel의 CATEGORY_ICON_MAP 기반) ── */ +/* ── 카테고리 → 이모지 매핑 (prediction LeftPanel의 CATEGORY_ICON_MAP 기반, 미사용 보존) ── */ +// eslint-disable-next-line @typescript-eslint/no-unused-vars const CATEGORY_ICON: Record = { 어장정보: '🐟', 양식장: '🦪', @@ -140,8 +117,20 @@ function getActiveModels(p: PredictionAnalysis): string { /* ── HNS/구난 섹션 (미개발, 고정 구조만 유지) ────── */ const STATIC_SECTIONS = [ - { key: 'hns', icon: '🧪', title: 'HNS 대기확산', color: '#a855f7', colorRgb: '168,85,247' }, - { key: 'rsc', icon: '🚨', title: '긴급구난', color: '#06b6d4', colorRgb: '6,182,212' }, + { + key: 'hns', + icon: '🧪', + title: 'HNS 대기확산', + color: 'var(--color-accent)', + colorRgb: '6,182,212', + }, + { + key: 'rsc', + icon: '🚨', + title: '긴급구난', + color: 'var(--color-accent)', + colorRgb: '6,182,212', + }, ]; /* ── Component ───────────────────────────────────── */ @@ -292,7 +281,7 @@ export function IncidentsRightPanel({ key: 'oil', icon: '🛢', title: '유출유 확산예측', - color: '#f97316', + color: 'var(--color-accent)', colorRgb: '249,115,22', totalLabel: `전체 ${predItems.length}건`, items: predItems.map((p) => { @@ -310,7 +299,7 @@ export function IncidentsRightPanel({ if (!incident) { return ( -
+
📊
좌측에서 사고를 선택하면 @@ -327,7 +316,7 @@ export function IncidentsRightPanel({
🔬 통합분석 조회
- 선택: {incident.name} + 선택: {incident.name}
@@ -344,22 +333,19 @@ export function IncidentsRightPanel({
- {sec.icon} - - {sec.title} - + {/* {sec.icon} */} + {sec.title}
@@ -374,8 +360,7 @@ export function IncidentsRightPanel({ className="flex items-center gap-1.5" style={{ padding: '5px 8px', - background: `rgba(${sec.colorRgb},0.06)`, - border: `1px solid rgba(${sec.colorRgb},0.15)`, + border: '1px solid var(--stroke-default)', borderRadius: '4px', }} > @@ -415,22 +400,19 @@ export function IncidentsRightPanel({
- {sec.icon} - - {sec.title} - + {/* {sec.icon} */} + {sec.title}
준비 중입니다
@@ -443,8 +425,8 @@ export function IncidentsRightPanel({ {/* 민감자원 */}
- 🐟 - 민감자원 + {/* 🐟 */} + 민감자원
{sensCategories.length === 0 ? ( @@ -452,38 +434,33 @@ export function IncidentsRightPanel({ 해당 사고 영역의 민감자원이 없습니다
) : ( - sensCategories.map((cat, i) => { - const icon = CATEGORY_ICON[cat.category] ?? '🌊'; + sensCategories.map((cat) => { const areaLabel = cat.totalArea != null ? `${cat.totalArea.toLocaleString('ko-KR', { maximumFractionDigits: 0 })}ha` : `${cat.count}개소`; - const [r, g, b] = getCategoryColor(i); - const hex = `#${r.toString(16).padStart(2, '0')}${g.toString(16).padStart(2, '0')}${b.toString(16).padStart(2, '0')}`; return ( @@ -496,10 +473,9 @@ export function IncidentsRightPanel({ {/* 근처 방제자원 */}
- 🛡 - 근처 방제자원 + 근처 방제자원 {nearbyOrgs.length > 0 && ( - + {nearbyOrgs.length}개 )} @@ -519,21 +495,18 @@ export function IncidentsRightPanel({ 반경 내 방제자원 없음
) : ( -
+
{nearbyOrgs.map((org) => (
{org.orgTp} @@ -544,7 +517,7 @@ export function IncidentsRightPanel({ {org.totalAssets > 0 ? ` · 장비 ${org.totalAssets}개` : ''}
- + {org.distanceNm.toFixed(1)} nm
@@ -553,10 +526,10 @@ export function IncidentsRightPanel({ )} {/* Radius slider */} -
+
탐색 반경 - + {nearbyRadius} nm
@@ -572,7 +545,7 @@ export function IncidentsRightPanel({ height: '4px', background: 'var(--stroke-default)', borderRadius: '2px', - accentColor: '#f59e0b', + accentColor: 'var(--color-accent)', }} />
@@ -605,7 +578,8 @@ export function IncidentsRightPanel({ color: isActive ? 'var(--color-accent)' : 'var(--fg-disabled)', }} > - {v.icon} {v.label} + {/* {v.icon} */} + {v.label} ); })} @@ -627,9 +601,7 @@ export function IncidentsRightPanel({ className="w-full text-label-2 font-bold cursor-pointer" style={{ padding: '8px', - background: analysisActive - ? 'linear-gradient(135deg,rgba(239,68,68,0.15),rgba(239,68,68,0.1))' - : 'linear-gradient(135deg,rgba(6,182,212,0.15),rgba(59,130,246,0.1))', + background: analysisActive ? 'rgba(239,68,68,0.1)' : 'rgba(6,182,212,0.1)', border: analysisActive ? '1px solid rgba(239,68,68,0.3)' : '1px solid rgba(6,182,212,0.3)', diff --git a/frontend/src/tabs/incidents/components/IncidentsView.tsx b/frontend/src/tabs/incidents/components/IncidentsView.tsx index 9d6837b..705a8db 100755 --- a/frontend/src/tabs/incidents/components/IncidentsView.tsx +++ b/frontend/src/tabs/incidents/components/IncidentsView.tsx @@ -137,6 +137,8 @@ export function IncidentsView() { const [hoverInfo, setHoverInfo] = useState(null); const [dischargeMode, setDischargeMode] = useState(false); + const [leftCollapsed, setLeftCollapsed] = useState(false); + const [rightCollapsed, setRightCollapsed] = useState(false); const [dischargeInfo, setDischargeInfo] = useState<{ lat: number; lon: number; @@ -195,12 +197,17 @@ export function IncidentsView() { if (sections.length === 0) return; const tags: { icon: string; label: string; color: string }[] = []; sections.forEach((s) => { - if (s.key === 'oil') tags.push({ icon: '🛢', label: '유출유', color: '#f97316' }); - if (s.key === 'hns') tags.push({ icon: '🧪', label: 'HNS', color: '#a855f7' }); - if (s.key === 'rsc') tags.push({ icon: '🚨', label: '구난', color: '#06b6d4' }); + if (s.key === 'oil') + tags.push({ icon: '🛢', label: '유출유', color: 'var(--color-warning)' }); + if (s.key === 'hns') tags.push({ icon: '🧪', label: 'HNS', color: 'var(--color-tertiary)' }); + if (s.key === 'rsc') tags.push({ icon: '🚨', label: '구난', color: 'var(--color-accent)' }); }); if (sensitiveCount > 0) - tags.push({ icon: '🐟', label: `민감자원 ${sensitiveCount}건`, color: '#22c55e' }); + tags.push({ + icon: '🐟', + label: `민감자원 ${sensitiveCount}건`, + color: 'var(--color-success)', + }); setAnalysisTags(tags); setAnalysisActive(true); }; @@ -573,11 +580,13 @@ export function IncidentsView() { return (
{/* Left Panel */} - +
+ +
{/* Center - Map + Analysis Views */}
@@ -588,7 +597,8 @@ export function IncidentsView() { style={{ height: 36, padding: '0 16px', - background: 'linear-gradient(90deg,rgba(6,182,212,0.06),var(--bg-surface))', + background: + 'linear-gradient(90deg, color-mix(in srgb, var(--color-accent) 6%, transparent), var(--bg-surface))', }} >
@@ -601,8 +611,8 @@ export function IncidentsView() { className="text-caption font-semibold rounded-md" style={{ padding: '2px 8px', - background: `${t.color}18`, - border: `1px solid ${t.color}40`, + background: `color-mix(in srgb, ${t.color} 18%, transparent)`, + border: `1px solid color-mix(in srgb, ${t.color} 40%, transparent)`, color: t.color, }} > @@ -625,10 +635,13 @@ export function IncidentsView() { className="text-caption font-semibold cursor-pointer rounded-sm" style={{ padding: '3px 10px', - background: viewMode === v.mode ? 'rgba(6,182,212,0.12)' : 'var(--bg-card)', + background: + viewMode === v.mode + ? 'color-mix(in srgb, var(--color-accent) 12%, transparent)' + : 'var(--bg-card)', border: viewMode === v.mode - ? '1px solid rgba(6,182,212,0.3)' + ? '1px solid color-mix(in srgb, var(--color-accent) 30%, transparent)' : '1px solid var(--stroke-default)', color: viewMode === v.mode ? 'var(--color-accent)' : 'var(--fg-disabled)', }} @@ -641,8 +654,8 @@ export function IncidentsView() { className="text-caption font-semibold cursor-pointer rounded-sm" style={{ padding: '3px 8px', - background: 'rgba(239,68,68,0.06)', - border: '1px solid rgba(239,68,68,0.2)', + background: 'color-mix(in srgb, var(--color-danger) 6%, transparent)', + border: '1px solid color-mix(in srgb, var(--color-danger) 20%, transparent)', color: 'var(--color-danger)', }} > @@ -654,6 +667,44 @@ export function IncidentsView() { {/* Map / Analysis Content Area */}
+ {/* Left panel toggle button */} + + + {/* Right panel toggle button */} + + {/* Default Map (visible when not in analysis or in overlay mode) */} {(!analysisActive || viewMode === 'overlay') && (
@@ -691,12 +742,13 @@ export function IncidentsView() { onClose={() => setIncidentPopup(null)} closeButton={true} closeOnClick={false} + className="incident-popup" >
-
+
{incidentPopup.incident.name}
-
+
상태: {getStatusLabel(incidentPopup.incident.status)}
일시: {incidentPopup.incident.date} {incidentPopup.incident.time} @@ -706,7 +758,7 @@ export function IncidentsView() {
원인: {incidentPopup.incident.causeType}
)} {incidentPopup.incident.prediction && ( -
+
{incidentPopup.incident.prediction}
)} @@ -750,7 +802,7 @@ export function IncidentsView() { width: 180, height: 120, background: - 'radial-gradient(ellipse, rgba(249,115,22,0.35) 0%, rgba(249,115,22,0.1) 50%, transparent 70%)', + 'radial-gradient(ellipse, color-mix(in srgb, var(--color-warning) 35%, transparent) 0%, color-mix(in srgb, var(--color-warning) 10%, transparent) 50%, transparent 70%)', borderRadius: '50%', transform: 'rotate(-15deg)', }} @@ -765,7 +817,7 @@ export function IncidentsView() { width: 150, height: 100, background: - 'radial-gradient(ellipse, rgba(168,85,247,0.3) 0%, rgba(168,85,247,0.08) 50%, transparent 70%)', + 'radial-gradient(ellipse, color-mix(in srgb, var(--color-tertiary) 30%, transparent) 0%, color-mix(in srgb, var(--color-tertiary) 8%, transparent) 50%, transparent 70%)', borderRadius: '50%', transform: 'rotate(20deg)', }} @@ -779,7 +831,8 @@ export function IncidentsView() { left: '42%', width: 200, height: 200, - border: '2px dashed rgba(6,182,212,0.4)', + border: + '2px dashed color-mix(in srgb, var(--color-accent) 40%, transparent)', borderRadius: '50%', }} /> @@ -796,18 +849,16 @@ export function IncidentsView() { className="absolute z-[500] cursor-pointer rounded-md text-caption font-bold font-korean" style={{ top: 10, - right: dischargeMode ? 340 : 180, + right: 180, padding: '6px 10px', - background: dischargeMode ? 'rgba(6,182,212,0.15)' : 'rgba(13,17,23,0.88)', - border: dischargeMode - ? '1px solid rgba(6,182,212,0.4)' - : '1px solid var(--stroke-default)', - color: dischargeMode ? '#22d3ee' : 'var(--fg-disabled)', + background: 'var(--bg-base)', + border: '1px solid var(--stroke-default)', + color: dischargeMode ? 'var(--color-accent)' : 'var(--fg-disabled)', backdropFilter: 'blur(8px)', - transition: 'all 0.2s', + transition: 'color 0.2s', }} > - 🚢 배출규정 {dischargeMode ? 'ON' : 'OFF'} + 배출규정 {dischargeMode ? 'ON' : 'OFF'} {/* 오염물 배출 규정 패널 */} @@ -830,9 +881,9 @@ export function IncidentsView() { left: '50%', transform: 'translate(-50%, -50%)', padding: '12px 20px', - background: 'rgba(13,17,23,0.9)', - border: '1px solid rgba(6,182,212,0.3)', - color: '#22d3ee', + background: 'var(--bg-base)', + border: '1px solid color-mix(in srgb, var(--color-accent) 30%, transparent)', + color: 'var(--color-accent)', backdropFilter: 'blur(8px)', pointerEvents: 'none', }} @@ -845,14 +896,14 @@ export function IncidentsView() {
-
- AIS Live + /> */} + AIS Live MarineTraffic
-
- 선박 20 -
-
- 사고 6 -
-
- 방제선 2 -
+
선박 20
+
사고 6
+
방제선 2
@@ -881,29 +926,29 @@ export function IncidentsView() {
사고 상태
-
+
{[ - { c: '#ef4444', l: '대응중' }, - { c: '#f59e0b', l: '조사중' }, - { c: '#6b7280', l: '종료' }, + { c: 'var(--color-danger)', l: '대응중' }, + { c: 'var(--color-warning)', l: '조사중' }, + { c: 'var(--fg-disabled)', l: '종료' }, ].map((s) => ( -
+
{s.l}
))}
AIS 선박
-
+
{VESSEL_LEGEND.map((vl) => ( -
+
- {vl.type} + {vl.type}
))}
@@ -993,11 +1038,15 @@ export function IncidentsView() { className="flex items-center shrink-0 border-b border-stroke" style={{ height: 28, - background: 'linear-gradient(90deg,rgba(249,115,22,0.08),var(--bg-surface))', + background: + 'linear-gradient(90deg, color-mix(in srgb, var(--color-warning) 8%, transparent), var(--bg-surface))', padding: '0 10px', }} > - + 🛢 유출유 확산예측
@@ -1006,7 +1055,7 @@ export function IncidentsView() { style={{ padding: 10 }} >
@@ -1016,11 +1065,15 @@ export function IncidentsView() { className="flex items-center shrink-0 border-b border-stroke" style={{ height: 28, - background: 'linear-gradient(90deg,rgba(168,85,247,0.08),var(--bg-surface))', + background: + 'linear-gradient(90deg, color-mix(in srgb, var(--color-tertiary) 8%, transparent), var(--bg-surface))', padding: '0 10px', }} > - + 🧪 HNS 대기확산
@@ -1029,7 +1082,7 @@ export function IncidentsView() { style={{ padding: 10 }} >
@@ -1039,7 +1092,8 @@ export function IncidentsView() { className="flex items-center shrink-0 border-b border-stroke" style={{ height: 28, - background: 'linear-gradient(90deg,rgba(6,182,212,0.08),var(--bg-surface))', + background: + 'linear-gradient(90deg, color-mix(in srgb, var(--color-accent) 8%, transparent), var(--bg-surface))', padding: '0 10px', }} > @@ -1050,7 +1104,7 @@ export function IncidentsView() { style={{ padding: 10 }} >
@@ -1074,8 +1128,8 @@ export function IncidentsView() { className="cursor-pointer rounded text-caption font-semibold" style={{ padding: '4px 12px', - background: 'rgba(59,130,246,0.1)', - border: '1px solid rgba(59,130,246,0.2)', + background: 'color-mix(in srgb, var(--color-info) 10%, transparent)', + border: '1px solid color-mix(in srgb, var(--color-info) 20%, transparent)', color: 'var(--color-info)', }} > @@ -1085,9 +1139,9 @@ export function IncidentsView() { className="cursor-pointer rounded text-caption font-semibold" style={{ padding: '4px 12px', - background: 'rgba(168,85,247,0.1)', - border: '1px solid rgba(168,85,247,0.2)', - color: '#a78bfa', + background: 'color-mix(in srgb, var(--color-tertiary) 10%, transparent)', + border: '1px solid color-mix(in srgb, var(--color-tertiary) 20%, transparent)', + color: 'var(--color-tertiary)', }} > 🔗 R&D 연계 @@ -1098,17 +1152,19 @@ export function IncidentsView() {
{/* Right Panel */} - +
+ +
); } @@ -1145,11 +1201,11 @@ function SplitPanelContent({ model: 'KOSPS + OpenDrift · BUNKER-C 150kL', items: [ { label: '예측 시간', value: '72시간 (3일)' }, - { label: '최대 확산거리', value: '12.3 NM', color: '#f97316' }, - { label: '해안 도달 시간', value: '18시간 후', color: '#ef4444' }, + { label: '최대 확산거리', value: '12.3 NM', color: 'var(--color-warning)' }, + { label: '해안 도달 시간', value: '18시간 후', color: 'var(--color-danger)' }, { label: '영향 해안선', value: '27.5 km' }, { label: '풍화율', value: '32.4%' }, - { label: '잔존유량', value: '101.4 kL', color: '#f97316' }, + { label: '잔존유량', value: '101.4 kL', color: 'var(--color-warning)' }, ], summary: '여수항 남동쪽 방향 확산, 18시간 후 돌산도 해안 도달 예상. 조류 영향으로 남서쪽 이동.', @@ -1158,12 +1214,12 @@ function SplitPanelContent({ title: 'HNS 대기확산 결과', model: 'ALOHA + PHAST · 톨루엔 5톤', items: [ - { label: 'IDLH 범위', value: '1.2 km', color: '#ef4444' }, - { label: 'ERPG-2 범위', value: '2.8 km', color: '#f97316' }, - { label: 'ERPG-1 범위', value: '5.1 km', color: '#eab308' }, + { label: 'IDLH 범위', value: '1.2 km', color: 'var(--color-danger)' }, + { label: 'ERPG-2 범위', value: '2.8 km', color: 'var(--color-warning)' }, + { label: 'ERPG-1 범위', value: '5.1 km', color: 'var(--color-caution)' }, { label: '풍향', value: 'SW → NE 방향' }, { label: '대기 안정도', value: 'D등급 (중립)' }, - { label: '영향 인구', value: '약 2,400명', color: '#ef4444' }, + { label: '영향 인구', value: '약 2,400명', color: 'var(--color-danger)' }, ], summary: '남서풍에 의해 북동쪽 내륙 방향 확산. IDLH 1.2km 이내 즉시 대피 필요.', }, @@ -1171,12 +1227,12 @@ function SplitPanelContent({ title: '긴급구난 SAR 결과', model: 'SAROPS · Monte Carlo 10,000회 시뮬레이션', items: [ - { label: '95% 확률 범위', value: '8.5 NM²', color: '#06b6d4' }, + { label: '95% 확률 범위', value: '8.5 NM²', color: 'var(--color-accent)' }, { label: '최적 탐색 경로', value: 'Sector Search' }, { label: '예상 표류 속도', value: '1.8 kn' }, { label: '표류 방향', value: 'NE (045°)' }, - { label: '생존 가능 시간', value: '36시간', color: '#ef4444' }, - { label: '필요 자산', value: '헬기 2 + 경비정 3', color: '#f97316' }, + { label: '생존 가능 시간', value: '36시간', color: 'var(--color-danger)' }, + { label: '필요 자산', value: '헬기 2 + 경비정 3', color: 'var(--color-warning)' }, ], summary: '북동쪽 방향 표류 예상. 06:00 기준 최적 탐색 패턴: 섹터탐색(Sector Search).', }, @@ -1190,8 +1246,8 @@ function SplitPanelContent({ className="rounded-sm" style={{ padding: '10px 12px', - background: `${tag.color}08`, - border: `1px solid ${tag.color}20`, + background: `color-mix(in srgb, ${tag.color} 8%, transparent)`, + border: `1px solid color-mix(in srgb, ${tag.color} 20%, transparent)`, }} >
@@ -1219,7 +1275,7 @@ function SplitPanelContent({ {item.label} {item.value} @@ -1231,8 +1287,8 @@ function SplitPanelContent({ className="rounded-sm text-caption text-fg-sub" style={{ padding: '8px 10px', - background: `${tag.color}06`, - border: `1px solid ${tag.color}15`, + background: `color-mix(in srgb, ${tag.color} 6%, transparent)`, + border: `1px solid color-mix(in srgb, ${tag.color} 15%, transparent)`, lineHeight: 1.6, }} > @@ -1262,8 +1318,10 @@ function VesselPopupPanel({ onClose: () => void; onDetail: () => void; }) { - const statusColor = v.status.includes('사고') ? '#ef4444' : '#22c55e'; - const statusBg = v.status.includes('사고') ? 'rgba(239,68,68,0.15)' : 'rgba(34,197,94,0.1)'; + const statusColor = v.status.includes('사고') ? 'var(--color-danger)' : 'var(--color-success)'; + const statusBg = v.status.includes('사고') + ? 'color-mix(in srgb, var(--color-danger) 15%, transparent)' + : 'color-mix(in srgb, var(--color-success) 10%, transparent)'; return (
@@ -1288,8 +1346,8 @@ function VesselPopupPanel({ alignItems: 'center', gap: 8, padding: '10px 14px', - background: 'var(--bg-elevated)', - borderBottom: '1px solid var(--stroke-default)', + background: 'rgba(22,27,34,0.97)', + borderBottom: '1px solid rgba(48,54,61,0.8)', }} >
-
+
{v.name}
-
MMSI: {v.mmsi}
+
+ MMSI: {v.mmsi} +
- +
{/* Ship Image */}
🚢 @@ -1324,14 +1392,14 @@ function VesselPopupPanel({ {/* Tags */}
{v.typS} @@ -1341,7 +1409,7 @@ function VesselPopupPanel({ style={{ padding: '2px 8px', background: statusBg, - border: `1px solid ${statusColor}40`, + border: `1px solid color-mix(in srgb, ${statusColor} 40%, transparent)`, color: statusColor, }} > @@ -1361,12 +1429,20 @@ function VesselPopupPanel({ }} >
- 출항지 - {v.depart} + + 출항지 + + + {v.depart} +
- 입항지 - {v.arrive} + + 입항지 + + + {v.arrive} +
@@ -1376,31 +1452,34 @@ function VesselPopupPanel({
+ )} + + {/* Right panel toggle button */} + {activeSubTab === 'analysis' && ( + + )} + {activeSubTab === 'list' ? ( { - if (!selectedAnalysis) { - alert('선택된 사고가 없습니다.\n분석 목록에서 사고를 선택해주세요.'); - return; +
+ { + if (!selectedAnalysis) { + alert('선택된 사고가 없습니다.\n분석 목록에서 사고를 선택해주세요.'); + return; + } + setRecalcModalOpen(true); + }} + onOpenReport={handleOpenReport} + detail={analysisDetail} + summary={ + stepSummariesByModel[windHydrModel]?.[currentStep] ?? + summaryByModel[windHydrModel] ?? + simulationSummary } - setRecalcModalOpen(true); - }} - onOpenReport={handleOpenReport} - detail={analysisDetail} - summary={ - stepSummariesByModel[windHydrModel]?.[currentStep] ?? - summaryByModel[windHydrModel] ?? - simulationSummary - } - boomBlockedVolume={boomBlockedVolume} - displayControls={displayControls} - onDisplayControlsChange={setDisplayControls} - windHydrModel={windHydrModel} - windHydrModelOptions={windHydrModelOptions} - onWindHydrModelChange={setWindHydrModel} - analysisTab={analysisTab} - onSwitchAnalysisTab={setAnalysisTab} - drawAnalysisMode={drawAnalysisMode} - analysisPolygonPoints={analysisPolygonPoints} - circleRadiusNm={circleRadiusNm} - onCircleRadiusChange={setCircleRadiusNm} - analysisResult={analysisResult} - incidentCoord={incidentCoord} - centerPoints={centerPoints} - predictionTime={predictionTime} - onStartPolygonDraw={handleStartPolygonDraw} - onRunPolygonAnalysis={handleRunPolygonAnalysis} - onRunCircleAnalysis={handleRunCircleAnalysis} - onCancelAnalysis={handleCancelAnalysis} - onClearAnalysis={handleClearAnalysis} - /> + boomBlockedVolume={boomBlockedVolume} + displayControls={displayControls} + onDisplayControlsChange={setDisplayControls} + windHydrModel={windHydrModel} + windHydrModelOptions={windHydrModelOptions} + onWindHydrModelChange={setWindHydrModel} + analysisTab={analysisTab} + onSwitchAnalysisTab={setAnalysisTab} + drawAnalysisMode={drawAnalysisMode} + analysisPolygonPoints={analysisPolygonPoints} + circleRadiusNm={circleRadiusNm} + onCircleRadiusChange={setCircleRadiusNm} + analysisResult={analysisResult} + incidentCoord={incidentCoord} + centerPoints={centerPoints} + predictionTime={predictionTime} + onStartPolygonDraw={handleStartPolygonDraw} + onRunPolygonAnalysis={handleRunPolygonAnalysis} + onRunCircleAnalysis={handleRunCircleAnalysis} + onCancelAnalysis={handleCancelAnalysis} + onClearAnalysis={handleClearAnalysis} + /> +
)} {/* 확산 예측 실행 중 로딩 오버레이 */} diff --git a/frontend/src/tabs/prediction/components/RightPanel.tsx b/frontend/src/tabs/prediction/components/RightPanel.tsx index 483c862..0109d13 100755 --- a/frontend/src/tabs/prediction/components/RightPanel.tsx +++ b/frontend/src/tabs/prediction/components/RightPanel.tsx @@ -117,7 +117,7 @@ export function RightPanel({ }, [incidentCoord, centerPoints, summary, predictionTime]); return ( -
+
{/* Tab Header */}
diff --git a/frontend/src/tabs/scat/components/PreScatView.tsx b/frontend/src/tabs/scat/components/PreScatView.tsx index d7a0ec1..56808a8 100755 --- a/frontend/src/tabs/scat/components/PreScatView.tsx +++ b/frontend/src/tabs/scat/components/PreScatView.tsx @@ -16,6 +16,8 @@ import ScatRightPanel from './ScatRightPanel'; // ═══ Main PreScatView ═══ export function PreScatView() { + const [leftCollapsed, setLeftCollapsed] = useState(false); + const [rightCollapsed, setRightCollapsed] = useState(false); const [segments, setSegments] = useState([]); const [zones, setZones] = useState([]); const [jurisdictions, setJurisdictions] = useState([]); @@ -199,29 +201,70 @@ export function PreScatView() { return (
- + {/* Left Panel */} +
+ +
+ +
+ {/* Left panel toggle button */} + + + {/* Right panel toggle button */} + -
*/}
- + {/* Right Panel */} +
+ +
{popupData && ( diff --git a/frontend/src/tabs/scat/components/ScatLeftPanel.tsx b/frontend/src/tabs/scat/components/ScatLeftPanel.tsx index 7cdc25d..0e8b725 100644 --- a/frontend/src/tabs/scat/components/ScatLeftPanel.tsx +++ b/frontend/src/tabs/scat/components/ScatLeftPanel.tsx @@ -156,7 +156,7 @@ function ScatLeftPanel({ }, []); return ( -
+
{/* Filters */}
@@ -269,7 +269,11 @@ function ScatLeftPanel({ rowCount={filtered.length} rowHeight={88} overscanCount={5} - style={{ height: listHeight }} + style={{ + height: listHeight, + scrollbarWidth: 'thin', + scrollbarColor: 'var(--stroke-default) transparent', + }} rowComponent={SegRow} rowProps={{ filtered, diff --git a/frontend/src/tabs/scat/components/ScatMap.tsx b/frontend/src/tabs/scat/components/ScatMap.tsx index e96525a..9fb5227 100644 --- a/frontend/src/tabs/scat/components/ScatMap.tsx +++ b/frontend/src/tabs/scat/components/ScatMap.tsx @@ -310,7 +310,7 @@ function ScatMap({
{/* Right info cards */} -
+
{/* ESI Legend */}
diff --git a/frontend/src/tabs/scat/components/ScatRightPanel.tsx b/frontend/src/tabs/scat/components/ScatRightPanel.tsx index 331b1c9..ee8b25b 100644 --- a/frontend/src/tabs/scat/components/ScatRightPanel.tsx +++ b/frontend/src/tabs/scat/components/ScatRightPanel.tsx @@ -23,7 +23,7 @@ export default function ScatRightPanel({ if (!detail && !loading) { return ( -
+
🏖️
좌측 목록에서 구간을 @@ -37,7 +37,7 @@ export default function ScatRightPanel({ } return ( -
+
{/* 헤더 */}
{detail ? ( diff --git a/frontend/src/tabs/weather/components/WeatherMapControls.tsx b/frontend/src/tabs/weather/components/WeatherMapControls.tsx index 9d6714f..fac20c1 100644 --- a/frontend/src/tabs/weather/components/WeatherMapControls.tsx +++ b/frontend/src/tabs/weather/components/WeatherMapControls.tsx @@ -33,7 +33,7 @@ export function WeatherMapControls({ center, zoom }: WeatherMapControlsProps) {
diff --git a/frontend/src/tabs/weather/components/WeatherMapOverlay.tsx b/frontend/src/tabs/weather/components/WeatherMapOverlay.tsx index 28175dd..5d9b442 100755 --- a/frontend/src/tabs/weather/components/WeatherMapOverlay.tsx +++ b/frontend/src/tabs/weather/components/WeatherMapOverlay.tsx @@ -33,26 +33,26 @@ interface WeatherMapOverlayProps { selectedStationId: string | null; } -// 풍속에 따른 hex 색상 반환 +// 풍속에 따른 색상 반환 function getWindHexColor(speed: number, isSelected: boolean): string { - if (isSelected) return '#06b6d4'; - if (speed > 10) return '#ef4444'; - if (speed > 7) return '#f59e0b'; - return '#3b82f6'; + if (isSelected) return 'var(--color-accent)'; + if (speed > 10) return 'var(--color-danger)'; + if (speed > 7) return 'var(--color-caution)'; + return 'var(--color-info)'; } -// 파고에 따른 hex 색상 반환 +// 파고에 따른 색상 반환 function getWaveHexColor(height: number): string { - if (height > 2.5) return '#ef4444'; - if (height > 1.5) return '#f59e0b'; - return '#3b82f6'; + if (height > 2.5) return 'var(--color-danger)'; + if (height > 1.5) return 'var(--color-caution)'; + return 'var(--color-info)'; } -// 수온에 따른 hex 색상 반환 +// 수온에 따른 색상 반환 function getTempHexColor(temp: number): string { - if (temp > 8) return '#ef4444'; - if (temp > 6) return '#f59e0b'; - return '#3b82f6'; + if (temp > 8) return 'var(--color-danger)'; + if (temp > 6) return 'var(--color-caution)'; + return 'var(--color-info)'; } /** @@ -91,15 +91,17 @@ export function WeatherMapOverlay({ width={24} height={24} viewBox="0 0 24 24" - style={{ filter: 'drop-shadow(0 2px 4px rgba(0,0,0,0.3))' }} + style={{ filter: 'drop-shadow(0 2px 6px rgba(0,0,0,0.5))' }} > - {/* 위쪽이 바람 방향을 나타내는 삼각형 */} - + {/* 흰 외곽선 레이어 */} + + {/* 색상 레이어 */} +
{station.wind.speed.toFixed(1)} @@ -205,7 +207,6 @@ export function useWeatherDeckLayers( onStationClick: (station: WeatherStation) => void, ): Layer[] { return useMemo(() => { - // eslint-disable-next-line @typescript-eslint/no-explicit-any const result: Layer[] = []; // 파고 분포 ScatterplotLayer (Circle 대체, 반경 = 파고 * 15km) diff --git a/frontend/src/tabs/weather/components/WeatherRightPanel.tsx b/frontend/src/tabs/weather/components/WeatherRightPanel.tsx index d7950b2..7d73638 100755 --- a/frontend/src/tabs/weather/components/WeatherRightPanel.tsx +++ b/frontend/src/tabs/weather/components/WeatherRightPanel.tsx @@ -1,3 +1,5 @@ +import { useState } from 'react'; + interface WeatherData { stationName: string; location: { lat: number; lon: number }; @@ -46,20 +48,14 @@ interface WeatherRightPanelProps { weatherData: WeatherData | null; } -/** 풍속 등급 색상 */ -function windColor(speed: number): string { - if (speed >= 14) return '#ef4444'; - if (speed >= 10) return '#f97316'; - if (speed >= 6) return '#eab308'; - return '#22c55e'; +/** 풍속 텍스트 색상 (2단계 — danger | accent) */ +function windTextColor(speed: number): string { + return speed >= 10 ? 'var(--color-danger)' : 'var(--color-accent)'; } -/** 파고 등급 색상 */ -function waveColor(height: number): string { - if (height >= 3) return '#ef4444'; - if (height >= 2) return '#f97316'; - if (height >= 1) return '#eab308'; - return '#22c55e'; +/** 파고 텍스트 색상 (2단계 — danger | accent) */ +function waveTextColor(height: number): string { + return height >= 2 ? 'var(--color-danger)' : 'var(--color-accent)'; } /** 풍향 텍스트 */ @@ -86,13 +82,38 @@ function windDirText(deg: number): string { } export function WeatherRightPanel({ weatherData }: WeatherRightPanelProps) { + const [collapsed, setCollapsed] = useState(false); + + if (collapsed) { + return ( +
+ +
+ ); + } + if (!weatherData) { return (
-
+

지도에서 해양 지점을 클릭하세요

+
); @@ -109,18 +130,30 @@ export function WeatherRightPanel({ weatherData }: WeatherRightPanelProps) {
{/* 헤더 */}
-
- - 📍 {weatherData.stationName} - - - 기상예보관 - +
+
+
+ + 📍 {weatherData.stationName} + + + 기상예보관 + +
+

+ {weatherData.location.lat.toFixed(2)}°N, {weatherData.location.lon.toFixed(2)}°E ·{' '} + {weatherData.currentTime} +

+
+
-

- {weatherData.location.lat.toFixed(2)}°N, {weatherData.location.lon.toFixed(2)}°E ·{' '} - {weatherData.currentTime} -

{/* 스크롤 콘텐츠 */} @@ -131,13 +164,13 @@ export function WeatherRightPanel({ weatherData }: WeatherRightPanelProps) { {/* ── 핵심 지표 3칸 카드 ── */}
-
+
{wSpd.toFixed(1)}
풍속 (m/s)
-
+
{wHgt.toFixed(1)}
파고 (m)
@@ -152,9 +185,7 @@ export function WeatherRightPanel({ weatherData }: WeatherRightPanelProps) { {/* ── 바람 상세 ── */}
-
- 🌬️ 바람 현황 -
+
🌬️ 바람 현황
{/* 풍향 컴파스 */}
@@ -202,11 +233,11 @@ export function WeatherRightPanel({ weatherData }: WeatherRightPanelProps) { y1="25" x2={25 + 14 * Math.sin((wind.direction * Math.PI) / 180)} y2={25 - 14 * Math.cos((wind.direction * Math.PI) / 180)} - stroke={windColor(wSpd)} + stroke="var(--color-accent)" strokeWidth="2" strokeLinecap="round" /> - +
@@ -222,19 +253,13 @@ export function WeatherRightPanel({ weatherData }: WeatherRightPanelProps) {
1k 최고 - + {Number(wind.speed_1k).toFixed(1)}
3k 평균 - + {Number(wind.speed_3k).toFixed(1)}
@@ -248,11 +273,8 @@ export function WeatherRightPanel({ weatherData }: WeatherRightPanelProps) {
@@ -263,24 +285,20 @@ export function WeatherRightPanel({ weatherData }: WeatherRightPanelProps) { {/* ── 파도 상세 ── */}
-
🌊 파도
+
🌊 파도
-
- {wHgt.toFixed(1)}m -
+
{wHgt.toFixed(1)}m
유의파고
-
+
{wave.maxHeight.toFixed(1)}m
최고파고
-
- {wave.period}s -
+
{wave.period}s
주기
@@ -295,7 +313,7 @@ export function WeatherRightPanel({ weatherData }: WeatherRightPanelProps) { className="h-full rounded-full transition-all" style={{ width: `${Math.min((wHgt / 5) * 100, 100)}%`, - background: waveColor(wHgt), + background: 'var(--color-accent)', }} />
@@ -307,14 +325,10 @@ export function WeatherRightPanel({ weatherData }: WeatherRightPanelProps) { {/* ── 수온/공기 ── */}
-
- 🌡️ 수온 · 공기 -
+
🌡️ 수온 · 공기
-
- {wTemp.toFixed(1)}° -
+
{wTemp.toFixed(1)}°
수온
@@ -332,9 +346,7 @@ export function WeatherRightPanel({ weatherData }: WeatherRightPanelProps) { {/* ── 시간별 예보 ── */}
-
- ⏰ 시간별 예보 -
+
⏰ 시간별 예보
{forecast.map((f, i) => (
-
- ☀️ 천문 · 조석 -
+
☀️ 천문 · 조석
{[ { icon: '🌅', label: '일출', value: astronomy.sunrise }, @@ -381,17 +391,21 @@ export function WeatherRightPanel({ weatherData }: WeatherRightPanelProps) { {/* ── 날씨 특보 ── */} {alert && (
-
- 🚨 날씨 특보 -
+
🚨 날씨 특보
주의 diff --git a/frontend/src/tabs/weather/components/WeatherView.tsx b/frontend/src/tabs/weather/components/WeatherView.tsx index 834b510..058a7e4 100755 --- a/frontend/src/tabs/weather/components/WeatherView.tsx +++ b/frontend/src/tabs/weather/components/WeatherView.tsx @@ -90,7 +90,6 @@ const WEATHER_MAP_CENTER: [number, number] = [127.8, 36.5]; // [lng, lat] const WEATHER_MAP_ZOOM = 7; // deck.gl 오버레이 컴포넌트 (MapLibre 컨트롤로 등록) -// eslint-disable-next-line @typescript-eslint/no-explicit-any function DeckGLOverlay({ layers }: { layers: Layer[] }) { const overlay = useControl(() => new MapboxOverlay({ interleaved: true })); overlay.setProps({ layers }); @@ -178,7 +177,7 @@ function WeatherMapInner({ {/* 핀 꼬리 */}
{/* 좌표 라벨 */} -
+
{clickedLocation.lat.toFixed(3)}°N {clickedLocation.lon.toFixed(3)}°E
@@ -295,7 +294,7 @@ export function WeatherView() { {/* Main Map Area */}
{/* Tab Navigation */} -
+
{(['0', '3', '6', '9'] as TimeOffset[]).map((offset) => ( +
+ + {/* 필터 바 */} +
+ 기간: + setStartDate(e.target.value)} + className="px-2 py-1 text-xs rounded bg-bg-elevated border border-stroke-1 text-t1 focus:outline-none focus:border-cyan-500" + /> + ~ + setEndDate(e.target.value)} + className="px-2 py-1 text-xs rounded bg-bg-elevated border border-stroke-1 text-t1 focus:outline-none focus:border-cyan-500" + /> + 작업자: + +
+ + {/* 로그 테이블 */} +
+ + + + {['시간', '작업자', '작업', '대상 데이터', '결과', '상세'].map((h) => ( + + ))} + + + + {filteredLogs.length === 0 ? ( + + + + ) : ( + filteredLogs.map((log) => ( + setSelectedLog(log)} + > + + + + + + + + )) + )} + +
+ {h} +
+ 감사로그가 없습니다. +
{log.time.split(' ')[1]}{log.operator}{log.action}{log.targetData} + + {log.result} + + + +
+
+ + {/* 로그 상세 정보 */} + {selectedLog && ( +
+

로그 상세 정보

+
+
로그ID: {selectedLog.id}
+
타임스탬프: {selectedLog.time}
+
작업자: {selectedLog.operator} ({selectedLog.operatorId})
+
작업 유형: {selectedLog.action}
+
대상: {selectedLog.targetData} ({selectedLog.detail.dataCount.toLocaleString()}건)
+
적용 규칙: {selectedLog.detail.rulesApplied}
+
결과: {selectedLog.result} (처리: {selectedLog.detail.processedCount.toLocaleString()}, 오류: {selectedLog.detail.errorCount})
+
IP 주소: {selectedLog.ip}
+
브라우저: {selectedLog.browser}
+
+
+ )} + + {/* 하단 버튼 */} +
+ + + +
+
+
+ ); +} + +// ─── 마법사 모달 ─────────────────────────────────────────── + +interface WizardModalProps { + onClose: () => void; + onSubmit: (wizard: WizardState) => void; +} + +function WizardModal({ onClose, onSubmit }: WizardModalProps) { + const [wizard, setWizard] = useState(INITIAL_WIZARD); + + const patch = useCallback((update: Partial) => { + setWizard((prev) => ({ ...prev, ...update })); + }, []); + + const handleNext = () => { + if (wizard.step < 5) patch({ step: wizard.step + 1 }); + }; + const handlePrev = () => { + if (wizard.step > 1) patch({ step: wizard.step - 1 }); + }; + const handleSubmit = () => { + onSubmit(wizard); + onClose(); + }; + + const canProceed = () => { + if (wizard.step === 1) return wizard.taskName.trim().length > 0; + if (wizard.step === 2) return wizard.fields.some((f) => f.selected); + if (wizard.step === 5) return wizard.confirmed; + return true; + }; + + return ( +
+
+ {/* 모달 헤더 */} +
+

새 비식별화 작업

+ +
+ + {/* 단계 표시기 */} + + + {/* 단계 내용 */} +
+ {wizard.step === 1 && } + {wizard.step === 2 && } + {wizard.step === 3 && } + {wizard.step === 4 && } + {wizard.step === 5 && } +
+ + {/* 푸터 버튼 */} +
+ +
+ + {wizard.step < 5 ? ( + + ) : ( + + )} +
+
+
+
+ ); +} + +// ─── 메인 패널 ────────────────────────────────────────────── + +type FilterStatus = '모두' | TaskStatus; + +export default function DeidentifyPanel() { + const [tasks, setTasks] = useState([]); + const [loading, setLoading] = useState(false); + const [showWizard, setShowWizard] = useState(false); + const [auditTask, setAuditTask] = useState(null); + const [searchName, setSearchName] = useState(''); + const [filterStatus, setFilterStatus] = useState('모두'); + const [filterPeriod, setFilterPeriod] = useState<'7' | '30' | '90'>('30'); + + const loadTasks = useCallback(async () => { + setLoading(true); + const data = await fetchTasks(); + setTasks(data); + setLoading(false); + }, []); + + useEffect(() => { + let isMounted = true; + if (tasks.length === 0) { + void Promise.resolve().then(() => { + if (isMounted) void loadTasks(); + }); + } + return () => { + isMounted = false; + }; + }, [tasks.length, loadTasks]); + + const handleAction = useCallback((action: string, task: DeidentifyTask) => { + // TODO: 실제 API 연동 시 각 액션에 맞는 API 호출로 교체 + if (action === 'delete') { + setTasks((prev) => prev.filter((t) => t.id !== task.id)); + } else if (action === 'audit') { + setAuditTask(task); + } + }, []); + + const handleWizardSubmit = useCallback((wizard: WizardState) => { + const selectedFields = wizard.fields.filter((f) => f.selected).map((f) => f.name); + const newTask: DeidentifyTask = { + id: String(tasks.length + 1).padStart(3, '0'), + name: wizard.taskName, + target: selectedFields.join(', ') || '-', + status: wizard.processMode === 'immediate' ? '진행중' : '대기', + startTime: new Date().toLocaleString('ko-KR', { + year: 'numeric', month: '2-digit', day: '2-digit', + hour: '2-digit', minute: '2-digit', hour12: false, + }).replace(/\. /g, '-').replace('.', ''), + progress: 0, + createdBy: '관리자', + }; + setTasks((prev) => [newTask, ...prev]); + }, [tasks.length]); + + const filteredTasks = tasks.filter((t) => { + if (searchName && !t.name.includes(searchName)) return false; + if (filterStatus !== '모두' && t.status !== filterStatus) return false; + return true; + }); + + const completedCount = tasks.filter((t) => t.status === '완료').length; + const inProgressCount = tasks.filter((t) => t.status === '진행중').length; + const errorCount = tasks.filter((t) => t.status === '오류').length; + + return ( +
+ {/* 헤더 */} +
+

비식별화조치

+ +
+ + {/* 상태 요약 */} +
+ + + 완료 {completedCount}건 + + + + 진행중 {inProgressCount}건 + + {errorCount > 0 && ( + + + 오류 {errorCount}건 + + )} + 전체 {tasks.length}건 +
+ + {/* 검색/필터 */} +
+ setSearchName(e.target.value)} + placeholder="작업명 검색" + className="px-2.5 py-1.5 text-xs rounded bg-bg-elevated border border-stroke-1 text-t1 placeholder:text-t3 focus:outline-none focus:border-cyan-500 w-40" + /> + + +
+ + {/* 테이블 */} +
+ +
+ + {/* 감사로그 모달 */} + {auditTask && ( + setAuditTask(null)} /> + )} + + {/* 마법사 모달 */} + {showWizard && ( + setShowWizard(false)} + onSubmit={handleWizardSubmit} + /> + )} +
+ ); +} diff --git a/frontend/src/tabs/admin/components/adminMenuConfig.ts b/frontend/src/tabs/admin/components/adminMenuConfig.ts index d719756..3494ced 100644 --- a/frontend/src/tabs/admin/components/adminMenuConfig.ts +++ b/frontend/src/tabs/admin/components/adminMenuConfig.ts @@ -91,6 +91,7 @@ export const ADMIN_MENU: AdminMenuItem[] = [ { id: 'monitor-vessel', label: '선박위치정보' }, ], }, + { id: 'deidentify', label: '비식별화조치' }, ], }, ]; -- 2.45.2 From 387e2a2e405353d15d76be3d39776e4f27e28133 Mon Sep 17 00:00:00 2001 From: Nan Kyung Lee Date: Sat, 11 Apr 2026 19:46:12 +0900 Subject: [PATCH 3/7] =?UTF-8?q?feat(rescue):=20=EA=B8=B4=EA=B8=89=EA=B5=AC?= =?UTF-8?q?=EB=82=9C/=EC=98=88=EC=B8=A1=EB=8F=84=20OSM=20=EC=A7=80?= =?UTF-8?q?=EB=8F=84=20=EC=A0=81=EC=9A=A9=20=EB=B0=8F=20=EA=B4=80=EB=A6=AC?= =?UTF-8?q?=EC=9E=90=20=ED=8C=A8=EB=84=90=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - RescueView: CenterMap을 MapView(useBaseMapStyle) 기반 OSM 지도로 교체 - RescueScenarioView: BASE_STYLE → useBaseMapStyle로 전환하여 OSM 통일 - 긴급구난 시나리오 시드 데이터 10건으로 확장 (모델 이론 기반) - 관리자 비식별화조치 R&D 패널 5종 추가 (HNS대기, KOSPS, POSEIDON, Rescue, 시스템아키텍처) Co-Authored-By: Claude Opus 4.6 (1M context) --- database/migration/016_rescue.sql | 124 +- .../src/tabs/admin/components/AdminView.tsx | 10 + .../admin/components/RndHnsAtmosPanel.tsx | 638 +++++++ .../tabs/admin/components/RndKospsPanel.tsx | 638 +++++++ .../admin/components/RndPoseidonPanel.tsx | 665 +++++++ .../tabs/admin/components/RndRescuePanel.tsx | 638 +++++++ .../tabs/admin/components/SystemArchPanel.tsx | 1544 +++++++++++++++++ .../tabs/admin/components/adminMenuConfig.ts | 11 + .../rescue/components/RescueScenarioView.tsx | 681 +++++++- .../src/tabs/rescue/components/RescueView.tsx | 378 ++-- 10 files changed, 5074 insertions(+), 253 deletions(-) create mode 100644 frontend/src/tabs/admin/components/RndHnsAtmosPanel.tsx create mode 100644 frontend/src/tabs/admin/components/RndKospsPanel.tsx create mode 100644 frontend/src/tabs/admin/components/RndPoseidonPanel.tsx create mode 100644 frontend/src/tabs/admin/components/RndRescuePanel.tsx create mode 100644 frontend/src/tabs/admin/components/SystemArchPanel.tsx diff --git a/database/migration/016_rescue.sql b/database/migration/016_rescue.sql index 5e8bd3c..9a2c9a1 100644 --- a/database/migration/016_rescue.sql +++ b/database/migration/016_rescue.sql @@ -128,55 +128,125 @@ INSERT INTO RESCUE_OPS ( ); -- ============================================================ --- 4. RESCUE_SCENARIO 시드 데이터 (5건, RESCUE_OPS_SN=1 기준) +-- 4. RESCUE_SCENARIO 시드 데이터 (10건, RESCUE_OPS_SN=1 기준) +-- 긴급구난 모델 이론 기반 시간 단계별 시나리오 +-- - 손상복원성(Damage Stability): GM, 횡경사, 트림 진행 +-- - 종강도(Longitudinal Strength): BM 비율 모니터링 +-- - 유출 모델링: 파공부 유출률 변화 +-- - 부력 잔여량: 침수 구획 확대에 따른 부력 변화 -- ============================================================ INSERT INTO RESCUE_SCENARIO ( RESCUE_OPS_SN, TIME_STEP, SCENARIO_DTM, SVRT_CD, GM_M, LIST_DEG, TRIM_M, BUOYANCY_PCT, OIL_RATE_LPM, BM_RATIO_PCT, DESCRIPTION, COMPARTMENTS, ASSESSMENT, ACTIONS, SORT_ORD ) VALUES +-- S-01: 사고 발생 (Initial Impact) +-- 충돌 직후 초기 손상 상태. 손상복원성 이론에 따라 파공부 침수 시작, GM 급락 ( 1, 'T+0h', '2024-10-27 10:30:00+09', 'CRITICAL', 0.8, 15.0, 2.5, 30.0, 100.0, 92.0, - '좌현 35° 충돌로 No.1P 화물탱크 파공, 벙커C유 유출 개시. 좌현 경사 15°, GM 위험수준.', + '좌현 35° 충돌로 No.1P 화물탱크 파공. 벙커C유 유출 개시. 손상복원성 분석: 초기 GM 0.8m으로 IMO 기준(1.0m) 미달, 복원력 위험 판정.', '[{"name":"#1 FP Tank","status":"FLOODED","color":"var(--red)"},{"name":"#1 Port Tank","status":"BREACHED","color":"var(--red)"},{"name":"#2 Port Tank","status":"RISK","color":"var(--orange)"},{"name":"Engine Room","status":"INTACT","color":"var(--green)"},{"name":"#3 Stbd Tank","status":"INTACT","color":"var(--green)"}]', - '[{"label":"복원력","value":"위험 (GM < 1.0m)","color":"var(--red)"},{"label":"유출 위험","value":"활발 유출중","color":"var(--red)"},{"label":"선체 강도","value":"BM 92% (경계)","color":"var(--orange)"},{"label":"승선인원","value":"15/20 확인, 5명 수색중","color":"var(--red)"}]', - '[{"time":"10:30","text":"충돌 발생, VHF Ch.16 조난 통보","color":"var(--red)"},{"time":"10:35","text":"해경 3009함 출동 지시","color":"var(--orange)"},{"time":"10:42","text":"인근 선박 구조 활동 개시","color":"var(--cyan)"},{"time":"10:50","text":"유출유 방제선 배치 요청","color":"var(--orange)"}]', + '[{"label":"복원력","value":"위험 (GM 0.8m < IMO 1.0m)","color":"var(--red)"},{"label":"유출 위험","value":"활발 유출중 (100 L/min)","color":"var(--red)"},{"label":"선체 강도","value":"BM 92% (경계)","color":"var(--orange)"},{"label":"승선인원","value":"15/20 확인, 5명 수색중","color":"var(--red)"}]', + '[{"time":"10:30","text":"충돌 발생, VHF Ch.16 조난 통보 (GMDSS DSC Alert)","color":"var(--red)"},{"time":"10:32","text":"EPIRB 자동 발신 확인","color":"var(--red)"},{"time":"10:35","text":"해경 3009함 출동 지시","color":"var(--orange)"},{"time":"10:42","text":"인근 선박 구조 활동 개시","color":"var(--cyan)"}]', 1 ), +-- S-02: 초동 손상 평가 (Emergency Damage Assessment) +-- 잠수사 투입, 파공부 규모 확인. 침수 진행 모델링: 파공면적 A, 수두차 h 기반 유입률 Q=Cd·A·√(2gh) ( - 1, 'T+2h', '2024-10-27 12:30:00+09', 'HIGH', - 0.6, 18.0, 3.2, 25.0, 150.0, 88.0, - '침수 확대로 경사 증가, 유출량 증가 추세. 긴급 이초 작업 검토 필요.', - '[{"name":"#1 FP Tank","status":"FLOODED","color":"var(--red)"},{"name":"#1 Port Tank","status":"FLOODED","color":"var(--red)"},{"name":"#2 Port Tank","status":"FLOODED","color":"var(--red)"},{"name":"Engine Room","status":"RISK","color":"var(--orange)"},{"name":"#3 Stbd Tank","status":"INTACT","color":"var(--green)"}]', - '[{"label":"복원력","value":"위험 (GM 0.6m)","color":"var(--red)"},{"label":"유출 위험","value":"증가 추세","color":"var(--red)"},{"label":"선체 강도","value":"BM 88%","color":"var(--orange)"},{"label":"승선인원","value":"전원 퇴선 완료","color":"var(--green)"}]', - '[{"time":"12:00","text":"2차 침수 확인 (#2 PT)","color":"var(--red)"},{"time":"12:15","text":"긴급 이초 작업 개시","color":"var(--orange)"},{"time":"12:20","text":"오일펜스 1차 전개 완료","color":"var(--cyan)"},{"time":"12:30","text":"항공기 유출유 촬영 요청","color":"var(--cyan)"}]', + 1, 'T+30m', '2024-10-27 11:00:00+09', 'CRITICAL', + 0.7, 17.0, 2.8, 28.0, 120.0, 90.0, + '잠수사 수중 조사 결과 좌현 No.1P 파공 크기 1.2m×0.8m 확인. Bernoulli 유입률 모델 적용: 수두차 4.5m 기준 유입률 약 2.1㎥/min. 30분 경과 침수량 추정 63㎥.', + '[{"name":"#1 FP Tank","status":"FLOODED","color":"var(--red)"},{"name":"#1 Port Tank","status":"BREACHED","color":"var(--red)"},{"name":"#2 Port Tank","status":"RISK","color":"var(--orange)"},{"name":"Engine Room","status":"INTACT","color":"var(--green)"},{"name":"#3 Stbd Tank","status":"INTACT","color":"var(--green)"}]', + '[{"label":"복원력","value":"악화 (GM 0.7m, GZ 커브 감소)","color":"var(--red)"},{"label":"유출 위험","value":"증가 (120 L/min)","color":"var(--red)"},{"label":"선체 강도","value":"BM 90% — 종강도 모니터링 개시","color":"var(--orange)"},{"label":"승선인원","value":"15명 퇴선, 5명 수색중","color":"var(--red)"}]', + '[{"time":"10:50","text":"잠수사 투입, 수중 손상 조사 개시","color":"var(--cyan)"},{"time":"10:55","text":"파공 규모 확인: 1.2m×0.8m, 수선 하 2.5m","color":"var(--red)"},{"time":"11:00","text":"손상복원성 재계산 — IMO Res.A.749 기준 위험","color":"var(--red)"},{"time":"11:00","text":"유출유 방제선 배치 요청","color":"var(--orange)"}]', 2 ), +-- S-03: 구조 작전 개시 (SAR Operations Initiated) +-- 해경 함정 현장 도착, 인명 구조 우선. GM 지속 하락, 복원력 한계 접근 ( - 1, 'T+6h', '2024-10-27 16:30:00+09', 'HIGH', - 0.4, 12.0, 2.8, 35.0, 80.0, 90.0, - '평형수 이동으로 경사 일부 복원. 유출률 감소 추세.', - '[{"name":"#1 FP Tank","status":"FLOODED","color":"var(--red)"},{"name":"#1 Port Tank","status":"FLOODED","color":"var(--red)"},{"name":"#2 Port Tank","status":"FLOODED","color":"var(--red)"},{"name":"Engine Room","status":"RISK","color":"var(--orange)"},{"name":"#3 Stbd Tank","status":"RISK","color":"var(--orange)"}]', - '[{"label":"복원력","value":"개선 추세 (GM 0.4m)","color":"var(--orange)"},{"label":"유출 위험","value":"감소 추세","color":"var(--orange)"},{"label":"선체 강도","value":"BM 90%","color":"var(--orange)"},{"label":"구조 상황","value":"구조 작전 진행중","color":"var(--cyan)"}]', - '[{"time":"14:00","text":"평형수 이동 작업 개시","color":"var(--cyan)"},{"time":"15:00","text":"해상크레인 도착","color":"var(--cyan)"},{"time":"15:30","text":"잔류유 이적 작업 개시","color":"var(--orange)"},{"time":"16:30","text":"예인준비 완료","color":"var(--green)"}]', + 1, 'T+1h', '2024-10-27 11:30:00+09', 'CRITICAL', + 0.65, 18.5, 3.0, 26.0, 135.0, 89.0, + '해경 3009함 현장 도착, SAR 작전 개시. 표류 예측 모델(Leeway Model) 적용: 풍속 8m/s, 해류 2.5kn NE 조건에서 실종자 표류 반경 1.2nm 산정. GZ 커브 분석: 최대 복원력 각도 25°로 감소.', + '[{"name":"#1 FP Tank","status":"FLOODED","color":"var(--red)"},{"name":"#1 Port Tank","status":"FLOODED","color":"var(--red)"},{"name":"#2 Port Tank","status":"FLOODING","color":"var(--red)"},{"name":"Engine Room","status":"INTACT","color":"var(--green)"},{"name":"#3 Stbd Tank","status":"INTACT","color":"var(--green)"}]', + '[{"label":"복원력","value":"한계 접근 (GM 0.65m, GZ_max 25°)","color":"var(--red)"},{"label":"유출 위험","value":"파공 확대 우려 (135 L/min)","color":"var(--red)"},{"label":"선체 강도","value":"BM 89% — Hogging 모멘트 증가","color":"var(--orange)"},{"label":"인명구조","value":"실종 5명 수색중, 표류 반경 1.2nm","color":"var(--red)"}]', + '[{"time":"11:10","text":"해경 3009함 현장 도착, SAR 구역 설정","color":"var(--cyan)"},{"time":"11:15","text":"실종자 Leeway 표류 예측 모델 적용","color":"var(--cyan)"},{"time":"11:20","text":"회전익 항공기 수색 개시 (R=1.2nm)","color":"var(--cyan)"},{"time":"11:30","text":"#2 Port Tank 2차 침수 징후 감지","color":"var(--red)"}]', 3 ), +-- S-04: 침수 확대 및 복원력 위기 (Flooding Progression & Stability Crisis) +-- 2차 구획 침수, 자유표면효과(Free Surface Effect) 반영 GM 급락 ( - 1, 'T+12h', '2024-10-27 22:30:00+09', 'MEDIUM', - 0.6, 8.0, 1.5, 50.0, 30.0, 94.0, - '예인 작업 진행중, 선체 안정화 확인. 유출 대부분 차단.', - '[{"name":"#1 FP Tank","status":"FLOODED","color":"var(--red)"},{"name":"#1 Port Tank","status":"FLOODED","color":"var(--red)"},{"name":"#2 Port Tank","status":"SEALED","color":"var(--orange)"},{"name":"Engine Room","status":"INTACT","color":"var(--green)"},{"name":"#3 Stbd Tank","status":"INTACT","color":"var(--green)"}]', - '[{"label":"복원력","value":"안정 (GM 0.6m)","color":"var(--orange)"},{"label":"유출 위험","value":"대부분 차단","color":"var(--green)"},{"label":"선체 강도","value":"BM 94%","color":"var(--green)"},{"label":"예인 상태","value":"목포항 예인 진행중","color":"var(--cyan)"}]', - '[{"time":"18:00","text":"예인 개시 (목포항 방향)","color":"var(--cyan)"},{"time":"19:00","text":"유출유 차단 확인","color":"var(--green)"},{"time":"20:00","text":"야간 감시 체제 전환","color":"var(--orange)"},{"time":"22:30","text":"예인 50% 진행","color":"var(--cyan)"}]', + 1, 'T+2h', '2024-10-27 12:30:00+09', 'CRITICAL', + 0.5, 20.0, 3.5, 22.0, 160.0, 86.0, + '격벽 관통으로 #2 Port Tank 침수 확대. 자유표면효과(FSE) 보정: GM_fluid = GM_solid - Σ(i/∇) = 0.5m. 종강도 분석: 중앙부 Sagging 모멘트 허용치 86% 도달. 침몰 위험 단계 진입.', + '[{"name":"#1 FP Tank","status":"FLOODED","color":"var(--red)"},{"name":"#1 Port Tank","status":"FLOODED","color":"var(--red)"},{"name":"#2 Port Tank","status":"FLOODED","color":"var(--red)"},{"name":"Engine Room","status":"RISK","color":"var(--orange)"},{"name":"#3 Stbd Tank","status":"INTACT","color":"var(--green)"}]', + '[{"label":"복원력","value":"위기 (GM 0.5m, FSE 보정 후)","color":"var(--red)"},{"label":"유출 위험","value":"최대치 접근 (160 L/min)","color":"var(--red)"},{"label":"선체 강도","value":"BM 86% — Sagging 허용치 경고","color":"var(--red)"},{"label":"승선인원","value":"실종 3명 발견, 2명 수색 지속","color":"var(--orange)"}]', + '[{"time":"12:00","text":"#2 Port Tank 격벽 관통 침수 확인","color":"var(--red)"},{"time":"12:10","text":"자유표면효과(FSE) 보정 재계산","color":"var(--red)"},{"time":"12:15","text":"긴급 Counter-Flooding 검토","color":"var(--orange)"},{"time":"12:30","text":"실종자 3명 추가 발견 구조","color":"var(--green)"}]', 4 ), +-- S-05: 응급 복원 작업 (Emergency Counter-Flooding) +-- Counter-Flooding 이론: 반대편 구획 의도적 침수로 횡경사 교정 +( + 1, 'T+3h', '2024-10-27 13:30:00+09', 'HIGH', + 0.55, 16.0, 3.2, 25.0, 140.0, 87.0, + 'Counter-Flooding 실시: #3 Stbd Tank에 평형수 280톤 주입하여 횡경사 20°→16° 교정. 복원력 일시적 개선. 종강도: Counter-Flooding으로 중량 재배분, BM 87% 유지. 유출률 감소 추세.', + '[{"name":"#1 FP Tank","status":"FLOODED","color":"var(--red)"},{"name":"#1 Port Tank","status":"FLOODED","color":"var(--red)"},{"name":"#2 Port Tank","status":"FLOODED","color":"var(--red)"},{"name":"Engine Room","status":"RISK","color":"var(--orange)"},{"name":"#3 Stbd Tank","status":"BALLASTED","color":"var(--orange)"}]', + '[{"label":"복원력","value":"개선 중 (GM 0.55m, 경사 16°)","color":"var(--orange)"},{"label":"유출 위험","value":"감소 추세 (140 L/min)","color":"var(--orange)"},{"label":"선체 강도","value":"BM 87% — Counter-Flooding 영향 평가","color":"var(--orange)"},{"label":"구조 상황","value":"실종 2명 수색 지속, 헬기 투입","color":"var(--orange)"}]', + '[{"time":"12:45","text":"Counter-Flooding 결정 — #3 Stbd 평형수 주입 개시","color":"var(--orange)"},{"time":"13:00","text":"평형수 280톤 주입, 횡경사 20°→18° 교정 진행","color":"var(--cyan)"},{"time":"13:15","text":"종강도 재계산 — 허용 범위 내 확인","color":"var(--cyan)"},{"time":"13:30","text":"횡경사 16° 안정화, 유출률 감소 확인","color":"var(--green)"}]', + 5 +), +-- S-06: 선체 안정화 및 잔류유 이적 (Hull Stabilization & Oil Transfer) +-- 평형수 조정 완료, 임시 보강. Trim/Stability Booklet 기준 안정 범위 진입 +( + 1, 'T+6h', '2024-10-27 16:30:00+09', 'HIGH', + 0.7, 12.0, 2.5, 32.0, 80.0, 90.0, + '임시 수중패치 설치, 유입률 감소. 평형수 재조정으로 GM 0.7m 회복. Trim/Stability Booklet 기준 예인 가능 최소 조건(GM≥0.5m, List≤15°) 충족. 잔류유 이적선(M/T) 배치.', + '[{"name":"#1 FP Tank","status":"FLOODED","color":"var(--red)"},{"name":"#1 Port Tank","status":"PATCHED","color":"var(--orange)"},{"name":"#2 Port Tank","status":"FLOODED","color":"var(--red)"},{"name":"Engine Room","status":"INTACT","color":"var(--green)"},{"name":"#3 Stbd Tank","status":"BALLASTED","color":"var(--orange)"}]', + '[{"label":"복원력","value":"개선 (GM 0.7m, 예인 가능 조건 충족)","color":"var(--orange)"},{"label":"유출 위험","value":"수중패치 효과 (80 L/min)","color":"var(--orange)"},{"label":"선체 강도","value":"BM 90% — 안정 범위","color":"var(--green)"},{"label":"구조 상황","value":"전원 구조 완료 (실종 2명 발견)","color":"var(--green)"}]', + '[{"time":"14:00","text":"수중패치 설치 작업 개시","color":"var(--cyan)"},{"time":"14:30","text":"잠수사 수중패치 설치 완료","color":"var(--green)"},{"time":"15:00","text":"해상크레인 도착, 잔류유 이적 준비","color":"var(--cyan)"},{"time":"16:30","text":"잔류유 1차 이적 완료 (약 45kL), 예인 준비 개시","color":"var(--green)"}]', + 6 +), +-- S-07: 오일 방제 전개 (Oil Boom Deployment & Containment) +-- 방제 이론: 오일붐 2중 전개, 유회수기 배치, 확산 모델 기반 방제 구역 설정 +( + 1, 'T+8h', '2024-10-27 18:30:00+09', 'MEDIUM', + 0.8, 10.0, 2.0, 38.0, 55.0, 91.0, + '오일붐 2중 전개 완료, 유회수기 3대 가동. 유출유 확산 예측 모델(GNOME) 적용: 풍향 NE 8m/s, 해류 2.5kn 조건에서 12시간 후 확산 면적 2.3km² 예측. 기계적 회수율 35% 달성.', + '[{"name":"#1 FP Tank","status":"FLOODED","color":"var(--red)"},{"name":"#1 Port Tank","status":"PATCHED","color":"var(--orange)"},{"name":"#2 Port Tank","status":"SEALED","color":"var(--orange)"},{"name":"Engine Room","status":"INTACT","color":"var(--green)"},{"name":"#3 Stbd Tank","status":"BALLASTED","color":"var(--orange)"}]', + '[{"label":"복원력","value":"안정 (GM 0.8m)","color":"var(--orange)"},{"label":"유출 위험","value":"방제 진행 (55 L/min, 회수율 35%)","color":"var(--orange)"},{"label":"선체 강도","value":"BM 91%","color":"var(--green)"},{"label":"방제 현황","value":"오일붐 2중, 유회수기 3대 가동","color":"var(--cyan)"}]', + '[{"time":"17:00","text":"오일붐 1차 전개 (500m)","color":"var(--cyan)"},{"time":"17:30","text":"오일붐 2차 전개 (300m, 이중 방어선)","color":"var(--cyan)"},{"time":"17:45","text":"유회수기 3대 배치·가동 개시","color":"var(--cyan)"},{"time":"18:30","text":"GNOME 확산 예측 갱신 — 방제 구역 재설정","color":"var(--orange)"}]', + 7 +), +-- S-08: 예인 작업 개시 (Towing Operation Commenced) +-- 예인 이론: 예인 저항 계산, 기상·해상 조건 판단, 예인 경로 최적화 +( + 1, 'T+12h', '2024-10-27 22:30:00+09', 'MEDIUM', + 0.9, 8.0, 1.5, 45.0, 30.0, 94.0, + '예인 개시. 예인 저항 계산: Rt = 1/2·ρ·Cd·A·V² 기반 예인선 4,000HP급 배정. 예인 경로: 현 위치→목포항 직선 42nm, 예인 속도 3kn 기준 ETA 14시간. 야간 감시 체제 전환.', + '[{"name":"#1 FP Tank","status":"FLOODED","color":"var(--red)"},{"name":"#1 Port Tank","status":"PATCHED","color":"var(--orange)"},{"name":"#2 Port Tank","status":"SEALED","color":"var(--orange)"},{"name":"Engine Room","status":"INTACT","color":"var(--green)"},{"name":"#3 Stbd Tank","status":"BALLASTED","color":"var(--orange)"}]', + '[{"label":"복원력","value":"안정 (GM 0.9m)","color":"var(--orange)"},{"label":"유출 위험","value":"억제 중 (30 L/min)","color":"var(--green)"},{"label":"선체 강도","value":"BM 94% — 예인 하중 반영","color":"var(--green)"},{"label":"예인 상태","value":"목포항 방향, ETA 14h, 3kn","color":"var(--cyan)"}]', + '[{"time":"18:00","text":"예인 접속 완료, 예인삭 250m 전개","color":"var(--cyan)"},{"time":"18:30","text":"예인 개시 (목포항 방향, 3kn)","color":"var(--cyan)"},{"time":"20:00","text":"야간 감시 체제 전환 (2시간 교대)","color":"var(--orange)"},{"time":"22:30","text":"예인 진행률 30%, 선체 상태 안정","color":"var(--green)"}]', + 8 +), +-- S-09: 이동 중 감시 및 안정성 유지 (Transit Monitoring) +-- 예인 중 동적 안정성 모니터링: 파랑 응답(RAO) 기반 횡동요 예측 +( + 1, 'T+18h', '2024-10-28 04:30:00+09', 'MEDIUM', + 1.0, 5.0, 1.0, 55.0, 15.0, 96.0, + '예인 진행률 65%. 파랑 응답 분석(RAO): 유의파고 1.2m, 주기 6s 조건에서 횡동요 진폭 ±3° 예측 — 안전 범위 내. 잔류 유출률 15 L/min으로 대폭 감소. 선체 안정성 지속 개선.', + '[{"name":"#1 FP Tank","status":"FLOODED","color":"var(--red)"},{"name":"#1 Port Tank","status":"PATCHED","color":"var(--orange)"},{"name":"#2 Port Tank","status":"SEALED","color":"var(--orange)"},{"name":"Engine Room","status":"INTACT","color":"var(--green)"},{"name":"#3 Stbd Tank","status":"STABLE","color":"var(--green)"}]', + '[{"label":"복원력","value":"양호 (GM 1.0m, IMO 기준 충족)","color":"var(--green)"},{"label":"유출 위험","value":"미량 유출 (15 L/min)","color":"var(--green)"},{"label":"선체 강도","value":"BM 96% — 정상 범위","color":"var(--green)"},{"label":"예인 상태","value":"진행률 65%, ETA 5.5h","color":"var(--cyan)"}]', + '[{"time":"00:00","text":"야간 예인 정상 진행, 기상 양호","color":"var(--green)"},{"time":"02:00","text":"파랑 응답 분석 — 안전 범위 확인","color":"var(--green)"},{"time":"03:00","text":"잔류유 유출률 15 L/min 확인","color":"var(--green)"},{"time":"04:30","text":"목포항 VTS 통보, 입항 예정 협의","color":"var(--cyan)"}]', + 9 +), +-- S-10: 상황 종료 및 사후 평가 (Resolution & Post-Assessment) +-- 접안 완료, 잔류유 이적, 사후 안정성 평가 ( 1, 'T+24h', '2024-10-28 10:30:00+09', 'RESOLVED', 1.2, 3.0, 0.5, 75.0, 5.0, 98.0, - '목포항 도착, 선체 안정. 잔류유 이적 완료.', - '[{"name":"#1 FP Tank","status":"SEALED","color":"var(--orange)"},{"name":"#1 Port Tank","status":"SEALED","color":"var(--orange)"},{"name":"#2 Port Tank","status":"SEALED","color":"var(--orange)"},{"name":"Engine Room","status":"INTACT","color":"var(--green)"},{"name":"#3 Stbd Tank","status":"INTACT","color":"var(--green)"}]', - '[{"label":"복원력","value":"안전 (GM 1.2m)","color":"var(--green)"},{"label":"유출 위험","value":"차단 완료","color":"var(--green)"},{"label":"선체 강도","value":"BM 98% 정상","color":"var(--green)"},{"label":"예인 상태","value":"목포항 접안 완료","color":"var(--green)"}]', - '[{"time":"06:00","text":"목포항 접근","color":"var(--cyan)"},{"time":"08:00","text":"도선사 승선, 접안 개시","color":"var(--cyan)"},{"time":"09:30","text":"접안 완료","color":"var(--green)"},{"time":"10:30","text":"잔류유 이적 완료, 상황 종료","color":"var(--green)"}]', - 5 + '목포항 접안 완료. 잔류유 전량 이적(총 120kL). 최종 손상복원성 평가: GM 1.2m으로 IMO 기준 충족, 횡경사 3° 잔류. 종강도 BM 98% 정상. 방제 총 회수량 85kL (회수율 71%). 상황 종료 선포.', + '[{"name":"#1 FP Tank","status":"SEALED","color":"var(--orange)"},{"name":"#1 Port Tank","status":"SEALED","color":"var(--orange)"},{"name":"#2 Port Tank","status":"SEALED","color":"var(--orange)"},{"name":"Engine Room","status":"INTACT","color":"var(--green)"},{"name":"#3 Stbd Tank","status":"STABLE","color":"var(--green)"}]', + '[{"label":"복원력","value":"안전 (GM 1.2m, IMO 기준 초과)","color":"var(--green)"},{"label":"유출 위험","value":"차단 완료 (잔류 5 L/min)","color":"var(--green)"},{"label":"선체 강도","value":"BM 98% 정상","color":"var(--green)"},{"label":"최종 상태","value":"접안 완료, 잔류유 이적 완료","color":"var(--green)"}]', + '[{"time":"06:00","text":"목포항 접근, 도선사 대기","color":"var(--cyan)"},{"time":"08:00","text":"도선사 승선, 접안 개시","color":"var(--cyan)"},{"time":"09:30","text":"접안 완료, 잔류유 이적선 접현","color":"var(--green)"},{"time":"10:30","text":"잔류유 전량 이적 완료, 상황 종료 선포","color":"var(--green)"}]', + 10 ); diff --git a/frontend/src/tabs/admin/components/AdminView.tsx b/frontend/src/tabs/admin/components/AdminView.tsx index 9708651..574dd66 100755 --- a/frontend/src/tabs/admin/components/AdminView.tsx +++ b/frontend/src/tabs/admin/components/AdminView.tsx @@ -20,6 +20,11 @@ import CollectHrPanel from './CollectHrPanel'; import MonitorForecastPanel from './MonitorForecastPanel'; import VesselMaterialsPanel from './VesselMaterialsPanel'; import DeidentifyPanel from './DeidentifyPanel'; +import RndPoseidonPanel from './RndPoseidonPanel'; +import RndKospsPanel from './RndKospsPanel'; +import RndHnsAtmosPanel from './RndHnsAtmosPanel'; +import RndRescuePanel from './RndRescuePanel'; +import SystemArchPanel from './SystemArchPanel'; /** 기존 패널이 있는 메뉴 ID 매핑 */ const PANEL_MAP: Record React.JSX.Element> = { @@ -44,6 +49,11 @@ const PANEL_MAP: Record React.JSX.Element> = { 'collect-hr': () => , 'monitor-forecast': () => , deidentify: () => , + 'rnd-poseidon': () => , + 'rnd-kosps': () => , + 'rnd-hns-atmos': () => , + 'rnd-rescue': () => , + 'system-arch': () => , }; export function AdminView() { diff --git a/frontend/src/tabs/admin/components/RndHnsAtmosPanel.tsx b/frontend/src/tabs/admin/components/RndHnsAtmosPanel.tsx new file mode 100644 index 0000000..4f006e1 --- /dev/null +++ b/frontend/src/tabs/admin/components/RndHnsAtmosPanel.tsx @@ -0,0 +1,638 @@ +import { useState, useEffect, useCallback } from 'react'; + +// ─── 타입 ────────────────────────────────────────────────────────────────────── + +type PipelineStatus = '정상' | '지연' | '중단'; +type ReceiveStatus = '수신완료' | '수신대기' | '수신실패' | '시간초과'; +type ProcessStatus = '처리완료' | '처리중' | '대기' | '오류'; +type DataSource = 'HYCOM' | '기상청' | '충북대 API'; +type AlertLevel = '경고' | '주의' | '정보'; + +interface PipelineNode { + id: string; + name: string; + status: PipelineStatus; + lastReceived: string; + cycle: string; +} + +interface DataLogRow { + id: string; + timestamp: string; + source: DataSource; + dataType: string; + size: string; + receiveStatus: ReceiveStatus; + processStatus: ProcessStatus; +} + +interface AlertItem { + id: string; + level: AlertLevel; + message: string; + timestamp: string; +} + +// ─── Mock 데이터 ──────────────────────────────────────────────────────────────── + +const MOCK_PIPELINE: PipelineNode[] = [ + { + id: 'hycom', + name: 'HYCOM 해양순환모델', + status: '정상', + lastReceived: '2026-04-11 06:00', + cycle: '6시간 주기', + }, + { + id: 'kma', + name: '기상청 수치모델', + status: '정상', + lastReceived: '2026-04-11 06:00', + cycle: '3시간 주기', + }, + { + id: 'chungbuk-api', + name: '충북대 API 서버', + status: '정상', + lastReceived: '2026-04-11 06:05', + cycle: 'API 호출', + }, + { + id: 'atmos-compute', + name: 'HNS 대기확산 연산', + status: '정상', + lastReceived: '2026-04-11 06:10', + cycle: '예측 시작 즉시', + }, + { + id: 'result-receive', + name: '결과 수신', + status: '지연', + lastReceived: '2026-04-11 06:00', + cycle: '연산 완료 즉시', + }, +]; + +const MOCK_LOGS: DataLogRow[] = [ + { + id: 'log-01', + timestamp: '2026-04-11 06:10', + source: 'HYCOM', + dataType: 'SST', + size: '98 MB', + receiveStatus: '수신완료', + processStatus: '처리완료', + }, + { + id: 'log-02', + timestamp: '2026-04-11 06:10', + source: 'HYCOM', + dataType: '해류', + size: '142 MB', + receiveStatus: '수신완료', + processStatus: '처리완료', + }, + { + id: 'log-03', + timestamp: '2026-04-11 06:05', + source: '기상청', + dataType: '풍향/풍속', + size: '38 MB', + receiveStatus: '수신완료', + processStatus: '처리완료', + }, + { + id: 'log-04', + timestamp: '2026-04-11 06:05', + source: '기상청', + dataType: '기압', + size: '22 MB', + receiveStatus: '수신완료', + processStatus: '처리완료', + }, + { + id: 'log-05', + timestamp: '2026-04-11 06:05', + source: '기상청', + dataType: '기온', + size: '19 MB', + receiveStatus: '수신완료', + processStatus: '처리완료', + }, + { + id: 'log-06', + timestamp: '2026-04-11 06:05', + source: '기상청', + dataType: '대기안정도', + size: '14 MB', + receiveStatus: '수신완료', + processStatus: '처리완료', + }, + { + id: 'log-07', + timestamp: '2026-04-11 06:07', + source: '충북대 API', + dataType: 'API 호출 요청', + size: '0.2 MB', + receiveStatus: '수신완료', + processStatus: '처리완료', + }, + { + id: 'log-08', + timestamp: '2026-04-11 06:15', + source: '충북대 API', + dataType: 'HNS 확산 결과', + size: '-', + receiveStatus: '수신대기', + processStatus: '대기', + }, + { + id: 'log-09', + timestamp: '2026-04-11 06:00', + source: 'HYCOM', + dataType: 'SSH', + size: '54 MB', + receiveStatus: '수신완료', + processStatus: '처리완료', + }, + { + id: 'log-10', + timestamp: '2026-04-11 03:05', + source: '기상청', + dataType: '풍향/풍속', + size: '37 MB', + receiveStatus: '수신완료', + processStatus: '처리완료', + }, + { + id: 'log-11', + timestamp: '2026-04-11 03:07', + source: '충북대 API', + dataType: 'API 호출 요청', + size: '0.2 MB', + receiveStatus: '수신완료', + processStatus: '처리완료', + }, + { + id: 'log-12', + timestamp: '2026-04-11 03:20', + source: '충북대 API', + dataType: 'HNS 확산 결과', + size: '12 MB', + receiveStatus: '수신완료', + processStatus: '처리완료', + }, + { + id: 'log-13', + timestamp: '2026-04-11 03:20', + source: '충북대 API', + dataType: '피해범위 데이터', + size: '4 MB', + receiveStatus: '수신완료', + processStatus: '처리완료', + }, + { + id: 'log-14', + timestamp: '2026-04-11 00:05', + source: '기상청', + dataType: '기압', + size: '23 MB', + receiveStatus: '수신완료', + processStatus: '처리완료', + }, + { + id: 'log-15', + timestamp: '2026-04-11 00:00', + source: 'HYCOM', + dataType: 'SST', + size: '97 MB', + receiveStatus: '시간초과', + processStatus: '오류', + }, +]; + +const MOCK_ALERTS: AlertItem[] = [ + { + id: 'alert-01', + level: '주의', + message: '충북대 API 결과 수신 지연 — 최근 응답 15분 지연 (2026-04-11 06:15)', + timestamp: '2026-04-11 06:30', + }, + { + id: 'alert-02', + level: '정보', + message: 'HYCOM 데이터 정상 수신 완료 (2026-04-11 06:00)', + timestamp: '2026-04-11 06:00', + }, + { + id: 'alert-03', + level: '정보', + message: '금일 HNS 대기확산 예측 완료: 2회/4회', + timestamp: '2026-04-11 06:12', + }, +]; + +// ─── Mock fetch ───────────────────────────────────────────────────────────────── + +interface HnsAtmosData { + pipeline: PipelineNode[]; + logs: DataLogRow[]; + alerts: AlertItem[]; +} + +function fetchHnsAtmosData(): Promise { + return new Promise((resolve) => { + setTimeout( + () => + resolve({ + pipeline: MOCK_PIPELINE, + logs: MOCK_LOGS, + alerts: MOCK_ALERTS, + }), + 300, + ); + }); +} + +// ─── 유틸 ─────────────────────────────────────────────────────────────────────── + +function getPipelineStatusStyle(status: PipelineStatus): string { + if (status === '정상') return 'text-emerald-400 bg-emerald-500/10'; + if (status === '지연') return 'text-yellow-400 bg-yellow-500/10'; + return 'text-red-400 bg-red-500/10'; +} + +function getPipelineBorderStyle(status: PipelineStatus): string { + if (status === '정상') return 'border-l-emerald-500'; + if (status === '지연') return 'border-l-yellow-500'; + return 'border-l-red-500'; +} + +function getReceiveStatusStyle(status: ReceiveStatus): string { + if (status === '수신완료') return 'text-emerald-400 bg-emerald-500/10'; + if (status === '수신대기') return 'text-yellow-400 bg-yellow-500/10'; + return 'text-red-400 bg-red-500/10'; +} + +function getProcessStatusStyle(status: ProcessStatus): string { + if (status === '처리완료') return 'text-emerald-400 bg-emerald-500/10'; + if (status === '처리중') return 'text-cyan-400 bg-cyan-500/10'; + if (status === '대기') return 'text-yellow-400 bg-yellow-500/10'; + return 'text-red-400 bg-red-500/10'; +} + +function getAlertStyle(level: AlertLevel): string { + if (level === '경고') return 'text-red-400 bg-red-500/10 border-red-500/30'; + if (level === '주의') return 'text-yellow-400 bg-yellow-500/10 border-yellow-500/30'; + return 'text-cyan-400 bg-cyan-500/10 border-cyan-500/30'; +} + +// ─── 파이프라인 카드 ───────────────────────────────────────────────────────────── + +function PipelineCard({ node }: { node: PipelineNode }) { + const badgeStyle = getPipelineStatusStyle(node.status); + const borderStyle = getPipelineBorderStyle(node.status); + + return ( +
+
{node.name}
+ + {node.status} + +
최근 수신: {node.lastReceived}
+
{node.cycle}
+
+ ); +} + +function PipelineFlow({ nodes, loading }: { nodes: PipelineNode[]; loading: boolean }) { + if (loading && nodes.length === 0) { + return ( +
+ {Array.from({ length: 5 }).map((_, i) => ( +
+
+ {i < 4 && } +
+ ))} +
+ ); + } + + return ( +
+ {nodes.map((node, idx) => ( +
+ + {idx < nodes.length - 1 && ( + + )} +
+ ))} +
+ ); +} + +// ─── 수신 이력 테이블 ──────────────────────────────────────────────────────────── + +type FilterSource = 'all' | DataSource; +type FilterReceive = 'all' | ReceiveStatus; +type FilterPeriod = '6h' | '12h' | '24h'; + +const PERIOD_HOURS: Record = { '6h': 6, '12h': 12, '24h': 24 }; + +function filterLogs( + rows: DataLogRow[], + source: FilterSource, + receive: FilterReceive, + period: FilterPeriod, +): DataLogRow[] { + const cutoff = new Date('2026-04-11T06:30:00'); + const hours = PERIOD_HOURS[period]; + const from = new Date(cutoff.getTime() - hours * 60 * 60 * 1000); + + return rows.filter((r) => { + if (source !== 'all' && r.source !== source) return false; + if (receive !== 'all' && r.receiveStatus !== receive) return false; + const ts = new Date(r.timestamp.replace(' ', 'T')); + if (ts < from) return false; + return true; + }); +} + +const LOG_HEADERS = ['시간', '데이터소스', '데이터종류', '크기', '수신상태', '처리상태']; + +function DataLogTable({ rows, loading }: { rows: DataLogRow[]; loading: boolean }) { + return ( +
+ + + + {LOG_HEADERS.map((h) => ( + + ))} + + + + {loading && rows.length === 0 + ? Array.from({ length: 8 }).map((_, i) => ( + + {LOG_HEADERS.map((_, j) => ( + + ))} + + )) + : rows.map((row) => ( + + + + + + + + + ))} + {!loading && rows.length === 0 && ( + + + + )} + +
+ {h} +
+
+
+ {row.timestamp} + {row.source}{row.dataType}{row.size} + + {row.receiveStatus} + + + + {row.processStatus} + +
+ 조회된 데이터가 없습니다. +
+
+ ); +} + +// ─── 알림 목록 ─────────────────────────────────────────────────────────────────── + +function AlertList({ alerts, loading }: { alerts: AlertItem[]; loading: boolean }) { + if (loading && alerts.length === 0) { + return ( +
+ {Array.from({ length: 3 }).map((_, i) => ( +
+ ))} +
+ ); + } + + if (alerts.length === 0) { + return

활성 알림이 없습니다.

; + } + + return ( +
+ {alerts.map((alert) => ( +
+ [{alert.level}] + {alert.message} + {alert.timestamp} +
+ ))} +
+ ); +} + +// ─── 메인 패널 ─────────────────────────────────────────────────────────────────── + +export default function RndHnsAtmosPanel() { + const [pipeline, setPipeline] = useState([]); + const [logs, setLogs] = useState([]); + const [alerts, setAlerts] = useState([]); + const [loading, setLoading] = useState(false); + const [lastUpdate, setLastUpdate] = useState(null); + + // 필터 + const [filterSource, setFilterSource] = useState('all'); + const [filterReceive, setFilterReceive] = useState('all'); + const [filterPeriod, setFilterPeriod] = useState('24h'); + + const fetchData = useCallback(async () => { + setLoading(true); + try { + const data = await fetchHnsAtmosData(); + setPipeline(data.pipeline); + setLogs(data.logs); + setAlerts(data.alerts); + setLastUpdate(new Date()); + } finally { + setLoading(false); + } + }, []); + + useEffect(() => { + let isMounted = true; + void Promise.resolve().then(() => { + if (isMounted) void fetchData(); + }); + return () => { + isMounted = false; + }; + }, [fetchData]); + + const filteredLogs = filterLogs(logs, filterSource, filterReceive, filterPeriod); + + const totalReceived = logs.filter((r) => r.receiveStatus === '수신완료').length; + const totalDelayed = logs.filter((r) => r.receiveStatus === '수신대기').length; + const totalFailed = logs.filter( + (r) => r.receiveStatus === '수신실패' || r.receiveStatus === '시간초과', + ).length; + + return ( +
+ {/* ── 헤더 ── */} +
+
+

HNS 대기확산 (충북대) 연계 모니터링

+
+ {lastUpdate && ( + + 갱신:{' '} + {lastUpdate.toLocaleTimeString('ko-KR', { + hour: '2-digit', + minute: '2-digit', + second: '2-digit', + })} + + )} + +
+
+ {/* 요약 통계 바 */} +
+ + 정상 수신:{' '} + {totalReceived}건 + + | + + 지연: {totalDelayed}건 + + | + + 실패: {totalFailed}건 + + | + + 금일 예측 완료:{' '} + 2 / 4회 + +
+
+ + {/* ── 스크롤 영역 ── */} +
+ {/* 파이프라인 현황 */} +
+

+ 데이터 파이프라인 현황 +

+ +
+ + {/* 필터 바 + 수신 이력 테이블 */} +
+
+

+ 데이터 수신 이력 +

+
+ {/* 데이터소스 필터 */} + + {/* 수신상태 필터 */} + + {/* 기간 필터 */} + + {filteredLogs.length}건 +
+
+ +
+ + {/* 알림 현황 */} +
+

+ 알림 현황 +

+ +
+
+
+ ); +} diff --git a/frontend/src/tabs/admin/components/RndKospsPanel.tsx b/frontend/src/tabs/admin/components/RndKospsPanel.tsx new file mode 100644 index 0000000..7e38abb --- /dev/null +++ b/frontend/src/tabs/admin/components/RndKospsPanel.tsx @@ -0,0 +1,638 @@ +import { useState, useEffect, useCallback } from 'react'; + +// ─── 타입 ────────────────────────────────────────────────────────────────────── + +type PipelineStatus = '정상' | '지연' | '중단'; +type ReceiveStatus = '수신완료' | '수신대기' | '수신실패' | '시간초과'; +type ProcessStatus = '처리완료' | '처리중' | '대기' | '오류'; +type DataSource = 'HYCOM' | '기상청' | 'KOSPS DLL'; +type AlertLevel = '경고' | '주의' | '정보'; + +interface PipelineNode { + id: string; + name: string; + status: PipelineStatus; + lastReceived: string; + cycle: string; +} + +interface DataLogRow { + id: string; + timestamp: string; + source: DataSource; + dataType: string; + size: string; + receiveStatus: ReceiveStatus; + processStatus: ProcessStatus; +} + +interface AlertItem { + id: string; + level: AlertLevel; + message: string; + timestamp: string; +} + +// ─── Mock 데이터 ──────────────────────────────────────────────────────────────── + +const MOCK_PIPELINE: PipelineNode[] = [ + { + id: 'hycom', + name: 'HYCOM 해양순환모델', + status: '정상', + lastReceived: '2026-04-11 06:00', + cycle: '6시간 주기', + }, + { + id: 'kma', + name: '기상청 수치모델', + status: '정상', + lastReceived: '2026-04-11 06:00', + cycle: '3시간 주기', + }, + { + id: 'kosps-server', + name: '광주 KOSPS 서버', + status: '정상', + lastReceived: '2026-04-11 06:05', + cycle: '수신 즉시', + }, + { + id: 'fortran-dll', + name: 'KOSPS Fortran DLL 연산', + status: '지연', + lastReceived: '2026-04-11 05:45', + cycle: '예측 시작 즉시', + }, + { + id: 'result-api', + name: '결과 수신 API', + status: '정상', + lastReceived: '2026-04-11 06:10', + cycle: '예측 완료 즉시', + }, +]; + +const MOCK_LOGS: DataLogRow[] = [ + { + id: 'log-01', + timestamp: '2026-04-11 06:10', + source: 'KOSPS DLL', + dataType: 'DLL 응답 결과', + size: '28 MB', + receiveStatus: '수신완료', + processStatus: '처리완료', + }, + { + id: 'log-02', + timestamp: '2026-04-11 06:05', + source: '기상청', + dataType: '풍향/풍속', + size: '38 MB', + receiveStatus: '수신완료', + processStatus: '처리완료', + }, + { + id: 'log-03', + timestamp: '2026-04-11 06:05', + source: '기상청', + dataType: '기압', + size: '22 MB', + receiveStatus: '수신완료', + processStatus: '처리완료', + }, + { + id: 'log-04', + timestamp: '2026-04-11 06:00', + source: 'HYCOM', + dataType: '해수면온도(SST)', + size: '98 MB', + receiveStatus: '수신완료', + processStatus: '처리완료', + }, + { + id: 'log-05', + timestamp: '2026-04-11 06:00', + source: 'HYCOM', + dataType: '해류(U/V)', + size: '142 MB', + receiveStatus: '수신완료', + processStatus: '처리완료', + }, + { + id: 'log-06', + timestamp: '2026-04-11 06:00', + source: '기상청', + dataType: '기온', + size: '19 MB', + receiveStatus: '수신완료', + processStatus: '처리완료', + }, + { + id: 'log-07', + timestamp: '2026-04-11 05:55', + source: 'KOSPS DLL', + dataType: 'DLL 호출 요청', + size: '3 MB', + receiveStatus: '수신완료', + processStatus: '처리중', + }, + { + id: 'log-08', + timestamp: '2026-04-11 05:45', + source: 'KOSPS DLL', + dataType: 'DLL 응답 결과', + size: '-', + receiveStatus: '수신대기', + processStatus: '대기', + }, + { + id: 'log-09', + timestamp: '2026-04-11 03:10', + source: 'HYCOM', + dataType: '해류(U/V)', + size: '140 MB', + receiveStatus: '수신완료', + processStatus: '처리완료', + }, + { + id: 'log-10', + timestamp: '2026-04-11 03:05', + source: '기상청', + dataType: '풍향/풍속', + size: '37 MB', + receiveStatus: '수신완료', + processStatus: '처리완료', + }, + { + id: 'log-11', + timestamp: '2026-04-11 03:00', + source: 'HYCOM', + dataType: '해수면높이(SSH)', + size: '54 MB', + receiveStatus: '수신완료', + processStatus: '처리완료', + }, + { + id: 'log-12', + timestamp: '2026-04-11 03:00', + source: 'KOSPS DLL', + dataType: 'DLL 응답 결과', + size: '27 MB', + receiveStatus: '수신완료', + processStatus: '처리완료', + }, + { + id: 'log-13', + timestamp: '2026-04-11 00:05', + source: '기상청', + dataType: '기압', + size: '23 MB', + receiveStatus: '수신완료', + processStatus: '처리완료', + }, + { + id: 'log-14', + timestamp: '2026-04-11 00:00', + source: 'HYCOM', + dataType: '해수면높이(SSH)', + size: '53 MB', + receiveStatus: '시간초과', + processStatus: '오류', + }, + { + id: 'log-15', + timestamp: '2026-04-11 00:00', + source: 'KOSPS DLL', + dataType: 'DLL 호출 요청', + size: '-', + receiveStatus: '수신실패', + processStatus: '오류', + }, +]; + +const MOCK_ALERTS: AlertItem[] = [ + { + id: 'alert-01', + level: '경고', + message: 'KOSPS Fortran DLL 응답 지연 — 평균 응답시간 초과', + timestamp: '2026-04-11 05:45', + }, + { + id: 'alert-02', + level: '주의', + message: 'HYCOM SSH 데이터 다음 수신 예정: 09:00', + timestamp: '2026-04-11 06:00', + }, + { + id: 'alert-03', + level: '정보', + message: '금일 KOSPS 예측 완료: 3회 / 6회', + timestamp: '2026-04-11 06:12', + }, +]; + +// ─── Mock fetch ───────────────────────────────────────────────────────────────── + +interface KospsData { + pipeline: PipelineNode[]; + logs: DataLogRow[]; + alerts: AlertItem[]; +} + +function fetchKospsData(): Promise { + return new Promise((resolve) => { + setTimeout( + () => + resolve({ + pipeline: MOCK_PIPELINE, + logs: MOCK_LOGS, + alerts: MOCK_ALERTS, + }), + 300, + ); + }); +} + +// ─── 유틸 ─────────────────────────────────────────────────────────────────────── + +function getPipelineStatusStyle(status: PipelineStatus): string { + if (status === '정상') return 'text-emerald-400 bg-emerald-500/10'; + if (status === '지연') return 'text-yellow-400 bg-yellow-500/10'; + return 'text-red-400 bg-red-500/10'; +} + +function getPipelineBorderStyle(status: PipelineStatus): string { + if (status === '정상') return 'border-l-emerald-500'; + if (status === '지연') return 'border-l-yellow-500'; + return 'border-l-red-500'; +} + +function getReceiveStatusStyle(status: ReceiveStatus): string { + if (status === '수신완료') return 'text-emerald-400 bg-emerald-500/10'; + if (status === '수신대기') return 'text-yellow-400 bg-yellow-500/10'; + return 'text-red-400 bg-red-500/10'; +} + +function getProcessStatusStyle(status: ProcessStatus): string { + if (status === '처리완료') return 'text-emerald-400 bg-emerald-500/10'; + if (status === '처리중') return 'text-cyan-400 bg-cyan-500/10'; + if (status === '대기') return 'text-yellow-400 bg-yellow-500/10'; + return 'text-red-400 bg-red-500/10'; +} + +function getAlertStyle(level: AlertLevel): string { + if (level === '경고') return 'text-red-400 bg-red-500/10 border-red-500/30'; + if (level === '주의') return 'text-yellow-400 bg-yellow-500/10 border-yellow-500/30'; + return 'text-cyan-400 bg-cyan-500/10 border-cyan-500/30'; +} + +// ─── 파이프라인 카드 ───────────────────────────────────────────────────────────── + +function PipelineCard({ node }: { node: PipelineNode }) { + const badgeStyle = getPipelineStatusStyle(node.status); + const borderStyle = getPipelineBorderStyle(node.status); + + return ( +
+
{node.name}
+ + {node.status} + +
최근 수신: {node.lastReceived}
+
{node.cycle}
+
+ ); +} + +function PipelineFlow({ nodes, loading }: { nodes: PipelineNode[]; loading: boolean }) { + if (loading && nodes.length === 0) { + return ( +
+ {Array.from({ length: 5 }).map((_, i) => ( +
+
+ {i < 4 && } +
+ ))} +
+ ); + } + + return ( +
+ {nodes.map((node, idx) => ( +
+ + {idx < nodes.length - 1 && ( + + )} +
+ ))} +
+ ); +} + +// ─── 수신 이력 테이블 ──────────────────────────────────────────────────────────── + +type FilterSource = 'all' | DataSource; +type FilterReceive = 'all' | ReceiveStatus; +type FilterPeriod = '6h' | '12h' | '24h'; + +const PERIOD_HOURS: Record = { '6h': 6, '12h': 12, '24h': 24 }; + +function filterLogs( + rows: DataLogRow[], + source: FilterSource, + receive: FilterReceive, + period: FilterPeriod, +): DataLogRow[] { + const cutoff = new Date('2026-04-11T06:30:00'); + const hours = PERIOD_HOURS[period]; + const from = new Date(cutoff.getTime() - hours * 60 * 60 * 1000); + + return rows.filter((r) => { + if (source !== 'all' && r.source !== source) return false; + if (receive !== 'all' && r.receiveStatus !== receive) return false; + const ts = new Date(r.timestamp.replace(' ', 'T')); + if (ts < from) return false; + return true; + }); +} + +const LOG_HEADERS = ['시간', '데이터소스', '데이터종류', '크기', '수신상태', '처리상태']; + +function DataLogTable({ rows, loading }: { rows: DataLogRow[]; loading: boolean }) { + return ( +
+ + + + {LOG_HEADERS.map((h) => ( + + ))} + + + + {loading && rows.length === 0 + ? Array.from({ length: 8 }).map((_, i) => ( + + {LOG_HEADERS.map((_, j) => ( + + ))} + + )) + : rows.map((row) => ( + + + + + + + + + ))} + {!loading && rows.length === 0 && ( + + + + )} + +
+ {h} +
+
+
+ {row.timestamp} + {row.source}{row.dataType}{row.size} + + {row.receiveStatus} + + + + {row.processStatus} + +
+ 조회된 데이터가 없습니다. +
+
+ ); +} + +// ─── 알림 목록 ─────────────────────────────────────────────────────────────────── + +function AlertList({ alerts, loading }: { alerts: AlertItem[]; loading: boolean }) { + if (loading && alerts.length === 0) { + return ( +
+ {Array.from({ length: 3 }).map((_, i) => ( +
+ ))} +
+ ); + } + + if (alerts.length === 0) { + return

활성 알림이 없습니다.

; + } + + return ( +
+ {alerts.map((alert) => ( +
+ [{alert.level}] + {alert.message} + {alert.timestamp} +
+ ))} +
+ ); +} + +// ─── 메인 패널 ─────────────────────────────────────────────────────────────────── + +export default function RndKospsPanel() { + const [pipeline, setPipeline] = useState([]); + const [logs, setLogs] = useState([]); + const [alerts, setAlerts] = useState([]); + const [loading, setLoading] = useState(false); + const [lastUpdate, setLastUpdate] = useState(null); + + // 필터 + const [filterSource, setFilterSource] = useState('all'); + const [filterReceive, setFilterReceive] = useState('all'); + const [filterPeriod, setFilterPeriod] = useState('24h'); + + const fetchData = useCallback(async () => { + setLoading(true); + try { + const data = await fetchKospsData(); + setPipeline(data.pipeline); + setLogs(data.logs); + setAlerts(data.alerts); + setLastUpdate(new Date()); + } finally { + setLoading(false); + } + }, []); + + useEffect(() => { + let isMounted = true; + void Promise.resolve().then(() => { + if (isMounted) void fetchData(); + }); + return () => { + isMounted = false; + }; + }, [fetchData]); + + const filteredLogs = filterLogs(logs, filterSource, filterReceive, filterPeriod); + + const totalReceived = logs.filter((r) => r.receiveStatus === '수신완료').length; + const totalDelayed = logs.filter((r) => r.receiveStatus === '수신대기').length; + const totalFailed = logs.filter( + (r) => r.receiveStatus === '수신실패' || r.receiveStatus === '시간초과', + ).length; + + return ( +
+ {/* ── 헤더 ── */} +
+
+

유출유확산예측 (KOSPS) 연계 모니터링

+
+ {lastUpdate && ( + + 갱신:{' '} + {lastUpdate.toLocaleTimeString('ko-KR', { + hour: '2-digit', + minute: '2-digit', + second: '2-digit', + })} + + )} + +
+
+ {/* 요약 통계 바 */} +
+ + 정상 수신:{' '} + {totalReceived}건 + + | + + 지연: {totalDelayed}건 + + | + + 실패: {totalFailed}건 + + | + + 금일 예측 완료:{' '} + 3 / 6회 + +
+
+ + {/* ── 스크롤 영역 ── */} +
+ {/* 파이프라인 현황 */} +
+

+ 데이터 파이프라인 현황 +

+ +
+ + {/* 필터 바 + 수신 이력 테이블 */} +
+
+

+ 데이터 수신 이력 +

+
+ {/* 데이터소스 필터 */} + + {/* 수신상태 필터 */} + + {/* 기간 필터 */} + + {filteredLogs.length}건 +
+
+ +
+ + {/* 알림 현황 */} +
+

+ 알림 현황 +

+ +
+
+
+ ); +} diff --git a/frontend/src/tabs/admin/components/RndPoseidonPanel.tsx b/frontend/src/tabs/admin/components/RndPoseidonPanel.tsx new file mode 100644 index 0000000..8d1bece --- /dev/null +++ b/frontend/src/tabs/admin/components/RndPoseidonPanel.tsx @@ -0,0 +1,665 @@ +import { useState, useEffect, useCallback } from 'react'; + +// ─── 타입 ────────────────────────────────────────────────────────────────────── + +type PipelineStatus = '정상' | '지연' | '중단'; +type ReceiveStatus = '수신완료' | '수신대기' | '수신실패' | '시간초과'; +type ProcessStatus = '처리완료' | '처리중' | '대기' | '오류'; +type DataSource = 'HYCOM' | '기상수치모델' | '기상기술'; +type AlertLevel = '경고' | '주의' | '정보'; + +interface PipelineNode { + id: string; + name: string; + status: PipelineStatus; + lastReceived: string; + cycle: string; +} + +interface DataLogRow { + id: string; + timestamp: string; + source: DataSource; + dataType: string; + size: string; + receiveStatus: ReceiveStatus; + processStatus: ProcessStatus; +} + +interface AlertItem { + id: string; + level: AlertLevel; + message: string; + timestamp: string; +} + +// ─── Mock 데이터 ──────────────────────────────────────────────────────────────── + +const MOCK_PIPELINE: PipelineNode[] = [ + { + id: 'hycom', + name: 'HYCOM 해양순환모델', + status: '정상', + lastReceived: '2026-04-11 06:00', + cycle: '6시간 주기', + }, + { + id: 'kma', + name: '기상수치모델(KMA)', + status: '정상', + lastReceived: '2026-04-11 06:00', + cycle: '3시간 주기', + }, + { + id: 'relay', + name: '기상기술 중계서버', + status: '지연', + lastReceived: '2026-04-11 05:30', + cycle: '3시간 주기', + }, + { + id: 'api', + name: '해경 9층 API서버', + status: '정상', + lastReceived: '2026-04-11 06:05', + cycle: '수신 즉시', + }, + { + id: 'gpu', + name: 'GPU 연산서버', + status: '정상', + lastReceived: '2026-04-11 06:10', + cycle: '예측 시작 즉시', + }, +]; + +const MOCK_LOGS: DataLogRow[] = [ + { + id: 'log-01', + timestamp: '2026-04-11 06:10', + source: 'HYCOM', + dataType: '해류(U/V)', + size: '142 MB', + receiveStatus: '수신완료', + processStatus: '처리완료', + }, + { + id: 'log-02', + timestamp: '2026-04-11 06:05', + source: '기상수치모델', + dataType: '풍향/풍속', + size: '38 MB', + receiveStatus: '수신완료', + processStatus: '처리완료', + }, + { + id: 'log-03', + timestamp: '2026-04-11 06:05', + source: '기상수치모델', + dataType: '기압', + size: '22 MB', + receiveStatus: '수신완료', + processStatus: '처리완료', + }, + { + id: 'log-04', + timestamp: '2026-04-11 06:00', + source: 'HYCOM', + dataType: '해수면온도(SST)', + size: '98 MB', + receiveStatus: '수신완료', + processStatus: '처리완료', + }, + { + id: 'log-05', + timestamp: '2026-04-11 06:00', + source: 'HYCOM', + dataType: '해수면높이(SSH)', + size: '54 MB', + receiveStatus: '수신완료', + processStatus: '처리완료', + }, + { + id: 'log-06', + timestamp: '2026-04-11 06:00', + source: '기상수치모델', + dataType: '기온', + size: '19 MB', + receiveStatus: '수신완료', + processStatus: '처리완료', + }, + { + id: 'log-07', + timestamp: '2026-04-11 06:00', + source: '기상수치모델', + dataType: '강수량', + size: '11 MB', + receiveStatus: '수신완료', + processStatus: '처리완료', + }, + { + id: 'log-08', + timestamp: '2026-04-11 06:00', + source: '기상기술', + dataType: '전처리 완료 데이터', + size: '310 MB', + receiveStatus: '수신대기', + processStatus: '대기', + }, + { + id: 'log-09', + timestamp: '2026-04-11 03:10', + source: 'HYCOM', + dataType: '해류(U/V)', + size: '140 MB', + receiveStatus: '수신완료', + processStatus: '처리완료', + }, + { + id: 'log-10', + timestamp: '2026-04-11 03:05', + source: '기상수치모델', + dataType: '풍향/풍속', + size: '37 MB', + receiveStatus: '수신완료', + processStatus: '처리완료', + }, + { + id: 'log-11', + timestamp: '2026-04-11 03:00', + source: 'HYCOM', + dataType: '해수면온도(SST)', + size: '97 MB', + receiveStatus: '수신완료', + processStatus: '처리완료', + }, + { + id: 'log-12', + timestamp: '2026-04-11 03:00', + source: '기상기술', + dataType: '전처리 완료 데이터', + size: '305 MB', + receiveStatus: '수신완료', + processStatus: '처리완료', + }, + { + id: 'log-13', + timestamp: '2026-04-11 00:05', + source: '기상수치모델', + dataType: '기압', + size: '23 MB', + receiveStatus: '수신완료', + processStatus: '처리완료', + }, + { + id: 'log-14', + timestamp: '2026-04-11 00:00', + source: 'HYCOM', + dataType: '해수면높이(SSH)', + size: '53 MB', + receiveStatus: '시간초과', + processStatus: '오류', + }, + { + id: 'log-15', + timestamp: '2026-04-11 00:00', + source: '기상기술', + dataType: '전처리 완료 데이터', + size: '-', + receiveStatus: '수신실패', + processStatus: '오류', + }, + { + id: 'log-16', + timestamp: '2026-04-10 21:05', + source: '기상수치모델', + dataType: '풍향/풍속', + size: '36 MB', + receiveStatus: '수신완료', + processStatus: '처리완료', + }, + { + id: 'log-17', + timestamp: '2026-04-10 21:00', + source: 'HYCOM', + dataType: '해류(U/V)', + size: '139 MB', + receiveStatus: '수신완료', + processStatus: '처리완료', + }, + { + id: 'log-18', + timestamp: '2026-04-10 21:00', + source: '기상기술', + dataType: '전처리 완료 데이터', + size: '302 MB', + receiveStatus: '수신완료', + processStatus: '처리완료', + }, +]; + +const MOCK_ALERTS: AlertItem[] = [ + { + id: 'alert-01', + level: '경고', + message: '기상기술 중계서버 데이터 30분 지연 — 06:00 배치 전처리 미완료', + timestamp: '2026-04-11 06:30', + }, + { + id: 'alert-02', + level: '주의', + message: 'HYCOM SSH 데이터 다음 수신 예정: 09:00', + timestamp: '2026-04-11 06:00', + }, + { + id: 'alert-03', + level: '정보', + message: 'GPU 연산서버 금일 처리 완료: 4회 / 8회', + timestamp: '2026-04-11 06:12', + }, +]; + +// ─── Mock fetch ───────────────────────────────────────────────────────────────── + +interface PoseidonData { + pipeline: PipelineNode[]; + logs: DataLogRow[]; + alerts: AlertItem[]; +} + +function fetchPoseidonData(): Promise { + return new Promise((resolve) => { + setTimeout( + () => + resolve({ + pipeline: MOCK_PIPELINE, + logs: MOCK_LOGS, + alerts: MOCK_ALERTS, + }), + 300, + ); + }); +} + +// ─── 유틸 ─────────────────────────────────────────────────────────────────────── + +function getPipelineStatusStyle(status: PipelineStatus): string { + if (status === '정상') return 'text-emerald-400 bg-emerald-500/10'; + if (status === '지연') return 'text-yellow-400 bg-yellow-500/10'; + return 'text-red-400 bg-red-500/10'; +} + +function getPipelineBorderStyle(status: PipelineStatus): string { + if (status === '정상') return 'border-l-emerald-500'; + if (status === '지연') return 'border-l-yellow-500'; + return 'border-l-red-500'; +} + +function getReceiveStatusStyle(status: ReceiveStatus): string { + if (status === '수신완료') return 'text-emerald-400 bg-emerald-500/10'; + if (status === '수신대기') return 'text-yellow-400 bg-yellow-500/10'; + return 'text-red-400 bg-red-500/10'; +} + +function getProcessStatusStyle(status: ProcessStatus): string { + if (status === '처리완료') return 'text-emerald-400 bg-emerald-500/10'; + if (status === '처리중') return 'text-cyan-400 bg-cyan-500/10'; + if (status === '대기') return 'text-yellow-400 bg-yellow-500/10'; + return 'text-red-400 bg-red-500/10'; +} + +function getAlertStyle(level: AlertLevel): string { + if (level === '경고') return 'text-red-400 bg-red-500/10 border-red-500/30'; + if (level === '주의') return 'text-yellow-400 bg-yellow-500/10 border-yellow-500/30'; + return 'text-cyan-400 bg-cyan-500/10 border-cyan-500/30'; +} + +// ─── 파이프라인 카드 ───────────────────────────────────────────────────────────── + +function PipelineCard({ node }: { node: PipelineNode }) { + const badgeStyle = getPipelineStatusStyle(node.status); + const borderStyle = getPipelineBorderStyle(node.status); + + return ( +
+
{node.name}
+ + {node.status} + +
최근 수신: {node.lastReceived}
+
{node.cycle}
+
+ ); +} + +function PipelineFlow({ nodes, loading }: { nodes: PipelineNode[]; loading: boolean }) { + if (loading && nodes.length === 0) { + return ( +
+ {Array.from({ length: 5 }).map((_, i) => ( +
+
+ {i < 4 && } +
+ ))} +
+ ); + } + + return ( +
+ {nodes.map((node, idx) => ( +
+ + {idx < nodes.length - 1 && ( + + )} +
+ ))} +
+ ); +} + +// ─── 수신 이력 테이블 ──────────────────────────────────────────────────────────── + +type FilterSource = 'all' | DataSource; +type FilterReceive = 'all' | ReceiveStatus; +type FilterPeriod = '6h' | '12h' | '24h'; + +const PERIOD_HOURS: Record = { '6h': 6, '12h': 12, '24h': 24 }; + +function filterLogs( + rows: DataLogRow[], + source: FilterSource, + receive: FilterReceive, + period: FilterPeriod, +): DataLogRow[] { + const cutoff = new Date('2026-04-11T06:30:00'); + const hours = PERIOD_HOURS[period]; + const from = new Date(cutoff.getTime() - hours * 60 * 60 * 1000); + + return rows.filter((r) => { + if (source !== 'all' && r.source !== source) return false; + if (receive !== 'all' && r.receiveStatus !== receive) return false; + const ts = new Date(r.timestamp.replace(' ', 'T')); + if (ts < from) return false; + return true; + }); +} + +const LOG_HEADERS = ['시간', '데이터소스', '데이터종류', '크기', '수신상태', '처리상태']; + +function DataLogTable({ rows, loading }: { rows: DataLogRow[]; loading: boolean }) { + return ( +
+ + + + {LOG_HEADERS.map((h) => ( + + ))} + + + + {loading && rows.length === 0 + ? Array.from({ length: 8 }).map((_, i) => ( + + {LOG_HEADERS.map((_, j) => ( + + ))} + + )) + : rows.map((row) => ( + + + + + + + + + ))} + {!loading && rows.length === 0 && ( + + + + )} + +
+ {h} +
+
+
+ {row.timestamp} + {row.source}{row.dataType}{row.size} + + {row.receiveStatus} + + + + {row.processStatus} + +
+ 조회된 데이터가 없습니다. +
+
+ ); +} + +// ─── 알림 목록 ─────────────────────────────────────────────────────────────────── + +function AlertList({ alerts, loading }: { alerts: AlertItem[]; loading: boolean }) { + if (loading && alerts.length === 0) { + return ( +
+ {Array.from({ length: 3 }).map((_, i) => ( +
+ ))} +
+ ); + } + + if (alerts.length === 0) { + return

활성 알림이 없습니다.

; + } + + return ( +
+ {alerts.map((alert) => ( +
+ [{alert.level}] + {alert.message} + {alert.timestamp} +
+ ))} +
+ ); +} + +// ─── 메인 패널 ─────────────────────────────────────────────────────────────────── + +export default function RndPoseidonPanel() { + const [pipeline, setPipeline] = useState([]); + const [logs, setLogs] = useState([]); + const [alerts, setAlerts] = useState([]); + const [loading, setLoading] = useState(false); + const [lastUpdate, setLastUpdate] = useState(null); + + // 필터 + const [filterSource, setFilterSource] = useState('all'); + const [filterReceive, setFilterReceive] = useState('all'); + const [filterPeriod, setFilterPeriod] = useState('24h'); + + const fetchData = useCallback(async () => { + setLoading(true); + try { + const data = await fetchPoseidonData(); + setPipeline(data.pipeline); + setLogs(data.logs); + setAlerts(data.alerts); + setLastUpdate(new Date()); + } finally { + setLoading(false); + } + }, []); + + useEffect(() => { + let isMounted = true; + void Promise.resolve().then(() => { + if (isMounted) void fetchData(); + }); + return () => { + isMounted = false; + }; + }, [fetchData]); + + const filteredLogs = filterLogs(logs, filterSource, filterReceive, filterPeriod); + + const totalReceived = logs.filter((r) => r.receiveStatus === '수신완료').length; + const totalDelayed = logs.filter((r) => r.receiveStatus === '수신대기').length; + const totalFailed = logs.filter( + (r) => r.receiveStatus === '수신실패' || r.receiveStatus === '시간초과', + ).length; + + return ( +
+ {/* ── 헤더 ── */} +
+
+

유출유확산예측 (포세이돈) 연계 모니터링

+
+ {lastUpdate && ( + + 갱신:{' '} + {lastUpdate.toLocaleTimeString('ko-KR', { + hour: '2-digit', + minute: '2-digit', + second: '2-digit', + })} + + )} + +
+
+ {/* 요약 통계 바 */} +
+ + 정상 수신:{' '} + {totalReceived}건 + + | + + 지연: {totalDelayed}건 + + | + + 실패: {totalFailed}건 + + | + + 금일 예측 완료:{' '} + 4 / 8회 + +
+
+ + {/* ── 스크롤 영역 ── */} +
+ {/* 파이프라인 현황 */} +
+

+ 데이터 파이프라인 현황 +

+ +
+ + {/* 필터 바 + 수신 이력 테이블 */} +
+
+

+ 데이터 수신 이력 +

+
+ {/* 데이터소스 필터 */} + + {/* 수신상태 필터 */} + + {/* 기간 필터 */} + + {filteredLogs.length}건 +
+
+ +
+ + {/* 알림 현황 */} +
+

+ 알림 현황 +

+ +
+
+
+ ); +} diff --git a/frontend/src/tabs/admin/components/RndRescuePanel.tsx b/frontend/src/tabs/admin/components/RndRescuePanel.tsx new file mode 100644 index 0000000..231b9dc --- /dev/null +++ b/frontend/src/tabs/admin/components/RndRescuePanel.tsx @@ -0,0 +1,638 @@ +import { useState, useEffect, useCallback } from 'react'; + +// ─── 타입 ────────────────────────────────────────────────────────────────────── + +type PipelineStatus = '정상' | '지연' | '중단'; +type ReceiveStatus = '수신완료' | '수신대기' | '수신실패' | '시간초과'; +type ProcessStatus = '처리완료' | '처리중' | '대기' | '오류'; +type DataSource = 'HYCOM' | '기상청' | '긴급구난시스템'; +type AlertLevel = '경고' | '주의' | '정보'; + +interface PipelineNode { + id: string; + name: string; + status: PipelineStatus; + lastReceived: string; + cycle: string; +} + +interface DataLogRow { + id: string; + timestamp: string; + source: DataSource; + dataType: string; + size: string; + receiveStatus: ReceiveStatus; + processStatus: ProcessStatus; +} + +interface AlertItem { + id: string; + level: AlertLevel; + message: string; + timestamp: string; +} + +// ─── Mock 데이터 ──────────────────────────────────────────────────────────────── + +const MOCK_PIPELINE: PipelineNode[] = [ + { + id: 'hycom', + name: 'HYCOM 해양순환모델', + status: '정상', + lastReceived: '2026-04-11 06:00', + cycle: '6시간 주기', + }, + { + id: 'kma', + name: '기상청 수치모델', + status: '정상', + lastReceived: '2026-04-11 06:00', + cycle: '3시간 주기', + }, + { + id: 'rescue', + name: '해경 긴급구난 시스템', + status: '정상', + lastReceived: '2026-04-11 06:30', + cycle: '내부 연계', + }, + { + id: 'analysis', + name: '구난 분석 연산', + status: '정상', + lastReceived: '2026-04-11 06:35', + cycle: '연계 시작 즉시', + }, + { + id: 'result', + name: '결과 연계 수신', + status: '정상', + lastReceived: '2026-04-11 06:40', + cycle: '분석 완료 즉시', + }, +]; + +const MOCK_LOGS: DataLogRow[] = [ + { + id: 'log-01', + timestamp: '2026-04-11 06:40', + source: '긴급구난시스템', + dataType: '구난 가능성 판단', + size: '1.2 MB', + receiveStatus: '수신완료', + processStatus: '처리완료', + }, + { + id: 'log-02', + timestamp: '2026-04-11 06:35', + source: '긴급구난시스템', + dataType: '선체상태 분석', + size: '3.4 MB', + receiveStatus: '수신완료', + processStatus: '처리완료', + }, + { + id: 'log-03', + timestamp: '2026-04-11 06:30', + source: '긴급구난시스템', + dataType: '사고선 위치정보', + size: '0.8 MB', + receiveStatus: '수신완료', + processStatus: '처리완료', + }, + { + id: 'log-04', + timestamp: '2026-04-11 06:30', + source: '긴급구난시스템', + dataType: '비상배인력 정보', + size: '0.5 MB', + receiveStatus: '수신완료', + processStatus: '처리완료', + }, + { + id: 'log-05', + timestamp: '2026-04-11 06:00', + source: 'HYCOM', + dataType: '해수면온도(SST)', + size: '98 MB', + receiveStatus: '수신완료', + processStatus: '처리완료', + }, + { + id: 'log-06', + timestamp: '2026-04-11 06:00', + source: 'HYCOM', + dataType: '해류(U/V)', + size: '142 MB', + receiveStatus: '수신완료', + processStatus: '처리완료', + }, + { + id: 'log-07', + timestamp: '2026-04-11 06:00', + source: 'HYCOM', + dataType: '해수면높이(SSH)', + size: '54 MB', + receiveStatus: '수신완료', + processStatus: '처리완료', + }, + { + id: 'log-08', + timestamp: '2026-04-11 06:00', + source: '기상청', + dataType: '풍향/풍속', + size: '38 MB', + receiveStatus: '수신완료', + processStatus: '처리완료', + }, + { + id: 'log-09', + timestamp: '2026-04-11 06:00', + source: '기상청', + dataType: '기압', + size: '22 MB', + receiveStatus: '수신완료', + processStatus: '처리완료', + }, + { + id: 'log-10', + timestamp: '2026-04-11 06:00', + source: '기상청', + dataType: '기온', + size: '19 MB', + receiveStatus: '수신완료', + processStatus: '처리완료', + }, + { + id: 'log-11', + timestamp: '2026-04-11 03:30', + source: '긴급구난시스템', + dataType: '선체상태 분석', + size: '3.1 MB', + receiveStatus: '수신완료', + processStatus: '처리완료', + }, + { + id: 'log-12', + timestamp: '2026-04-11 03:30', + source: '긴급구난시스템', + dataType: '구난 가능성 판단', + size: '1.1 MB', + receiveStatus: '수신완료', + processStatus: '처리완료', + }, + { + id: 'log-13', + timestamp: '2026-04-11 00:30', + source: '긴급구난시스템', + dataType: '사고선 위치정보', + size: '0.8 MB', + receiveStatus: '수신완료', + processStatus: '처리완료', + }, + { + id: 'log-14', + timestamp: '2026-04-11 00:00', + source: 'HYCOM', + dataType: '해수면높이(SSH)', + size: '53 MB', + receiveStatus: '시간초과', + processStatus: '오류', + }, + { + id: 'log-15', + timestamp: '2026-04-10 21:30', + source: '긴급구난시스템', + dataType: '비상배인력 정보', + size: '0.4 MB', + receiveStatus: '수신완료', + processStatus: '처리완료', + }, +]; + +const MOCK_ALERTS: AlertItem[] = [ + { + id: 'alert-01', + level: '정보', + message: '해경 긴급구난 시스템 정상 연계 중', + timestamp: '2026-04-11 06:30', + }, + { + id: 'alert-02', + level: '정보', + message: 'HYCOM 데이터 정상 수신', + timestamp: '2026-04-11 06:00', + }, + { + id: 'alert-03', + level: '정보', + message: '금일 긴급구난 분석 완료: 5회/6회', + timestamp: '2026-04-11 06:40', + }, +]; + +// ─── Mock fetch ───────────────────────────────────────────────────────────────── + +interface RescueData { + pipeline: PipelineNode[]; + logs: DataLogRow[]; + alerts: AlertItem[]; +} + +function fetchRescueData(): Promise { + return new Promise((resolve) => { + setTimeout( + () => + resolve({ + pipeline: MOCK_PIPELINE, + logs: MOCK_LOGS, + alerts: MOCK_ALERTS, + }), + 300, + ); + }); +} + +// ─── 유틸 ─────────────────────────────────────────────────────────────────────── + +function getPipelineStatusStyle(status: PipelineStatus): string { + if (status === '정상') return 'text-emerald-400 bg-emerald-500/10'; + if (status === '지연') return 'text-yellow-400 bg-yellow-500/10'; + return 'text-red-400 bg-red-500/10'; +} + +function getPipelineBorderStyle(status: PipelineStatus): string { + if (status === '정상') return 'border-l-emerald-500'; + if (status === '지연') return 'border-l-yellow-500'; + return 'border-l-red-500'; +} + +function getReceiveStatusStyle(status: ReceiveStatus): string { + if (status === '수신완료') return 'text-emerald-400 bg-emerald-500/10'; + if (status === '수신대기') return 'text-yellow-400 bg-yellow-500/10'; + return 'text-red-400 bg-red-500/10'; +} + +function getProcessStatusStyle(status: ProcessStatus): string { + if (status === '처리완료') return 'text-emerald-400 bg-emerald-500/10'; + if (status === '처리중') return 'text-cyan-400 bg-cyan-500/10'; + if (status === '대기') return 'text-yellow-400 bg-yellow-500/10'; + return 'text-red-400 bg-red-500/10'; +} + +function getAlertStyle(level: AlertLevel): string { + if (level === '경고') return 'text-red-400 bg-red-500/10 border-red-500/30'; + if (level === '주의') return 'text-yellow-400 bg-yellow-500/10 border-yellow-500/30'; + return 'text-cyan-400 bg-cyan-500/10 border-cyan-500/30'; +} + +// ─── 파이프라인 카드 ───────────────────────────────────────────────────────────── + +function PipelineCard({ node }: { node: PipelineNode }) { + const badgeStyle = getPipelineStatusStyle(node.status); + const borderStyle = getPipelineBorderStyle(node.status); + + return ( +
+
{node.name}
+ + {node.status} + +
최근 수신: {node.lastReceived}
+
{node.cycle}
+
+ ); +} + +function PipelineFlow({ nodes, loading }: { nodes: PipelineNode[]; loading: boolean }) { + if (loading && nodes.length === 0) { + return ( +
+ {Array.from({ length: 5 }).map((_, i) => ( +
+
+ {i < 4 && } +
+ ))} +
+ ); + } + + return ( +
+ {nodes.map((node, idx) => ( +
+ + {idx < nodes.length - 1 && ( + + )} +
+ ))} +
+ ); +} + +// ─── 수신 이력 테이블 ──────────────────────────────────────────────────────────── + +type FilterSource = 'all' | DataSource; +type FilterReceive = 'all' | ReceiveStatus; +type FilterPeriod = '6h' | '12h' | '24h'; + +const PERIOD_HOURS: Record = { '6h': 6, '12h': 12, '24h': 24 }; + +function filterLogs( + rows: DataLogRow[], + source: FilterSource, + receive: FilterReceive, + period: FilterPeriod, +): DataLogRow[] { + const cutoff = new Date('2026-04-11T06:40:00'); + const hours = PERIOD_HOURS[period]; + const from = new Date(cutoff.getTime() - hours * 60 * 60 * 1000); + + return rows.filter((r) => { + if (source !== 'all' && r.source !== source) return false; + if (receive !== 'all' && r.receiveStatus !== receive) return false; + const ts = new Date(r.timestamp.replace(' ', 'T')); + if (ts < from) return false; + return true; + }); +} + +const LOG_HEADERS = ['시간', '데이터소스', '데이터종류', '크기', '수신상태', '처리상태']; + +function DataLogTable({ rows, loading }: { rows: DataLogRow[]; loading: boolean }) { + return ( +
+ + + + {LOG_HEADERS.map((h) => ( + + ))} + + + + {loading && rows.length === 0 + ? Array.from({ length: 8 }).map((_, i) => ( + + {LOG_HEADERS.map((_, j) => ( + + ))} + + )) + : rows.map((row) => ( + + + + + + + + + ))} + {!loading && rows.length === 0 && ( + + + + )} + +
+ {h} +
+
+
+ {row.timestamp} + {row.source}{row.dataType}{row.size} + + {row.receiveStatus} + + + + {row.processStatus} + +
+ 조회된 데이터가 없습니다. +
+
+ ); +} + +// ─── 알림 목록 ─────────────────────────────────────────────────────────────────── + +function AlertList({ alerts, loading }: { alerts: AlertItem[]; loading: boolean }) { + if (loading && alerts.length === 0) { + return ( +
+ {Array.from({ length: 3 }).map((_, i) => ( +
+ ))} +
+ ); + } + + if (alerts.length === 0) { + return

활성 알림이 없습니다.

; + } + + return ( +
+ {alerts.map((alert) => ( +
+ [{alert.level}] + {alert.message} + {alert.timestamp} +
+ ))} +
+ ); +} + +// ─── 메인 패널 ─────────────────────────────────────────────────────────────────── + +export default function RndRescuePanel() { + const [pipeline, setPipeline] = useState([]); + const [logs, setLogs] = useState([]); + const [alerts, setAlerts] = useState([]); + const [loading, setLoading] = useState(false); + const [lastUpdate, setLastUpdate] = useState(null); + + // 필터 + const [filterSource, setFilterSource] = useState('all'); + const [filterReceive, setFilterReceive] = useState('all'); + const [filterPeriod, setFilterPeriod] = useState('24h'); + + const fetchData = useCallback(async () => { + setLoading(true); + try { + const data = await fetchRescueData(); + setPipeline(data.pipeline); + setLogs(data.logs); + setAlerts(data.alerts); + setLastUpdate(new Date()); + } finally { + setLoading(false); + } + }, []); + + useEffect(() => { + let isMounted = true; + void Promise.resolve().then(() => { + if (isMounted) void fetchData(); + }); + return () => { + isMounted = false; + }; + }, [fetchData]); + + const filteredLogs = filterLogs(logs, filterSource, filterReceive, filterPeriod); + + const totalReceived = logs.filter((r) => r.receiveStatus === '수신완료').length; + const totalDelayed = logs.filter((r) => r.receiveStatus === '수신대기').length; + const totalFailed = logs.filter( + (r) => r.receiveStatus === '수신실패' || r.receiveStatus === '시간초과', + ).length; + + return ( +
+ {/* ── 헤더 ── */} +
+
+

긴급구난과제 연계 모니터링

+
+ {lastUpdate && ( + + 갱신:{' '} + {lastUpdate.toLocaleTimeString('ko-KR', { + hour: '2-digit', + minute: '2-digit', + second: '2-digit', + })} + + )} + +
+
+ {/* 요약 통계 바 */} +
+ + 정상 수신:{' '} + {totalReceived}건 + + | + + 지연: {totalDelayed}건 + + | + + 실패: {totalFailed}건 + + | + + 금일 분석 완료:{' '} + 5 / 6회 + +
+
+ + {/* ── 스크롤 영역 ── */} +
+ {/* 파이프라인 현황 */} +
+

+ 데이터 파이프라인 현황 +

+ +
+ + {/* 필터 바 + 수신 이력 테이블 */} +
+
+

+ 데이터 수신 이력 +

+
+ {/* 데이터소스 필터 */} + + {/* 수신상태 필터 */} + + {/* 기간 필터 */} + + {filteredLogs.length}건 +
+
+ +
+ + {/* 알림 현황 */} +
+

+ 알림 현황 +

+ +
+
+
+ ); +} diff --git a/frontend/src/tabs/admin/components/SystemArchPanel.tsx b/frontend/src/tabs/admin/components/SystemArchPanel.tsx new file mode 100644 index 0000000..b160cd3 --- /dev/null +++ b/frontend/src/tabs/admin/components/SystemArchPanel.tsx @@ -0,0 +1,1544 @@ +import { useState } from 'react'; + +type TabId = 'framework' | 'target' | 'interface' | 'heterogeneous' | 'common-features'; + +const TABS: { id: TabId; label: string }[] = [ + { id: 'framework', label: '표준 프레임워크' }, + { id: 'target', label: '목표시스템 아키텍쳐' }, + { id: 'interface', label: '시스템 인터페이스 연계' }, + { id: 'heterogeneous', label: '이기종시스템연계' }, + { id: 'common-features', label: '공통기능' }, +]; + +// ─── 기술 스택 테이블 데이터 ────────────────────────────────────────────────────── + +interface TechStackRow { + category: string; + tech: string; + version: string; + description: string; +} + +const TECH_STACK: TechStackRow[] = [ + { category: 'Frontend', tech: 'React', version: '19.x', description: '컴포넌트 기반 SPA' }, + { category: 'Frontend', tech: 'TypeScript', version: '5.9', description: '정적 타입 시스템' }, + { category: 'Frontend', tech: 'Vite', version: '7.x', description: '빌드 도구 (HMR)' }, + { category: 'Frontend', tech: 'Tailwind CSS', version: '3.x', description: '유틸리티 기반 CSS' }, + { category: 'Frontend', tech: 'MapLibre GL', version: '5.x', description: '오픈소스 GIS 엔진' }, + { category: 'Frontend', tech: 'deck.gl', version: '9.x', description: '대규모 데이터 시각화' }, + { category: 'Frontend', tech: 'Zustand', version: '-', description: '클라이언트 상태관리' }, + { category: 'Frontend', tech: 'TanStack Query', version: '-', description: '서버 상태관리/캐싱' }, + { category: 'Backend', tech: 'Express', version: '4.x', description: 'REST API 서버' }, + { category: 'Backend', tech: 'Socket.IO', version: '-', description: '실시간 양방향 통신' }, + { category: 'DB', tech: 'PostgreSQL', version: '16', description: '관계형 데이터베이스' }, + { category: 'DB', tech: 'PostGIS', version: '-', description: '공간정보 확장' }, + { + category: '인증', + tech: 'JWT', + version: '-', + description: '토큰 기반 인증 (HttpOnly Cookie)', + }, + { category: '인증', tech: 'Google OAuth', version: '2.0', description: 'SSO 연동' }, + { category: '보안', tech: 'Helmet', version: '-', description: 'HTTP 헤더 보안' }, + { category: '보안', tech: 'Rate Limiting', version: '-', description: 'API 호출 제한' }, + { category: 'CI/CD', tech: 'Gitea Actions', version: '-', description: '자동 빌드/배포' }, +]; + +// ─── 탭 모듈 데이터 ─────────────────────────────────────────────────────────────── + +interface TabModuleRow { + module: string; + name: string; + feature: string; + integration: string; +} + +const TAB_MODULES: TabModuleRow[] = [ + { + module: '확산예측', + name: 'prediction', + feature: '유출유 확산 시뮬레이션, 역추적 분석, 오일붐 배치', + integration: 'KOSPS, 포세이돈 R&D', + }, + { + module: 'HNS 분석', + name: 'hns', + feature: '화학물질 확산 예측, 물질 DB, 위험도 평가', + integration: '충북대 R&D, 물질 DB', + }, + { + module: '구조 시나리오', + name: 'rescue', + feature: '긴급구난 분석, 표류 예측', + integration: '긴급구난 R&D', + }, + { + module: '항공 방제', + name: 'aerial', + feature: '위성영상 분석, 드론 영상, 유막 면적 분석', + integration: '위성/드론 데이터', + }, + { + module: '해양 기상', + name: 'weather', + feature: '기상·해상 정보, 조위·해류 관측', + integration: 'KHOA API, 기상청 API', + }, + { + module: '사건/사고', + name: 'incidents', + feature: '해양오염 사고 등록·관리·이력', + integration: '해경 사고 DB', + }, + { + module: '자산 관리', + name: 'assets', + feature: '기관·장비·선박 보험 관리', + integration: '해경 자산 DB', + }, + { + module: 'SCAT 조사', + name: 'scat', + feature: 'Pre-SCAT 해안 조사 기록', + integration: '현장 조사 데이터', + }, + { + module: '관리자', + name: 'admin', + feature: '사용자/권한/메뉴/설정/연계 관리', + integration: '전체 시스템', + }, +]; + +// ─── 연계 인터페이스 데이터 ─────────────────────────────────────────────────────── + +interface InterfaceRow { + system: string; + method: string; + data: string; + cycle: string; + protocol: string; +} + +const INTERFACES: InterfaceRow[] = [ + { + system: 'KHOA (해양조사원)', + method: 'REST API', + data: '조위, 해류, 수온', + cycle: '실시간/1시간', + protocol: 'HTTPS', + }, + { + system: '기상청', + method: 'REST API', + data: '풍향/풍속, 기압, 기온, 강수', + cycle: '3시간', + protocol: 'HTTPS', + }, + { + system: 'HYCOM', + method: '파일 수신', + data: 'SST, 해류(U/V), SSH', + cycle: '6시간', + protocol: 'HTTPS/FTP', + }, + { + system: '해경 KBP (인사)', + method: '배치 수집', + data: '사용자, 부서, 직위, 조직', + cycle: '1일 1회', + protocol: '내부망 API', + }, + { + system: 'AIS 선박위치', + method: '실시간 수집', + data: '선박 위치, 속도, 방향', + cycle: '실시간', + protocol: 'Socket/API', + }, + { + system: '포세이돈 R&D', + method: 'API 연계', + data: '유출유 확산 예측 결과', + cycle: '요청 시', + protocol: 'HTTPS', + }, + { + system: 'KOSPS (광주)', + method: 'DLL 호출', + data: '유출유 확산 예측 결과', + cycle: '요청 시', + protocol: 'HTTPS (Fortran DLL)', + }, + { + system: '충북대 HNS', + method: 'API 호출', + data: 'HNS 대기확산 결과', + cycle: '요청 시', + protocol: 'HTTPS', + }, + { + system: '긴급구난 R&D', + method: '내부 연계', + data: '구난 분석 결과', + cycle: '요청 시', + protocol: '내부망 API', + }, +]; + +// ─── 탭 1: 표준 프레임워크 ──────────────────────────────────────────────────────── + +function FrameworkTab() { + return ( +
+ {/* 1. 개발 프레임워크 구성 */} +
+

1. 개발 프레임워크 구성

+
+ {/* 프레젠테이션 계층 */} +
+

프레젠테이션 계층

+

React 19 + TypeScript 5.9 + Tailwind CSS 3

+
+ {[ + { name: 'MapLibre', sub: 'GL JS 5' }, + { name: 'deck.gl', sub: '9.x' }, + { name: 'Zustand', sub: '상태관리' }, + { name: 'TanStack', sub: 'Query' }, + ].map((item) => ( +
+

{item.name}

+

{item.sub}

+
+ ))} +
+
+ {/* 비즈니스 로직 계층 */} +
+

비즈니스 로직 계층

+

Express 4 + TypeScript

+
+ {[ + { name: 'JWT 인증', sub: 'OAuth2.0' }, + { name: 'RBAC', sub: '권한엔진' }, + { name: 'Socket.IO', sub: '실시간' }, + { name: 'Helmet', sub: '보안' }, + ].map((item) => ( +
+

{item.name}

+

{item.sub}

+
+ ))} +
+
+ {/* 데이터 접근 계층 */} +
+

데이터 접근 계층

+

PostgreSQL 16 + PostGIS

+
+ {[ + { name: 'wing DB', sub: '운영 DB' }, + { name: 'wing_auth', sub: '인증 DB' }, + { name: 'PostGIS', sub: '공간정보' }, + ].map((item) => ( +
+

{item.name}

+

{item.sub}

+
+ ))} +
+
+
+
+ + {/* 2. 기술 스택 상세 */} +
+

2. 기술 스택 상세

+
+ + + + {['구분', '기술', '버전', '설명'].map((h) => ( + + ))} + + + + {TECH_STACK.map((row, idx) => ( + + + + + + + ))} + +
+ {h} +
+ {row.category} + {row.tech}{row.version}{row.description}
+
+
+ + {/* 3. 개발 표준 및 규칙 */} +
+

3. 개발 표준 및 규칙

+
+ {[ + { + title: 'HTTP 정책', + content: + 'GET/POST만 사용 (PUT/DELETE/PATCH 금지) — 한국 보안취약점 점검 가이드 준수', + }, + { + title: '코드 표준', + content: 'ESLint + Prettier 적용, TypeScript strict 모드 필수', + }, + { + title: '모듈 구조', + content: '@common/ (공통 모듈) + @tabs/ (업무별 탭) Path Alias 기반 분리', + }, + { + title: '보안', + content: '입력 살균(sanitize), XSS/SQL Injection 방지, CORS 정책, Rate Limiting', + }, + ].map((item) => ( +
+

{item.title}

+

{item.content}

+
+ ))} +
+
+
+ ); +} + +// ─── 탭 2: 목표시스템 아키텍쳐 ─────────────────────────────────────────────────── + +function TargetArchTab() { + return ( +
+ {/* 1. 시스템 전체 구성도 */} +
+

1. 시스템 전체 구성도

+
+ {/* 사용자 접근 계층 */} +
+

사용자 접근 계층

+

웹 브라우저 (React SPA)

+

+ 확산예측 | HNS분석 | 구조시나리오 | 항공방제 | 기상정보 | 사고관리 | SCAT조사 | + 자산관리 | 관리자 +

+
+ {/* 화살표 + 프로토콜 */} +
+ + HTTPS (TLS 1.2+) +
+ {/* API 서버 계층 */} +
+

API 서버 계층

+

Express 4 REST API (Port 3001)

+
+ {[ + 'JWT 인증 미들웨어', + 'RBAC 권한 엔진 (permResolver)', + '감사로그 자동 기록', + '입력 살균 / Rate Limiting / Helmet', + ].map((item) => ( +
+

{item}

+
+ ))} +
+
+ {/* 화살표 + 프로토콜 */} +
+ + pg connection pool +
+ {/* 데이터 계층 */} +
+

데이터 계층

+

PostgreSQL 16 + PostGIS

+
+ {[ + { name: 'wing DB', sub: '운영' }, + { name: 'wing_auth', sub: '인증' }, + ].map((item) => ( +
+

{item.name}

+

({item.sub})

+
+ ))} +
+
+
+
+ + {/* 2. 탭 기반 업무 모듈 구조 */} +
+

2. 탭 기반 업무 모듈 구조

+
+ + + + {['모듈', '패키지명', '기능', '주요 연계'].map((h) => ( + + ))} + + + + {TAB_MODULES.map((row) => ( + + + + + + + ))} + +
+ {h} +
{row.module}{row.name}{row.feature}{row.integration}
+
+
+ + {/* 3. RBAC 권한 체계 */} +
+

3. RBAC 권한 체계

+
+ {[ + { + title: '2차원 권한 엔진', + content: + 'AUTH_PERM OPER_CD 기반: R(조회), C(생성), U(수정), D(삭제) — 역할별 메뉴·기능 접근 제어', + }, + { + title: 'permResolver', + content: + '역할(Role)과 권한(Permission)의 2차원 매핑으로 메뉴 표시 여부 및 기능 사용 가능 여부를 동적으로 판단', + }, + { + title: '감사로그 자동 기록', + content: + '누가(사용자) / 언제(타임스탬프) / 무엇을(기능) / 어디서(IP, 메뉴) — 모든 주요 작업 자동 기록', + }, + ].map((item) => ( +
+

{item.title}

+

{item.content}

+
+ ))} +
+
+
+ ); +} + +// ─── 탭 3: 시스템 인터페이스 연계 ──────────────────────────────────────────────── + +function InterfaceTab() { + const dataFlowSteps = [ + '수집', + '전처리', + '저장', + '분석/예측', + '시각화', + '의사결정지원', + ]; + + return ( +
+ {/* 1. 외부 시스템 연계 구성도 */} +
+

1. 외부 시스템 연계 구성도

+
+ {/* 외부 시스템 */} +
+

외부 시스템

+ {['KHOA API', '기상청 API', '해경 KBP', 'AIS 선박'].map((item) => ( +
+

{item}

+
+ ))} +
+ {/* 화살표 */} +
+ + +
+ {/* 통합지원시스템 */} +
+

+ 해양환경 위기대응 +
+ 통합지원시스템 +

+
+

연계관리 모듈

+
+ {['수집자료 관리', '연계 모니터링', '비식별화 조치'].map((item) => ( +

+ - {item} +

+ ))} +
+
+
+ {/* 화살표 */} +
+ + +
+ {/* R&D 시스템 */} +
+

R&D 시스템

+ {['포세이돈', 'KOSPS', '충북대 HNS', '긴급구난'].map((item) => ( +
+

{item}

+
+ ))} +
+
+
+ + {/* 2. 연계 인터페이스 목록 */} +
+

2. 연계 인터페이스 목록

+
+ + + + {['연계 시스템', '연계 방식', '데이터', '주기', '프로토콜'].map((h) => ( + + ))} + + + + {INTERFACES.map((row) => ( + + + + + + + + ))} + +
+ {h} +
{row.system}{row.method}{row.data}{row.cycle}{row.protocol}
+
+
+ + {/* 3. 데이터 흐름도 */} +
+

3. 데이터 흐름도

+
+ {dataFlowSteps.map((step, idx) => ( +
+
+

{step}

+
+ {idx < dataFlowSteps.length - 1 && ( + + )} +
+ ))} +
+
+ {[ + { step: '수집', desc: 'KHOA, 기상청, HYCOM, AIS 등 외부 원천 데이터 수신' }, + { step: '전처리', desc: '포맷 변환, 좌표계 통일, 비식별화, 품질 검사' }, + { step: '저장', desc: 'PostgreSQL 16 + PostGIS 공간정보 DB 적재' }, + { step: '분석/예측', desc: 'R&D 모델 연계 (포세이돈, KOSPS, 충북대, 긴급구난)' }, + { step: '시각화', desc: 'MapLibre GL + deck.gl 기반 지도 레이어 렌더링' }, + { step: '의사결정지원', desc: '방제작전 시나리오, 구조분석, 경보 발령 지원' }, + ].map((item) => ( +
+

{item.step}

+

{item.desc}

+
+ ))} +
+
+ + {/* 4. 연계 장애 대응 */} +
+

4. 연계 장애 대응

+
+ {[ + { + title: '연계 모니터링', + content: '관리자 > 연계관리 > 연계모니터링에서 실시간 연계 상태 확인', + }, + { + title: 'R&D 파이프라인 모니터링', + content: '관리자 > 연계관리 > R&D과제에서 과제별 데이터 수신 이력 및 처리 현황 확인', + }, + { + title: '장애 알림', + content: '데이터 수신 지연/실패 발생 시 알림 발생 — 운영자 즉시 인지 가능', + }, + { + title: '비식별화 조치', + content: '개인정보 포함 데이터(해경 KBP 인사 등) 수집 시 자동 비식별화 처리 적용', + }, + ].map((item) => ( +
+

{item.title}

+

{item.content}

+
+ ))} +
+
+
+ ); +} + + +// ─── 이기종시스템 연계 데이터 ───────────────────────────────────────────────────── + +interface HeterogeneousSystemRow { + system: string; + lang: string; + os: string; + location: string; + protocol: string; + description: string; +} + +const HETEROGENEOUS_SYSTEMS: HeterogeneousSystemRow[] = [ + { + system: 'KOSPS', + lang: 'Fortran', + os: 'Linux', + location: '광주', + protocol: 'HTTPS (REST 래퍼)', + description: '유출유 확산 예측 — Fortran DLL을 REST API로 래핑하여 연계', + }, + { + system: '충북대 HNS', + lang: 'Python / C++', + os: 'Linux', + location: '충북대', + protocol: 'HTTPS', + description: 'HNS 대기확산 예측 — Python/C++ 모델을 REST API로 호출', + }, + { + system: '긴급구난', + lang: 'Python', + os: 'Linux', + location: '해경 내부', + protocol: '내부망 API', + description: '구난 표류 분석 — Python 모델을 내부망 REST API로 연계', + }, + { + system: 'HYCOM', + lang: 'Fortran / NetCDF', + os: 'Linux HPC', + location: '미 해군 공개', + protocol: 'HTTPS / FTP', + description: '전지구 해류·수온 예측 — NetCDF 파일 수신 후 ETL 전처리', + }, + { + system: '기상청', + lang: '-', + os: '-', + location: '기상청 API Hub', + protocol: 'HTTPS', + description: '풍향·풍속·기온·강수 등 기상 데이터 REST API 수집', + }, + { + system: 'KHOA', + lang: '-', + os: '-', + location: '해양조사원', + protocol: 'HTTPS', + description: '조위·해류·수온 등 해양관측 데이터 REST API 수집', + }, + { + system: '해경 KBP', + lang: 'Java 전자정부', + os: 'Linux', + location: '해경 내부망', + protocol: '내부망 API', + description: '사용자·조직·직위 인사 데이터 배치 수집 (비식별화 적용)', + }, + { + system: 'AIS', + lang: '-', + os: '-', + location: '해경 AIS 서버', + protocol: 'Socket / API', + description: '선박 위치·속도·방향 실시간 수신', + }, +]; + +interface HeterogeneousStrategyCard { + challenge: string; + solution: string; + description: string; +} + +interface IntegrationPlanItem { + title: string; + description: string; + details?: string[]; +} + +const INTEGRATION_PLANS: IntegrationPlanItem[] = [ + { + title: '사용자 정보 연계', + description: + '해양경찰청의 인사관리플랫폼과 연계 또는 사용자 정보를 제공받아 구성할 수 있어야 함', + }, + { + title: '해양공간 데이터 연계', + description: + '해경 해양공간 데이터 구축사업(해양공간정보 활용체계 구축 및 빅데이터 관련 사업)의 \'데이터통합저장소\' 시스템과 연계하여 현장탐색 전자지도 자동표출 기술 등에 영상 및 사진자료를 연계하여 구축', + }, + { + title: 'DB 통합설계 기반 맞춤형 인터페이스', + description: + '플랫폼 변경 및 신규 통합설계 되는 데이터베이스(DB) 구조 설계를 기반으로 사용자 맞춤형 화면 인터페이스를 구현해야 함', + details: [ + 'DBMS는 분리되어 있는 시스템들을 통합설계를 통하여 공통, 분야별 등으로 설계하여야 함', + ], + }, + { + title: '유출유 확산예측 정확성 향상 (KOSPS 연계)', + description: + '유출유 확산예측 정확성 향상을 위해, 해양오염방제지원시스템(KOSPS)를 연계·탑재하여야 함', + details: [ + '다양한 유출유 확산 예측 결과를 사용자가 한눈에 확인 가능하여야 함', + '확산예측 기반으로 역추적, 최초 유출유 발생지점을 예측할 수 있어야 함', + '그 밖에 유출유 확산예측 정확성 향상을 위한 대책을 마련하여야 함', + ], + }, + { + title: '기타 시스템 연계', + description: + '그 밖에 시스템 구축 중 효율적인 사고대응을 위한 타 시스템 연계할 수 있음', + }, +]; + +const HETEROGENEOUS_STRATEGIES: HeterogeneousStrategyCard[] = [ + { + challenge: '언어 이질성', + solution: 'REST API 래퍼 계층', + description: + 'Fortran, Python, C++, Java 등 각 언어로 작성된 모델을 REST API 래퍼로 감싸 언어·플랫폼 독립적인 표준 인터페이스 제공', + }, + { + challenge: '데이터 형식 차이', + solution: 'ETL 전처리 파이프라인', + description: + 'NetCDF, CSV, Binary, JSON 등 이기종 포맷을 ETL 파이프라인으로 표준 JSON/GeoJSON 형식으로 변환 후 DB 적재', + }, + { + challenge: '네트워크 분리', + solution: '이중 네트워크 연계', + description: + '외부망(인터넷) 연계와 내부망(해경 내부) 연계를 분리 운영하여 보안 정책 준수 및 데이터 안전성 확보', + }, + { + challenge: '가용성·장애 대응', + solution: '연계 모니터링 + 알림', + description: + '연계 상태를 실시간 모니터링하고 수신 지연·실패 발생 시 운영자에게 즉시 알림 발송하여 신속 대응', + }, + { + challenge: '인증·보안 차이', + solution: 'API Gateway 패턴', + description: + '시스템별 상이한 인증 방식(API Key, JWT, IP 제한 등)을 API Gateway 계층에서 통합 관리하여 단일 보안 정책 적용', + }, + { + challenge: '프로토콜 차이', + solution: '어댑터 패턴 적용', + description: + 'HTTP REST, FTP, Socket, 배치 파일 등 다양한 프로토콜을 어댑터 패턴으로 추상화하여 표준 인터페이스로 통일', + }, +]; + +const HETEROGENEOUS_FLOW_STEPS = [ + '원본 데이터', + '수집 어댑터', + 'ETL 전처리', + '표준 변환', + 'DB 적재', + 'API 제공', +]; + +interface SecurityPolicyCard { + title: string; + items: string[]; +} + +const HETEROGENEOUS_SECURITY: SecurityPolicyCard[] = [ + { + title: '외부망 연계', + items: [ + 'TLS 1.2+ 암호화 통신', + 'API Key / OAuth 인증', + 'IP 화이트리스트 제한', + 'Rate Limiting 적용', + ], + }, + { + title: '내부망 연계', + items: [ + '전용 내부망 구간 분리', + '상호 인증서 검증', + '비식별화 자동 처리', + '접근 이력 감사로그', + ], + }, + { + title: '데이터 보호', + items: [ + '개인정보 수집 최소화', + 'ETL 단계 비식별화', + '전송 구간 암호화', + '저장 데이터 접근 제어', + ], + }, +]; + +// ─── 탭 4: 이기종시스템연계 ─────────────────────────────────────────────────────── + +function HeterogeneousTab() { + return ( +
+ {/* 1. 이기종시스템 연계 개요 */} +
+

1. 이기종시스템 연계 개요

+

+ 통합지원시스템은 Fortran, Python, C++, Java 등 다양한 언어와 플랫폼으로 구현된 이기종 + 시스템과 연계한다. REST API 표준화, ETL 전처리, 어댑터 패턴을 통해 언어·플랫폼 독립적인 + 연계 구조를 구현하며, 외부망·내부망 이중 네트워크 정책을 준수한다. +

+
+
+

이기종 시스템

+ {['Fortran KOSPS', 'Python/C++ 충북대', 'Java 해경KBP', 'NetCDF HYCOM'].map((item) => ( +

+ {item} +

+ ))} +
+
+ + +
+
+

연계 어댑터 계층

+ {['REST API 래퍼', 'ETL 전처리', '프로토콜 변환', '인증 통합'].map((item) => ( +

+ {item} +

+ ))} +
+
+ + +
+
+

통합지원시스템

+ {['Express REST API', 'PostgreSQL+PostGIS', 'React SPA', '표준 JSON'].map((item) => ( +

+ {item} +

+ ))} +
+
+
+ + {/* 2. 이기종 시스템 간의 연계 방안 */} +
+

2. 이기종 시스템 간의 연계 방안

+
+ {INTEGRATION_PLANS.map((item, idx) => ( +
+

+ {idx + 1}. {item.title} +

+

{item.description}

+ {item.details && ( +
    + {item.details.map((detail) => ( +
  • + {detail} +
  • + ))} +
+ )} +
+ ))} +
+
+ + {/* 3. 연계 대상 이기종 시스템 목록 */} +
+

3. 연계 대상 이기종 시스템 목록

+
+ + + + {['시스템', '구현 언어', 'OS', '위치', '연계 프로토콜', '연계 설명'].map((h) => ( + + ))} + + + + {HETEROGENEOUS_SYSTEMS.map((row) => ( + + + + + + + + + ))} + +
+ {h} +
{row.system}{row.lang}{row.os}{row.location}{row.protocol}{row.description}
+
+
+ + {/* 4. 이기종 연계 전략 */} +
+

4. 이기종 연계 전략

+
+ {HETEROGENEOUS_STRATEGIES.map((card) => ( +
+
+ {card.challenge} + + {card.solution} +
+

{card.description}

+
+ ))} +
+
+ + {/* 5. 이기종 데이터 변환 흐름 */} +
+

5. 이기종 데이터 변환 흐름

+
+ {HETEROGENEOUS_FLOW_STEPS.map((step, idx) => ( +
+
+

{step}

+
+ {idx < HETEROGENEOUS_FLOW_STEPS.length - 1 && ( + + )} +
+ ))} +
+
+ + {/* 6. 이기종 연계 보안 정책 */} +
+

6. 이기종 연계 보안 정책

+
+ {HETEROGENEOUS_SECURITY.map((card) => ( +
+

{card.title}

+
    + {card.items.map((item) => ( +
  • + · {item} +
  • + ))} +
+
+ ))} +
+
+
+ ); +} + +// ─── 공통기능 탭 데이터 ────────────────────────────────────────────────────────── + +interface CommonFeatureItem { + title: string; + description: string; + details: string[]; +} + +const COMMON_FEATURES: CommonFeatureItem[] = [ + { + title: '인증 시스템', + description: 'JWT 기반 세션 인증 + Google OAuth 소셜 로그인', + details: [ + 'HttpOnly 쿠키(WING_SESSION) 기반 토큰 관리 — XSS 방어', + 'Access Token(15분) + Refresh Token(7일) 이중 토큰 구조', + 'Google OAuth 2.0 소셜 로그인 지원', + 'Zustand authStore 기반 프론트엔드 인증 상태 통합 관리', + ], + }, + { + title: 'RBAC 2차원 권한', + description: 'AUTH_PERM 기반 기능별·역할별 2차원 권한 엔진', + details: [ + 'OPER_CD (R: 조회, C: 생성, U: 수정, D: 삭제) 4단계 조작 권한', + '역할(Role) × 기능(Feature) 매트릭스 기반 권한 매핑', + 'permResolver 엔진으로 백엔드·프론트엔드 동시 권한 검증', + '메뉴 접근, 버튼 노출, API 호출 3중 권한 통제', + ], + }, + { + title: 'API 통신 패턴', + description: 'Axios 기반 공통 API 클라이언트 + 자동 인증·에러 처리', + details: [ + 'GET/POST만 사용 (PUT/DELETE/PATCH 금지 — 보안취약점 점검 가이드 준수)', + '요청 인터셉터: 쿠키 자동 첨부 (withCredentials)', + '응답 인터셉터: 401 시 자동 토큰 갱신, 실패 시 로그아웃', + 'TanStack Query 기반 서버 상태 캐싱 및 자동 재검증', + ], + }, + { + title: '상태 관리', + description: 'Zustand(클라이언트) + TanStack Query(서버) 이중 상태 관리', + details: [ + 'Zustand: authStore(인증), menuStore(메뉴) 등 클라이언트 전역 상태', + 'TanStack Query: API 응답 캐싱, 자동 재요청, 낙관적 업데이트', + '컴포넌트 로컬 상태: useState 활용', + ], + }, + { + title: '메뉴 시스템', + description: 'DB 기반 동적 메뉴 + 권한 연동 자동 필터링', + details: [ + 'DB에서 메뉴 트리 구조를 동적으로 로드', + '사용자 권한에 따라 메뉴 항목 자동 필터링 (접근 불가 메뉴 미노출)', + '관리자 화면에서 메뉴 순서·표시 여부·아이콘 실시간 편집', + 'menuStore(Zustand)로 현재 활성 메뉴 상태 전역 관리', + ], + }, + { + title: '지도 엔진', + description: 'MapLibre GL JS 5.x + deck.gl 9.x 기반 GIS 시각화', + details: [ + 'MapLibre GL JS: 오픈소스 벡터 타일 기반 지도 렌더링', + 'deck.gl: 대규모 공간 데이터(파티클, 히트맵, 궤적) 고성능 시각화', + 'PostGIS 공간 쿼리 → GeoJSON → deck.gl 레이어 파이프라인', + '레이어 트리 UI로 사용자별 레이어 표시·숨김 제어', + ], + }, + { + title: '스타일링', + description: 'Tailwind CSS @layer 아키텍처 + CSS 변수 디자인 시스템', + details: [ + '@layer base → components → wing 3단계 CSS 계층 구조', + 'CSS 변수 기반 시맨틱 컬러 (bg-bg-base, text-t1, border-stroke-1 등)', + '다크 모드 기본 적용 — CSS 변수 전환으로 테마 일괄 변경', + '인라인 스타일 지양, Tailwind 유틸리티 클래스 우선', + ], + }, + { + title: '감사 로그', + description: '사용자 행위 자동 기록 — 접속·조회·변경 이력 추적', + details: [ + '로그인/로그아웃, 메뉴 접근, 데이터 변경 자동 기록', + 'App.tsx에서 탭 전환 시 감사 로그 자동 전송', + '관리자 화면에서 사용자별·기간별 감사 로그 조회 가능', + 'IP 주소, User-Agent, 요청 경로 등 부가 정보 기록', + ], + }, + { + title: '보안', + description: '입력 살균·CORS·CSP·Rate Limiting 다층 보안 정책', + details: [ + '입력 살균(sanitize): XSS·SQL Injection 방어 미들웨어 적용', + 'Helmet: CSP, X-Frame-Options, HSTS 등 보안 헤더 자동 설정', + 'CORS: 허용 오리진 화이트리스트 제한', + 'Rate Limiting: API 요청 빈도 제한으로 DoS 방어', + ], + }, +]; + +// ─── 방제대응 프로세스 데이터 ───────────────────────────────────────────────────── + +interface ProcessStep { + phase: string; + description: string; + modules: string[]; +} + +const RESPONSE_PROCESS: ProcessStep[] = [ + { + phase: '사고 접수', + description: '해양오염 사고 신고 접수 및 초동 상황 등록', + modules: ['사건/사고'], + }, + { + phase: '상황 파악', + description: '사고 현장 기상·해상 조건 확인, 유출원·유출량 파악', + modules: ['해양기상', '사건/사고'], + }, + { + phase: '확산 예측', + description: '유출유/HNS 확산 시뮬레이션 및 역추적 분석 수행', + modules: ['확산예측', 'HNS분석'], + }, + { + phase: '방제 계획', + description: '오일붐 배치, 유처리제 살포 구역, 방제선 투입 계획 수립', + modules: ['확산예측', '자산관리'], + }, + { + phase: '구조 작전', + description: '인명 구조 시나리오 수립, 표류 예측 기반 수색 구역 결정', + modules: ['구조시나리오'], + }, + { + phase: '항공 감시', + description: '위성·드론 영상으로 유막 면적 모니터링 및 방제 효과 확인', + modules: ['항공방제'], + }, + { + phase: '해안 조사', + description: 'Pre-SCAT 해안 오염 조사, 피해 범위 기록', + modules: ['SCAT조사'], + }, + { + phase: '상황 종료', + description: '방제 완료 보고, 감사 이력 정리, 사후 분석', + modules: ['사건/사고', '관리자'], + }, +]; + +// ─── 시스템별 기능 유무 매트릭스 데이터 ──────────────────────────────────────────── + +const SYSTEM_MODULES = [ + '확산예측', + 'HNS분석', + '구조시나리오', + '항공방제', + '해양기상', + '사건/사고', + '자산관리', + 'SCAT조사', + '게시판', + '관리자', +] as const; + +interface FeatureMatrixRow { + feature: string; + category: '공통기능' | '기본정보관리' | '업무기능'; + integrated: boolean; + systems: Record; +} + +const FEATURE_MATRIX: FeatureMatrixRow[] = [ + { + feature: '사용자 인증 (JWT)', + category: '공통기능', + integrated: true, + systems: { '확산예측': true, 'HNS분석': true, '구조시나리오': true, '항공방제': true, '해양기상': true, '사건/사고': true, '자산관리': true, 'SCAT조사': true, '게시판': true, '관리자': true }, + }, + { + feature: 'RBAC 권한 제어', + category: '공통기능', + integrated: true, + systems: { '확산예측': true, 'HNS분석': true, '구조시나리오': true, '항공방제': true, '해양기상': true, '사건/사고': true, '자산관리': true, 'SCAT조사': true, '게시판': true, '관리자': true }, + }, + { + feature: '감사 로그', + category: '공통기능', + integrated: true, + systems: { '확산예측': true, 'HNS분석': true, '구조시나리오': true, '항공방제': true, '해양기상': true, '사건/사고': true, '자산관리': true, 'SCAT조사': true, '게시판': true, '관리자': true }, + }, + { + feature: 'API 통신 (Axios)', + category: '공통기능', + integrated: true, + systems: { '확산예측': true, 'HNS분석': true, '구조시나리오': true, '항공방제': true, '해양기상': true, '사건/사고': true, '자산관리': true, 'SCAT조사': true, '게시판': true, '관리자': true }, + }, + { + feature: '입력 살균/보안', + category: '공통기능', + integrated: true, + systems: { '확산예측': true, 'HNS분석': true, '구조시나리오': true, '항공방제': true, '해양기상': true, '사건/사고': true, '자산관리': true, 'SCAT조사': true, '게시판': true, '관리자': true }, + }, + { + feature: '사용자 관리', + category: '기본정보관리', + integrated: true, + systems: { '확산예측': false, 'HNS분석': false, '구조시나리오': false, '항공방제': false, '해양기상': false, '사건/사고': false, '자산관리': false, 'SCAT조사': false, '게시판': false, '관리자': true }, + }, + { + feature: '지도 엔진 (MapLibre)', + category: '기본정보관리', + integrated: true, + systems: { '확산예측': true, 'HNS분석': true, '구조시나리오': true, '항공방제': true, '해양기상': true, '사건/사고': true, '자산관리': false, 'SCAT조사': true, '게시판': false, '관리자': false }, + }, + { + feature: '레이어 관리', + category: '기본정보관리', + integrated: true, + systems: { '확산예측': true, 'HNS분석': true, '구조시나리오': true, '항공방제': true, '해양기상': true, '사건/사고': true, '자산관리': false, 'SCAT조사': true, '게시판': false, '관리자': true }, + }, + { + feature: '메뉴 관리', + category: '기본정보관리', + integrated: true, + systems: { '확산예측': false, 'HNS분석': false, '구조시나리오': false, '항공방제': false, '해양기상': false, '사건/사고': false, '자산관리': false, 'SCAT조사': false, '게시판': false, '관리자': true }, + }, + { + feature: '시스템 설정', + category: '기본정보관리', + integrated: true, + systems: { '확산예측': false, 'HNS분석': false, '구조시나리오': false, '항공방제': false, '해양기상': false, '사건/사고': false, '자산관리': false, 'SCAT조사': false, '게시판': false, '관리자': true }, + }, + { + feature: '확산 시뮬레이션', + category: '업무기능', + integrated: false, + systems: { '확산예측': true, 'HNS분석': false, '구조시나리오': false, '항공방제': false, '해양기상': false, '사건/사고': false, '자산관리': false, 'SCAT조사': false, '게시판': false, '관리자': false }, + }, + { + feature: 'HNS 대기확산', + category: '업무기능', + integrated: false, + systems: { '확산예측': false, 'HNS분석': true, '구조시나리오': false, '항공방제': false, '해양기상': false, '사건/사고': false, '자산관리': false, 'SCAT조사': false, '게시판': false, '관리자': false }, + }, + { + feature: '표류 예측', + category: '업무기능', + integrated: false, + systems: { '확산예측': false, 'HNS분석': false, '구조시나리오': true, '항공방제': false, '해양기상': false, '사건/사고': false, '자산관리': false, 'SCAT조사': false, '게시판': false, '관리자': false }, + }, + { + feature: '위성/드론 영상', + category: '업무기능', + integrated: false, + systems: { '확산예측': false, 'HNS분석': false, '구조시나리오': false, '항공방제': true, '해양기상': false, '사건/사고': false, '자산관리': false, 'SCAT조사': false, '게시판': false, '관리자': false }, + }, + { + feature: '기상/해상 정보', + category: '업무기능', + integrated: false, + systems: { '확산예측': true, 'HNS분석': true, '구조시나리오': true, '항공방제': false, '해양기상': true, '사건/사고': false, '자산관리': false, 'SCAT조사': false, '게시판': false, '관리자': false }, + }, + { + feature: '역추적 분석', + category: '업무기능', + integrated: false, + systems: { '확산예측': true, 'HNS분석': false, '구조시나리오': false, '항공방제': false, '해양기상': false, '사건/사고': false, '자산관리': false, 'SCAT조사': false, '게시판': false, '관리자': false }, + }, + { + feature: '사고 등록/이력', + category: '업무기능', + integrated: false, + systems: { '확산예측': false, 'HNS분석': false, '구조시나리오': false, '항공방제': false, '해양기상': false, '사건/사고': true, '자산관리': false, 'SCAT조사': false, '게시판': false, '관리자': false }, + }, + { + feature: '장비/선박 관리', + category: '업무기능', + integrated: false, + systems: { '확산예측': false, 'HNS분석': false, '구조시나리오': false, '항공방제': false, '해양기상': false, '사건/사고': false, '자산관리': true, 'SCAT조사': false, '게시판': false, '관리자': false }, + }, + { + feature: '해안 조사', + category: '업무기능', + integrated: false, + systems: { '확산예측': false, 'HNS분석': false, '구조시나리오': false, '항공방제': false, '해양기상': false, '사건/사고': false, '자산관리': false, 'SCAT조사': true, '게시판': false, '관리자': false }, + }, + { + feature: '게시판 CRUD', + category: '업무기능', + integrated: false, + systems: { '확산예측': false, 'HNS분석': false, '구조시나리오': false, '항공방제': false, '해양기상': false, '사건/사고': false, '자산관리': false, 'SCAT조사': false, '게시판': true, '관리자': false }, + }, +]; + +const CATEGORY_STYLES: Record = { + '공통기능': 'bg-cyan-600/20 text-cyan-300', + '기본정보관리': 'bg-emerald-600/20 text-emerald-300', + '업무기능': 'bg-bg-elevated text-t3', +}; + +// ─── 탭 5: 공통기능 ───────────────────────────────────────────────────────────── + +function CommonFeaturesTab() { + return ( +
+ {/* 1. 방제대응 프로세스 */} +
+

1. 방제대응 프로세스

+

+ 해양오염 사고 발생 시 사고 접수부터 상황 종료까지의 단계별 대응 프로세스이며, + 각 단계에서 활용하는 시스템 모듈을 표시한다. +

+ {/* 프로세스 흐름도 */} +
+ {RESPONSE_PROCESS.map((step, idx) => ( +
+
+

{step.phase}

+
+ {step.modules.map((mod) => ( + {mod} + ))} +
+
+ {idx < RESPONSE_PROCESS.length - 1 && ( + + )} +
+ ))} +
+ {/* 프로세스 상세 */} +
+ {RESPONSE_PROCESS.map((step, idx) => ( +
+ + {idx + 1} + +
+

{step.phase}

+

{step.description}

+
+
+ {step.modules.map((mod) => ( + + {mod} + + ))} +
+
+ ))} +
+
+ + {/* 2. 시스템별 기능 유무 매트릭스 */} +
+

2. 시스템별 기능 유무 매트릭스

+

+ 각 시스템(업무 모듈)별 기능의 유무를 파악하여 공통기능, 기본정보 관리(사용자, 지도 등) 등 + 통합할 수 있는 기능을 표시한다. 통합 대상 기능은 + 공통 모듈로 일원화하여 중복 개발을 방지한다. +

+
+ + + + + + + {SYSTEM_MODULES.map((mod) => ( + + ))} + + + + {FEATURE_MATRIX.map((row) => ( + + + + + {SYSTEM_MODULES.map((mod) => ( + + ))} + + ))} + +
+ 기능 + + 분류 + + 통합 + + {mod} +
+ {row.feature} + + + {row.category} + + + {row.integrated ? ( + 통합 + ) : ( + 개별 + )} + + {row.systems[mod] ? ( + O + ) : ( + - + )} +
+
+ {/* 범례 */} +
+
+ 공통기능 + 전 모듈 공통 적용 +
+
+ 기본정보관리 + 사용자·지도·메뉴·설정 통합 관리 +
+
+ 업무기능 + 모듈별 고유 기능 +
+
+
+ + {/* 3. 공통기능 상세 */} +
+

3. 공통기능 상세

+
+ {COMMON_FEATURES.map((feature, idx) => ( +
+
+ + {idx + 1} + +

{feature.title}

+
+

{feature.description}

+
    + {feature.details.map((detail) => ( +
  • + {detail} +
  • + ))} +
+
+ ))} +
+
+ + {/* 4. 공통 모듈 구조 */} +
+

4. 공통 모듈 디렉토리 구조

+
+ + + + {['디렉토리', '역할', '주요 파일'].map((h) => ( + + ))} + + + + {[ + { dir: 'common/components/', role: '공통 UI 컴포넌트', files: 'auth/, layout/, map/, ui/, layer/' }, + { dir: 'common/hooks/', role: '공통 커스텀 훅', files: 'useLayers, useSubMenu, useFeatureTracking' }, + { dir: 'common/services/', role: 'API 통신 모듈', files: 'api.ts, authApi.ts, layerService.ts' }, + { dir: 'common/store/', role: '전역 상태 스토어', files: 'authStore.ts, menuStore.ts' }, + { dir: 'common/styles/', role: 'CSS @layer 스타일', files: 'base.css, components.css, wing.css' }, + { dir: 'common/types/', role: '공통 타입 정의', files: 'backtrack, hns, navigation 등' }, + { dir: 'common/utils/', role: '유틸리티 함수', files: 'coordinates, geo, sanitize, cn.ts' }, + { dir: 'common/constants/', role: '상수 정의', files: 'featureIds.ts' }, + { dir: 'common/data/', role: 'UI 데이터', files: 'layerData.ts (레이어 트리)' }, + ].map((row) => ( + + + + + + ))} + +
+ {h} +
{row.dir}{row.role}{row.files}
+
+
+
+ ); +} + +// ─── 메인 패널 ─────────────────────────────────────────────────────────────────── + +export default function SystemArchPanel() { + const [activeTab, setActiveTab] = useState('framework'); + + return ( +
+ {/* 헤더 */} +
+

시스템구조

+
+ + {/* 탭 버튼 */} +
+ {TABS.map((tab) => ( + + ))} +
+ + {/* 탭 콘텐츠 */} +
+ {activeTab === 'framework' && } + {activeTab === 'target' && } + {activeTab === 'interface' && } + {activeTab === 'heterogeneous' && } + {activeTab === 'common-features' && } +
+
+ ); +} diff --git a/frontend/src/tabs/admin/components/adminMenuConfig.ts b/frontend/src/tabs/admin/components/adminMenuConfig.ts index 3494ced..643ce0f 100644 --- a/frontend/src/tabs/admin/components/adminMenuConfig.ts +++ b/frontend/src/tabs/admin/components/adminMenuConfig.ts @@ -15,6 +15,7 @@ export const ADMIN_MENU: AdminMenuItem[] = [ children: [ { id: 'menus', label: '메뉴관리' }, { id: 'settings', label: '시스템설정' }, + { id: 'system-arch', label: '시스템구조' }, ], }, { @@ -91,6 +92,16 @@ export const ADMIN_MENU: AdminMenuItem[] = [ { id: 'monitor-vessel', label: '선박위치정보' }, ], }, + { + id: 'rnd', + label: 'R&D과제', + children: [ + { id: 'rnd-poseidon', label: '유출유확산예측(포세이돈)' }, + { id: 'rnd-kosps', label: '유출유확산예측(KOSPS)' }, + { id: 'rnd-hns-atmos', label: 'HNS대기확산(충북대)' }, + { id: 'rnd-rescue', label: '긴급구난과제' }, + ], + }, { id: 'deidentify', label: '비식별화조치' }, ], }, diff --git a/frontend/src/tabs/rescue/components/RescueScenarioView.tsx b/frontend/src/tabs/rescue/components/RescueScenarioView.tsx index 4fd23a9..7cfe54b 100755 --- a/frontend/src/tabs/rescue/components/RescueScenarioView.tsx +++ b/frontend/src/tabs/rescue/components/RescueScenarioView.tsx @@ -1,4 +1,7 @@ -import { useState, useEffect, useCallback, useRef } from 'react'; +import { useState, useEffect, useCallback, useRef, useMemo } from 'react'; +import { Map, Marker, Popup } from '@vis.gl/react-maplibre'; +import 'maplibre-gl/dist/maplibre-gl.css'; +import { useBaseMapStyle } from '@common/hooks/useBaseMapStyle'; import { fetchRescueOps, fetchRescueScenarios } from '../services/rescueApi'; import type { RescueOpsItem, RescueScenarioItem } from '../services/rescueApi'; @@ -103,6 +106,295 @@ interface ChartDataItem { severity: Severity; } +/* ─── 시나리오 관리 요건 ─── */ +const SCENARIO_MGMT_GUIDELINES = [ + '긴급구난 R&D 분석 결과는 시간 단계별 시나리오의 형태로 관리되어야 함', + '각 시나리오는 사고 발생 시점부터 구난 진행 단계별 상태 변화를 포함하여야 함', + '시나리오별 분석 결과는 사고 단위로 기존 사고 정보와 연계되어 관리되어야 함', + '동일 사고에 대해 복수 시나리오(시간대, 조건별)가 존재할 경우, 상호 비교·검토가 되어야 함', + '시나리오별 분석결과는 긴급구난 대응 판단을 지원할 수 있도록 요약 정보 형태로 제공되어야 함', + '시나리오 관리 기능은 기존 통합지원시스템의 흐름과 연계되어 실질적인 구난 대응 업무에 활용 가능하도록 반영되어야 함', + '긴급구난 시나리오 관리 기능 구현 시 1차 구축 완료된 GIS기능을 활용하여 구축하여 재개발하거나 중복구현하지 않도록 함', +]; + +/* ─── Mock 시나리오 (API 미연결 시 폴백) — 긴급구난 모델 이론 기반 10개 ─── */ +const MOCK_SCENARIOS: RescueScenarioItem[] = [ + { + scenarioSn: 1, rescueOpsSn: 1, timeStep: 'T+0h', + scenarioDtm: '2024-10-27T01:30:00.000Z', svrtCd: 'CRITICAL', + gmM: 0.8, listDeg: 15.0, trimM: 2.5, buoyancyPct: 30.0, oilRateLpm: 100.0, bmRatioPct: 92.0, + description: '좌현 35° 충돌로 No.1P 화물탱크 파공. 벙커C유 유출 개시. 손상복원성 분석: 초기 GM 0.8m으로 IMO 기준(1.0m) 미달, 복원력 위험 판정.', + compartments: [ + { name: '#1 FP Tank', status: 'FLOODED', color: 'var(--red)' }, + { name: '#1 Port Tank', status: 'BREACHED', color: 'var(--red)' }, + { name: '#2 Port Tank', status: 'RISK', color: 'var(--orange)' }, + { name: 'Engine Room', status: 'INTACT', color: 'var(--green)' }, + { name: '#3 Stbd Tank', status: 'INTACT', color: 'var(--green)' }, + ], + assessment: [ + { label: '복원력', value: '위험 (GM 0.8m < IMO 1.0m)', color: 'var(--red)' }, + { label: '유출 위험', value: '활발 유출중 (100 L/min)', color: 'var(--red)' }, + { label: '선체 강도', value: 'BM 92% (경계)', color: 'var(--orange)' }, + { label: '승선인원', value: '15/20 확인, 5명 수색중', color: 'var(--red)' }, + ], + actions: [ + { time: '10:30', text: '충돌 발생, VHF Ch.16 조난 통보', color: 'var(--red)' }, + { time: '10:32', text: 'EPIRB 자동 발신 확인', color: 'var(--red)' }, + { time: '10:35', text: '해경 3009함 출동 지시', color: 'var(--orange)' }, + { time: '10:42', text: '인근 선박 구조 활동 개시', color: 'var(--cyan)' }, + ], + sortOrd: 1, + }, + { + scenarioSn: 2, rescueOpsSn: 1, timeStep: 'T+30m', + scenarioDtm: '2024-10-27T02:00:00.000Z', svrtCd: 'CRITICAL', + gmM: 0.7, listDeg: 17.0, trimM: 2.8, buoyancyPct: 28.0, oilRateLpm: 120.0, bmRatioPct: 90.0, + description: '잠수사 수중 조사 결과 좌현 No.1P 파공 크기 1.2m×0.8m 확인. Bernoulli 유입률 모델 적용: 수두차 4.5m 기준 유입률 약 2.1㎥/min.', + compartments: [ + { name: '#1 FP Tank', status: 'FLOODED', color: 'var(--red)' }, + { name: '#1 Port Tank', status: 'BREACHED', color: 'var(--red)' }, + { name: '#2 Port Tank', status: 'RISK', color: 'var(--orange)' }, + { name: 'Engine Room', status: 'INTACT', color: 'var(--green)' }, + { name: '#3 Stbd Tank', status: 'INTACT', color: 'var(--green)' }, + ], + assessment: [ + { label: '복원력', value: '악화 (GM 0.7m, GZ 커브 감소)', color: 'var(--red)' }, + { label: '유출 위험', value: '증가 (120 L/min)', color: 'var(--red)' }, + { label: '선체 강도', value: 'BM 90% — 종강도 모니터링 개시', color: 'var(--orange)' }, + { label: '승선인원', value: '15명 퇴선, 5명 수색중', color: 'var(--red)' }, + ], + actions: [ + { time: '10:50', text: '잠수사 투입, 수중 손상 조사 개시', color: 'var(--cyan)' }, + { time: '10:55', text: '파공 규모 확인: 1.2m×0.8m', color: 'var(--red)' }, + { time: '11:00', text: '손상복원성 재계산 — IMO 기준 위험', color: 'var(--red)' }, + { time: '11:00', text: '유출유 방제선 배치 요청', color: 'var(--orange)' }, + ], + sortOrd: 2, + }, + { + scenarioSn: 3, rescueOpsSn: 1, timeStep: 'T+1h', + scenarioDtm: '2024-10-27T02:30:00.000Z', svrtCd: 'CRITICAL', + gmM: 0.65, listDeg: 18.5, trimM: 3.0, buoyancyPct: 26.0, oilRateLpm: 135.0, bmRatioPct: 89.0, + description: '해경 3009함 현장 도착, SAR 작전 개시. Leeway 표류 예측 모델: 풍속 8m/s, 해류 2.5kn NE — 실종자 표류 반경 1.2nm. GZ 최대 복원력 각도 25°로 감소.', + compartments: [ + { name: '#1 FP Tank', status: 'FLOODED', color: 'var(--red)' }, + { name: '#1 Port Tank', status: 'FLOODED', color: 'var(--red)' }, + { name: '#2 Port Tank', status: 'FLOODING', color: 'var(--red)' }, + { name: 'Engine Room', status: 'INTACT', color: 'var(--green)' }, + { name: '#3 Stbd Tank', status: 'INTACT', color: 'var(--green)' }, + ], + assessment: [ + { label: '복원력', value: '한계 접근 (GM 0.65m)', color: 'var(--red)' }, + { label: '유출 위험', value: '파공 확대 우려 (135 L/min)', color: 'var(--red)' }, + { label: '선체 강도', value: 'BM 89% — Hogging 증가', color: 'var(--orange)' }, + { label: '인명구조', value: '실종 5명 수색중, 표류 1.2nm', color: 'var(--red)' }, + ], + actions: [ + { time: '11:10', text: '해경 3009함 현장 도착, SAR 구역 설정', color: 'var(--cyan)' }, + { time: '11:15', text: 'Leeway 표류 예측 모델 적용', color: 'var(--cyan)' }, + { time: '11:20', text: '회전익 항공기 수색 개시', color: 'var(--cyan)' }, + { time: '11:30', text: '#2 Port Tank 2차 침수 징후', color: 'var(--red)' }, + ], + sortOrd: 3, + }, + { + scenarioSn: 4, rescueOpsSn: 1, timeStep: 'T+2h', + scenarioDtm: '2024-10-27T03:30:00.000Z', svrtCd: 'CRITICAL', + gmM: 0.5, listDeg: 20.0, trimM: 3.5, buoyancyPct: 22.0, oilRateLpm: 160.0, bmRatioPct: 86.0, + description: '격벽 관통으로 #2 Port Tank 침수 확대. 자유표면효과(FSE) 보정: GM_fluid = 0.5m. 종강도: Sagging 모멘트 86%. 침몰 위험 단계 진입.', + compartments: [ + { name: '#1 FP Tank', status: 'FLOODED', color: 'var(--red)' }, + { name: '#1 Port Tank', status: 'FLOODED', color: 'var(--red)' }, + { name: '#2 Port Tank', status: 'FLOODED', color: 'var(--red)' }, + { name: 'Engine Room', status: 'RISK', color: 'var(--orange)' }, + { name: '#3 Stbd Tank', status: 'INTACT', color: 'var(--green)' }, + ], + assessment: [ + { label: '복원력', value: '위기 (GM 0.5m, FSE 보정)', color: 'var(--red)' }, + { label: '유출 위험', value: '최대치 접근 (160 L/min)', color: 'var(--red)' }, + { label: '선체 강도', value: 'BM 86% — Sagging 경고', color: 'var(--red)' }, + { label: '승선인원', value: '실종 3명 발견, 2명 수색', color: 'var(--orange)' }, + ], + actions: [ + { time: '12:00', text: '#2 Port Tank 격벽 관통 침수', color: 'var(--red)' }, + { time: '12:10', text: '자유표면효과(FSE) 보정 재계산', color: 'var(--red)' }, + { time: '12:15', text: '긴급 Counter-Flooding 검토', color: 'var(--orange)' }, + { time: '12:30', text: '실종자 3명 추가 발견 구조', color: 'var(--green)' }, + ], + sortOrd: 4, + }, + { + scenarioSn: 5, rescueOpsSn: 1, timeStep: 'T+3h', + scenarioDtm: '2024-10-27T04:30:00.000Z', svrtCd: 'HIGH', + gmM: 0.55, listDeg: 16.0, trimM: 3.2, buoyancyPct: 25.0, oilRateLpm: 140.0, bmRatioPct: 87.0, + description: 'Counter-Flooding 실시: #3 Stbd Tank에 평형수 280톤 주입, 횡경사 20°→16° 교정. 종강도: 중량 재배분으로 BM 87% 유지.', + compartments: [ + { name: '#1 FP Tank', status: 'FLOODED', color: 'var(--red)' }, + { name: '#1 Port Tank', status: 'FLOODED', color: 'var(--red)' }, + { name: '#2 Port Tank', status: 'FLOODED', color: 'var(--red)' }, + { name: 'Engine Room', status: 'RISK', color: 'var(--orange)' }, + { name: '#3 Stbd Tank', status: 'BALLASTED', color: 'var(--orange)' }, + ], + assessment: [ + { label: '복원력', value: '개선 중 (GM 0.55m, 경사 16°)', color: 'var(--orange)' }, + { label: '유출 위험', value: '감소 추세 (140 L/min)', color: 'var(--orange)' }, + { label: '선체 강도', value: 'BM 87% — Counter-Flooding 평가', color: 'var(--orange)' }, + { label: '구조 상황', value: '실종 2명 수색 지속', color: 'var(--orange)' }, + ], + actions: [ + { time: '12:45', text: 'Counter-Flooding — #3 Stbd 주입 개시', color: 'var(--orange)' }, + { time: '13:00', text: '평형수 280톤 주입, 경사 교정 진행', color: 'var(--cyan)' }, + { time: '13:15', text: '종강도 재계산 — 허용 범위 내', color: 'var(--cyan)' }, + { time: '13:30', text: '횡경사 16° 안정화 확인', color: 'var(--green)' }, + ], + sortOrd: 5, + }, + { + scenarioSn: 6, rescueOpsSn: 1, timeStep: 'T+6h', + scenarioDtm: '2024-10-27T07:30:00.000Z', svrtCd: 'HIGH', + gmM: 0.7, listDeg: 12.0, trimM: 2.5, buoyancyPct: 32.0, oilRateLpm: 80.0, bmRatioPct: 90.0, + description: '수중패치 설치, 유입률 감소. GM 0.7m 회복. Trim/Stability Booklet 기준 예인 가능 최소 조건(GM≥0.5m, List≤15°) 충족.', + compartments: [ + { name: '#1 FP Tank', status: 'FLOODED', color: 'var(--red)' }, + { name: '#1 Port Tank', status: 'PATCHED', color: 'var(--orange)' }, + { name: '#2 Port Tank', status: 'FLOODED', color: 'var(--red)' }, + { name: 'Engine Room', status: 'INTACT', color: 'var(--green)' }, + { name: '#3 Stbd Tank', status: 'BALLASTED', color: 'var(--orange)' }, + ], + assessment: [ + { label: '복원력', value: '개선 (GM 0.7m, 예인 가능)', color: 'var(--orange)' }, + { label: '유출 위험', value: '수중패치 효과 (80 L/min)', color: 'var(--orange)' }, + { label: '선체 강도', value: 'BM 90% — 안정 범위', color: 'var(--green)' }, + { label: '구조 상황', value: '전원 구조 완료', color: 'var(--green)' }, + ], + actions: [ + { time: '14:00', text: '수중패치 설치 작업 개시', color: 'var(--cyan)' }, + { time: '14:30', text: '수중패치 설치 완료', color: 'var(--green)' }, + { time: '15:00', text: '해상크레인 도착, 잔류유 이적 준비', color: 'var(--cyan)' }, + { time: '16:30', text: '잔류유 1차 이적 완료 (45kL)', color: 'var(--green)' }, + ], + sortOrd: 6, + }, + { + scenarioSn: 7, rescueOpsSn: 1, timeStep: 'T+8h', + scenarioDtm: '2024-10-27T09:30:00.000Z', svrtCd: 'MEDIUM', + gmM: 0.8, listDeg: 10.0, trimM: 2.0, buoyancyPct: 38.0, oilRateLpm: 55.0, bmRatioPct: 91.0, + description: '오일붐 2중 전개, 유회수기 3대 가동. GNOME 확산 모델: 12시간 후 확산 면적 2.3km² 예측. 기계적 회수율 35%.', + compartments: [ + { name: '#1 FP Tank', status: 'FLOODED', color: 'var(--red)' }, + { name: '#1 Port Tank', status: 'PATCHED', color: 'var(--orange)' }, + { name: '#2 Port Tank', status: 'SEALED', color: 'var(--orange)' }, + { name: 'Engine Room', status: 'INTACT', color: 'var(--green)' }, + { name: '#3 Stbd Tank', status: 'BALLASTED', color: 'var(--orange)' }, + ], + assessment: [ + { label: '복원력', value: '안정 (GM 0.8m)', color: 'var(--orange)' }, + { label: '유출 위험', value: '방제 진행 (55 L/min, 회수 35%)', color: 'var(--orange)' }, + { label: '선체 강도', value: 'BM 91%', color: 'var(--green)' }, + { label: '방제 현황', value: '오일붐 2중, 유회수기 3대', color: 'var(--cyan)' }, + ], + actions: [ + { time: '17:00', text: '오일붐 1차 전개 (500m)', color: 'var(--cyan)' }, + { time: '17:30', text: '오일붐 2차 전개 (이중 방어선)', color: 'var(--cyan)' }, + { time: '17:45', text: '유회수기 3대 배치·가동', color: 'var(--cyan)' }, + { time: '18:30', text: 'GNOME 확산 예측 갱신', color: 'var(--orange)' }, + ], + sortOrd: 7, + }, + { + scenarioSn: 8, rescueOpsSn: 1, timeStep: 'T+12h', + scenarioDtm: '2024-10-27T13:30:00.000Z', svrtCd: 'MEDIUM', + gmM: 0.9, listDeg: 8.0, trimM: 1.5, buoyancyPct: 45.0, oilRateLpm: 30.0, bmRatioPct: 94.0, + description: '예인 개시. 예인 저항 Rt=1/2·ρ·Cd·A·V² 기반 4,000HP급 배정. 목포항 42nm, 예인 속도 3kn, ETA 14h.', + compartments: [ + { name: '#1 FP Tank', status: 'FLOODED', color: 'var(--red)' }, + { name: '#1 Port Tank', status: 'PATCHED', color: 'var(--orange)' }, + { name: '#2 Port Tank', status: 'SEALED', color: 'var(--orange)' }, + { name: 'Engine Room', status: 'INTACT', color: 'var(--green)' }, + { name: '#3 Stbd Tank', status: 'BALLASTED', color: 'var(--orange)' }, + ], + assessment: [ + { label: '복원력', value: '안정 (GM 0.9m)', color: 'var(--orange)' }, + { label: '유출 위험', value: '억제 중 (30 L/min)', color: 'var(--green)' }, + { label: '선체 강도', value: 'BM 94%', color: 'var(--green)' }, + { label: '예인 상태', value: '목포항, ETA 14h, 3kn', color: 'var(--cyan)' }, + ], + actions: [ + { time: '18:00', text: '예인 접속, 예인삭 250m 전개', color: 'var(--cyan)' }, + { time: '18:30', text: '예인 개시 (목포항 방향)', color: 'var(--cyan)' }, + { time: '20:00', text: '야간 감시 체제 전환', color: 'var(--orange)' }, + { time: '22:30', text: '예인 진행률 30%, 선체 안정', color: 'var(--green)' }, + ], + sortOrd: 8, + }, + { + scenarioSn: 9, rescueOpsSn: 1, timeStep: 'T+18h', + scenarioDtm: '2024-10-27T19:30:00.000Z', svrtCd: 'MEDIUM', + gmM: 1.0, listDeg: 5.0, trimM: 1.0, buoyancyPct: 55.0, oilRateLpm: 15.0, bmRatioPct: 96.0, + description: '예인 진행률 65%. 파랑 응답 분석(RAO): 유의파고 1.2m, 주기 6s — 횡동요 ±3° 안전 범위. 잔류 유출률 15 L/min.', + compartments: [ + { name: '#1 FP Tank', status: 'FLOODED', color: 'var(--red)' }, + { name: '#1 Port Tank', status: 'PATCHED', color: 'var(--orange)' }, + { name: '#2 Port Tank', status: 'SEALED', color: 'var(--orange)' }, + { name: 'Engine Room', status: 'INTACT', color: 'var(--green)' }, + { name: '#3 Stbd Tank', status: 'STABLE', color: 'var(--green)' }, + ], + assessment: [ + { label: '복원력', value: '양호 (GM 1.0m, IMO 충족)', color: 'var(--green)' }, + { label: '유출 위험', value: '미량 유출 (15 L/min)', color: 'var(--green)' }, + { label: '선체 강도', value: 'BM 96% 정상', color: 'var(--green)' }, + { label: '예인 상태', value: '진행률 65%, ETA 5.5h', color: 'var(--cyan)' }, + ], + actions: [ + { time: '00:00', text: '야간 예인 정상 진행', color: 'var(--green)' }, + { time: '02:00', text: '파랑 응답 분석 — 안전 확인', color: 'var(--green)' }, + { time: '03:00', text: '잔류유 유출률 15 L/min', color: 'var(--green)' }, + { time: '04:30', text: '목포항 VTS 통보, 입항 협의', color: 'var(--cyan)' }, + ], + sortOrd: 9, + }, + { + scenarioSn: 10, rescueOpsSn: 1, timeStep: 'T+24h', + scenarioDtm: '2024-10-28T01:30:00.000Z', svrtCd: 'RESOLVED', + gmM: 1.2, listDeg: 3.0, trimM: 0.5, buoyancyPct: 75.0, oilRateLpm: 5.0, bmRatioPct: 98.0, + description: '목포항 접안 완료. 잔류유 전량 이적(120kL). 최종 GM 1.2m IMO 충족, BM 98% 정상. 방제 총 회수량 85kL (회수율 71%). 상황 종료.', + compartments: [ + { name: '#1 FP Tank', status: 'SEALED', color: 'var(--orange)' }, + { name: '#1 Port Tank', status: 'SEALED', color: 'var(--orange)' }, + { name: '#2 Port Tank', status: 'SEALED', color: 'var(--orange)' }, + { name: 'Engine Room', status: 'INTACT', color: 'var(--green)' }, + { name: '#3 Stbd Tank', status: 'STABLE', color: 'var(--green)' }, + ], + assessment: [ + { label: '복원력', value: '안전 (GM 1.2m)', color: 'var(--green)' }, + { label: '유출 위험', value: '차단 완료', color: 'var(--green)' }, + { label: '선체 강도', value: 'BM 98% 정상', color: 'var(--green)' }, + { label: '최종 상태', value: '접안 완료, 상황 종료', color: 'var(--green)' }, + ], + actions: [ + { time: '06:00', text: '목포항 접근, 도선사 대기', color: 'var(--cyan)' }, + { time: '08:00', text: '도선사 승선, 접안 개시', color: 'var(--cyan)' }, + { time: '09:30', text: '접안 완료, 잔류유 이적선 접현', color: 'var(--green)' }, + { time: '10:30', text: '잔류유 전량 이적, 상황 종료', color: 'var(--green)' }, + ], + sortOrd: 10, + }, +]; + +const MOCK_OPS: RescueOpsItem[] = [ + { + rescueOpsSn: 1, acdntSn: 1, opsCd: 'RSC-2026-001', acdntTpCd: 'collision', + vesselNm: 'M/V SEA GUARDIAN', commanderNm: null, + lon: 126.25, lat: 37.467, locDc: '37°28\'N, 126°15\'E', + depthM: 25.0, currentDc: '2.5kn NE', + gmM: 0.8, listDeg: 15.0, trimM: 2.5, buoyancyPct: 30.0, + oilRateLpm: 100.0, bmRatioPct: 92.0, + totalCrew: 20, survivors: 15, missing: 5, + hydroData: null, gmdssData: null, + sttsCd: 'ACTIVE', regDtm: '2024-10-27T01:30:00.000Z', + }, +]; + /* ═══════════════════════════════════════════════════════════════════ RescueScenarioView ═══════════════════════════════════════════════════════════════════ */ @@ -116,14 +408,15 @@ export function RescueScenarioView() { const [sortBy, setSortBy] = useState<'time' | 'risk'>('time'); const [detailView, setDetailView] = useState(0); const [newScnModalOpen, setNewScnModalOpen] = useState(false); + const [guideOpen, setGuideOpen] = useState(false); const loadScenarios = useCallback(async (opsSn: number) => { setLoading(true); try { const items = await fetchRescueScenarios(opsSn); - setApiScenarios(items); - } catch (err) { - console.error('[rescue] 시나리오 조회 실패:', err); + setApiScenarios(items.length > 0 ? items : MOCK_SCENARIOS); + } catch { + setApiScenarios(MOCK_SCENARIOS); } finally { setLoading(false); } @@ -132,14 +425,17 @@ export function RescueScenarioView() { const loadOps = useCallback(async () => { try { const items = await fetchRescueOps(); - setOps(items); if (items.length > 0) { + setOps(items); loadScenarios(items[0].rescueOpsSn); } else { + setOps(MOCK_OPS); + setApiScenarios(MOCK_SCENARIOS); setLoading(false); } - } catch (err) { - console.error('[rescue] 구난 작전 목록 조회 실패:', err); + } catch { + setOps(MOCK_OPS); + setApiScenarios(MOCK_SCENARIOS); setLoading(false); } }, [loadScenarios]); @@ -229,9 +525,35 @@ export function RescueScenarioView() { > + 신규 시나리오 +
+ {/* ── 시나리오 관리 요건 가이드라인 ── */} + {guideOpen && ( +
+

시나리오 관리 요건

+
    + {SCENARIO_MGMT_GUIDELINES.map((g, i) => ( +
  • + {i + 1}. + {g} +
  • + ))} +
+
+ )} + {/* ── Content: Left List + Right Detail ── */}
{/* ═══ LEFT: 시나리오 목록 ═══ */} @@ -376,7 +698,7 @@ export function RescueScenarioView() {
{/* View content */} -
+
{/* ─── VIEW 0: 시나리오 상세 ─── */} {detailView === 0 && selected && (
@@ -536,37 +858,14 @@ export function RescueScenarioView() { {/* ─── VIEW 2: 지도 오버레이 ─── */} {detailView === 2 && ( -
-
-
🗺
-
GIS 기반 시나리오 비교
-
- 선택된 시나리오의 침수 구역을 지도 위에 오버레이하여 비교합니다. -
-
- {scenarios.map((sc) => ( -
- - {sc.id} - - {sc.name} -
- ))} -
-
-
- 지도 뷰 영역 — 구난 분석 지도와 연동하여 침수 구역 오버레이 표시 -
-
-
-
+ )}
@@ -578,6 +877,310 @@ export function RescueScenarioView() { ); } +/* ═══ 지도 오버레이 ═══ */ +interface ScenarioMapOverlayProps { + ops: RescueOpsItem[]; + selectedIncident: number; + scenarios: RescueScenario[]; + selectedId: string; + checked: Set; + onSelectScenario: (id: string) => void; +} + +function ScenarioMapOverlay({ + ops, + selectedIncident, + scenarios, + selectedId, + checked, + onSelectScenario, +}: ScenarioMapOverlayProps) { + const [popupId, setPopupId] = useState(null); + const baseMapStyle = useBaseMapStyle(); + + const currentOp = ops[selectedIncident] ?? null; + const center = useMemo<[number, number]>( + () => + currentOp?.lon != null && currentOp?.lat != null + ? [currentOp.lon, currentOp.lat] + : [126.25, 37.467], + [currentOp], + ); + + const visibleScenarios = useMemo( + () => scenarios.filter((s) => checked.has(s.id)), + [scenarios, checked], + ); + + const selected = scenarios.find((s) => s.id === selectedId); + + return ( +
+ {/* 시나리오 선택 바 */} +
+ 시나리오: + {visibleScenarios.map((sc) => { + const sev = SEV_STYLE[sc.severity]; + const isActive = selectedId === sc.id; + return ( + + ); + })} +
+ + {/* 지도 영역 */} +
+ + {/* 사고 위치 마커 */} + {currentOp && currentOp.lon != null && currentOp.lat != null && ( + +
+
+
+ + )} + + {/* 시나리오별 마커 — 사고 지점 주변에 시간 순서대로 배치 */} + {visibleScenarios.map((sc, idx) => { + const angle = (idx / visibleScenarios.length) * Math.PI * 2 - Math.PI / 2; + const radius = 0.015 + idx * 0.003; + const lng = center[0] + Math.cos(angle) * radius; + const lat = center[1] + Math.sin(angle) * radius * 0.8; + const sev = SEV_STYLE[sc.severity]; + const isActive = selectedId === sc.id; + + return ( + { + e.originalEvent.stopPropagation(); + onSelectScenario(sc.id); + setPopupId(popupId === sc.id ? null : sc.id); + }} + > +
+ + {sc.timeStep.replace('T+', '')} + +
+
+ ); + })} + + {/* 팝업 — 클릭한 시나리오 정보 표출 */} + {popupId && + (() => { + const sc = visibleScenarios.find((s) => s.id === popupId); + if (!sc) return null; + const idx = visibleScenarios.indexOf(sc); + const angle = (idx / visibleScenarios.length) * Math.PI * 2 - Math.PI / 2; + const radius = 0.015 + idx * 0.003; + const lng = center[0] + Math.cos(angle) * radius; + const lat = center[1] + Math.sin(angle) * radius * 0.8; + const sev = SEV_STYLE[sc.severity]; + + return ( + setPopupId(null)} + maxWidth="320px" + className="rescue-map-popup" + > +
+
+ + {sc.id} + + {sc.timeStep} + + {sev.label} + +
+
+ {sc.description} +
+ {/* KPI */} +
+ {[ + { label: 'GM', value: `${sc.gm}m`, color: gmColor(parseFloat(sc.gm)) }, + { label: '횡경사', value: `${sc.list}°`, color: listColor(parseFloat(sc.list)) }, + { label: '부력', value: `${sc.buoyancy}%`, color: buoyColor(sc.buoyancy) }, + { label: '유출', value: sc.oilRate.split(' ')[0], color: oilColor(parseFloat(sc.oilRate)) }, + ].map((m) => ( +
+
{m.label}
+
{m.value}
+
+ ))} +
+ {/* 구획 상태 */} + {sc.compartments.length > 0 && ( +
+
+ 구획 상태 +
+
+ {sc.compartments.map((c) => ( + + {c.name}: {c.status} + + ))} +
+
+ )} +
+
+ ); + })()} + + + {/* 좌측 하단 — 선택된 시나리오 요약 오버레이 */} + {selected && ( +
+
+ {selected.id} + {selected.timeStep} + + {SEV_STYLE[selected.severity].label} + +
+
+
+ {[ + { label: 'GM', value: `${selected.gm}m`, color: gmColor(parseFloat(selected.gm)) }, + { label: '횡경사', value: `${selected.list}°`, color: listColor(parseFloat(selected.list)) }, + { label: '부력', value: `${selected.buoyancy}%`, color: buoyColor(selected.buoyancy) }, + { label: '유출', value: selected.oilRate.split(' ')[0], color: oilColor(parseFloat(selected.oilRate)) }, + ].map((m) => ( +
+
{m.label}
+
{m.value}
+
+ ))} +
+
+ {selected.description.slice(0, 120)} + {selected.description.length > 120 ? '...' : ''} +
+
+
+ )} + + {/* 우측 상단 — 범례 */} +
+
시나리오 범례
+ {(['CRITICAL', 'HIGH', 'MEDIUM', 'RESOLVED'] as Severity[]).map((sev) => ( +
+ + {SEV_STYLE[sev].label} +
+ ))} +
+ + 사고 위치 +
+
+
+
+ ); +} + /* ═══ 신규 시나리오 생성 모달 ═══ */ function NewScenarioModal({ ops, onClose }: { ops: RescueOpsItem[]; onClose: () => void }) { const overlayRef = useRef(null); diff --git a/frontend/src/tabs/rescue/components/RescueView.tsx b/frontend/src/tabs/rescue/components/RescueView.tsx index d0e22bc..59d27d7 100755 --- a/frontend/src/tabs/rescue/components/RescueView.tsx +++ b/frontend/src/tabs/rescue/components/RescueView.tsx @@ -1,9 +1,12 @@ import { Fragment, useState, useEffect, useCallback } from 'react'; import { useSubMenu } from '@common/hooks/useSubMenu'; +import { MapView } from '@common/components/map/MapView'; import { RescueTheoryView } from './RescueTheoryView'; import { RescueScenarioView } from './RescueScenarioView'; import { fetchRescueOps } from '../services/rescueApi'; import type { RescueOpsItem } from '../services/rescueApi'; +import { fetchIncidentsRaw } from '@tabs/incidents/services/incidentsApi'; +import type { IncidentListItem } from '@tabs/incidents/services/incidentsApi'; /* ─── Types ─── */ type AccidentType = @@ -221,12 +224,145 @@ function TopInfoBar({ activeType }: { activeType: AccidentType }) { function LeftPanel({ activeType, onTypeChange, + incidents, + selectedAcdnt, + onSelectAcdnt, }: { activeType: AccidentType; onTypeChange: (t: AccidentType) => void; + incidents: IncidentListItem[]; + selectedAcdnt: IncidentListItem | null; + onSelectAcdnt: (item: IncidentListItem | null) => void; }) { + const [acdntName, setAcdntName] = useState(''); + const [acdntDate, setAcdntDate] = useState(''); + const [acdntTime, setAcdntTime] = useState(''); + const [acdntLat, setAcdntLat] = useState(''); + const [acdntLon, setAcdntLon] = useState(''); + const [showList, setShowList] = useState(false); + + // 사고 선택 시 필드 자동 채움 + const handlePickIncident = (item: IncidentListItem) => { + onSelectAcdnt(item); + setAcdntName(item.acdntNm); + const dt = new Date(item.occrnDtm); + setAcdntDate( + `${dt.getFullYear()}. ${String(dt.getMonth() + 1).padStart(2, '0')}. ${String(dt.getDate()).padStart(2, '0')}.`, + ); + setAcdntTime( + `${dt.getHours() >= 12 ? '오후' : '오전'} ${String(dt.getHours() % 12 || 12).padStart(2, '0')}:${String(dt.getMinutes()).padStart(2, '0')}`, + ); + setAcdntLat(String(item.lat)); + setAcdntLon(String(item.lng)); + setShowList(false); + }; + return (
+ {/* ── 사고 기본정보 ── */} +
+ 사고 기본정보 +
+ + {/* 사고명 직접 입력 */} + { + setAcdntName(e.target.value); + if (selectedAcdnt) onSelectAcdnt(null); + }} + className="w-full px-2 py-1.5 text-caption bg-bg-card border border-stroke rounded font-korean placeholder:text-fg-disabled/50 text-fg focus:border-[rgba(6,182,212,0.5)] focus:outline-none" + /> + + {/* 또는 사고 리스트에서 선택 */} +
+ + {showList && ( +
+ {incidents.length === 0 && ( +
+ 사고 데이터 없음 +
+ )} + {incidents.map((item) => ( + + ))} +
+ )} +
+ + {/* 사고 발생 일시 */} +
사고 발생 일시
+
+ setAcdntDate(e.target.value)} + className="flex-1 min-w-0 px-1.5 py-1 text-caption bg-bg-card border border-stroke rounded font-mono text-fg placeholder:text-fg-disabled/50 focus:border-[rgba(6,182,212,0.5)] focus:outline-none" + /> + setAcdntTime(e.target.value)} + className="flex-1 min-w-0 px-1.5 py-1 text-caption bg-bg-card border border-stroke rounded font-mono text-fg placeholder:text-fg-disabled/50 focus:border-[rgba(6,182,212,0.5)] focus:outline-none" + /> +
+ + {/* 위도 / 경도 */} +
+ setAcdntLat(e.target.value)} + className="flex-1 min-w-0 px-1.5 py-1 text-caption bg-bg-card border border-stroke rounded font-mono text-fg placeholder:text-fg-disabled/50 focus:border-[rgba(6,182,212,0.5)] focus:outline-none" + /> + setAcdntLon(e.target.value)} + className="flex-1 min-w-0 px-1.5 py-1 text-caption bg-bg-card border border-stroke rounded font-mono text-fg placeholder:text-fg-disabled/50 focus:border-[rgba(6,182,212,0.5)] focus:outline-none" + /> + +
+
+ 지도에서 위치를 선택하세요 +
+ + {/* 구분선 */} +
+ {/* 사고유형 제목 */}
사고 유형 (INCIDENT TYPE) @@ -290,191 +426,6 @@ function LeftPanel({ } /* ─── 중앙 지도 영역 ─── */ -function CenterMap({ activeType }: { activeType: AccidentType }) { - const d = rscTypeData[activeType]; - - return ( -
- {/* 해양 배경 그라데이션 */} -
- {/* 격자 */} -
- {/* 해안선 힌트 */} -
- - {/* 사고 해역 정보 */} -
-
사고 해역 정보
-
- 위치 - 37°28'N, 126°15'E - 수심 - 45m - 조류 - 2.5 knots NE -
-
- - {/* 선박 모형 */} -
-
-
-
-
- M/V SEA GUARDIAN -
-
- - {/* 예측 구역 원 */} -
- {/* 구역 라벨 */} -
- {d.zone.replace('\\n', '\n')} -
- - {/* SAR 자산 */} -
- ETA 5 MIN ─ -
-
- ETA 15 MIN ─ -
-
- 🚁 -
-
- 6M -
-
🚢
- - {/* 환경 민감 구역 */} -
-
- ENVIRONMENTALLY SENSITIVE -
- AREA: AQUACULTURE FARM -
-
- - {/* 지도 컨트롤 */} -
- {['🗺', '🔍', '📐'].map((ico, i) => ( - - ))} -
- - {/* 스케일 바 */} -
-
- 5 km · Zoom: 100% -
- - {/* 사고 유형 표시 */} - {/*
-
현재 사고 유형
-
- {at.icon} {at.label} ({at.eng}) -
-
*/} - - {/* 타임라인 시뮬레이션 컨트롤 */} -
-
TIMELINE
-
- [-6h] - [NOW] - [+6H] - [+12H] - [+24H] -
-
-
-
-
- - - -
-
- 10:45 KST -
-
-
- ); -} - /* ─── 오른쪽 분석 패널 ─── */ function RightPanel({ activeAnalysis, @@ -1572,6 +1523,44 @@ export function RescueView() { const { activeSubTab } = useSubMenu('rescue'); const [activeType, setActiveType] = useState('collision'); const [activeAnalysis, setActiveAnalysis] = useState('rescue'); + const [incidents, setIncidents] = useState([]); + const [selectedAcdnt, setSelectedAcdnt] = useState(null); + const [incidentCoord, setIncidentCoord] = useState<{ lon: number; lat: number } | null>(null); + const [isSelectingLocation, setIsSelectingLocation] = useState(false); + + useEffect(() => { + fetchIncidentsRaw() + .then((items) => setIncidents(items)) + .catch(() => setIncidents([])); + }, []); + + // 지도 클릭 시 좌표 선택 + const handleMapClick = useCallback((lon: number, lat: number) => { + setIncidentCoord({ lon, lat }); + setIsSelectingLocation(false); + }, []); + + // 사고 선택 시 사고유형 자동 매핑 + const handleSelectAcdnt = useCallback( + (item: IncidentListItem | null) => { + setSelectedAcdnt(item); + if (item) { + const typeMap: Record = { + collision: 'collision', + grounding: 'grounding', + turning: 'turning', + capsizing: 'capsizing', + sharpTurn: 'sharpTurn', + flooding: 'flooding', + sinking: 'sinking', + }; + const mapped = typeMap[item.acdntTpCd]; + if (mapped) setActiveType(mapped); + setIncidentCoord({ lon: item.lng, lat: item.lat }); + } + }, + [], + ); if (activeSubTab === 'list') { return ( @@ -1596,8 +1585,23 @@ export function RescueView() { {/* 3단 레이아웃: 사고유형 | 지도 | 분석 패널 */}
- - + +
+ +
Date: Tue, 14 Apr 2026 11:01:18 +0900 Subject: [PATCH 4/7] =?UTF-8?q?docs:=20=EB=A6=B4=EB=A6=AC=EC=A6=88=20?= =?UTF-8?q?=EB=85=B8=ED=8A=B8=20=EC=97=85=EB=8D=B0=EC=9D=B4=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/RELEASE-NOTES.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/RELEASE-NOTES.md b/docs/RELEASE-NOTES.md index 5c127bb..2e6a632 100644 --- a/docs/RELEASE-NOTES.md +++ b/docs/RELEASE-NOTES.md @@ -4,6 +4,10 @@ ## [Unreleased] +### 추가 +- 관리자: 비식별화조치 메뉴 및 패널 추가 +- 긴급구난/예측도 OSM 지도 적용 및 관리자 패널 추가 + ## [2026-04-13] ### 추가 -- 2.45.2 From 547e83e6179f261235dbb0d50e246c625e41aea5 Mon Sep 17 00:00:00 2001 From: leedano Date: Tue, 14 Apr 2026 11:05:28 +0900 Subject: [PATCH 5/7] =?UTF-8?q?refactor(design):=20=ED=8F=B0=ED=8A=B8=20?= =?UTF-8?q?=EC=97=85=EC=8A=A4=EC=BC=80=EC=9D=BC=20=ED=86=A0=ED=81=B0=20?= =?UTF-8?q?=EC=A0=81=EC=9A=A9=20=EB=B0=8F=20=EC=A0=84=EC=B2=B4=20=ED=83=AD?= =?UTF-8?q?=20=EB=94=94=EC=9E=90=EC=9D=B8=20=EC=8B=9C=EC=8A=A4=ED=85=9C=20?= =?UTF-8?q?=EC=83=89=EC=83=81=C2=B7=ED=8F=B0=ED=8A=B8=20=ED=86=B5=EC=9D=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CLAUDE.md | 22 +++ .../src/common/components/auth/LoginPage.tsx | 8 +- .../common/components/layout/SubMenuBar.tsx | 2 +- .../src/common/components/layout/TopBar.tsx | 10 +- .../components/map/BacktrackReplayBar.tsx | 4 +- .../src/common/components/map/MapView.tsx | 23 ++-- frontend/src/common/styles/base.css | 18 +-- frontend/src/common/styles/components.css | 54 ++++---- frontend/src/common/styles/wing.css | 2 +- frontend/src/pages/design/ButtonContent.tsx | 33 +++-- .../src/pages/design/ColorPaletteContent.tsx | 102 +++++++------- .../src/pages/design/ComponentsContent.tsx | 2 +- .../src/pages/design/ComponentsOverview.tsx | 9 +- frontend/src/pages/design/DesignContent.tsx | 23 ++-- frontend/src/pages/design/FloatContent.tsx | 7 +- .../src/pages/design/FoundationsOverview.tsx | 9 +- frontend/src/pages/design/LayoutContent.tsx | 39 +++--- frontend/src/pages/design/RadiusContent.tsx | 10 +- .../src/pages/design/TextFieldContent.tsx | 126 ++++++++++-------- .../src/pages/design/TypographyContent.tsx | 80 ++++++----- .../components/ButtonCatalogSection.tsx | 6 +- .../pages/design/components/CardSection.tsx | 2 +- .../design/components/IconBadgeSection.tsx | 4 +- .../design/float/FloatDropdownContent.tsx | 24 ++-- .../pages/design/float/FloatModalContent.tsx | 51 ++++--- .../design/float/FloatOverlayContent.tsx | 21 +-- .../pages/design/float/FloatToastContent.tsx | 14 +- .../admin/components/AdminPlaceholder.tsx | 2 +- .../tabs/admin/components/AdminSidebar.tsx | 4 +- .../admin/components/AssetUploadPanel.tsx | 34 ++--- .../tabs/admin/components/BoardMgmtPanel.tsx | 20 +-- .../admin/components/CleanupEquipPanel.tsx | 18 +-- .../tabs/admin/components/CollectHrPanel.tsx | 12 +- .../admin/components/DispersingZonePanel.tsx | 6 +- .../src/tabs/admin/components/LayerPanel.tsx | 40 +++--- .../tabs/admin/components/MapBasePanel.tsx | 36 ++--- .../src/tabs/admin/components/MenusPanel.tsx | 8 +- .../admin/components/MonitorForecastPanel.tsx | 30 +++-- .../admin/components/MonitorRealtimePanel.tsx | 42 +++--- .../admin/components/MonitorVesselPanel.tsx | 18 +-- .../admin/components/PermissionsPanel.tsx | 32 ++--- .../admin/components/SensitiveLayerPanel.tsx | 22 +-- .../tabs/admin/components/SettingsPanel.tsx | 14 +- .../admin/components/SortableMenuItem.tsx | 6 +- .../src/tabs/admin/components/UsersPanel.tsx | 48 +++---- .../admin/components/VesselMaterialsPanel.tsx | 14 +- .../admin/components/VesselSignalPanel.tsx | 8 +- .../src/tabs/aerial/components/CctvView.tsx | 6 +- .../aerial/components/MediaManagement.tsx | 12 +- .../aerial/components/OilAreaAnalysis.tsx | 4 +- .../tabs/aerial/components/RealtimeDrone.tsx | 10 +- .../aerial/components/SatelliteRequest.tsx | 22 +-- .../tabs/aerial/components/SensorAnalysis.tsx | 8 +- .../src/tabs/aerial/components/WingAI.tsx | 6 +- .../assets/components/AssetManagement.tsx | 12 +- .../tabs/assets/components/AssetUpload.tsx | 16 +-- .../src/tabs/assets/components/AssetsView.tsx | 6 +- .../tabs/assets/components/ShipInsurance.tsx | 16 +-- .../src/tabs/hns/components/HNSLeftPanel.tsx | 6 +- .../tabs/hns/components/HNSSubstanceView.tsx | 14 +- .../incidents/components/IncidentTable.tsx | 44 +++--- .../components/IncidentsLeftPanel.tsx | 16 +-- .../components/IncidentsRightPanel.tsx | 16 +-- .../incidents/components/IncidentsView.tsx | 2 +- .../components/AnalysisListTable.tsx | 40 +++--- .../prediction/components/BacktrackModal.tsx | 11 +- .../components/BoomDeploymentTheoryView.tsx | 2 +- .../prediction/components/OilSpillView.tsx | 16 +-- .../prediction/components/RecalcModal.tsx | 6 +- .../reports/components/ReportGenerator.tsx | 4 +- .../tabs/reports/components/ReportsView.tsx | 6 +- .../rescue/components/RescueScenarioView.tsx | 6 +- .../tabs/scat/components/DistributionView.tsx | 4 +- .../src/tabs/scat/components/PreScatView.tsx | 6 +- .../src/tabs/scat/components/ScatPopup.tsx | 22 +-- .../tabs/scat/components/ScatRightPanel.tsx | 4 +- .../src/tabs/scat/components/ScatTimeline.tsx | 14 +- .../src/tabs/scat/components/SurveyView.tsx | 4 +- .../weather/components/WeatherMapControls.tsx | 2 +- .../weather/components/WeatherMapOverlay.tsx | 10 +- .../weather/components/WeatherRightPanel.tsx | 2 +- .../tabs/weather/components/WeatherView.tsx | 6 +- frontend/tailwind.config.js | 20 +-- 83 files changed, 820 insertions(+), 700 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 348f5b3..3cbe76c 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -127,6 +127,28 @@ wing/ ## 진행 중 작업 (완료 후 삭제) +### 폰트 크기 업스케일 작업 (진행 중) + +반드시 `memory/font-upscale-plan.md`를 읽고 Phase 진행 상황을 확인할 것. + +**토큰 변경 매핑 (이름 유지, 값만 변경):** +- `caption`/`label-2`/`title-6`: 11px → **12px** (0.75rem) +- `label-1`/`title-5`: 12px → **13px** (0.8125rem) +- `body-2`/`title-4`: 13px → **14px** (0.875rem) +- `body-1`/`title-3`: 14px → **16px** (1rem) + +**네비게이션 클래스 교체:** +- TopBar 메인탭: `text-title-4` → `text-title-2` (16px) +- SubMenuBar 서브탭: `text-title-5` → `text-title-4` (14px) + +**작업 범위:** +- Phase 1: tailwind.config.js + base.css 토큰 값 수정 +- Phase 2: components.css 하드코딩(27곳) + wing.css `.wing-tab` text-xs→text-caption +- Phase 3: TopBar.tsx + SubMenuBar.tsx 클래스 교체 +- Phase 4: text-xs→text-caption, text-sm→text-body-2 스크립트 교체 (design 페이지 제외, 608건) +- Phase 5: prediction 탭 인라인 fontSize 수정 +- Phase 6 (보류): wing-header-bar 패딩 — 폰트 변경 후 유저 확인 후 진행 + ### 디자인 시스템 폰트+색상 통일 작업 compact 후 반드시 `memory/design-system-work.md`를 읽고 작업 상태(완료/미완료 컴포넌트)를 확인할 것. diff --git a/frontend/src/common/components/auth/LoginPage.tsx b/frontend/src/common/components/auth/LoginPage.tsx index 6413cf1..717c7ec 100644 --- a/frontend/src/common/components/auth/LoginPage.tsx +++ b/frontend/src/common/components/auth/LoginPage.tsx @@ -120,7 +120,7 @@ export function LoginPage() {
- + setActiveSubTab(item.id)} className={` - px-4 py-2.5 text-title-5 font-medium transition-all duration-200 + px-4 py-2.5 text-title-4 font-medium transition-all duration-200 font-korean tracking-navigation ${activeSubTab === item.id ? 'text-color-accent' : 'text-fg-sub hover:text-fg'} `} diff --git a/frontend/src/common/components/layout/TopBar.tsx b/frontend/src/common/components/layout/TopBar.tsx index ca22afd..2168bfd 100755 --- a/frontend/src/common/components/layout/TopBar.tsx +++ b/frontend/src/common/components/layout/TopBar.tsx @@ -56,11 +56,7 @@ export function TopBar({ activeTab, onTabChange }: TopBarProps) { className="flex items-center hover:opacity-80 transition-opacity cursor-pointer" title="홈으로 이동" > - WING 해양환경 위기대응 + WING 해양환경 위기대응 {/* Divider */} @@ -87,7 +83,7 @@ export function TopBar({ activeTab, onTabChange }: TopBarProps) { onClick={handleClick} title={tab.label} className={` - px-2.5 xl:px-4 py-2 text-title-4 font-bold transition-all duration-200 + px-2.5 xl:px-4 py-2 text-title-2 font-bold transition-all duration-200 font-korean tracking-navigation border-b-2 border-transparent ${isIncident ? 'ml-1' : ''} ${isMonitor ? 'ml-1 flex items-center gap-1.5' : ''} @@ -127,7 +123,7 @@ export function TopBar({ activeTab, onTabChange }: TopBarProps) { {/* Right Section */}
{/* Status Badge */} - {/*
+ {/*
사고 진행중
*/} diff --git a/frontend/src/common/components/map/BacktrackReplayBar.tsx b/frontend/src/common/components/map/BacktrackReplayBar.tsx index 246fa18..dfe63cc 100755 --- a/frontend/src/common/components/map/BacktrackReplayBar.tsx +++ b/frontend/src/common/components/map/BacktrackReplayBar.tsx @@ -141,7 +141,7 @@ export function BacktrackReplayBar({ className="w-2 h-2 rounded-full bg-color-tertiary" style={{ boxShadow: '0 0 8px rgba(168,85,247,0.5)' }} /> - 역추적 리플레이 + 역추적 리플레이
@@ -180,7 +180,7 @@ export function BacktrackReplayBar({ {/* Play/Pause */} @@ -1575,7 +1578,7 @@ function MapLegend({ className="flex items-center gap-1.5 mt-2 rounded" style={{ padding: '6px', background: 'rgba(168,85,247,0.08)' }} > -
🧭
+
🧭
풍향 (방사형)
@@ -1888,7 +1891,9 @@ function BacktrackReplayBar({ minWidth: '340px', }} > -
{progress.toFixed(0)}%
+
+ {progress.toFixed(0)}% +
{ {/* ── 섹션 1: 헤더 ── */}

Components @@ -244,7 +244,7 @@ export const ButtonContent = ({ theme }: ButtonContentProps) => {

- + 텍스트 + 아이콘 버튼
@@ -298,7 +298,7 @@ export const ButtonContent = ({ theme }: ButtonContentProps) => {
- + 아이콘 전용 버튼
@@ -339,7 +339,7 @@ export const ButtonContent = ({ theme }: ButtonContentProps) => {
{/* 라벨 */} {size.label} @@ -349,7 +349,7 @@ export const ButtonContent = ({ theme }: ButtonContentProps) => {
-

+

모든 컬러 토큰은{' '} Property-Role-Variant 3계층 구조를 따릅니다. Property는 색상이 적용되는 CSS 속성, Role은 의미 기반 역할, Variant는 상태 @@ -551,17 +551,17 @@ export const ColorPaletteContent = ({ theme }: ColorPaletteContentProps) => { }} > {row.prop}

-
+
{row.desc}
- + {row.example}
@@ -581,7 +581,7 @@ export const ColorPaletteContent = ({ theme }: ColorPaletteContentProps) => { style={{ border: `1px solid ${dividerColor}` }} >
{ }} > {row.name} - + {row.desc}
@@ -626,7 +626,7 @@ export const ColorPaletteContent = ({ theme }: ColorPaletteContentProps) => { style={{ border: `1px solid ${dividerColor}` }} >
{ }} > {row.name} - + {row.desc}
@@ -672,7 +672,7 @@ export const ColorPaletteContent = ({ theme }: ColorPaletteContentProps) => {

Semantic Tokens

-

+

용도에 따라 의미를 부여한 토큰. 테마 전환 시 값이 변경됩니다.

@@ -745,7 +745,7 @@ export const ColorPaletteContent = ({ theme }: ColorPaletteContentProps) => { }, ].map((group) => (
-

+

{group.title}

{ > {/* 헤더 */}
{ }} > {tk.legacy} {tk.name} - + {tk.desc} - + {tk.value}
@@ -804,7 +804,7 @@ export const ColorPaletteContent = ({ theme }: ColorPaletteContentProps) => { flexShrink: 0, }} /> - + {hexToRgb(tk.value)}
@@ -823,7 +823,7 @@ export const ColorPaletteContent = ({ theme }: ColorPaletteContentProps) => {

Palette Tokens

-

+

fg · bg · stroke 모든 맥락에서 사용되는 색상 원본. Property 접두사 없이{' '} --color-* @@ -836,7 +836,7 @@ export const ColorPaletteContent = ({ theme }: ColorPaletteContentProps) => { style={{ border: `1px solid ${dividerColor}` }} >

{ backgroundColor: isDark ? 'rgba(255,255,255,0.02)' : '#fafafa', }} > - + {tk.legacy} {tk.name} - + {tk.value}
@@ -905,11 +908,11 @@ export const ColorPaletteContent = ({ theme }: ColorPaletteContentProps) => { flexShrink: 0, }} /> - + {hexToRgb(tk.value)}
- + {tk.desc}
@@ -925,7 +928,7 @@ export const ColorPaletteContent = ({ theme }: ColorPaletteContentProps) => {

Non-color Tokens

-

+

타이포그래피, 라운딩 등 색상 외 토큰.

@@ -934,7 +937,7 @@ export const ColorPaletteContent = ({ theme }: ColorPaletteContentProps) => { style={{ border: `1px solid ${dividerColor}` }} >
{ backgroundColor: isDark ? 'rgba(255,255,255,0.02)' : '#fafafa', }} > - + {tk.legacy} {tk.name} { > {tk.category} - + {tk.desc}
@@ -1015,7 +1021,7 @@ export const ColorPaletteContent = ({ theme }: ColorPaletteContentProps) => {

프라이머리 색상(primary color)

-

+

Primary 색상은 해양 방제 시스템의 핵심 인터랙션 요소에 사용됩니다. Cyan~Blue 그라디언트가 주요 액션 버튼과 강조 요소에 적용됩니다.

@@ -1023,7 +1029,7 @@ export const ColorPaletteContent = ({ theme }: ColorPaletteContentProps) => {
{/* Light Mode */}
-

+

Light Mode

{ {/* Dark Mode */}
-

+

Dark Mode

{

세컨더리 색상(secondary color)

-

+

Secondary 색상은 UI의 배경과 구조적 요소에 사용됩니다. Navy 계열로 다크 모드의 깊이감과 계층 구조를 표현합니다.

@@ -1075,7 +1081,7 @@ export const ColorPaletteContent = ({ theme }: ColorPaletteContentProps) => {
{/* Light Mode */}
-

+

Light Mode

{ {/* Dark Mode */}
-

+

Dark Mode

{

그레이 색상(gray color) / 네추럴, 중립 색상

-

+

Gray 색상은 주로 배경, 텍스트, 구분 선에 사용되며, 시각적 집중을 방해하지 않고 콘텐츠에 초점을 맞추도록 도와주는 중립적인 색상이다.

-

+

표준형 스타일의 그레이 색상은 주요 색상과 선명한 모드에서의 조화를 고려해 블루 그레이 계열을 사용한다.

@@ -1141,7 +1147,7 @@ export const ColorPaletteContent = ({ theme }: ColorPaletteContentProps) => {

Transparent

-

+

투명도와 음영을 활용하여 정보의 집중도를 조절합니다. 배경의 음영 처리는 투명도 65%를 사용합니다.

@@ -1174,12 +1180,12 @@ export const ColorPaletteContent = ({ theme }: ColorPaletteContentProps) => {

Primitive

-

+

UI 전반에서 사용하는 기본 색조 팔레트. 테마와 무관하게 고정된 값입니다.

@@ -1214,17 +1220,17 @@ export const ColorPaletteContent = ({ theme }: ColorPaletteContentProps) => { /> {/* 토큰명 */} {token.name} {/* HEX + RGB */}
-
+
{token.hex}
-
+
{hexToRgb(token.hex)}
diff --git a/frontend/src/pages/design/ComponentsContent.tsx b/frontend/src/pages/design/ComponentsContent.tsx index 663231e..efa2d6c 100644 --- a/frontend/src/pages/design/ComponentsContent.tsx +++ b/frontend/src/pages/design/ComponentsContent.tsx @@ -13,7 +13,7 @@ export const ComponentsContent = () => { > 시스템 컴포넌트 카탈로그 -

+

WING-OPS 해상 물류를 위한 시각적 아이덴티티 시스템입니다. 정밀도와 미션 크리티컬한 운영을 위해 설계된 고밀도 산업용 인터페이스입니다.

diff --git a/frontend/src/pages/design/ComponentsOverview.tsx b/frontend/src/pages/design/ComponentsOverview.tsx index 731664a..ce1a119 100644 --- a/frontend/src/pages/design/ComponentsOverview.tsx +++ b/frontend/src/pages/design/ComponentsOverview.tsx @@ -256,7 +256,7 @@ const ComponentsOverview = ({ theme, onNavigate }: ComponentsOverviewProps) => { {/* ── 헤더 영역 ── */}
Components @@ -264,7 +264,7 @@ const ComponentsOverview = ({ theme, onNavigate }: ComponentsOverviewProps) => {

Overview

-

+

재사용 가능한 UI 컴포넌트 카탈로그입니다.

@@ -307,7 +307,10 @@ const ComponentsOverview = ({ theme, onNavigate }: ComponentsOverviewProps) => { {/* 카드 라벨 */}
- + {card.label}
diff --git a/frontend/src/pages/design/DesignContent.tsx b/frontend/src/pages/design/DesignContent.tsx index 69c9b36..007c8a8 100644 --- a/frontend/src/pages/design/DesignContent.tsx +++ b/frontend/src/pages/design/DesignContent.tsx @@ -154,7 +154,7 @@ export const DesignContent = ({ theme }: DesignContentProps) => { style={{ backgroundColor: t.textAccent, boxShadow: t.systemActiveShadow }} /> System Active @@ -192,11 +192,14 @@ export const DesignContent = ({ theme }: DesignContentProps) => { /> {/* 정보 */}
- + {item.token} {item.hex} @@ -233,7 +236,7 @@ export const DesignContent = ({ theme }: DesignContentProps) => { {item.token} {item.hex} @@ -263,7 +266,7 @@ export const DesignContent = ({ theme }: DesignContentProps) => { {item.token} {item.sampleText} - + {item.desc}
@@ -297,7 +300,7 @@ export const DesignContent = ({ theme }: DesignContentProps) => { />
{item.name} @@ -435,7 +438,7 @@ export const DesignContent = ({ theme }: DesignContentProps) => {
{/* radius-sm */}
- + {t.radiusSmLabel}
{ Small Elements

Applied to tactical buttons, search inputs, and micro-cards for a precise, sharp @@ -463,7 +466,7 @@ export const DesignContent = ({ theme }: DesignContentProps) => {

{/* radius-md */}
- + {t.radiusMdLabel}
{ Structural Panels

Applied to telemetry cards, floating modals, and primary operational panels to diff --git a/frontend/src/pages/design/FloatContent.tsx b/frontend/src/pages/design/FloatContent.tsx index 020fac6..bfca117 100644 --- a/frontend/src/pages/design/FloatContent.tsx +++ b/frontend/src/pages/design/FloatContent.tsx @@ -50,7 +50,10 @@ export const FloatContent = ({ theme }: FloatContentProps) => {

Float

-

+

화면 위에 떠서 표시되는 UI 패턴 카탈로그 — Modal, Dropdown, Overlay, Toast

@@ -70,7 +73,7 @@ export const FloatContent = ({ theme }: FloatContentProps) => { }} > {label} diff --git a/frontend/src/pages/design/FoundationsOverview.tsx b/frontend/src/pages/design/FoundationsOverview.tsx index 1837f0b..ef03049 100644 --- a/frontend/src/pages/design/FoundationsOverview.tsx +++ b/frontend/src/pages/design/FoundationsOverview.tsx @@ -174,7 +174,7 @@ const FoundationsOverview = ({ theme, onNavigate }: FoundationsOverviewProps) => {/* ── 헤더 영역 ── */}
Foundations @@ -182,7 +182,7 @@ const FoundationsOverview = ({ theme, onNavigate }: FoundationsOverviewProps) =>

Overview

-

+

디자인의 기반이 되는 핵심 요소 사용 기준입니다.

@@ -225,7 +225,10 @@ const FoundationsOverview = ({ theme, onNavigate }: FoundationsOverviewProps) => {/* 카드 라벨 */}
- + {card.label}
diff --git a/frontend/src/pages/design/LayoutContent.tsx b/frontend/src/pages/design/LayoutContent.tsx index 82035d8..0a180f1 100644 --- a/frontend/src/pages/design/LayoutContent.tsx +++ b/frontend/src/pages/design/LayoutContent.tsx @@ -324,7 +324,7 @@ export const LayoutContent = ({ theme }: LayoutContentProps) => {

Layout

-

+

WING-OPS는 데스크톱 전용 고정 뷰포트 애플리케이션입니다. 화면 전체를 채우는 고정 레이아웃(100vh)으로, flex 기반의 패널 구조를 사용합니다. KRDS 가이드라인을 기반으로 xlarge / xxlarge 구간에 최적화되어 있습니다. @@ -364,7 +364,7 @@ export const LayoutContent = ({ theme }: LayoutContentProps) => {

Breakpoint

-

+

화면 크기에 따라 반응형 레이아웃을 사용하여 환경에 최적화된 구조로 표시됩니다. WING-OPS 사용 구간(xl, 2xl)은 cyan으로 강조되어 있습니다.

@@ -499,7 +499,7 @@ export const LayoutContent = ({ theme }: LayoutContentProps) => { borderColor: isDark ? 'rgba(76,215,246,0.45)' : 'rgba(6,182,212,0.40)', }} /> - + WING-OPS 사용 중
@@ -511,7 +511,7 @@ export const LayoutContent = ({ theme }: LayoutContentProps) => { borderColor: isDark ? 'rgba(140,144,159,0.25)' : 'rgba(148,163,184,0.30)', }} /> - + 미지원 (1280px 미만)
@@ -525,7 +525,7 @@ export const LayoutContent = ({ theme }: LayoutContentProps) => {

Grid

-

+

컬럼, 마진, 거터로 구성된 그리드 시스템입니다. 데스크톱 전용으로 xl / 2xl 두 구간만 지원합니다.

@@ -548,7 +548,7 @@ export const LayoutContent = ({ theme }: LayoutContentProps) => { style={{ borderColor: isDark ? 'rgba(66,71,84,0.20)' : '#e2e8f0' }} >
- + Breakpoint {
- + Width - + {spec.width}
@@ -683,7 +683,7 @@ export const LayoutContent = ({ theme }: LayoutContentProps) => { - + 1280px 미만 미지원 — Mobile / Tablet 구간(xs / s / md / lg)은 데스크톱 전용 운영 정책에 따라 지원하지 않습니다. @@ -696,7 +696,7 @@ export const LayoutContent = ({ theme }: LayoutContentProps) => {

App Shell

-

+

WING-OPS 애플리케이션의 기본 레이아웃 구조와 KRDS Sub-page 영역 매핑입니다.

@@ -720,7 +720,7 @@ export const LayoutContent = ({ theme }: LayoutContentProps) => { }} >
- + TopBar {

Spacing

-

+

UI 요소 간의 간격과 여백을 정의하여 콘텐츠의 위계와 가독성을 조율합니다. Tailwind spacing 토큰과 직결되며, 막대 길이는 실제 px 비율입니다.

@@ -1000,7 +1000,7 @@ export const LayoutContent = ({ theme }: LayoutContentProps) => {

4pt Grid

-

+

모든 여백과 간격을 4point 단위로 설정해 규칙성을 확보합니다. 컴팩트한 컴포넌트의 경우, 2의 배수 단위를 제한적으로 사용합니다.

@@ -1048,7 +1048,7 @@ export const LayoutContent = ({ theme }: LayoutContentProps) => { > {item.label}
- + {item.text}
@@ -1145,7 +1145,10 @@ export const LayoutContent = ({ theme }: LayoutContentProps) => { minWidth: '180px', }} > - + 카드 타이틀 @@ -1185,7 +1188,7 @@ export const LayoutContent = ({ theme }: LayoutContentProps) => { 디자인 시스템 진실 소스
-

+

UI 요소의 레이어 스택 순서입니다. 높은 z-index가 위에 표시되며, 이 값은 디자인 시스템의 이상적 설계 값으로 실제 코드는 이 값에 맞춰 정정되어야 합니다.

@@ -1216,7 +1219,7 @@ export const LayoutContent = ({ theme }: LayoutContentProps) => { className="w-2 h-2 rounded-full shrink-0" style={{ backgroundColor: layer.color }} /> - + {layer.name} @@ -1234,7 +1237,7 @@ export const LayoutContent = ({ theme }: LayoutContentProps) => {

Reference

-

+

App Shell CSS 클래스와 KRDS Grid 규칙 비교 — 코드 작성 시 참조용입니다.

diff --git a/frontend/src/pages/design/RadiusContent.tsx b/frontend/src/pages/design/RadiusContent.tsx index 0f34e49..04d3e89 100644 --- a/frontend/src/pages/design/RadiusContent.tsx +++ b/frontend/src/pages/design/RadiusContent.tsx @@ -70,17 +70,17 @@ export const RadiusContent = ({ theme }: RadiusContentProps) => {

Radius

-

+

Radius는 컴포넌트 혹은 콘텐츠 모서리의 둥글기를 표현합니다.

-

+

Radius는 UI 구성 요소의 모서리를 둥글게 처리하여 부드럽고 현대적인 느낌을 제공합니다. 일관된 Radius 값은 브랜드 아이덴티티를 강화하고, 사용자 경험을 향상시키며, 다양한 화면과 컨텍스트에서 시각적 일관성을 유지하는 데 중요한 역할을 합니다.

  • @@ -203,7 +203,7 @@ export const RadiusContent = ({ theme }: RadiusContentProps) => {

    컴포넌트 매핑

    -

    +

    wing.css 컴포넌트 클래스에 적용된 Radius 토큰입니다.

@@ -233,7 +233,7 @@ export const RadiusContent = ({ theme }: RadiusContentProps) => { {/* 정보 */}
- + {item.className}
diff --git a/frontend/src/pages/design/TextFieldContent.tsx b/frontend/src/pages/design/TextFieldContent.tsx index 9ec4386..2891f0a 100644 --- a/frontend/src/pages/design/TextFieldContent.tsx +++ b/frontend/src/pages/design/TextFieldContent.tsx @@ -207,7 +207,7 @@ export const TextFieldContent = ({ theme }: TextFieldContentProps) => { {/* ── 섹션 1: 헤더 ── */}

Components @@ -225,7 +225,7 @@ export const TextFieldContent = ({ theme }: TextFieldContentProps) => {

Input Field

-

+

단일 행 텍스트를 입력받는 필드입니다.

@@ -246,7 +246,7 @@ export const TextFieldContent = ({ theme }: TextFieldContentProps) => { {/* Prefix label */}
Prefix @@ -272,7 +272,7 @@ export const TextFieldContent = ({ theme }: TextFieldContentProps) => { {/* Input label */}
Input @@ -295,7 +295,7 @@ export const TextFieldContent = ({ theme }: TextFieldContentProps) => { {/* Suffix label */}
Suffix @@ -377,7 +377,7 @@ export const TextFieldContent = ({ theme }: TextFieldContentProps) => { {/* Suffix 텍스트 */} 원 @@ -402,7 +402,7 @@ export const TextFieldContent = ({ theme }: TextFieldContentProps) => { }} > Container @@ -437,7 +437,7 @@ export const TextFieldContent = ({ theme }: TextFieldContentProps) => { style={{ width: '1px', height: '10px', backgroundColor: annotationColor }} /> Clear Button @@ -468,7 +468,7 @@ export const TextFieldContent = ({ theme }: TextFieldContentProps) => { Container
-

+

입력 필드의 외곽 영역입니다. 테두리, 곡률, 내부 여백을 정의합니다.

@@ -519,13 +519,13 @@ export const TextFieldContent = ({ theme }: TextFieldContentProps) => {
-

+

height: 44px (Medium)

-

+

padding: 12px (좌우)

-

+

border-radius: 6px

@@ -543,14 +543,14 @@ export const TextFieldContent = ({ theme }: TextFieldContentProps) => { Placeholder
-

+

값이 입력되지 않았을 때 표시되는 안내 텍스트입니다. 입력 시 사라집니다.

{/* 플레이스홀더 있는 필드 */}
- + 플레이스홀더 있음
{ {/* 빈 필드 (플레이스홀더 없음) */}
- + 플레이스홀더 없음
{ Label
-

+

입력 필드의 용도를 설명하는 텍스트입니다. 필수 항목은 * 표시로 구분합니다.

{/* 일반 라벨 */}
- + 이름
{ {/* 필수 라벨 */}
- + 이메일 *
{ Input Text
-

+

사용자가 실제로 입력한 텍스트입니다. 플레이스홀더보다 진한 색상으로 표시됩니다.

@@ -673,7 +679,10 @@ export const TextFieldContent = ({ theme }: TextFieldContentProps) => { > 홍길동
-
+
font-size: 14px color: textPrimary font-weight: 400 @@ -692,14 +701,14 @@ export const TextFieldContent = ({ theme }: TextFieldContentProps) => { Clear Icon
-

+

입력값이 있을 때 표시되는 초기화 버튼입니다. 클릭 시 입력값을 삭제합니다.

{/* 텍스트 입력 + Clear 아이콘 표시 */}
- + 입력값 있음 (Clear 표시)
{ {/* 빈 상태 (Clear 미표시) */}
- + 입력값 없음 (Clear 미표시)
{ Helper Text
-

+

입력 필드 하단에 표시되는 보조 텍스트입니다. 안내 또는 에러 메시지로 사용됩니다.

@@ -787,7 +796,7 @@ export const TextFieldContent = ({ theme }: TextFieldContentProps) => { > 비밀번호
- + 영문, 숫자 포함 8자 이상
@@ -807,7 +816,7 @@ export const TextFieldContent = ({ theme }: TextFieldContentProps) => { > 비밀번호
- + 필수 입력 항목입니다.
@@ -828,7 +837,7 @@ export const TextFieldContent = ({ theme }: TextFieldContentProps) => {
{/* 왼쪽: State 라벨 + 뱃지 */}
- + State {

Text Area

-

+

여러 줄의 텍스트를 입력받는 필드입니다.

@@ -911,7 +920,7 @@ export const TextFieldContent = ({ theme }: TextFieldContentProps) => { {/* Input Area label */}
Input Area @@ -933,7 +942,7 @@ export const TextFieldContent = ({ theme }: TextFieldContentProps) => { {/* Placeholder label */}
Placeholder @@ -955,7 +964,7 @@ export const TextFieldContent = ({ theme }: TextFieldContentProps) => { {/* Character Counter label */}
Character Counter @@ -1042,7 +1051,7 @@ export const TextFieldContent = ({ theme }: TextFieldContentProps) => { }} > Container @@ -1075,7 +1084,7 @@ export const TextFieldContent = ({ theme }: TextFieldContentProps) => { style={{ width: '1px', height: '10px', backgroundColor: annotationColor }} /> Resize Handle @@ -1103,7 +1112,7 @@ export const TextFieldContent = ({ theme }: TextFieldContentProps) => { Container
-

+

텍스트 영역의 외곽 컨테이너입니다. 기본 높이 112px이며 사용자가 리사이즈할 수 있습니다.

@@ -1154,16 +1163,16 @@ export const TextFieldContent = ({ theme }: TextFieldContentProps) => {
-

+

height: 112px (default)

-

+

padding: 12px

-

+

border-radius: 6px

-

+

resize: vertical

@@ -1181,14 +1190,14 @@ export const TextFieldContent = ({ theme }: TextFieldContentProps) => { Placeholder
-

+

값이 입력되지 않았을 때 표시되는 안내 텍스트입니다.

{/* 플레이스홀더 있는 TextArea */}
- + 플레이스홀더 있음
{ {/* 빈 TextArea */}
- + 플레이스홀더 없음
{ Label
-

+

텍스트 영역의 용도를 설명하는 라벨입니다.

{/* 기본 라벨 */}
- + 내용
{ {/* 필수(*) 라벨 */}
- + 비고 *
{ Input Text
-

+

사용자가 입력한 여러 줄의 텍스트입니다.

@@ -1316,7 +1331,10 @@ export const TextFieldContent = ({ theme }: TextFieldContentProps) => { > {'오늘 점검 내용을 기록합니다.\n상세 내용은 아래와 같습니다.'}
-
+
font-size: 14px color: textPrimary line-height: 1.6 @@ -1335,14 +1353,14 @@ export const TextFieldContent = ({ theme }: TextFieldContentProps) => { Clear Icon
-

+

입력값 초기화 버튼입니다. 텍스트 영역 우상단에 표시됩니다.

{/* 텍스트 있는 상태 (Clear 표시) */}
- + 입력값 있음 (Clear 표시)
{ {/* 빈 상태 (Clear 미표시) */}
- + 입력값 없음 (Clear 미표시)
{ Helper Text
-

+

텍스트 영역 하단의 도움말 또는 에러 메시지입니다.

@@ -1434,10 +1452,10 @@ export const TextFieldContent = ({ theme }: TextFieldContentProps) => { 내용을 입력하세요
- + 상세 내용을 입력해 주세요 - + 0/500
@@ -1459,7 +1477,7 @@ export const TextFieldContent = ({ theme }: TextFieldContentProps) => { > 내용을 입력하세요
- + 필수 입력 항목입니다.
@@ -1480,7 +1498,7 @@ export const TextFieldContent = ({ theme }: TextFieldContentProps) => {
{/* 왼쪽: State 라벨 + 뱃지 */}
- + State {

Typography

-

+

WING-OPS 인터페이스에서 사용되는 타이포그래피 체계입니다. 폰트 패밀리, 크기, 두께를 토큰과 컴포넌트 클래스로 정의하여 시각적 계층 구조와 일관성을 유지합니다.

-

+

개요

  • @@ -337,7 +337,7 @@ export const TypographyContent = ({ theme }: TypographyContentProps) => {

    글꼴

    -

    +

    사용자의 디바이스 환경을 고려하여, 시스템 폰트와 웹 폰트를 조합하여 사용합니다. 한국어 UI에 최적화된 폰트 스택으로 다양한 기기에서 일관된 가독성을 보장합니다.

    @@ -352,7 +352,7 @@ export const TypographyContent = ({ theme }: TypographyContentProps) => { }} >
                 font-family
    @@ -390,7 +390,7 @@ export const TypographyContent = ({ theme }: TypographyContentProps) => {
                       
{ > {font.stack}
-

{font.usage}

+

{font.usage}

Regular @@ -421,7 +421,7 @@ export const TypographyContent = ({ theme }: TypographyContentProps) => {

타입 스케일

-

+

Display, Heading, Body, Navigation, Label의 5가지 용도 카테고리에 맞게 조합하여 사용합니다.

@@ -434,7 +434,7 @@ export const TypographyContent = ({ theme }: TypographyContentProps) => {

{category.name}

-

+

{category.description}

@@ -445,7 +445,7 @@ export const TypographyContent = ({ theme }: TypographyContentProps) => { style={{ border: `1px solid ${isDark ? 'rgba(66,71,84,0.20)' : '#e2e8f0'}` }} >
{ backgroundColor: isDark ? 'rgba(255,255,255,0.02)' : '#fafafa', }} > - + {row.token} - + {row.px} - + {row.weight} {`${(row.lineHeight * 100).toFixed(0)}%`} - + {row.letterSpacing} { >
{row.token} @@ -533,7 +536,7 @@ export const TypographyContent = ({ theme }: TypographyContentProps) => { {row.sample}
-
+
{row.role}
@@ -551,7 +554,7 @@ export const TypographyContent = ({ theme }: TypographyContentProps) => {

폰트 두께 토큰

-

+

기본 두께 Regular(400), 강조 Bold(700). Medium(500)은 레이블과 소제목, Thin(300)은 장식적 대형 텍스트에 사용합니다.

@@ -561,7 +564,7 @@ export const TypographyContent = ({ theme }: TypographyContentProps) => { style={{ border: `1px solid ${isDark ? 'rgba(66,71,84,0.20)' : '#e2e8f0'}` }} >
{ backgroundColor: isDark ? 'rgba(255,255,255,0.02)' : '#fafafa', }} > - + {row.token} - + {row.value} - + {row.name} {row.preview} @@ -632,7 +638,7 @@ export const TypographyContent = ({ theme }: TypographyContentProps) => {

줄 높이 토큰

-

+

대형 텍스트는 타이트하게(1.3), 본문은 여유롭게(1.6). 가독성과 공간 효율의 균형을 맞춥니다.

@@ -642,7 +648,7 @@ export const TypographyContent = ({ theme }: TypographyContentProps) => { style={{ border: `1px solid ${isDark ? 'rgba(66,71,84,0.20)' : '#e2e8f0'}` }} >
{ backgroundColor: isDark ? 'rgba(255,255,255,0.02)' : '#fafafa', }} > - + {row.token} - + {row.value} - + {row.pct} - + {row.desc}
@@ -700,7 +709,7 @@ export const TypographyContent = ({ theme }: TypographyContentProps) => {

자간 토큰

-

+

카테고리별로 자간을 정의합니다. Display는 넓게, Body는 기본값을 사용합니다.

@@ -709,7 +718,7 @@ export const TypographyContent = ({ theme }: TypographyContentProps) => { style={{ border: `1px solid ${isDark ? 'rgba(66,71,84,0.20)' : '#e2e8f0'}` }} >
{ backgroundColor: isDark ? 'rgba(255,255,255,0.02)' : '#fafafa', }} > - + {row.token} - + {row.value} { > {row.tw} - + {row.category}
diff --git a/frontend/src/pages/design/components/ButtonCatalogSection.tsx b/frontend/src/pages/design/components/ButtonCatalogSection.tsx index bd8fe8d..f4ef9e4 100644 --- a/frontend/src/pages/design/components/ButtonCatalogSection.tsx +++ b/frontend/src/pages/design/components/ButtonCatalogSection.tsx @@ -167,7 +167,7 @@ export const ButtonCatalogSection = () => {
제어 인터페이스: 버튼 @@ -185,7 +185,7 @@ export const ButtonCatalogSection = () => { className="pt-px pr-2 pb-[17.5px] pl-2 flex flex-col gap-0 items-start justify-start flex-1 min-w-0 relative" >
{header} @@ -207,7 +207,7 @@ export const ButtonCatalogSection = () => { > {/* 버튼 유형 레이블 */}
-
+
{row.label}
diff --git a/frontend/src/pages/design/components/CardSection.tsx b/frontend/src/pages/design/components/CardSection.tsx index 4d6118c..17d1627 100644 --- a/frontend/src/pages/design/components/CardSection.tsx +++ b/frontend/src/pages/design/components/CardSection.tsx @@ -129,7 +129,7 @@ export const CardSection = () => {
24.8
-
+
노트 (knots)
diff --git a/frontend/src/pages/design/components/IconBadgeSection.tsx b/frontend/src/pages/design/components/IconBadgeSection.tsx index 87c1953..bb947a9 100644 --- a/frontend/src/pages/design/components/IconBadgeSection.tsx +++ b/frontend/src/pages/design/components/IconBadgeSection.tsx @@ -61,7 +61,7 @@ export const IconBadgeSection = () => {
마이크로 컨트롤: 아이콘 버튼 @@ -113,7 +113,7 @@ export const IconBadgeSection = () => {
마이크로 컨트롤: 아이콘 버튼 diff --git a/frontend/src/pages/design/float/FloatDropdownContent.tsx b/frontend/src/pages/design/float/FloatDropdownContent.tsx index 9a3792e..2391c4d 100644 --- a/frontend/src/pages/design/float/FloatDropdownContent.tsx +++ b/frontend/src/pages/design/float/FloatDropdownContent.tsx @@ -36,10 +36,10 @@ export const FloatDropdownContent = ({ theme }: FloatDropdownContentProps) => {

Dropdown

-

+

트리거 요소에{' '} { 로 부착되는 선택 목록. 5개 이상의 선택지가 있는 단일 선택에 사용한다. 프로젝트 공통 컴포넌트는{' '} { >

- + 유출 유형 {
- + 예측 알고리즘 {
-

+

위 컴포넌트는{' '} @common/components/ui/ComboBox @@ -373,7 +373,7 @@ export const FloatDropdownContent = ({ theme }: FloatDropdownContentProps) => {

- + {row.desc}
@@ -423,10 +423,16 @@ export const FloatDropdownContent = ({ theme }: FloatDropdownContentProps) => { : t.cardBorder, }} > - + {item.title} - + {item.desc}
diff --git a/frontend/src/pages/design/float/FloatModalContent.tsx b/frontend/src/pages/design/float/FloatModalContent.tsx index 5eed471..0557b78 100644 --- a/frontend/src/pages/design/float/FloatModalContent.tsx +++ b/frontend/src/pages/design/float/FloatModalContent.tsx @@ -88,9 +88,9 @@ export const FloatModalContent = ({ theme }: FloatModalContentProps) => {

Modal

-

+

{ ))}

- + {SIZE_CONFIG[activeSize].desc}
@@ -166,7 +166,7 @@ export const FloatModalContent = ({ theme }: FloatModalContentProps) => {
@@ -480,7 +483,7 @@ export const FloatModalContent = ({ theme }: FloatModalContentProps) => { }} >
- + {item.component}
@@ -496,7 +499,7 @@ export const FloatModalContent = ({ theme }: FloatModalContentProps) => {
- + {item.trigger}
@@ -533,7 +536,10 @@ export const FloatModalContent = ({ theme }: FloatModalContentProps) => { className="flex items-center justify-between px-5 py-4 border-b border-solid shrink-0" style={{ borderColor: modalBorder }} > - + Modal Preview — {SIZE_CONFIG[activeSize].label} ({SIZE_CONFIG[activeSize].width})
-

+

이 모달은{' '} { className="rounded border border-solid px-3 py-2.5" style={{ borderColor: t.cardBorder }} > - + {label}

@@ -582,7 +588,7 @@ export const FloatModalContent = ({ theme }: FloatModalContentProps) => {
-

+

삭제된 데이터는 복구할 수 없습니다. 계속 진행하시겠습니까?

@@ -641,7 +650,7 @@ export const FloatModalContent = ({ theme }: FloatModalContentProps) => {
- + {row.overlay}
- + {row.modal}
@@ -284,7 +284,7 @@ export const FloatOverlayContent = ({ theme }: FloatOverlayContentProps) => { className="rounded-lg border border-solid p-5 flex flex-col gap-4" style={{ backgroundColor: t.cardBg, borderColor: t.cardBorder }} > -

+

ScatPopup은 지도 마커에 앵커된 컨텍스트 팝업이다. Modal(fixed 뷰포트 중앙)과 달리 마커 위치에서 동적으로 좌표를 계산하며, 지도 패닝·줌 시 위치가 함께 업데이트된다. @@ -307,7 +307,7 @@ export const FloatOverlayContent = ({ theme }: FloatOverlayContentProps) => { {item.label} - + {item.value} @@ -323,7 +323,7 @@ export const FloatOverlayContent = ({ theme }: FloatOverlayContentProps) => { borderColor: 'rgba(234,179,8,0.25)', }} > - + 주의: ScatPopup은 MapLibre GL JS의 Popup/Marker 컴포넌트가 아닌 React DOM으로 구현됨. 지도 컨테이너 내부에 position: absolute로 렌더링된다. @@ -377,7 +377,7 @@ export const FloatOverlayContent = ({ theme }: FloatOverlayContentProps) => { }} >

- + {item.component}
@@ -413,7 +413,10 @@ export const FloatOverlayContent = ({ theme }: FloatOverlayContentProps) => {
- + {item.desc}
diff --git a/frontend/src/pages/design/float/FloatToastContent.tsx b/frontend/src/pages/design/float/FloatToastContent.tsx index 05aea63..1f14fb1 100644 --- a/frontend/src/pages/design/float/FloatToastContent.tsx +++ b/frontend/src/pages/design/float/FloatToastContent.tsx @@ -84,10 +84,10 @@ export const FloatToastContent = ({ theme }: FloatToastContentProps) => { 미구현 — 설계 사양
-

+

화면을 차단하지 않는 비파괴적 알림. { 에 위치하며 일정 시간 후 자동으로 사라진다. 현재 프로젝트에서는{' '} { className="rounded-lg border border-solid p-5 flex flex-col gap-4" style={{ backgroundColor: t.cardBg, borderColor: t.cardBorder }} > -

+

버튼 클릭 시 화면 우하단에 Toast가 표시됩니다. 3초 후 자동으로 사라집니다.

@@ -280,7 +280,7 @@ export const FloatToastContent = ({ theme }: FloatToastContentProps) => { {cfg.icon} - + {cfg.label}
@@ -311,7 +311,7 @@ export const FloatToastContent = ({ theme }: FloatToastContentProps) => { className="rounded-lg border border-solid p-5 flex flex-col gap-4" style={{ backgroundColor: t.cardBg, borderColor: t.cardBorder }} > -

+

Toast는 앱 어디서든 호출해야 하므로 Zustand store + useToast hook{' '} 패턴을 권장한다. ToastContainer는 App.tsx 최상위에 한 번만 렌더링한다.

@@ -387,7 +387,7 @@ export const FloatToastContent = ({ theme }: FloatToastContentProps) => { {cfg.icon} - + {toast.message} @@ -162,7 +162,7 @@ export default function BoardMgmtPanel({ initialCategory = '' }: BoardMgmtPanelP @@ -170,7 +170,7 @@ export default function BoardMgmtPanel({ initialCategory = '' }: BoardMgmtPanelP {/* 테이블 */}
- +
diff --git a/frontend/src/tabs/admin/components/CollectHrPanel.tsx b/frontend/src/tabs/admin/components/CollectHrPanel.tsx index b943d1d..5cd324e 100644 --- a/frontend/src/tabs/admin/components/CollectHrPanel.tsx +++ b/frontend/src/tabs/admin/components/CollectHrPanel.tsx @@ -211,7 +211,7 @@ const HEADERS = [ function HrTable({ rows, loading }: { rows: HrCollectItem[]; loading: boolean }) { return (
-
@@ -222,7 +222,7 @@ export default function BoardMgmtPanel({ initialCategory = '' }: BoardMgmtPanelP @@ -234,7 +234,7 @@ export default function BoardMgmtPanel({ initialCategory = '' }: BoardMgmtPanelP diff --git a/frontend/src/tabs/admin/components/CleanupEquipPanel.tsx b/frontend/src/tabs/admin/components/CleanupEquipPanel.tsx index ba1793a..0f60686 100644 --- a/frontend/src/tabs/admin/components/CleanupEquipPanel.tsx +++ b/frontend/src/tabs/admin/components/CleanupEquipPanel.tsx @@ -99,13 +99,15 @@ function CleanupEquipPanel() {

방제장비 현황

-

총 {filtered.length}개 기관

+

+ 총 {filtered.length}개 기관 +

{typeOptions.map((t) => ( @@ -129,7 +131,7 @@ function CleanupEquipPanel() {
조회된 기관이 없습니다.
+
{HEADERS.map((h) => ( @@ -317,10 +317,10 @@ export default function CollectHrPanel() {
{/* 헤더 */}
-

인사정보 수집 현황

+

인사정보 수집 현황

{lastUpdate && ( - + 갱신:{' '} {lastUpdate.toLocaleTimeString('ko-KR', { hour: '2-digit', @@ -332,7 +332,7 @@ export default function CollectHrPanel() {
diff --git a/frontend/src/tabs/admin/components/DispersingZonePanel.tsx b/frontend/src/tabs/admin/components/DispersingZonePanel.tsx index 4f07252..884bd7b 100644 --- a/frontend/src/tabs/admin/components/DispersingZonePanel.tsx +++ b/frontend/src/tabs/admin/components/DispersingZonePanel.tsx @@ -130,7 +130,9 @@ const DispersingZonePanel = () => { onClick={() => handleToggleExpand(zone)} > - {info.label} + + {info.label} + {/* 토글 스위치 */} @@ -487,7 +487,7 @@ const LayerPanel = () => { {/* 오류 메시지 */} {error && ( -
+
{error}
)} @@ -495,7 +495,7 @@ const LayerPanel = () => { {/* 테이블 영역 */}
{loading ? ( -
+
불러오는 중...
) : ( @@ -539,7 +539,7 @@ const LayerPanel = () => {
@@ -551,15 +551,15 @@ const LayerPanel = () => { className="border-b border-stroke hover:bg-[rgba(255,255,255,0.02)] transition-colors" > {/* 번호 */} - {/* 레이어코드 */} {/* 레이어명 */} - + {/* 레이어전체명 */} - {/* 정렬순서 */} - {/* 등록일시 */} @@ -614,13 +614,13 @@ const LayerPanel = () => {
diff --git a/frontend/src/tabs/admin/components/MapBasePanel.tsx b/frontend/src/tabs/admin/components/MapBasePanel.tsx index 50efd74..539f26f 100644 --- a/frontend/src/tabs/admin/components/MapBasePanel.tsx +++ b/frontend/src/tabs/admin/components/MapBasePanel.tsx @@ -78,7 +78,7 @@ function MapBaseModal({
{/* 모달 헤더 */}
-

+

{isEdit ? '지도 수정' : '지도 등록'}

@@ -123,7 +123,7 @@ function MapBaseModal({ onChange={(e) => setField('mapKey', e.target.value)} placeholder="고유 식별 키 (영문/숫자)" disabled={isEdit} - className="w-full px-3 py-2 text-xs bg-bg-elevated border border-stroke rounded-md text-fg placeholder-fg-disabled focus:border-color-accent focus:outline-none font-mono disabled:opacity-50 disabled:cursor-not-allowed" + className="w-full px-3 py-2 text-caption bg-bg-elevated border border-stroke rounded-md text-fg placeholder-fg-disabled focus:border-color-accent focus:outline-none font-mono disabled:opacity-50 disabled:cursor-not-allowed" />
@@ -135,7 +135,7 @@ function MapBaseModal({
데이터가 없습니다. + {(page - 1) * PAGE_SIZE + idx + 1} {item.layerCd}{item.layerNm}{item.layerNm} + {item.layerFullNm} @@ -575,7 +575,7 @@ const LayerPanel = () => { {item.wmsLayerNm ?? -} + {item.sortOrd}
+
@@ -433,7 +433,7 @@ function MapBasePanel() {
번호 @@ -441,7 +441,7 @@ function MapBasePanel() { @@ -452,7 +452,7 @@ function MapBasePanel() {
{!loading && items.length === 0 && ( -
+
등록된 지도가 없습니다.
)} @@ -464,7 +464,7 @@ function MapBasePanel() { @@ -476,7 +476,7 @@ function MapBasePanel() { diff --git a/frontend/src/tabs/admin/components/MenusPanel.tsx b/frontend/src/tabs/admin/components/MenusPanel.tsx index dc9786c..d9e603b 100644 --- a/frontend/src/tabs/admin/components/MenusPanel.tsx +++ b/frontend/src/tabs/admin/components/MenusPanel.tsx @@ -124,7 +124,7 @@ function MenusPanel() { if (loading) { return (
-
메뉴 설정을 불러오는 중...
+
메뉴 설정을 불러오는 중...
); } @@ -136,14 +136,14 @@ function MenusPanel() {

메뉴 관리

-

+

메뉴 표시 여부, 순서, 라벨, 아이콘을 관리합니다

@@ -815,7 +815,7 @@ function UserPermTab({ roles, permTree, rolePerms }: UserPermTabProps) { onFocus={() => setShowDropdown(true)} placeholder={loadingUsers ? '불러오는 중...' : '이름, 계정, 조직으로 검색...'} disabled={loadingUsers} - className="w-full max-w-sm px-3 py-2 text-xs bg-bg-elevated border border-stroke rounded-md text-fg placeholder-fg-disabled focus:border-color-accent focus:outline-none font-korean disabled:opacity-50" + className="w-full max-w-sm px-3 py-2 text-caption bg-bg-elevated border border-stroke rounded-md text-fg placeholder-fg-disabled focus:border-color-accent focus:outline-none font-korean disabled:opacity-50" /> {showDropdown && filteredUsers.length > 0 && (
@@ -826,7 +826,7 @@ function UserPermTab({ roles, permTree, rolePerms }: UserPermTabProps) { className="w-full px-3 py-2 text-left hover:bg-bg-surface-hover transition-colors flex items-center gap-2" >
-
+
{user.name} {user.rank && ( @@ -848,7 +848,7 @@ function UserPermTab({ roles, permTree, rolePerms }: UserPermTabProps) {
)} {showDropdown && !loadingUsers && filteredUsers.length === 0 && searchQuery && ( -
+
검색 결과 없음
)} @@ -954,13 +954,13 @@ function UserPermTab({ roles, permTree, rolePerms }: UserPermTabProps) {
) : ( -
+
역할을 하나 이상 할당하면 유효 권한이 표시됩니다
)} ) : ( -
+
사용자를 선택하세요
)} @@ -1180,7 +1180,7 @@ function PermissionsPanel() { if (loading) { return ( -
+
불러오는 중...
); @@ -1194,7 +1194,7 @@ function PermissionsPanel() { style={{ flexShrink: 0 }} >
-

권한 관리

+

권한 관리

역할별 리소스 × CRUD 권한 설정

@@ -1203,7 +1203,7 @@ function PermissionsPanel() {
@@ -168,7 +168,7 @@ const SensitiveLayerPanel = ({ categoryCode, title }: SensitiveLayerPanelProps) {/* 오류 메시지 */} {error && ( -
+
{error}
)} @@ -176,7 +176,7 @@ const SensitiveLayerPanel = ({ categoryCode, title }: SensitiveLayerPanelProps) {/* 테이블 영역 */}
{loading ? ( -
+
불러오는 중...
) : ( @@ -217,7 +217,7 @@ const SensitiveLayerPanel = ({ categoryCode, title }: SensitiveLayerPanelProps) 데이터가 없습니다. @@ -228,12 +228,12 @@ const SensitiveLayerPanel = ({ categoryCode, title }: SensitiveLayerPanelProps) key={item.layerCd} className="border-b border-stroke hover:bg-[rgba(255,255,255,0.02)] transition-colors" > - + {(page - 1) * PAGE_SIZE + idx + 1} {item.layerCd} - {item.layerNm} - + {item.layerNm} + {item.layerFullNm} @@ -246,7 +246,7 @@ const SensitiveLayerPanel = ({ categoryCode, title }: SensitiveLayerPanelProps) {item.wmsLayerNm ?? -} - + {item.sortOrd} diff --git a/frontend/src/tabs/admin/components/SettingsPanel.tsx b/frontend/src/tabs/admin/components/SettingsPanel.tsx index bd09b68..36e8923 100644 --- a/frontend/src/tabs/admin/components/SettingsPanel.tsx +++ b/frontend/src/tabs/admin/components/SettingsPanel.tsx @@ -54,7 +54,7 @@ function SettingsPanel() { if (loading) { return ( -
+
불러오는 중...
); @@ -64,7 +64,7 @@ function SettingsPanel() {

시스템 설정

-

+

사용자 등록 및 권한 관련 시스템 설정을 관리합니다

@@ -74,7 +74,7 @@ function SettingsPanel() { {/* 사용자 등록 설정 */}
-

사용자 등록 설정

+

사용자 등록 설정

신규 사용자 등록 시 적용되는 정책을 설정합니다

@@ -140,7 +140,7 @@ function SettingsPanel() { {/* OAuth 설정 */}
-

Google OAuth 설정

+

Google OAuth 설정

Google 계정 로그인 시 자동 승인할 이메일 도메인을 설정합니다

@@ -162,7 +162,7 @@ function SettingsPanel() { value={oauthDomainInput} onChange={(e) => setOauthDomainInput(e.target.value)} placeholder="gcsc.co.kr, example.com" - className="flex-1 px-3 py-2 text-xs bg-bg-elevated border border-stroke rounded-md text-fg placeholder-fg-disabled focus:border-color-accent focus:outline-none font-mono" + className="flex-1 px-3 py-2 text-caption bg-bg-elevated border border-stroke rounded-md text-fg placeholder-fg-disabled focus:border-color-accent focus:outline-none font-mono" /> - + {idx + 1} {isEditing ? ( @@ -152,14 +152,14 @@ function SortableMenuItem({ diff --git a/frontend/src/tabs/admin/components/UsersPanel.tsx b/frontend/src/tabs/admin/components/UsersPanel.tsx index a3bb490..5a57d34 100644 --- a/frontend/src/tabs/admin/components/UsersPanel.tsx +++ b/frontend/src/tabs/admin/components/UsersPanel.tsx @@ -87,7 +87,7 @@ function RegisterModal({ allRoles, allOrgs, onClose, onSuccess }: RegisterModalP
{/* 헤더 */}
-

사용자 등록

+

사용자 등록

@@ -129,7 +129,7 @@ function RegisterModal({ allRoles, allOrgs, onClose, onSuccess }: RegisterModalP value={password} onChange={(e) => setPassword(e.target.value)} placeholder="초기 비밀번호" - className="w-full px-3 py-2 text-xs bg-bg-elevated border border-stroke rounded-md text-fg placeholder-fg-disabled focus:border-color-accent focus:outline-none font-mono" + className="w-full px-3 py-2 text-caption bg-bg-elevated border border-stroke rounded-md text-fg placeholder-fg-disabled focus:border-color-accent focus:outline-none font-mono" />
@@ -143,7 +143,7 @@ function RegisterModal({ allRoles, allOrgs, onClose, onSuccess }: RegisterModalP value={name} onChange={(e) => setName(e.target.value)} placeholder="실명" - className="w-full px-3 py-2 text-xs bg-bg-elevated border border-stroke rounded-md text-fg placeholder-fg-disabled focus:border-color-accent focus:outline-none font-korean" + className="w-full px-3 py-2 text-caption bg-bg-elevated border border-stroke rounded-md text-fg placeholder-fg-disabled focus:border-color-accent focus:outline-none font-korean" />
@@ -157,7 +157,7 @@ function RegisterModal({ allRoles, allOrgs, onClose, onSuccess }: RegisterModalP value={rank} onChange={(e) => setRank(e.target.value)} placeholder="예: 팀장, 주임 등" - className="w-full px-3 py-2 text-xs bg-bg-elevated border border-stroke rounded-md text-fg placeholder-fg-disabled focus:border-color-accent focus:outline-none font-korean" + className="w-full px-3 py-2 text-caption bg-bg-elevated border border-stroke rounded-md text-fg placeholder-fg-disabled focus:border-color-accent focus:outline-none font-korean" />
@@ -169,7 +169,7 @@ function RegisterModal({ allRoles, allOrgs, onClose, onSuccess }: RegisterModalP setOrgSn(e.target.value !== '' ? Number(e.target.value) : '')} - className="w-full px-3 py-1.5 text-xs bg-bg-elevated border border-stroke rounded-md text-fg focus:border-color-accent focus:outline-none font-korean" + className="w-full px-3 py-1.5 text-caption bg-bg-elevated border border-stroke rounded-md text-fg focus:border-color-accent focus:outline-none font-korean" > {allOrgs.map((org) => ( @@ -427,7 +427,7 @@ function UserDetailModal({ user, allOrgs, onClose, onUpdated }: UserDetailModalP value={newPassword} onChange={(e) => setNewPassword(e.target.value)} placeholder="새 비밀번호 입력" - className="w-full px-3 py-1.5 text-xs bg-bg-elevated border border-stroke rounded-md text-fg placeholder-fg-disabled focus:border-color-accent focus:outline-none font-mono" + className="w-full px-3 py-1.5 text-caption bg-bg-elevated border border-stroke rounded-md text-fg placeholder-fg-disabled focus:border-color-accent focus:outline-none font-mono" />
@@ -680,7 +680,7 @@ function UsersPanel() {

사용자 관리

-

+

총 {filteredUsers.length}명

@@ -698,7 +698,7 @@ function UsersPanel() { setOrgFilter(e.target.value); setCurrentPage(1); }} - className="px-3 py-2 text-xs bg-bg-elevated border border-stroke rounded-md text-fg focus:border-color-accent focus:outline-none font-korean" + className="px-3 py-2 text-caption bg-bg-elevated border border-stroke rounded-md text-fg focus:border-color-accent focus:outline-none font-korean" > {allOrgs.map((org) => ( @@ -711,7 +711,7 @@ function UsersPanel() { @@ -110,7 +110,7 @@ function VesselMaterialsPanel() { setDate(e.target.value)} - className="px-2 py-1 text-xs rounded bg-bg-elevated border border-stroke-1 text-fg" + className="px-2 py-1 text-caption rounded bg-bg-elevated border border-stroke-1 text-fg" /> @@ -163,7 +163,7 @@ export default function VesselSignalPanel() {
{loading ? (
- 로딩 중... + 로딩 중...
) : (
diff --git a/frontend/src/tabs/aerial/components/CctvView.tsx b/frontend/src/tabs/aerial/components/CctvView.tsx index 93ec81e..1cb1474 100644 --- a/frontend/src/tabs/aerial/components/CctvView.tsx +++ b/frontend/src/tabs/aerial/components/CctvView.tsx @@ -589,7 +589,7 @@ export function CctvView() { {/* 헤더 */}
-
+
-
+
{selectedCamera ? `📹 ${selectedCamera.cameraNm}` : '📹 카메라를 선택하세요'}
{selectedCamera?.sttsCd === 'LIVE' && ( @@ -966,7 +966,7 @@ export function CctvView() {
{/* 출처 헤더 */}
- {group.icon} + {group.icon} {group.label} diff --git a/frontend/src/tabs/aerial/components/MediaManagement.tsx b/frontend/src/tabs/aerial/components/MediaManagement.tsx index 1fa4469..b5f281c 100644 --- a/frontend/src/tabs/aerial/components/MediaManagement.tsx +++ b/frontend/src/tabs/aerial/components/MediaManagement.tsx @@ -421,7 +421,7 @@ export function MediaManagement() {
📥
-
다운로드 완료
+
다운로드 완료
{downloadResult.total}건 선택
@@ -441,7 +441,7 @@ export function MediaManagement() {
@@ -475,7 +475,7 @@ export function MediaManagement() {
-
-
-