fix: prediction API 프록시 경로 수정 + nginx 라우팅 추가
vite dev: /api/prediction/ → 192.168.1.18:8001 (rewrite /api/prediction → /api) nginx 프로덕션: /api/prediction/ → redis-211:8001 (동일 rewrite) 디버그 로그: fetchCorrelationTracks URL/status, loadHistory fetch 결과 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
부모
dddb978dea
커밋
21df325010
@ -83,6 +83,17 @@ export function FleetClusterLayer({ ships, analysisMap: analysisMapProp, onShipS
|
||||
const filled = fillGapFrames(sorted);
|
||||
const corrData = corrRes.items;
|
||||
const corrTracks = trackRes.vessels;
|
||||
|
||||
// 디버그: fetch 결과 확인
|
||||
const withTrack = corrTracks.filter(v => v.track && v.track.length > 0).length;
|
||||
console.log('[loadHistory] fetch 완료:', {
|
||||
history: history.length,
|
||||
corrData: corrData.length,
|
||||
corrTracks: corrTracks.length,
|
||||
withTrack,
|
||||
sampleTrack: corrTracks[0] ? { mmsi: corrTracks[0].mmsi, trackPts: corrTracks[0].track?.length, score: corrTracks[0].score } : 'none',
|
||||
});
|
||||
|
||||
const vessels = new Set(corrTracks.filter(v => v.score >= 0.7).map(v => v.mmsi));
|
||||
|
||||
// 3. React 상태 동기화 (패널 표시용)
|
||||
|
||||
@ -160,11 +160,17 @@ export async function fetchCorrelationTracks(
|
||||
hours = 24,
|
||||
minScore = 0.3,
|
||||
): Promise<CorrelationTracksResponse> {
|
||||
const res = await fetch(
|
||||
`/api/prediction/v1/correlation/${encodeURIComponent(groupKey)}/tracks?hours=${hours}&minScore=${minScore}`,
|
||||
);
|
||||
if (!res.ok) return { groupKey, vessels: [] };
|
||||
return res.json();
|
||||
const url = `/api/prediction/v1/correlation/${encodeURIComponent(groupKey)}/tracks?hours=${hours}&minScore=${minScore}`;
|
||||
console.log('[fetchCorrelationTracks] URL:', url);
|
||||
const res = await fetch(url);
|
||||
console.log('[fetchCorrelationTracks] status:', res.status, res.statusText);
|
||||
if (!res.ok) {
|
||||
console.warn('[fetchCorrelationTracks] 실패:', res.status);
|
||||
return { groupKey, vessels: [] };
|
||||
}
|
||||
const data: CorrelationTracksResponse = await res.json();
|
||||
console.log('[fetchCorrelationTracks] 응답:', data.vessels.length, '건');
|
||||
return data;
|
||||
}
|
||||
|
||||
/* ── Fleet Companies ─────────────────────────────────────────── */
|
||||
|
||||
@ -115,8 +115,8 @@ export default defineConfig(({ mode }): UserConfig => ({
|
||||
changeOrigin: true,
|
||||
secure: true,
|
||||
},
|
||||
'/api/prediction': {
|
||||
target: 'http://localhost:8001',
|
||||
'/api/prediction/': {
|
||||
target: 'http://192.168.1.18:8001',
|
||||
changeOrigin: true,
|
||||
rewrite: (path) => path.replace(/^\/api\/prediction/, '/api'),
|
||||
},
|
||||
|
||||
불러오는 중...
Reference in New Issue
Block a user