diff --git a/services/pcp-tgu-ui-service/src/features/tgu-slots/TguSlotsTab.tsx b/services/pcp-tgu-ui-service/src/features/tgu-slots/TguSlotsTab.tsx
index 46f14fb..62d4479 100644
--- a/services/pcp-tgu-ui-service/src/features/tgu-slots/TguSlotsTab.tsx
+++ b/services/pcp-tgu-ui-service/src/features/tgu-slots/TguSlotsTab.tsx
@@ -23,7 +23,7 @@ import type { Tgu2DMapLayersState } from "../tgu-map-2d/model/mapLayerTypes";
import type { Tgu2DMapSelection } from "../tgu-map-2d/model/mapSelectionTypes";
import { MapObjectInspector } from "../tgu-map-2d/MapObjectInspector";
import { Tgu2DMapView } from "../tgu-map-2d/Tgu2DMapView";
-import { formatLocalDateTime, parseLocal, toLocalInputValue, toLocalIso } from "../../utils/localTime";
+import { formatLocalDateTimeSeconds, parseLocal, toLocalInputValue, toLocalIso } from "../../utils/localTime";
import { SlotDaySelector, type SlotDay } from "./SlotDaySelector";
import { SlotPickMenu, type SlotPick } from "./SlotPickMenu";
import { chunk, selectionAfterCheck } from "./slotSelection";
@@ -830,9 +830,8 @@ export function TguSlotsTab({ range }: TguSlotsTabProps) {
КА |
Виток |
- Слот / цикл |
Начало |
- Конец |
+ Длит. |
Крен |
Статус |
@@ -840,7 +839,7 @@ export function TguSlotsTab({ range }: TguSlotsTabProps) {
{padTop > 0 && (
- |
+ |
)}
{virtualRows.map((vrow) => {
@@ -868,13 +867,11 @@ export function TguSlotsTab({ range }: TguSlotsTabProps) {
{slot.satelliteId} |
- {slot.revolution} / {slot.revolutionSign === "DESC" ? "нисх" : "восх"}
+ {slot.revolution} / {slot.revolutionSign === "DESC" ? "нисх" : "восх"} /{" "}
+ {slot.cycle}
|
-
- {slot.slotNumber} / {slot.cycle}
- |
- {formatLocalDateTime(parseLocal(slot.tn))} |
- {formatLocalDateTime(parseLocal(slot.tk))} |
+ {formatLocalDateTimeSeconds(parseLocal(slot.tn))} |
+ {slotDurationSec(slot)} с |
{slot.roll.toFixed(1)}° |
{booked ? (
@@ -888,7 +885,7 @@ export function TguSlotsTab({ range }: TguSlotsTabProps) {
})}
{padBottom > 0 && (
|
- |
+ |
)}
@@ -1040,6 +1037,11 @@ function strategyLabel(strategy: SlotCoverageStrategy): string {
return strategy === "CONTINUOUS" ? "непрерывный" : "жадный";
}
+/** Длительность слота в секундах (tk − tn). Слоты короткие, поэтому показываем секунды. */
+function slotDurationSec(slot: SlotDTO): number {
+ return Math.max(0, Math.round((parseLocal(slot.tk) - parseLocal(slot.tn)) / 1000));
+}
+
function slotStateLabel(state: string): string {
switch (state) {
case "AVAILABLE":
diff --git a/services/pcp-tgu-ui-service/src/utils/localTime.ts b/services/pcp-tgu-ui-service/src/utils/localTime.ts
index 35e5364..fe249e4 100644
--- a/services/pcp-tgu-ui-service/src/utils/localTime.ts
+++ b/services/pcp-tgu-ui-service/src/utils/localTime.ts
@@ -31,6 +31,18 @@ export function formatLocalDateTime(ms: number): string {
});
}
+/** Дата-время с секундами (дд.мм.гггг, чч:мм:сс) — для коротких слотов, где важны секунды. */
+export function formatLocalDateTimeSeconds(ms: number): string {
+ return new Date(ms).toLocaleString("ru-RU", {
+ year: "numeric",
+ month: "2-digit",
+ day: "2-digit",
+ hour: "2-digit",
+ minute: "2-digit",
+ second: "2-digit"
+ });
+}
+
/** Дата (дд.мм) в локальной зоне. */
export function formatLocalDate(ms: number): string {
return new Date(ms).toLocaleDateString("ru-RU", { day: "2-digit", month: "2-digit" });