[예측] - OpenDrift Python API 서버 및 스크립트 추가 (prediction/opendrift/) - 시뮬레이션 상태 폴링 훅(useSimulationStatus), 로딩 오버레이 추가 - HydrParticleOverlay: deck.gl 기반 입자 궤적 시각화 레이어 - OilSpillView/LeftPanel/RightPanel: 시뮬레이션 실행·결과 표시 UI 개편 - predictionService/predictionRouter: 시뮬레이션 CRUD 및 상태 관리 API - simulation.ts: OpenDrift 연동 엔드포인트 확장 - docs/PREDICTION-GUIDE.md: 예측 기능 개발 가이드 추가 [CCTV/항공방제] - CCTV 오일 감지 GPU 추론 연동 (OilDetectionOverlay, useOilDetection) - CCTV 안전관리 감지 기능 추가 (선박 출입, 침입 감지) - oil_inference_server.py: Python GPU 추론 서버 [관리자] - 관리자 화면 고도화 (사용자/권한/게시판/선박신호 패널) - AdminSidebar, BoardMgmtPanel, VesselSignalPanel 신규 컴포넌트 [기타] - DB: 시뮬레이션 결과, 선박보험 시드(1391건), 역할 정리 마이그레이션 - 팀 워크플로우 v1.6.1 동기화 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
17 lines
639 B
TypeScript
17 lines
639 B
TypeScript
import { useQuery } from '@tanstack/react-query';
|
|
import { api } from '@common/services/api';
|
|
import type { SimulationStatusResponse } from '../services/predictionApi';
|
|
|
|
export const useSimulationStatus = (execSn: number | null) => {
|
|
return useQuery<SimulationStatusResponse>({
|
|
queryKey: ['simulationStatus', execSn],
|
|
queryFn: () => api.get<SimulationStatusResponse>(`/simulation/status/${execSn}`).then(r => r.data),
|
|
enabled: execSn !== null,
|
|
refetchInterval: (query) => {
|
|
const status = query.state.data?.status;
|
|
if (status === 'DONE' || status === 'ERROR') return false;
|
|
return 3000;
|
|
},
|
|
});
|
|
};
|