c3a1a8b4a1
Capture current PCP architecture notes, service-map prototypes, TGU operations UI/map work, local configuration updates, database helper scripts, and request/sample JSON artifacts.
30 lines
839 B
TypeScript
30 lines
839 B
TypeScript
import type { TguPlanUi, TimelineRange } from "../../model/timelineTypes";
|
|
|
|
export const MAX_TGU_2D_MAP_INTERVAL_MS = 7 * 24 * 60 * 60 * 1000;
|
|
|
|
export const TGU_2D_MAP_INTERVAL_WARNING =
|
|
"Интервал карты больше 7 суток. Для тяжёлых canvas-слоёв выберите меньший интервал или конкретный план.";
|
|
|
|
export type Tgu2DMapIntervalState = {
|
|
range: TimelineRange;
|
|
tooLarge: boolean;
|
|
};
|
|
|
|
export function getTgu2DMapIntervalState(range: TimelineRange, selectedPlan?: TguPlanUi): Tgu2DMapIntervalState {
|
|
if (selectedPlan) {
|
|
return {
|
|
range: {
|
|
fromMs: selectedPlan.startMs,
|
|
toMs: selectedPlan.endMs
|
|
},
|
|
tooLarge: false
|
|
};
|
|
}
|
|
|
|
return {
|
|
range,
|
|
tooLarge: range.toMs - range.fromMs > MAX_TGU_2D_MAP_INTERVAL_MS
|
|
};
|
|
}
|
|
|