E4 (B21): отправка зон в КОНТУР по операции (контракт B20)

- contour_operation_id в PATCH /operations/{id} (mapping на операцию КОНТУРа).
- backend/routers/contour.py: POST /{id}/send-to-contour — последний анализ
  (search_models → legacy analysis_log) → SearchZones[] GeoJSON-сектора
  направлений (±22.5°, probability по приоритету) → POST {CONTOUR_API_URL}/
  api/v1/vector/zones?operation_id=... (Bearer CONTOUR_TOKEN). Все шаги
  аудируются (contour_send_ok/failed). GET /{id}/areas-checked — прокси
  проверенных квадратов (inbound к B17).
- env: CONTOUR_API_URL (дефолт CT130:8000), CONTOUR_TOKEN (в secrets).
- case_id-фильтр в GET /operations.
- UI: панель «КОНТУР» на странице анализа: ввод/сохранение UUID операции
  КОНТУРа, кнопка «Отправить зоны в КОНТУР» со статусом результата.
- Тесты E4 (4): build B20-payload (полигон замкнут, probability 0..1,
  operation_id в query, Bearer), недостающий contour_id 400, отказ КОНТУРа
  → 502 + аудит, геометрия сектора.
226 passed, 5 skipped.
This commit is contained in:
2026-09-09 21:39:18 +03:00
parent ab3eebe274
commit 90213e0491
6 changed files with 509 additions and 1 deletions
+34 -1
View File
@@ -679,4 +679,37 @@
.case-info { flex-direction: column; align-items: flex-start; gap: 6px; }
.separator { display: none; }
.tactics-grid { grid-template-columns: 1fr; }
}
}
/* E4: панель КОНТУР */
.contour-panel {
margin-top: 12px;
padding: 12px;
background: #161b22;
border: 1px solid #30363d;
border-radius: 6px;
}
.contour-title { font-size: 13px; font-weight: 600; color: #e6edf3; margin-bottom: 8px; }
.contour-row { display: flex; gap: 8px; margin-bottom: 8px; }
.contour-input {
flex: 1;
padding: 8px 10px;
background: #0d1117;
border: 1px solid #30363d;
border-radius: 6px;
color: #e6edf3;
font-size: 13px;
}
.contour-save, .contour-send {
padding: 8px 12px;
border: none;
border-radius: 6px;
color: #fff;
font-size: 13px;
cursor: pointer;
white-space: nowrap;
}
.contour-save { background: #21262d; color: #e6edf3; }
.contour-send { background: #238636; }
.contour-send:disabled { background: #21262d; color: #8b949e; cursor: not-allowed; }
.contour-ok { font-size: 12px; color: #3fb950; }
.contour-err { font-size: 12px; color: #f85149; }