Новый сервис pcp-tgu-ui-service: ТГУ-фронт на headless-auth nstart + платформенный CI/деплой

This commit is contained in:
Дмитрий Соловьев
2026-06-09 13:35:13 +03:00
parent 0b617594fd
commit 505bf1f31c
129 changed files with 21640 additions and 0 deletions
@@ -0,0 +1,40 @@
export type PlanSurveyMode = {
id: number;
planId: number;
timeStart: string | null;
revolution: number;
type: "SURVEY";
status: string;
lat: number;
longitude: number;
duration: number;
contourWkt: string | null;
roll: number;
/** Объём маршрута, МБ (скорость накопления × длительность). Считает бэк (pcp-types-lib). */
volumeMb?: number;
};
export type PlanDropMode = {
id: number;
planId: number;
timeStart: string | null;
revolution: number;
type: "DROP";
station: string | null;
duration: number;
surveys: number[];
/** Объём сброса, Мбайт (канал 1200 Мбит/с ÷ 8 × длительность). Считает бэк (pcp-types-lib). */
volumeMb?: number;
};
export type PlanMode = PlanSurveyMode | PlanDropMode;
export async function fetchPlanModes(planId: string): Promise<PlanMode[]> {
const response = await fetch(`/api/current-plans/missions/${encodeURIComponent(planId)}/modes`, {
headers: { Accept: "application/json" }
});
if (!response.ok) {
throw new Error(`Ошибка загрузки включений плана: ${response.status}`);
}
return response.json() as Promise<PlanMode[]>;
}