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/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/docs/RELEASE-NOTES.md b/docs/RELEASE-NOTES.md index 5c127bb..7415bfa 100644 --- a/docs/RELEASE-NOTES.md +++ b/docs/RELEASE-NOTES.md @@ -4,6 +4,16 @@ ## [Unreleased] +## [2026-04-14] + +### 추가 +- 디자인 시스템: HNS·사건사고·확산예측·SCAT·기상 탭 디자인 시스템 토큰 전면 적용 +- 관리자: 비식별화조치 메뉴 및 패널 추가 +- 긴급구난/예측도 OSM 지도 적용 및 관리자 패널 추가 + +### 변경 +- 디자인 시스템: 폰트 업스케일 토큰 값 변경 및 전체 탭 색상·폰트 통일 + ## [2026-04-13] ### 추가 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/DeidentifyPanel.tsx b/frontend/src/tabs/admin/components/DeidentifyPanel.tsx new file mode 100644 index 0000000..e5a579f --- /dev/null +++ b/frontend/src/tabs/admin/components/DeidentifyPanel.tsx @@ -0,0 +1,1241 @@ +import { useState, useEffect, useCallback } from 'react'; + +// ─── 타입 ────────────────────────────────────────────────── + +type TaskStatus = '완료' | '진행중' | '대기' | '오류'; + +interface AuditLogEntry { + id: string; + time: string; + operator: string; + operatorId: string; + action: string; + targetData: string; + result: string; + resultType: '성공' | '실패' | '거부' | '진행중'; + ip: string; + browser: string; + detail: { + dataCount: number; + rulesApplied: string; + processedCount: number; + errorCount: number; + }; +} + +interface DeidentifyTask { + id: string; + name: string; + target: string; + status: TaskStatus; + startTime: string; + progress: number; + createdBy: string; +} + +type SourceType = 'db' | 'file' | 'api'; +type ProcessMode = 'immediate' | 'scheduled' | 'oneshot'; +type RepeatType = 'daily' | 'weekly' | 'monthly'; +type DeidentifyTechnique = + | '마스킹' + | '삭제' + | '범주화' + | '암호화' + | '샘플링' + | '가명처리' + | '유지'; + +interface FieldConfig { + name: string; + dataType: string; + technique: DeidentifyTechnique; + configValue: string; + selected: boolean; +} + +interface DbConfig { + host: string; + port: string; + database: string; + tableName: string; +} + +interface ApiConfig { + url: string; + method: 'GET' | 'POST'; +} + +interface ScheduleConfig { + hour: string; + repeatType: RepeatType; + weekday: string; + startDate: string; + notifyOnComplete: boolean; + notifyOnError: boolean; +} + +interface OneshotConfig { + date: string; + hour: string; +} + +interface WizardState { + step: number; + taskName: string; + sourceType: SourceType; + dbConfig: DbConfig; + apiConfig: ApiConfig; + fields: FieldConfig[]; + processMode: ProcessMode; + scheduleConfig: ScheduleConfig; + oneshotConfig: OneshotConfig; + saveAsTemplate: boolean; + applyTemplate: string; + confirmed: boolean; +} + +// ─── Mock 데이터 ──────────────────────────────────────────── + +const MOCK_TASKS: DeidentifyTask[] = [ + { id: '001', name: 'customer_2024', target: '선박/운항 - 선장·선원 성명', status: '완료', startTime: '2026-04-10 14:30', progress: 100, createdBy: '관리자' }, + { id: '002', name: 'transaction_04', target: '사고 현장 - 현장사진, 영상내 인물', status: '진행중', startTime: '2026-04-10 14:15', progress: 82, createdBy: '김담당' }, + { id: '003', name: 'employee_info', target: '인사정보 - 계정, 로그인 정보', status: '대기', startTime: '2026-04-10 22:00', progress: 0, createdBy: '이담당' }, + { id: '004', name: 'vendor_data', target: 'HNS 대응 - 화학물질 취급자, 방제업체 연락처', status: '오류', startTime: '2026-04-09 13:45', progress: 45, createdBy: '관리자' }, + { id: '005', name: 'partner_contacts', target: '시스템 운영 - 관리자, 운영자 접속로그', status: '완료', startTime: '2026-04-08 09:00', progress: 100, createdBy: '박담당' }, +]; + +const DEFAULT_FIELDS: FieldConfig[] = [ + { name: '고객ID', dataType: '문자열', technique: '삭제', configValue: '-', selected: true }, + { name: '이름', dataType: '문자열', technique: '마스킹', configValue: '*로 치환', selected: true }, + { name: '휴대폰', dataType: '문자열', technique: '마스킹', configValue: '010-****-****', selected: true }, + { name: '주소', dataType: '문자열', technique: '범주화', configValue: '시/도만 표시', selected: true }, + { name: '이메일', dataType: '문자열', technique: '가명처리', configValue: '키: random_001', selected: true }, + { name: '생년월일', dataType: '날짜', technique: '범주화', configValue: '연도만 표시', selected: true }, + { name: '회사', dataType: '문자열', technique: '유지', configValue: '변경 없음', selected: true }, +]; + +const TECHNIQUES: DeidentifyTechnique[] = ['마스킹', '삭제', '범주화', '암호화', '샘플링', '가명처리', '유지']; + +const HOURS = Array.from({ length: 24 }, (_, i) => `${String(i).padStart(2, '0')}:00`); + +const WEEKDAYS = ['월', '화', '수', '목', '금', '토', '일']; + +const TEMPLATES = ['기본 개인정보', '금융데이터', '의료데이터']; + +const MOCK_AUDIT_LOGS: Record = { + '001': [ + { id: 'LOG_20260410_001', time: '2026-04-10 14:30:45', operator: '김철수', operatorId: 'user_12345', action: '처리완료', targetData: 'customer_2024', result: '성공 (100%)', resultType: '성공', ip: '192.168.1.100', browser: 'Chrome 123.0', detail: { dataCount: 15240, rulesApplied: '마스킹 3, 범주화 2, 삭제 2', processedCount: 15240, errorCount: 0 } }, + { id: 'LOG_20260410_002', time: '2026-04-10 14:15:10', operator: '김철수', operatorId: 'user_12345', action: '처리시작', targetData: 'customer_2024', result: '성공', resultType: '성공', ip: '192.168.1.100', browser: 'Chrome 123.0', detail: { dataCount: 15240, rulesApplied: '마스킹 3, 범주화 2, 삭제 2', processedCount: 0, errorCount: 0 } }, + { id: 'LOG_20260410_003', time: '2026-04-10 14:10:30', operator: '김철수', operatorId: 'user_12345', action: '규칙설정', targetData: 'customer_2024', result: '성공', resultType: '성공', ip: '192.168.1.100', browser: 'Chrome 123.0', detail: { dataCount: 15240, rulesApplied: '7개 규칙 적용', processedCount: 0, errorCount: 0 } }, + ], + '002': [ + { id: 'LOG_20260410_004', time: '2026-04-10 14:15:22', operator: '이영희', operatorId: 'user_23456', action: '처리시작', targetData: 'transaction_04', result: '진행중 (82%)', resultType: '진행중', ip: '192.168.1.101', browser: 'Firefox 124.0', detail: { dataCount: 8920, rulesApplied: '마스킹 2, 암호화 1, 삭제 3', processedCount: 7314, errorCount: 0 } }, + ], + '003': [ + { id: 'LOG_20260410_005', time: '2026-04-10 13:45:30', operator: '박민준', operatorId: 'user_34567', action: '규칙수정', targetData: 'employee_info', result: '성공', resultType: '성공', ip: '192.168.1.102', browser: 'Chrome 123.0', detail: { dataCount: 3200, rulesApplied: '마스킹 4, 가명처리 1', processedCount: 0, errorCount: 0 } }, + ], + '004': [ + { id: 'LOG_20260409_001', time: '2026-04-09 13:45:30', operator: '관리자', operatorId: 'user_admin', action: '처리오류', targetData: 'vendor_data', result: '오류 (45%)', resultType: '실패', ip: '192.168.1.100', browser: 'Chrome 123.0', detail: { dataCount: 5100, rulesApplied: '마스킹 2, 범주화 1, 삭제 1', processedCount: 2295, errorCount: 12 } }, + { id: 'LOG_20260409_002', time: '2026-04-09 13:40:15', operator: '김철수', operatorId: 'user_12345', action: '규칙조회', targetData: 'vendor_data', result: '성공', resultType: '성공', ip: '192.168.1.100', browser: 'Chrome 123.0', detail: { dataCount: 5100, rulesApplied: '4개 규칙', processedCount: 0, errorCount: 0 } }, + { id: 'LOG_20260409_003', time: '2026-04-09 09:25:00', operator: '이영희', operatorId: 'user_23456', action: '삭제시도', targetData: 'vendor_data', result: '거부 (권한부족)', resultType: '거부', ip: '192.168.1.101', browser: 'Firefox 124.0', detail: { dataCount: 5100, rulesApplied: '-', processedCount: 0, errorCount: 0 } }, + ], + '005': [ + { id: 'LOG_20260408_001', time: '2026-04-08 09:15:00', operator: '박담당', operatorId: 'user_45678', action: '처리완료', targetData: 'partner_contacts', result: '성공 (100%)', resultType: '성공', ip: '192.168.1.103', browser: 'Edge 122.0', detail: { dataCount: 1850, rulesApplied: '마스킹 2, 유지 3', processedCount: 1850, errorCount: 0 } }, + ], +}; + +function fetchTasks(): Promise { + return new Promise((resolve) => { + setTimeout(() => resolve(MOCK_TASKS), 300); + }); +} + +// ─── 상태 뱃지 ───────────────────────────────────────────── + +function getStatusBadgeClass(status: TaskStatus): string { + switch (status) { + case '완료': return 'text-emerald-400 bg-emerald-500/10'; + case '진행중': return 'text-cyan-400 bg-cyan-500/10'; + case '대기': return 'text-yellow-400 bg-yellow-500/10'; + case '오류': return 'text-red-400 bg-red-500/10'; + } +} + +// ─── 진행률 바 ───────────────────────────────────────────── + +function ProgressBar({ value }: { value: number }) { + const colorClass = + value === 100 ? 'bg-emerald-500' : value > 0 ? 'bg-cyan-500' : 'bg-bg-elevated'; + return ( +
+
+
+
+ {value}% +
+ ); +} + +// ─── 작업 테이블 ──────────────────────────────────────────── + +const TABLE_HEADERS = ['작업ID', '작업명', '대상', '상태', '시작시간', '진행률', '등록자', '액션']; + +interface TaskTableProps { + rows: DeidentifyTask[]; + loading: boolean; + onAction: (action: string, task: DeidentifyTask) => void; +} + +function TaskTable({ rows, loading, onAction }: TaskTableProps) { + return ( +
+
+ + + {TABLE_HEADERS.map((h) => ( + + ))} + + + + {loading && rows.length === 0 + ? Array.from({ length: 5 }).map((_, i) => ( + + {TABLE_HEADERS.map((_, j) => ( + + ))} + + )) + : rows.map((row) => ( + + + + + + + + + + + ))} + +
+ {h} +
+
+
{row.id}{row.name}{row.target} + + {row.status} + + {row.startTime} + + {row.createdBy} +
+ + + + + +
+
+
+ ); +} + +// ─── 마법사: 단계 표시기 ──────────────────────────────────── + +const STEP_LABELS = ['소스선택', '데이터검증', '비식별화규칙', '처리방식', '최종확인']; + +function StepIndicator({ current }: { current: number }) { + return ( +
+ {STEP_LABELS.map((label, i) => { + const stepNum = i + 1; + const isDone = stepNum < current; + const isActive = stepNum === current; + return ( +
+
+
+ {isDone ? ( + + + + ) : ( + stepNum + )} +
+ + {stepNum}.{label} + +
+ {i < STEP_LABELS.length - 1 && ( +
+ )} +
+ ); + })} +
+ ); +} + +// ─── 마법사: Step 1 ───────────────────────────────────────── + +interface Step1Props { + wizard: WizardState; + onChange: (patch: Partial) => void; +} + +function Step1({ wizard, onChange }: Step1Props) { + const handleDbChange = (key: keyof DbConfig, value: string) => { + onChange({ dbConfig: { ...wizard.dbConfig, [key]: value } }); + }; + const handleApiChange = (key: keyof ApiConfig, value: string) => { + onChange({ apiConfig: { ...wizard.apiConfig, [key]: value } }); + }; + + return ( +
+
+ + onChange({ taskName: e.target.value })} + placeholder="작업 이름을 입력하세요" + className="w-full px-3 py-2 text-xs rounded bg-bg-elevated border border-stroke-1 text-t1 placeholder:text-t3 focus:outline-none focus:border-cyan-500" + /> +
+ +
+ +
+ {([ + ['db', '데이터베이스 연결'], + ['file', '파일 업로드'], + ['api', 'API 호출'], + ] as [SourceType, string][]).map(([val, label]) => ( + + ))} +
+
+ + {wizard.sourceType === 'db' && ( +
+ {( + [ + ['host', '호스트', 'localhost'], + ['port', '포트', '5432'], + ['database', '데이터베이스', 'wing'], + ['tableName', '테이블명', 'public.customers'], + ] as [keyof DbConfig, string, string][] + ).map(([key, labelText, placeholder]) => ( +
+ + handleDbChange(key, e.target.value)} + placeholder={placeholder} + className="w-full 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" + /> +
+ ))} +
+ )} + + {wizard.sourceType === 'file' && ( +
+ + + +

파일을 드래그하거나 클릭하여 업로드

+

CSV, XLSX, JSON 지원 (최대 500MB)

+
+ )} + + {wizard.sourceType === 'api' && ( +
+
+ + handleApiChange('url', e.target.value)} + placeholder="https://api.example.com/data" + className="w-full 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" + /> +
+
+ + +
+
+ )} +
+ ); +} + +// ─── 마법사: Step 2 ───────────────────────────────────────── + +interface Step2Props { + wizard: WizardState; + onChange: (patch: Partial) => void; +} + +function Step2({ wizard, onChange }: Step2Props) { + const toggleField = (idx: number) => { + const updated = wizard.fields.map((f, i) => + i === idx ? { ...f, selected: !f.selected } : f, + ); + onChange({ fields: updated }); + }; + + return ( +
+
+ {[ + { label: '총 데이터 건수', value: '15,240건', color: 'text-t1' }, + { label: '중복', value: '0건', color: 'text-emerald-400' }, + { label: '누락값', value: '23건', color: 'text-yellow-400' }, + ].map((stat) => ( +
+

{stat.label}

+

{stat.value}

+
+ ))} +
+ +
+

스키마 분석 결과 — 포함 필드 선택

+
+ + + + + + + + + + {wizard.fields.map((field, idx) => ( + + + + + + ))} + +
+ f.selected)} + onChange={(e) => + onChange({ fields: wizard.fields.map((f) => ({ ...f, selected: e.target.checked })) }) + } + className="accent-cyan-500" + /> + 필드명데이터 타입
+ toggleField(idx)} + className="accent-cyan-500" + /> + {field.name}{field.dataType}
+
+

+ {wizard.fields.filter((f) => f.selected).length}개 선택됨 (전체 {wizard.fields.length}개) +

+
+
+ ); +} + +// ─── 마법사: Step 3 ───────────────────────────────────────── + +interface Step3Props { + wizard: WizardState; + onChange: (patch: Partial) => void; +} + +function Step3({ wizard, onChange }: Step3Props) { + const updateField = (idx: number, key: keyof FieldConfig, value: string | boolean) => { + const updated = wizard.fields.map((f, i) => + i === idx ? { ...f, [key]: value } : f, + ); + onChange({ fields: updated }); + }; + + const selectedFields = wizard.fields.filter((f) => f.selected); + + return ( +
+
+ + + + + + + + + + + {selectedFields.map((field) => { + const globalIdx = wizard.fields.findIndex((f) => f.name === field.name); + return ( + + + + + + + ); + })} + +
필드명데이터타입선택된 기법설정값
{field.name}{field.dataType} + + + updateField(globalIdx, 'configValue', e.target.value)} + className="w-full px-2 py-1 text-xs rounded bg-bg-elevated border border-stroke-1 text-t1 focus:outline-none focus:border-cyan-500" + /> +
+
+ +
+ + +
+ 이전 템플릿 적용: + +
+
+
+ ); +} + +// ─── 마법사: Step 4 ───────────────────────────────────────── + +interface Step4Props { + wizard: WizardState; + onChange: (patch: Partial) => void; +} + +function Step4({ wizard, onChange }: Step4Props) { + const handleScheduleChange = (key: keyof ScheduleConfig, value: string | boolean) => { + onChange({ scheduleConfig: { ...wizard.scheduleConfig, [key]: value } }); + }; + const handleOneshotChange = (key: keyof OneshotConfig, value: string) => { + onChange({ oneshotConfig: { ...wizard.oneshotConfig, [key]: value } }); + }; + + return ( +
+
+ {( + [ + ['immediate', '즉시 처리', '지금 바로 데이터를 비식별화합니다.'], + ['scheduled', '배치 처리 - 정기 스케줄링', '반복 일정에 따라 자동으로 처리합니다.'], + ['oneshot', '배치 처리 - 일회성', '지정한 날짜/시간에 한 번 처리합니다.'], + ] as [ProcessMode, string, string][] + ).map(([val, label, desc]) => ( +
+ + + {val === 'scheduled' && wizard.processMode === 'scheduled' && ( +
+
+ + +
+
+ +
+ {( + [ + ['daily', '매일'], + ['weekly', '주 1회'], + ['monthly', '월 1회'], + ] as [RepeatType, string][] + ).map(([rt, rl]) => ( +
+ handleScheduleChange('repeatType', rt)} + className="accent-cyan-500" + /> + {rl} + {rt === 'weekly' && wizard.scheduleConfig.repeatType === 'weekly' && ( + + )} +
+ ))} +
+
+
+ + handleScheduleChange('startDate', e.target.value)} + className="px-2.5 py-1.5 text-xs rounded bg-bg-elevated border border-stroke-1 text-t1 focus:outline-none focus:border-cyan-500" + /> +
+
+ + +
+
+ )} + + {val === 'oneshot' && wizard.processMode === 'oneshot' && ( +
+
+ + handleOneshotChange('date', e.target.value)} + className="px-2.5 py-1.5 text-xs rounded bg-bg-elevated border border-stroke-1 text-t1 focus:outline-none focus:border-cyan-500" + /> +
+
+ + +
+
+ )} +
+ ))} +
+
+ ); +} + +// ─── 마법사: Step 5 ───────────────────────────────────────── + +interface Step5Props { + wizard: WizardState; + onChange: (patch: Partial) => void; +} + +function Step5({ wizard, onChange }: Step5Props) { + const selectedCount = wizard.fields.filter((f) => f.selected).length; + const ruleCount = wizard.fields.filter((f) => f.selected && f.technique !== '유지').length; + + const processModeLabel: Record = { + immediate: '즉시 처리', + scheduled: `배치 - 정기 (${wizard.scheduleConfig.hour} / ${wizard.scheduleConfig.repeatType === 'daily' ? '매일' : wizard.scheduleConfig.repeatType === 'weekly' ? `주1회 ${wizard.scheduleConfig.weekday}요일` : '월1회'})`, + oneshot: `배치 - 일회성 (${wizard.oneshotConfig.date} ${wizard.oneshotConfig.hour})`, + }; + + const summaryRows = [ + { label: '작업명', value: wizard.taskName || '(미입력)' }, + { label: '소스', value: wizard.sourceType === 'db' ? `DB: ${wizard.dbConfig.database}.${wizard.dbConfig.tableName}` : wizard.sourceType === 'file' ? '파일 업로드' : `API: ${wizard.apiConfig.url}` }, + { label: '데이터 건수', value: '15,240건' }, + { label: '선택 필드 수', value: `${selectedCount}개` }, + { label: '비식별화 규칙 수', value: `${ruleCount}개` }, + { label: '처리 방식', value: processModeLabel[wizard.processMode] }, + { label: '예상 처리시간', value: '약 3~5분' }, + ]; + + return ( +
+
+ + + {summaryRows.map(({ label, value }) => ( + + + + + ))} + +
{label}{value}
+
+ + +
+ ); +} + +// ─── 마법사 모달 ───────────────────────────────────────────── + +const INITIAL_WIZARD: WizardState = { + step: 1, + taskName: '', + sourceType: 'db', + dbConfig: { host: '', port: '5432', database: '', tableName: '' }, + apiConfig: { url: '', method: 'GET' }, + fields: DEFAULT_FIELDS, + processMode: 'immediate', + scheduleConfig: { + hour: '02:00', + repeatType: 'daily', + weekday: '월', + startDate: '', + notifyOnComplete: true, + notifyOnError: true, + }, + oneshotConfig: { date: '', hour: '02:00' }, + saveAsTemplate: false, + applyTemplate: '', + confirmed: false, +}; + +// ─── 감사로그 모달 ───────────────────────────────────────── + +function getAuditResultClass(type: AuditLogEntry['resultType']): string { + switch (type) { + case '성공': return 'text-emerald-400 bg-emerald-500/10'; + case '진행중': return 'text-cyan-400 bg-cyan-500/10'; + case '실패': return 'text-red-400 bg-red-500/10'; + case '거부': return 'text-yellow-400 bg-yellow-500/10'; + } +} + +interface AuditLogModalProps { + task: DeidentifyTask; + onClose: () => void; +} + +function AuditLogModal({ task, onClose }: AuditLogModalProps) { + const logs = MOCK_AUDIT_LOGS[task.id] ?? []; + const [selectedLog, setSelectedLog] = useState(null); + const [filterOperator, setFilterOperator] = useState('모두'); + const [startDate, setStartDate] = useState('2026-04-01'); + const [endDate, setEndDate] = useState('2026-04-11'); + + const operators = ['모두', ...Array.from(new Set(logs.map((l) => l.operator)))]; + const filteredLogs = logs.filter((l) => { + if (filterOperator !== '모두' && l.operator !== filterOperator) return false; + return true; + }); + + return ( +
+
+ {/* 헤더 */} +
+

+ 감시 감독 (감사로그) — {task.name} +

+ +
+ + {/* 필터 바 */} +
+ 기간: + 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/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" > {/* 번호 */} - + {(page - 1) * PAGE_SIZE + idx + 1} {/* 레이어코드 */} {item.layerCd} {/* 레이어명 */} - {item.layerNm} + {item.layerNm} {/* 레이어전체명 */} - + {item.layerFullNm} @@ -575,7 +575,7 @@ const LayerPanel = () => { {item.wmsLayerNm ?? -} {/* 정렬순서 */} - + {item.sortOrd} {/* 등록일시 */} @@ -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({ setFilterSource(e.target.value as FilterSource)} + className="px-2 py-1 text-xs rounded bg-bg-elevated border border-stroke-1 text-t2 focus:outline-none focus:border-cyan-500 transition-colors" + > + + + + + + {/* 수신상태 필터 */} + + {/* 기간 필터 */} + + {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/SensitiveLayerPanel.tsx b/frontend/src/tabs/admin/components/SensitiveLayerPanel.tsx index dda8889..de93bfc 100644 --- a/frontend/src/tabs/admin/components/SensitiveLayerPanel.tsx +++ b/frontend/src/tabs/admin/components/SensitiveLayerPanel.tsx @@ -136,7 +136,7 @@ const SensitiveLayerPanel = ({ categoryCode, title }: SensitiveLayerPanelProps)

{title}

-

총 {total}개

+

총 {total}개

@@ -146,12 +146,12 @@ const SensitiveLayerPanel = ({ categoryCode, title }: SensitiveLayerPanelProps) onChange={(e) => setSearchInput(e.target.value)} onKeyDown={(e) => e.key === 'Enter' && handleSearch()} placeholder="레이어코드 / 레이어명 검색" - className="flex-1 px-3 py-1.5 text-xs bg-bg-elevated border border-stroke rounded text-fg placeholder-fg-disabled focus:border-color-accent focus:outline-none font-korean" + className="flex-1 px-3 py-1.5 text-caption bg-bg-elevated border border-stroke rounded text-fg placeholder-fg-disabled focus:border-color-accent focus:outline-none font-korean" /> @@ -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/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/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/admin/components/adminMenuConfig.ts b/frontend/src/tabs/admin/components/adminMenuConfig.ts index d719756..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,17 @@ 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/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() {
-
-
-