Новый сервис pcp-tgu-ui-service: ТГУ-фронт на headless-auth nstart + платформенный CI/деплой
This commit is contained in:
@@ -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[]>;
|
||||
}
|
||||
Reference in New Issue
Block a user