@seedtactics/insight-client 17.0.1-beta.15 → 17.0.1-beta.17
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/dist/assets/{ProgramHighlight-CnZe9PDO.js → ProgramHighlight-mKbZxoXO.js} +1 -1
- package/dist/assets/index-htn3QO9k.js +367 -0
- package/dist/components/ChooseMode.js +15 -3
- package/dist/components/ErrorsAndLoading.js +2 -1
- package/dist/components/LoadingIcon.js +3 -1
- package/dist/components/quality/QualityMaterial.js +3 -12
- package/dist/components/station-monitor/BasketLoadStationWork.d.ts +4 -1
- package/dist/components/station-monitor/BasketLoadStationWork.js +60 -41
- package/dist/components/station-monitor/CancelLoadButton.js +3 -2
- package/dist/components/station-monitor/InvalidateCycle.js +2 -6
- package/dist/components/station-monitor/LoadStation.js +56 -44
- package/dist/components/station-monitor/Material.d.ts +6 -1
- package/dist/components/station-monitor/Material.js +19 -8
- package/dist/components/station-monitor/MoveMaterialArrows.js +9 -0
- package/dist/components/station-monitor/QuarantineButton.js +4 -3
- package/dist/components/station-monitor/QueuesAddMaterial.js +2 -5
- package/dist/components/station-monitor/SystemOverview.js +56 -17
- package/dist/data/move-arrows.d.ts +7 -0
- package/dist/data/move-arrows.js +107 -24
- package/dist/data/queue-material.d.ts +1 -0
- package/dist/data/queue-material.js +55 -48
- package/dist/index.html +1 -1
- package/dist/network/api-errors.d.ts +6 -0
- package/dist/network/api-errors.js +72 -0
- package/dist/network/websocket.js +5 -3
- package/dist/util/parseISODuration.js +10 -9
- package/docs/server-config.md +20 -12
- package/package.json +13 -13
- package/dist/assets/index-Z6GAS_qc.js +0 -367
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/* Copyright (c) 2026, John Lenz
|
|
2
|
+
|
|
3
|
+
All rights reserved.
|
|
4
|
+
|
|
5
|
+
Redistribution and use in source and binary forms, with or without
|
|
6
|
+
modification, are permitted provided that the following conditions are met:
|
|
7
|
+
|
|
8
|
+
* Redistributions of source code must retain the above copyright
|
|
9
|
+
notice, this list of conditions and the following disclaimer.
|
|
10
|
+
|
|
11
|
+
* Redistributions in binary form must reproduce the above
|
|
12
|
+
copyright notice, this list of conditions and the following
|
|
13
|
+
disclaimer in the documentation and/or other materials provided
|
|
14
|
+
with the distribution.
|
|
15
|
+
|
|
16
|
+
* Neither the name of John Lenz, Black Maple Software, SeedTactics,
|
|
17
|
+
nor the names of other contributors may be used to endorse or
|
|
18
|
+
promote products derived from this software without specific
|
|
19
|
+
prior written permission.
|
|
20
|
+
|
|
21
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
22
|
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
23
|
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
24
|
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
25
|
+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
26
|
+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
27
|
+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
28
|
+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
29
|
+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
30
|
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
31
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
32
|
+
*/
|
|
33
|
+
import { ApiException } from "./api.js";
|
|
34
|
+
function mediaType(headers) {
|
|
35
|
+
const value = headers["content-type"];
|
|
36
|
+
return typeof value === "string" ? (value.split(";")[0] ?? "").trim().toLowerCase() : "";
|
|
37
|
+
}
|
|
38
|
+
function nonBlank(value) {
|
|
39
|
+
return typeof value === "string" && value.trim() !== "" ? value : null;
|
|
40
|
+
}
|
|
41
|
+
function problemMessage(response) {
|
|
42
|
+
try {
|
|
43
|
+
const problem = JSON.parse(response);
|
|
44
|
+
if (problem === null || typeof problem !== "object")
|
|
45
|
+
return null;
|
|
46
|
+
return (("detail" in problem ? nonBlank(problem.detail) : null) ??
|
|
47
|
+
("title" in problem ? nonBlank(problem.title) : null));
|
|
48
|
+
}
|
|
49
|
+
catch {
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* The server's explanation for a failed request: the detail of a JSON problem or a plain-text
|
|
55
|
+
* message (also assumed without a content type). Other responses, such as HTML from a proxy, use
|
|
56
|
+
* the request error's own message.
|
|
57
|
+
*/
|
|
58
|
+
export function apiErrorMessage(error, fallback = "Error") {
|
|
59
|
+
if (error !== null && typeof error === "object" && ApiException.isApiException(error)) {
|
|
60
|
+
const type = mediaType(error.headers);
|
|
61
|
+
const message = type === "application/problem+json" || type === "application/json"
|
|
62
|
+
? problemMessage(error.response)
|
|
63
|
+
: type === "text/plain" || type === ""
|
|
64
|
+
? nonBlank(error.response)
|
|
65
|
+
: null;
|
|
66
|
+
if (message !== null)
|
|
67
|
+
return message;
|
|
68
|
+
}
|
|
69
|
+
if (error instanceof Error)
|
|
70
|
+
return error.message;
|
|
71
|
+
return nonBlank(error) ?? fallback;
|
|
72
|
+
}
|
|
@@ -31,6 +31,7 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
31
31
|
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
32
32
|
*/
|
|
33
33
|
import { ServerEvent } from "./api.js";
|
|
34
|
+
import { apiErrorMessage } from "./api-errors.js";
|
|
34
35
|
import { JobsBackend, LogBackend } from "./backend.js";
|
|
35
36
|
import { fmsInformation } from "./server-settings.js";
|
|
36
37
|
import { useEffect, useRef } from "react";
|
|
@@ -83,7 +84,7 @@ function loadHistory(get, set, session, from, retryDelay = 1000) {
|
|
|
83
84
|
}, (e) => {
|
|
84
85
|
if (!isCurrentSession(get, session))
|
|
85
86
|
return;
|
|
86
|
-
set(errorLoadingLogRW, e
|
|
87
|
+
set(errorLoadingLogRW, apiErrorMessage(e, "Error loading log history"));
|
|
87
88
|
// Keep buffering and retry from the same applied position without interrupting live status.
|
|
88
89
|
setTimeout(() => {
|
|
89
90
|
if (isCurrentSession(get, session)) {
|
|
@@ -106,8 +107,9 @@ function loadConnection(get, set, session) {
|
|
|
106
107
|
function finishLoading(loads, get, set, session) {
|
|
107
108
|
Promise.all(loads)
|
|
108
109
|
.catch((e) => {
|
|
109
|
-
if (isCurrentSession(get, session))
|
|
110
|
-
set(errorLoadingLast30RW, e
|
|
110
|
+
if (isCurrentSession(get, session)) {
|
|
111
|
+
set(errorLoadingLast30RW, apiErrorMessage(e, "Error"));
|
|
112
|
+
}
|
|
111
113
|
})
|
|
112
114
|
.finally(() => {
|
|
113
115
|
if (isCurrentSession(get, session))
|
|
@@ -1,29 +1,30 @@
|
|
|
1
1
|
const nr = "-?\\d+(?:[\\.,]\\d+)?";
|
|
2
2
|
const dateRegex = "(" + nr + "Y)?(" + nr + "M)?(" + nr + "D)?";
|
|
3
3
|
const timeRegex = "T(" + nr + "H)?(" + nr + "M)?(" + nr + "S)?";
|
|
4
|
-
const durationRegex = new RegExp("P" + dateRegex + "(?:" + timeRegex + ")
|
|
4
|
+
const durationRegex = new RegExp("^(-?)P" + dateRegex + "(?:" + timeRegex + ")?$");
|
|
5
5
|
export default function parseISODuration(argument) {
|
|
6
6
|
const match = durationRegex.exec(argument);
|
|
7
7
|
if (!match) {
|
|
8
8
|
return null;
|
|
9
9
|
}
|
|
10
10
|
// at least one part must be specified
|
|
11
|
-
if (!match
|
|
11
|
+
if (!match.slice(2).some(Boolean)) {
|
|
12
12
|
return null;
|
|
13
13
|
}
|
|
14
|
+
const sign = match[1] === "-" ? -1 : 1;
|
|
14
15
|
const duration = {};
|
|
15
|
-
if (match[1])
|
|
16
|
-
duration.years = parseFloat(match[1]);
|
|
17
16
|
if (match[2])
|
|
18
|
-
duration.
|
|
17
|
+
duration.years = sign * parseFloat(match[2]);
|
|
19
18
|
if (match[3])
|
|
20
|
-
duration.
|
|
19
|
+
duration.months = sign * parseFloat(match[3]);
|
|
21
20
|
if (match[4])
|
|
22
|
-
duration.
|
|
21
|
+
duration.days = sign * parseFloat(match[4]);
|
|
23
22
|
if (match[5])
|
|
24
|
-
duration.
|
|
23
|
+
duration.hours = sign * parseFloat(match[5]);
|
|
25
24
|
if (match[6])
|
|
26
|
-
duration.
|
|
25
|
+
duration.minutes = sign * parseFloat(match[6]);
|
|
26
|
+
if (match[7])
|
|
27
|
+
duration.seconds = sign * parseFloat(match[7]);
|
|
27
28
|
return duration;
|
|
28
29
|
}
|
|
29
30
|
export function durationToSeconds(duration) {
|
package/docs/server-config.md
CHANGED
|
@@ -29,19 +29,27 @@ message with details into the [event log](server-errors).
|
|
|
29
29
|
|
|
30
30
|
FMS Insight uses [SQLite](https://www.sqlite.org/) to store data about the cell. The primary data
|
|
31
31
|
stored is a log of the activity of all parts, pallets, machines, jobs, schedules, inspections,
|
|
32
|
-
serial numbers, orders, and other data.
|
|
33
|
-
|
|
32
|
+
serial numbers, orders, and other data. The databases also hold operational state, including
|
|
33
|
+
committed basket contents, material-allocation identities, and operation receipts used to recognize
|
|
34
|
+
completed work on retries.
|
|
34
35
|
|
|
35
36
|
The SQLite databases are by default stored locally in the Windows Common AppData folder which on a
|
|
36
37
|
default Windows install is `c:\ProgramData\SeedTactics\FMSInsight`. This path can be changed in the
|
|
37
38
|
`config.ini` file if needed, but we suggest that the databases are kept on the local drive for
|
|
38
|
-
performance and data integrity (SQLite works best on a local drive).
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
39
|
+
performance and data integrity (SQLite works best on a local drive). Database size grows with
|
|
40
|
+
production activity and retained history; allow space for both production databases and backups.
|
|
41
|
+
|
|
42
|
+
Preserve production databases and back them up before upgrades. Use a backup method that captures a
|
|
43
|
+
consistent SQLite database, such as stopping the server before copying its database files. If an
|
|
44
|
+
integration maintains additional coordination databases, follow its procedure for backing up the
|
|
45
|
+
complete installation consistently.
|
|
46
|
+
|
|
47
|
+
Deleting a production database loses both history and operational identities and retry records.
|
|
48
|
+
Creating a fresh database does not reconstruct that state from the equipment. Follow the
|
|
49
|
+
integration's recovery procedure before resetting or restoring databases, including reconciling the
|
|
50
|
+
physical cell and any integration-specific state. A backup from an earlier point in production is
|
|
51
|
+
not automatically safe to restore against a cell that has continued operating.
|
|
52
|
+
|
|
53
|
+
Fresh databases can be used for controlled QA or initial commissioning when the physical cell and
|
|
54
|
+
the integration's state have been prepared for a fresh start. FMS Insight creates missing databases
|
|
55
|
+
at startup; integrations may impose additional startup and initialization requirements.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seedtactics/insight-client",
|
|
3
|
-
"version": "17.0.1-beta.
|
|
3
|
+
"version": "17.0.1-beta.17",
|
|
4
4
|
"license": "BSD-3-Clause",
|
|
5
5
|
"repository": {
|
|
6
6
|
"url": "https://github.com/SeedTactics/fms-insight"
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
"@emotion/react": "^11.14.0",
|
|
29
29
|
"@emotion/styled": "^11.14.1",
|
|
30
30
|
"@fontsource/roboto": "^5.3.0",
|
|
31
|
-
"@mui/icons-material": "^9.
|
|
32
|
-
"@mui/material": "^9.
|
|
31
|
+
"@mui/icons-material": "^9.5.0",
|
|
32
|
+
"@mui/material": "^9.5.0",
|
|
33
33
|
"@react-spring/rafz": "^10.1.2",
|
|
34
34
|
"@react-spring/web": "^10.1.2",
|
|
35
35
|
"@seedtactics/immutable-collections": "^1.1.1",
|
|
@@ -58,23 +58,23 @@
|
|
|
58
58
|
"@types/d3-sankey": "^0.12.5",
|
|
59
59
|
"@types/d3-scale": "^4.0.9",
|
|
60
60
|
"@types/d3-shape": "^3.2.0",
|
|
61
|
-
"@types/node": "^26.6.
|
|
61
|
+
"@types/node": "^26.6.5",
|
|
62
62
|
"@types/react": "^19.3.0",
|
|
63
63
|
"@types/react-dom": "^19.3.0",
|
|
64
|
-
"@vitejs/plugin-react": "^6.1.
|
|
65
|
-
"@vitest/browser-playwright": "^5.0.
|
|
64
|
+
"@vitejs/plugin-react": "^6.1.2",
|
|
65
|
+
"@vitest/browser-playwright": "^5.0.4",
|
|
66
66
|
"jotai": "^3.0.1",
|
|
67
|
-
"jsdom": "^30.1.
|
|
67
|
+
"jsdom": "^30.1.2",
|
|
68
68
|
"nswag": "^14.7.1",
|
|
69
|
-
"oxfmt": "^0.
|
|
70
|
-
"oxlint": "^1.
|
|
71
|
-
"oxlint-tsgolint": "^7.0.
|
|
72
|
-
"playwright": "^1.
|
|
69
|
+
"oxfmt": "^0.73.0",
|
|
70
|
+
"oxlint": "^1.88.0",
|
|
71
|
+
"oxlint-tsgolint": "^7.0.2004",
|
|
72
|
+
"playwright": "^1.64.0",
|
|
73
73
|
"react": "^19.3.0",
|
|
74
74
|
"react-dom": "^19.3.0",
|
|
75
75
|
"typescript": "^7.0.2",
|
|
76
|
-
"vite": "^8.3.
|
|
77
|
-
"vitest": "^5.0.
|
|
76
|
+
"vite": "^8.3.4",
|
|
77
|
+
"vitest": "^5.0.4",
|
|
78
78
|
"vitest-browser-react": "^2.3.0"
|
|
79
79
|
},
|
|
80
80
|
"peerDependencies": {
|