@yarkivaev/scada-server 1.1.2 → 1.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -41,18 +41,18 @@ export default function segmentRoute(basePath, plant) {
|
|
|
41
41
|
options.to = query.to;
|
|
42
42
|
}
|
|
43
43
|
const segments = await machine.segments.query(options);
|
|
44
|
-
const items = segments.map((
|
|
44
|
+
const items = segments.map(({ name, start_time: startTime, end_time: endTime, duration, options: opts, label }) => {
|
|
45
45
|
const mapped = {
|
|
46
|
-
name
|
|
47
|
-
start:
|
|
48
|
-
end:
|
|
49
|
-
duration
|
|
46
|
+
name,
|
|
47
|
+
start: startTime.toISOString(),
|
|
48
|
+
end: duration === 0 ? new Date().toISOString() : endTime.toISOString(),
|
|
49
|
+
duration
|
|
50
50
|
};
|
|
51
|
-
if (
|
|
52
|
-
mapped.options =
|
|
51
|
+
if (opts) {
|
|
52
|
+
mapped.options = opts;
|
|
53
53
|
}
|
|
54
|
-
if (
|
|
55
|
-
mapped.label =
|
|
54
|
+
if (label) {
|
|
55
|
+
mapped.label = label;
|
|
56
56
|
}
|
|
57
57
|
return mapped;
|
|
58
58
|
});
|