@seedtactics/insight-client 16.8.3 → 16.8.4-beta.1
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/index-DXfAwuj-.css +1 -0
- package/dist/assets/index-Y5yNHUvc.js +388 -0
- package/dist/assets/roboto-cyrillic-300-normal-D0x1uCa7.woff +0 -0
- package/dist/assets/roboto-cyrillic-400-normal-BepgbcUK.woff +0 -0
- package/dist/assets/roboto-cyrillic-500-normal-C8ZOEKN4.woff +0 -0
- package/dist/assets/roboto-cyrillic-700-normal-D8g9KsRf.woff +0 -0
- package/dist/assets/roboto-cyrillic-ext-300-normal-C0UYUNTV.woff +0 -0
- package/dist/assets/roboto-cyrillic-ext-400-normal-DhDk0Xwi.woff +0 -0
- package/dist/assets/roboto-cyrillic-ext-500-normal-SCgicl0l.woff +0 -0
- package/dist/assets/roboto-cyrillic-ext-700-normal-BWOtdzfy.woff +0 -0
- package/dist/assets/roboto-greek-300-normal-xS8CB6LN.woff +0 -0
- package/dist/assets/roboto-greek-400-normal-D904r64h.woff +0 -0
- package/dist/assets/roboto-greek-500-normal-XBIQOowA.woff +0 -0
- package/dist/assets/roboto-greek-700-normal-xQsEWSIA.woff +0 -0
- package/dist/assets/roboto-latin-300-normal-Dqn3NW0Y.woff +0 -0
- package/dist/assets/roboto-latin-400-normal-D27F5sTu.woff +0 -0
- package/dist/assets/roboto-latin-500-normal-fsTFPL3E.woff +0 -0
- package/dist/assets/roboto-latin-700-normal-YuyVweIx.woff +0 -0
- package/dist/assets/roboto-latin-ext-300-normal-B0-sTZUp.woff +0 -0
- package/dist/assets/roboto-latin-ext-400-normal-CIveymTr.woff +0 -0
- package/dist/assets/roboto-latin-ext-500-normal-C1cK9xmS.woff +0 -0
- package/dist/assets/roboto-latin-ext-700-normal-BDePAh3g.woff +0 -0
- package/dist/assets/roboto-math-300-normal-CkwMvXpj.woff +0 -0
- package/dist/assets/roboto-math-400-normal-D6sS4O5l.woff +0 -0
- package/dist/assets/roboto-math-500-normal-BNGXE_xU.woff +0 -0
- package/dist/assets/roboto-math-700-normal-DbhUef31.woff +0 -0
- package/dist/assets/roboto-symbols-300-normal-CBIeSvs3.woff +0 -0
- package/dist/assets/roboto-symbols-400-normal-C7tGlxgb.woff +0 -0
- package/dist/assets/roboto-symbols-500-normal-DFnofPUt.woff +0 -0
- package/dist/assets/roboto-symbols-700-normal-C59U6HqI.woff +0 -0
- package/dist/assets/roboto-vietnamese-300-normal-CYjuQheQ.woff +0 -0
- package/dist/assets/roboto-vietnamese-400-normal-Bf76hAzZ.woff +0 -0
- package/dist/assets/roboto-vietnamese-500-normal-BgoYVz-9.woff +0 -0
- package/dist/assets/roboto-vietnamese-700-normal-kpkdMgbf.woff +0 -0
- package/dist/bootstrap.d.ts +5 -0
- package/dist/bootstrap.js +56 -0
- package/dist/cell-status/custom-state.d.ts +9 -0
- package/dist/cell-status/custom-state.js +42 -0
- package/dist/cell-status/loading.js +5 -0
- package/dist/components/App.d.ts +2 -0
- package/dist/components/App.js +1 -1
- package/dist/components/LogEntry.js +21 -6
- package/dist/components/log-entry-container-name.d.ts +4 -0
- package/dist/components/log-entry-container-name.js +7 -0
- package/dist/components/station-monitor/BasketLoadStationWork.d.ts +15 -0
- package/dist/components/station-monitor/BasketLoadStationWork.js +147 -0
- package/dist/components/station-monitor/LoadStation.d.ts +2 -0
- package/dist/components/station-monitor/LoadStation.js +26 -17
- package/dist/components/station-monitor/Material.js +22 -3
- package/dist/components/station-monitor/MoveMaterialArrows.js +1 -1
- package/dist/components/station-monitor/QuarantineButton.js +5 -2
- package/dist/components/station-monitor/QueuesAddMaterial.js +2 -1
- package/dist/components/station-monitor/SystemOverview.js +7 -3
- package/dist/data/all-material-bins.js +10 -0
- package/dist/data/current-cycles.js +22 -20
- package/dist/data/move-arrows.d.ts +1 -0
- package/dist/data/move-arrows.js +18 -2
- package/dist/data/queue-material.js +2 -0
- package/dist/index.html +2 -2
- package/dist/index.js +7 -15
- package/dist/network/api.d.ts +23 -2
- package/dist/network/api.js +37 -0
- package/dist/network/backend.d.ts +2 -0
- package/dist/network/backend.js +14 -9
- package/package.json +8 -7
- package/dist/assets/index-BDPKYaRT.js +0 -388
- package/dist/assets/index-CbqW4-gR.css +0 -1
- package/dist/assets/roboto-cyrillic-300-normal-DEFNdjk5.woff +0 -0
- package/dist/assets/roboto-cyrillic-400-normal-Bjg-1-sg.woff +0 -0
- package/dist/assets/roboto-cyrillic-500-normal-CBKMylY4.woff +0 -0
- package/dist/assets/roboto-cyrillic-700-normal-DhZFXDSN.woff +0 -0
- package/dist/assets/roboto-cyrillic-ext-300-normal-D7ank4TF.woff +0 -0
- package/dist/assets/roboto-cyrillic-ext-400-normal-CaK1767H.woff +0 -0
- package/dist/assets/roboto-cyrillic-ext-500-normal-DqF2hftb.woff +0 -0
- package/dist/assets/roboto-cyrillic-ext-700-normal-CI7FH63F.woff +0 -0
- package/dist/assets/roboto-greek-300-normal-C_Dgaih9.woff +0 -0
- package/dist/assets/roboto-greek-400-normal-Bb5mj_fZ.woff +0 -0
- package/dist/assets/roboto-greek-500-normal-oCqhoyfc.woff +0 -0
- package/dist/assets/roboto-greek-700-normal-DjRqqLBV.woff +0 -0
- package/dist/assets/roboto-latin-300-normal-BARJ-h6h.woff +0 -0
- package/dist/assets/roboto-latin-400-normal-DyYNIH4P.woff +0 -0
- package/dist/assets/roboto-latin-500-normal-DQZyH_nt.woff +0 -0
- package/dist/assets/roboto-latin-700-normal-DLgJJpmK.woff +0 -0
- package/dist/assets/roboto-latin-ext-300-normal-CTCCHkZF.woff +0 -0
- package/dist/assets/roboto-latin-ext-400-normal-scX0fKtV.woff +0 -0
- package/dist/assets/roboto-latin-ext-500-normal-Cyc0AKLz.woff +0 -0
- package/dist/assets/roboto-latin-ext-700-normal-BUhwtWwy.woff +0 -0
- package/dist/assets/roboto-math-300-normal-Ds0YpBw2.woff +0 -0
- package/dist/assets/roboto-math-400-normal-C9RxBKAh.woff +0 -0
- package/dist/assets/roboto-math-500-normal-C-7mKPO3.woff +0 -0
- package/dist/assets/roboto-math-700-normal-DVoD5t2k.woff +0 -0
- package/dist/assets/roboto-symbols-300-normal-BCnjhQd_.woff +0 -0
- package/dist/assets/roboto-symbols-400-normal-DLYbZahX.woff +0 -0
- package/dist/assets/roboto-symbols-500-normal-F7c8nfcH.woff +0 -0
- package/dist/assets/roboto-symbols-700-normal-BoS6HWkc.woff +0 -0
- package/dist/assets/roboto-vietnamese-300-normal-INUupD3o.woff +0 -0
- package/dist/assets/roboto-vietnamese-400-normal-DnpnVwnf.woff +0 -0
- package/dist/assets/roboto-vietnamese-500-normal-D380IkQ8.woff +0 -0
- package/dist/assets/roboto-vietnamese-700-normal-DsFyXAL4.woff +0 -0
|
@@ -89,11 +89,12 @@ function shakeAnimationIteration(event) {
|
|
|
89
89
|
}
|
|
90
90
|
const MatCardHeader = styled("div", { shouldForwardProp: (prop) => prop !== "fsize" })(({ fsize, theme }) => {
|
|
91
91
|
if (!fsize)
|
|
92
|
-
return { fontSize: "1.25rem" };
|
|
92
|
+
return { fontSize: "1.25rem", fontWeight: "500" };
|
|
93
93
|
switch (fsize) {
|
|
94
94
|
case "normal":
|
|
95
95
|
return {
|
|
96
96
|
fontSize: "1rem",
|
|
97
|
+
fontWeight: "500",
|
|
97
98
|
[theme.breakpoints.up("md")]: {
|
|
98
99
|
fontSize: "1.25rem",
|
|
99
100
|
},
|
|
@@ -104,6 +105,7 @@ const MatCardHeader = styled("div", { shouldForwardProp: (prop) => prop !== "fsi
|
|
|
104
105
|
case "large":
|
|
105
106
|
return {
|
|
106
107
|
fontSize: "1.5rem",
|
|
108
|
+
fontWeight: "500",
|
|
107
109
|
[theme.breakpoints.up("lg")]: {
|
|
108
110
|
fontSize: "1.75rem",
|
|
109
111
|
},
|
|
@@ -114,6 +116,7 @@ const MatCardHeader = styled("div", { shouldForwardProp: (prop) => prop !== "fsi
|
|
|
114
116
|
case "x-large":
|
|
115
117
|
return {
|
|
116
118
|
fontSize: "1.5rem",
|
|
119
|
+
fontWeight: "500",
|
|
117
120
|
[theme.breakpoints.up("md")]: {
|
|
118
121
|
fontSize: "1.75rem",
|
|
119
122
|
},
|
|
@@ -128,11 +131,12 @@ const MatCardHeader = styled("div", { shouldForwardProp: (prop) => prop !== "fsi
|
|
|
128
131
|
});
|
|
129
132
|
const MatCardDetail = styled("div", { shouldForwardProp: (prop) => prop !== "fsize" })(({ fsize, theme }) => {
|
|
130
133
|
if (!fsize)
|
|
131
|
-
return { fontSize: "0.75rem" };
|
|
134
|
+
return { fontSize: "0.75rem", fontWeight: "500" };
|
|
132
135
|
switch (fsize) {
|
|
133
136
|
case "normal":
|
|
134
137
|
return {
|
|
135
138
|
fontSize: "0.75rem",
|
|
139
|
+
fontWeight: "500",
|
|
136
140
|
[theme.breakpoints.up("md")]: {
|
|
137
141
|
fontSize: "1rem",
|
|
138
142
|
},
|
|
@@ -140,6 +144,7 @@ const MatCardDetail = styled("div", { shouldForwardProp: (prop) => prop !== "fsi
|
|
|
140
144
|
case "large":
|
|
141
145
|
return {
|
|
142
146
|
fontSize: "1rem",
|
|
147
|
+
fontWeight: "500",
|
|
143
148
|
[theme.breakpoints.up("lg")]: {
|
|
144
149
|
fontSize: "1.5rem",
|
|
145
150
|
},
|
|
@@ -150,6 +155,7 @@ const MatCardDetail = styled("div", { shouldForwardProp: (prop) => prop !== "fsi
|
|
|
150
155
|
case "x-large":
|
|
151
156
|
return {
|
|
152
157
|
fontSize: "1rem",
|
|
158
|
+
fontWeight: "500",
|
|
153
159
|
[theme.breakpoints.up("md")]: {
|
|
154
160
|
fontSize: "1.5rem",
|
|
155
161
|
},
|
|
@@ -228,6 +234,10 @@ export function MaterialAction({ mat, displayActionForSinglePallet, fsize, }) {
|
|
|
228
234
|
}
|
|
229
235
|
}
|
|
230
236
|
}
|
|
237
|
+
case api.ActionType.LoadingToBasket:
|
|
238
|
+
return (_jsxs(MatCardDetail, { fsize: fsize, children: ["Load into ", basketName, " ", mat.action.loadToBasketId ?? "", mat.action.loadToBasketSlot !== undefined
|
|
239
|
+
? ` slot ${mat.action.loadToBasketSlot + 1}`
|
|
240
|
+
: ""] }));
|
|
231
241
|
case api.ActionType.UnloadToInProcess:
|
|
232
242
|
case api.ActionType.UnloadToCompletedMaterial:
|
|
233
243
|
if (mat.action.unloadToBasketId) {
|
|
@@ -238,6 +248,13 @@ export function MaterialAction({ mat, displayActionForSinglePallet, fsize, }) {
|
|
|
238
248
|
else if (mat.action.unloadIntoQueue) {
|
|
239
249
|
return (_jsxs(MatCardDetail, { fsize: fsize, children: ["Unload into queue ", mat.action.unloadIntoQueue] }));
|
|
240
250
|
}
|
|
251
|
+
else if (mat.action.type === api.ActionType.UnloadToCompletedMaterial &&
|
|
252
|
+
mat.location.type === api.LocType.InBasket) {
|
|
253
|
+
return (_jsxs(MatCardDetail, { fsize: fsize, children: ["Unload from ", basketName, " ", mat.location.basketId, " to completed material"] }));
|
|
254
|
+
}
|
|
255
|
+
else if (mat.location.type === api.LocType.InBasket) {
|
|
256
|
+
return (_jsxs(MatCardDetail, { fsize: fsize, children: ["Unload from ", basketName, " ", mat.location.basketId] }));
|
|
257
|
+
}
|
|
241
258
|
else {
|
|
242
259
|
return _jsx(MatCardDetail, { fsize: fsize, children: "Unload from pallet" });
|
|
243
260
|
}
|
|
@@ -282,7 +299,9 @@ function Warning({ mat }) {
|
|
|
282
299
|
function JobRawMaterial({ fsize, mat, }) {
|
|
283
300
|
const job = useAtomValue(currentStatus).jobs[mat.jobUnique];
|
|
284
301
|
let path = mat.path;
|
|
285
|
-
if (mat.action.type === api.ActionType.Loading
|
|
302
|
+
if ((mat.action.type === api.ActionType.Loading ||
|
|
303
|
+
mat.action.type === api.ActionType.LoadingToBasket) &&
|
|
304
|
+
mat.action.pathAfterLoad) {
|
|
286
305
|
path = mat.action.pathAfterLoad;
|
|
287
306
|
}
|
|
288
307
|
if (!job) {
|
|
@@ -116,5 +116,5 @@ export function useMoveMaterialArrowRef(kind) {
|
|
|
116
116
|
}
|
|
117
117
|
export function MoveMaterialArrowNode({ kind, children, }) {
|
|
118
118
|
const ref = useMoveMaterialArrowRef(kind);
|
|
119
|
-
return _jsx("div", { ref: ref, children: children });
|
|
119
|
+
return (_jsx("div", { ref: ref, "data-move-material-identifier": uniqueIdForNodeKind(kind), children: children }));
|
|
120
120
|
}
|
|
@@ -116,10 +116,13 @@ function useQuarantineMaterial(ignoreOperator) {
|
|
|
116
116
|
}
|
|
117
117
|
break;
|
|
118
118
|
case LocType.InQueue:
|
|
119
|
-
if (inProcMat.action.type === ActionType.Loading
|
|
119
|
+
if ((inProcMat.action.type === ActionType.Loading ||
|
|
120
|
+
inProcMat.action.type === ActionType.LoadingToBasket) &&
|
|
121
|
+
!fmsInfo.allowQuarantineToCancelLoad) {
|
|
120
122
|
return null;
|
|
121
123
|
}
|
|
122
|
-
else if (inProcMat.action.type === ActionType.Loading
|
|
124
|
+
else if (inProcMat.action.type === ActionType.Loading ||
|
|
125
|
+
inProcMat.action.type === ActionType.LoadingToBasket) {
|
|
123
126
|
type = "CancelLoad";
|
|
124
127
|
}
|
|
125
128
|
else {
|
|
@@ -54,7 +54,8 @@ function useAllowAddToQueue(queueNames) {
|
|
|
54
54
|
return false;
|
|
55
55
|
if (inProcMat?.location.type === api.LocType.OnPallet)
|
|
56
56
|
return false;
|
|
57
|
-
if (inProcMat?.action.type === api.ActionType.Loading
|
|
57
|
+
if (inProcMat?.action.type === api.ActionType.Loading ||
|
|
58
|
+
inProcMat?.action.type === api.ActionType.LoadingToBasket)
|
|
58
59
|
return false;
|
|
59
60
|
if (existingMat === null && !possibleNewMats) {
|
|
60
61
|
return false;
|
|
@@ -59,10 +59,13 @@ function useCellOverview() {
|
|
|
59
59
|
.filter((m) => m.location.type === LocType.OnPallet || m.action.type === ActionType.Loading)
|
|
60
60
|
.toRLookup((m) => m.location.palletNum ?? m.action.loadOntoPalletNum ?? 0);
|
|
61
61
|
const matByBasket = LazySeq.of(currentSt.material)
|
|
62
|
-
.filter((m) => m.location.type === LocType.InBasket &&
|
|
62
|
+
.filter((m) => (m.location.type === LocType.InBasket &&
|
|
63
63
|
m.location.basketId !== null &&
|
|
64
|
-
m.location.basketId !== undefined)
|
|
65
|
-
|
|
64
|
+
m.location.basketId !== undefined) ||
|
|
65
|
+
(m.action.type === ActionType.LoadingToBasket &&
|
|
66
|
+
m.action.loadToBasketId !== null &&
|
|
67
|
+
m.action.loadToBasketId !== undefined))
|
|
68
|
+
.toRLookup((m) => m.location.basketId ?? m.action.loadToBasketId ?? 0);
|
|
66
69
|
let loads = LazySeq.ofObject(currentSt.pallets)
|
|
67
70
|
.filter(([_, p]) => p.currentPalletLocation.loc === PalletLocationEnum.LoadUnload)
|
|
68
71
|
.toOrderedMap(([_, p]) => [
|
|
@@ -582,6 +585,7 @@ function Machine({ maxNumFaces, machine }) {
|
|
|
582
585
|
}
|
|
583
586
|
function useElapsedLoadTime(material) {
|
|
584
587
|
const mat = material?.find((m) => m.action.type === ActionType.Loading ||
|
|
588
|
+
m.action.type === ActionType.LoadingToBasket ||
|
|
585
589
|
m.action.type === ActionType.UnloadToCompletedMaterial ||
|
|
586
590
|
m.action.type === ActionType.UnloadToInProcess);
|
|
587
591
|
const elapsedDurationFromCurSt = mat?.action?.elapsedLoadUnloadTime;
|
|
@@ -126,6 +126,16 @@ export function selectAllMaterialIntoBins(curSt, curBinOrder) {
|
|
|
126
126
|
addToMap(loadStations, lul, mat);
|
|
127
127
|
break;
|
|
128
128
|
}
|
|
129
|
+
case api.ActionType.LoadingToBasket: {
|
|
130
|
+
const basket = curSt.baskets?.[mat.action.loadToBasketId ?? 0];
|
|
131
|
+
if (basket?.position.location === api.BasketLocationEnum.LoadUnload) {
|
|
132
|
+
addToMap(loadStations, basket.position.locationNum, mat);
|
|
133
|
+
}
|
|
134
|
+
else {
|
|
135
|
+
addToMap(queues, "Free Material", mat);
|
|
136
|
+
}
|
|
137
|
+
break;
|
|
138
|
+
}
|
|
129
139
|
default:
|
|
130
140
|
addToMap(queues, "Free Material", mat);
|
|
131
141
|
break;
|
|
@@ -47,24 +47,17 @@ function basketsAtLoad(currentSt) {
|
|
|
47
47
|
})
|
|
48
48
|
.toRMap(([basketId, loc]) => [basketId, loc]);
|
|
49
49
|
}
|
|
50
|
-
function locationForLoadActivity(material,
|
|
51
|
-
if (material.action.type === ActionType.
|
|
50
|
+
function locationForLoadActivity(material, palToLoc, basketToLoad) {
|
|
51
|
+
if (material.action.type === ActionType.LoadingToBasket) {
|
|
52
|
+
return basketToLoad.get(material.action.loadToBasketId ?? 0) ?? null;
|
|
53
|
+
}
|
|
54
|
+
else if (material.action.type === ActionType.Loading) {
|
|
52
55
|
if (material.action.loadOntoPalletNum) {
|
|
53
56
|
return palToLoc.get(material.action.loadOntoPalletNum) ?? null;
|
|
54
57
|
}
|
|
55
58
|
if (material.action.loadFromBasketId) {
|
|
56
59
|
return basketToLoad.get(material.action.loadFromBasketId) ?? null;
|
|
57
60
|
}
|
|
58
|
-
// queue → basket: neither pallet nor source basket set. Find a basket at a load station
|
|
59
|
-
// that is a basket-load station for this job/process.
|
|
60
|
-
const proc = material.action.processAfterLoad ?? material.process;
|
|
61
|
-
const procInfo = jobs[material.jobUnique]?.procsAndPaths?.[proc - 1];
|
|
62
|
-
const basketLoadStations = procInfo?.basketLoadStations ?? [];
|
|
63
|
-
for (const [, loc] of basketToLoad) {
|
|
64
|
-
if (basketLoadStations.length === 0 || basketLoadStations.includes(loc.num)) {
|
|
65
|
-
return loc;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
61
|
return null;
|
|
69
62
|
}
|
|
70
63
|
else {
|
|
@@ -110,13 +103,14 @@ function loadCurrentCycles(currentSt, estimated, palToLoc, loadStationNames) {
|
|
|
110
103
|
.collect((m) => {
|
|
111
104
|
if (m.action.type === ActionType.UnloadToCompletedMaterial ||
|
|
112
105
|
m.action.type === ActionType.UnloadToInProcess) {
|
|
113
|
-
const loc = locationForLoadActivity(m,
|
|
106
|
+
const loc = locationForLoadActivity(m, palToLoc, basketToLoad);
|
|
114
107
|
if (!loc)
|
|
115
108
|
return null;
|
|
116
109
|
return { mat: m, material: [m], proc: m.process, path: m.path, loc };
|
|
117
110
|
}
|
|
118
|
-
else if (m.action.type === ActionType.Loading
|
|
119
|
-
|
|
111
|
+
else if (m.action.type === ActionType.Loading ||
|
|
112
|
+
m.action.type === ActionType.LoadingToBasket) {
|
|
113
|
+
const loc = locationForLoadActivity(m, palToLoc, basketToLoad);
|
|
120
114
|
if (!loc)
|
|
121
115
|
return null;
|
|
122
116
|
return {
|
|
@@ -133,8 +127,9 @@ function loadCurrentCycles(currentSt, estimated, palToLoc, loadStationNames) {
|
|
|
133
127
|
const job = currentSt.jobs[m.mat.jobUnique];
|
|
134
128
|
const procInfo = job?.procsAndPaths?.[m.proc - 1];
|
|
135
129
|
const pathData = job?.procsAndPaths?.[m.proc - 1]?.paths?.[m.path - 1];
|
|
136
|
-
if (m.mat.action.type === ActionType.Loading
|
|
137
|
-
|
|
130
|
+
if (m.mat.action.type === ActionType.Loading ||
|
|
131
|
+
m.mat.action.type === ActionType.LoadingToBasket) {
|
|
132
|
+
const expected = m.mat.action.type === ActionType.Loading
|
|
138
133
|
? pathData?.expectedLoadTime
|
|
139
134
|
: (procInfo?.expectedBasketLoadTime ?? pathData?.expectedLoadTime);
|
|
140
135
|
return { ...m, expectedLoadSecs: durationToSeconds(expected ?? "PT0S") };
|
|
@@ -152,7 +147,8 @@ function loadCurrentCycles(currentSt, estimated, palToLoc, loadStationNames) {
|
|
|
152
147
|
let outlier = false;
|
|
153
148
|
let expectedSecs = 0;
|
|
154
149
|
for (const { cycle: m, elapsedForSingleMaterialMinutes } of matsWithTime) {
|
|
155
|
-
const stats = estimated.get(new PartAndStationOperation(m.mat.partName, statGroup, m.mat.action.type === ActionType.Loading
|
|
150
|
+
const stats = estimated.get(new PartAndStationOperation(m.mat.partName, statGroup, m.mat.action.type === ActionType.Loading ||
|
|
151
|
+
m.mat.action.type === ActionType.LoadingToBasket
|
|
156
152
|
? "LOAD-" + m.proc.toString()
|
|
157
153
|
: "UNLOAD-" + m.proc.toString()));
|
|
158
154
|
if (stats && isOutlierAbove(stats, elapsedForSingleMaterialMinutes)) {
|
|
@@ -172,10 +168,16 @@ function loadCurrentCycles(currentSt, estimated, palToLoc, loadStationNames) {
|
|
|
172
168
|
expectedEnd: addSeconds(currentSt.timeOfCurrentStatusUTC, -elapsedSec + expectedSecs),
|
|
173
169
|
isOutlier: outlier,
|
|
174
170
|
parts: LazySeq.of(mats)
|
|
175
|
-
.distinctAndSortBy((m) => m.mat.partName, (m) => m.proc, (m) =>
|
|
171
|
+
.distinctAndSortBy((m) => m.mat.partName, (m) => m.proc, (m) => m.mat.action.type === ActionType.Loading ||
|
|
172
|
+
m.mat.action.type === ActionType.LoadingToBasket
|
|
173
|
+
? "LOAD"
|
|
174
|
+
: "UNLOAD")
|
|
176
175
|
.map((m) => ({
|
|
177
176
|
part: m.mat.partName + "-" + m.proc.toString(),
|
|
178
|
-
oper: m.mat.action.type === ActionType.Loading
|
|
177
|
+
oper: m.mat.action.type === ActionType.Loading ||
|
|
178
|
+
m.mat.action.type === ActionType.LoadingToBasket
|
|
179
|
+
? "LOAD"
|
|
180
|
+
: "UNLOAD",
|
|
179
181
|
}))
|
|
180
182
|
.toRArray(),
|
|
181
183
|
};
|
|
@@ -12,6 +12,7 @@ export declare enum MoveMaterialNodeKindType {
|
|
|
12
12
|
export type MoveMaterialNodeKind = {
|
|
13
13
|
readonly type: MoveMaterialNodeKindType.Material;
|
|
14
14
|
readonly material: Readonly<api.IInProcessMaterial> | null;
|
|
15
|
+
readonly identifier?: string;
|
|
15
16
|
} | {
|
|
16
17
|
readonly type: MoveMaterialNodeKindType.FreeMaterialZone;
|
|
17
18
|
} | {
|
package/dist/data/move-arrows.js
CHANGED
|
@@ -45,7 +45,7 @@ export var MoveMaterialNodeKindType;
|
|
|
45
45
|
export function uniqueIdForNodeKind(kind) {
|
|
46
46
|
switch (kind.type) {
|
|
47
47
|
case MoveMaterialNodeKindType.Material:
|
|
48
|
-
return "Material-" + (kind.material?.materialID ?? -1).toString();
|
|
48
|
+
return "Material-" + (kind.identifier ?? (kind.material?.materialID ?? -1).toString());
|
|
49
49
|
case MoveMaterialNodeKindType.FreeMaterialZone:
|
|
50
50
|
return "FreeMaterialZone";
|
|
51
51
|
case MoveMaterialNodeKindType.CompletedCollapsedMaterialZone:
|
|
@@ -63,7 +63,7 @@ export function uniqueIdForNodeKind(kind) {
|
|
|
63
63
|
export function memoPropsForNodeKind(kind) {
|
|
64
64
|
switch (kind.type) {
|
|
65
65
|
case MoveMaterialNodeKindType.Material:
|
|
66
|
-
return [kind.type, kind.material];
|
|
66
|
+
return [kind.type, kind.material, kind.identifier];
|
|
67
67
|
case MoveMaterialNodeKindType.FreeMaterialZone:
|
|
68
68
|
case MoveMaterialNodeKindType.CompletedCollapsedMaterialZone:
|
|
69
69
|
case MoveMaterialNodeKindType.CompletedExpandedMaterialZone:
|
|
@@ -257,6 +257,22 @@ export function computeArrows(container, allNodes) {
|
|
|
257
257
|
}
|
|
258
258
|
}
|
|
259
259
|
break;
|
|
260
|
+
case api.ActionType.LoadingToBasket: {
|
|
261
|
+
const basketId = mat.action.loadToBasketId;
|
|
262
|
+
if (basketId === undefined)
|
|
263
|
+
break;
|
|
264
|
+
const dest = byKind.baskets.get(basketId);
|
|
265
|
+
const lastSlotUsed = basketDestUsed.get(basketId) ?? 0;
|
|
266
|
+
basketDestUsed.set(basketId, lastSlotUsed + 1);
|
|
267
|
+
arrows.push({
|
|
268
|
+
fromX: rect.right,
|
|
269
|
+
fromY: rect.top + rect.height / 2,
|
|
270
|
+
toX: dest !== undefined ? dest.left + 20 : container.right - 10,
|
|
271
|
+
toY: dest !== undefined ? dest.top + 50 + 20 * lastSlotUsed : rect.top + rect.height / 2,
|
|
272
|
+
curveDirection: -1,
|
|
273
|
+
});
|
|
274
|
+
break;
|
|
275
|
+
}
|
|
260
276
|
}
|
|
261
277
|
}
|
|
262
278
|
return arrows.map((arr) => ({
|
|
@@ -107,12 +107,14 @@ function isMatAssignedRaw(unique, m) {
|
|
|
107
107
|
return (m.jobUnique === unique &&
|
|
108
108
|
m.location.type === api.LocType.InQueue &&
|
|
109
109
|
m.action.type !== api.ActionType.Loading &&
|
|
110
|
+
m.action.type !== api.ActionType.LoadingToBasket &&
|
|
110
111
|
m.process === 0);
|
|
111
112
|
}
|
|
112
113
|
function isMatUnassignedRaw(rawMatName, m) {
|
|
113
114
|
return (m.partName === rawMatName &&
|
|
114
115
|
m.location.type === api.LocType.InQueue &&
|
|
115
116
|
m.action.type !== api.ActionType.Loading &&
|
|
117
|
+
m.action.type !== api.ActionType.LoadingToBasket &&
|
|
116
118
|
m.process === 0 &&
|
|
117
119
|
!m.jobUnique);
|
|
118
120
|
}
|
package/dist/index.html
CHANGED
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
</style>
|
|
47
|
-
<script type="module" crossorigin src="/assets/index-
|
|
48
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
47
|
+
<script type="module" crossorigin src="/assets/index-Y5yNHUvc.js"></script>
|
|
48
|
+
<link rel="stylesheet" crossorigin href="/assets/index-DXfAwuj-.css">
|
|
49
49
|
</head>
|
|
50
50
|
<body>
|
|
51
51
|
<noscript> You need to enable JavaScript to run this app. </noscript>
|
package/dist/index.js
CHANGED
|
@@ -30,16 +30,15 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
30
30
|
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
31
31
|
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
32
32
|
*/
|
|
33
|
-
import {
|
|
34
|
-
import { registerNetworkBackend } from "./network/backend.js";
|
|
35
|
-
import { fmsInformation, loadInfo } from "./network/server-settings.js";
|
|
33
|
+
import { bootstrapInsight } from "./bootstrap.js";
|
|
36
34
|
import { ApiException } from "./network/api.js";
|
|
37
|
-
import { createStore } from "jotai";
|
|
38
35
|
async function main() {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
36
|
+
const developmentProps = import.meta.env.DEV
|
|
37
|
+
? {
|
|
38
|
+
submitBasketLoadStationCommand: async () => "accepted",
|
|
39
|
+
}
|
|
40
|
+
: {};
|
|
41
|
+
await bootstrapInsight(developmentProps);
|
|
43
42
|
}
|
|
44
43
|
main().catch((e) => {
|
|
45
44
|
console.log(e);
|
|
@@ -51,10 +50,3 @@ main().catch((e) => {
|
|
|
51
50
|
p.textContent = msg;
|
|
52
51
|
(document.getElementById("loading") ?? document.body).appendChild(p);
|
|
53
52
|
});
|
|
54
|
-
if ("serviceWorker" in navigator) {
|
|
55
|
-
void navigator.serviceWorker.getRegistrations().then((registrations) => {
|
|
56
|
-
for (const reg of registrations) {
|
|
57
|
-
void reg.unregister();
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
}
|
package/dist/network/api.d.ts
CHANGED
|
@@ -221,6 +221,8 @@ export declare class LogEntry implements ILogEntry {
|
|
|
221
221
|
loc: string;
|
|
222
222
|
locnum: number;
|
|
223
223
|
pal: number;
|
|
224
|
+
containerId?: string | undefined;
|
|
225
|
+
containerIds?: string[] | undefined;
|
|
224
226
|
program: string;
|
|
225
227
|
result: string;
|
|
226
228
|
elapsed: string;
|
|
@@ -243,6 +245,8 @@ export interface ILogEntry {
|
|
|
243
245
|
loc: string;
|
|
244
246
|
locnum: number;
|
|
245
247
|
pal: number;
|
|
248
|
+
containerId?: string | undefined;
|
|
249
|
+
containerIds?: string[] | undefined;
|
|
246
250
|
program: string;
|
|
247
251
|
result: string;
|
|
248
252
|
elapsed: string;
|
|
@@ -301,7 +305,9 @@ export declare enum LogType {
|
|
|
301
305
|
CancelRebooking = "CancelRebooking",
|
|
302
306
|
BasketLoadUnload = "BasketLoadUnload",
|
|
303
307
|
BasketCycle = "BasketCycle",
|
|
304
|
-
BasketInLocation = "BasketInLocation"
|
|
308
|
+
BasketInLocation = "BasketInLocation",
|
|
309
|
+
BasketIdentityHint = "BasketIdentityHint",
|
|
310
|
+
BasketContentSnapshot = "BasketContentSnapshot"
|
|
305
311
|
}
|
|
306
312
|
export declare class ToolUse implements IToolUse {
|
|
307
313
|
tool: string;
|
|
@@ -454,6 +460,9 @@ export interface IHoldPattern {
|
|
|
454
460
|
holdUnholdPatternRepeats: boolean;
|
|
455
461
|
}
|
|
456
462
|
export declare class ProcessInfo implements IProcessInfo {
|
|
463
|
+
extraFields?: {
|
|
464
|
+
[key: string]: number;
|
|
465
|
+
} | undefined;
|
|
457
466
|
basketLoadStations?: number[] | undefined;
|
|
458
467
|
expectedBasketLoadTime?: string | undefined;
|
|
459
468
|
basketUnloadStations?: number[] | undefined;
|
|
@@ -465,6 +474,9 @@ export declare class ProcessInfo implements IProcessInfo {
|
|
|
465
474
|
toJSON(data?: any): any;
|
|
466
475
|
}
|
|
467
476
|
export interface IProcessInfo {
|
|
477
|
+
extraFields?: {
|
|
478
|
+
[key: string]: number;
|
|
479
|
+
} | undefined;
|
|
468
480
|
basketLoadStations?: number[] | undefined;
|
|
469
481
|
expectedBasketLoadTime?: string | undefined;
|
|
470
482
|
basketUnloadStations?: number[] | undefined;
|
|
@@ -710,6 +722,7 @@ export declare class CurrentStatus implements ICurrentStatus {
|
|
|
710
722
|
[key: string]: BasketStatus;
|
|
711
723
|
} | undefined;
|
|
712
724
|
basketMoveInstructions?: BasketMoveInstruction[] | undefined;
|
|
725
|
+
customState?: unknown | undefined;
|
|
713
726
|
constructor(data?: ICurrentStatus);
|
|
714
727
|
init(_data?: any): void;
|
|
715
728
|
static fromJS(data: any): CurrentStatus;
|
|
@@ -734,6 +747,7 @@ export interface ICurrentStatus {
|
|
|
734
747
|
[key: string]: BasketStatus;
|
|
735
748
|
} | undefined;
|
|
736
749
|
basketMoveInstructions?: BasketMoveInstruction[] | undefined;
|
|
750
|
+
customState?: unknown | undefined;
|
|
737
751
|
}
|
|
738
752
|
export declare class HistoricJob extends Job implements IHistoricJob {
|
|
739
753
|
scheduleId?: string | undefined;
|
|
@@ -890,11 +904,14 @@ export declare enum LocType {
|
|
|
890
904
|
}
|
|
891
905
|
export declare class InProcessMaterialAction implements IInProcessMaterialAction {
|
|
892
906
|
type: ActionType;
|
|
907
|
+
workId?: string | undefined;
|
|
893
908
|
loadOntoPalletNum?: number | undefined;
|
|
894
909
|
loadOntoFace?: number | undefined;
|
|
895
910
|
processAfterLoad?: number | undefined;
|
|
896
911
|
pathAfterLoad?: number | undefined;
|
|
897
912
|
loadFromBasketId?: number | undefined;
|
|
913
|
+
loadToBasketId?: number | undefined;
|
|
914
|
+
loadToBasketSlot?: number | undefined;
|
|
898
915
|
unloadIntoQueue?: string | undefined;
|
|
899
916
|
unloadToBasketId?: number | undefined;
|
|
900
917
|
unloadToBasketSlot?: number | undefined;
|
|
@@ -909,11 +926,14 @@ export declare class InProcessMaterialAction implements IInProcessMaterialAction
|
|
|
909
926
|
}
|
|
910
927
|
export interface IInProcessMaterialAction {
|
|
911
928
|
type: ActionType;
|
|
929
|
+
workId?: string | undefined;
|
|
912
930
|
loadOntoPalletNum?: number | undefined;
|
|
913
931
|
loadOntoFace?: number | undefined;
|
|
914
932
|
processAfterLoad?: number | undefined;
|
|
915
933
|
pathAfterLoad?: number | undefined;
|
|
916
934
|
loadFromBasketId?: number | undefined;
|
|
935
|
+
loadToBasketId?: number | undefined;
|
|
936
|
+
loadToBasketSlot?: number | undefined;
|
|
917
937
|
unloadIntoQueue?: string | undefined;
|
|
918
938
|
unloadToBasketId?: number | undefined;
|
|
919
939
|
unloadToBasketSlot?: number | undefined;
|
|
@@ -927,7 +947,8 @@ export declare enum ActionType {
|
|
|
927
947
|
Loading = "Loading",
|
|
928
948
|
UnloadToInProcess = "UnloadToInProcess",
|
|
929
949
|
UnloadToCompletedMaterial = "UnloadToCompletedMaterial",
|
|
930
|
-
Machining = "Machining"
|
|
950
|
+
Machining = "Machining",
|
|
951
|
+
LoadingToBasket = "LoadingToBasket"
|
|
931
952
|
}
|
|
932
953
|
export declare class QueueInfo implements IQueueInfo {
|
|
933
954
|
maxSizeBeforeStopUnloading?: number | undefined;
|
package/dist/network/api.js
CHANGED
|
@@ -2386,6 +2386,12 @@ export class LogEntry {
|
|
|
2386
2386
|
this.loc = _data["loc"];
|
|
2387
2387
|
this.locnum = _data["locnum"];
|
|
2388
2388
|
this.pal = _data["pal"];
|
|
2389
|
+
this.containerId = _data["containerId"];
|
|
2390
|
+
if (Array.isArray(_data["containerIds"])) {
|
|
2391
|
+
this.containerIds = [];
|
|
2392
|
+
for (let item of _data["containerIds"])
|
|
2393
|
+
this.containerIds.push(item);
|
|
2394
|
+
}
|
|
2389
2395
|
this.program = _data["program"];
|
|
2390
2396
|
this.result = _data["result"];
|
|
2391
2397
|
this.elapsed = _data["elapsed"];
|
|
@@ -2424,6 +2430,12 @@ export class LogEntry {
|
|
|
2424
2430
|
data["loc"] = this.loc;
|
|
2425
2431
|
data["locnum"] = this.locnum;
|
|
2426
2432
|
data["pal"] = this.pal;
|
|
2433
|
+
data["containerId"] = this.containerId;
|
|
2434
|
+
if (Array.isArray(this.containerIds)) {
|
|
2435
|
+
data["containerIds"] = [];
|
|
2436
|
+
for (let item of this.containerIds)
|
|
2437
|
+
data["containerIds"].push(item);
|
|
2438
|
+
}
|
|
2427
2439
|
data["program"] = this.program;
|
|
2428
2440
|
data["result"] = this.result;
|
|
2429
2441
|
data["elapsed"] = this.elapsed;
|
|
@@ -2510,6 +2522,8 @@ export var LogType;
|
|
|
2510
2522
|
LogType["BasketLoadUnload"] = "BasketLoadUnload";
|
|
2511
2523
|
LogType["BasketCycle"] = "BasketCycle";
|
|
2512
2524
|
LogType["BasketInLocation"] = "BasketInLocation";
|
|
2525
|
+
LogType["BasketIdentityHint"] = "BasketIdentityHint";
|
|
2526
|
+
LogType["BasketContentSnapshot"] = "BasketContentSnapshot";
|
|
2513
2527
|
})(LogType || (LogType = {}));
|
|
2514
2528
|
export class ToolUse {
|
|
2515
2529
|
constructor(data) {
|
|
@@ -2903,6 +2917,13 @@ export class ProcessInfo {
|
|
|
2903
2917
|
}
|
|
2904
2918
|
init(_data) {
|
|
2905
2919
|
if (_data) {
|
|
2920
|
+
if (_data["ExtraFields"]) {
|
|
2921
|
+
this.extraFields = {};
|
|
2922
|
+
for (let key in _data["ExtraFields"]) {
|
|
2923
|
+
if (_data["ExtraFields"].hasOwnProperty(key))
|
|
2924
|
+
this.extraFields[key] = _data["ExtraFields"][key];
|
|
2925
|
+
}
|
|
2926
|
+
}
|
|
2906
2927
|
if (Array.isArray(_data["BasketLoadStations"])) {
|
|
2907
2928
|
this.basketLoadStations = [];
|
|
2908
2929
|
for (let item of _data["BasketLoadStations"])
|
|
@@ -2930,6 +2951,13 @@ export class ProcessInfo {
|
|
|
2930
2951
|
}
|
|
2931
2952
|
toJSON(data) {
|
|
2932
2953
|
data = typeof data === "object" ? data : {};
|
|
2954
|
+
if (this.extraFields) {
|
|
2955
|
+
data["ExtraFields"] = {};
|
|
2956
|
+
for (let key in this.extraFields) {
|
|
2957
|
+
if (this.extraFields.hasOwnProperty(key))
|
|
2958
|
+
data["ExtraFields"][key] = this.extraFields[key];
|
|
2959
|
+
}
|
|
2960
|
+
}
|
|
2933
2961
|
if (Array.isArray(this.basketLoadStations)) {
|
|
2934
2962
|
data["BasketLoadStations"] = [];
|
|
2935
2963
|
for (let item of this.basketLoadStations)
|
|
@@ -3533,6 +3561,7 @@ export class CurrentStatus {
|
|
|
3533
3561
|
for (let item of _data["BasketMoveInstructions"])
|
|
3534
3562
|
this.basketMoveInstructions.push(BasketMoveInstruction.fromJS(item));
|
|
3535
3563
|
}
|
|
3564
|
+
this.customState = _data["CustomState"];
|
|
3536
3565
|
}
|
|
3537
3566
|
}
|
|
3538
3567
|
static fromJS(data) {
|
|
@@ -3607,6 +3636,7 @@ export class CurrentStatus {
|
|
|
3607
3636
|
for (let item of this.basketMoveInstructions)
|
|
3608
3637
|
data["BasketMoveInstructions"].push(item ? item.toJSON() : undefined);
|
|
3609
3638
|
}
|
|
3639
|
+
data["CustomState"] = this.customState;
|
|
3610
3640
|
return data;
|
|
3611
3641
|
}
|
|
3612
3642
|
}
|
|
@@ -3951,11 +3981,14 @@ export class InProcessMaterialAction {
|
|
|
3951
3981
|
init(_data) {
|
|
3952
3982
|
if (_data) {
|
|
3953
3983
|
this.type = _data["Type"];
|
|
3984
|
+
this.workId = _data["WorkId"];
|
|
3954
3985
|
this.loadOntoPalletNum = _data["LoadOntoPalletNum"];
|
|
3955
3986
|
this.loadOntoFace = _data["LoadOntoFace"];
|
|
3956
3987
|
this.processAfterLoad = _data["ProcessAfterLoad"];
|
|
3957
3988
|
this.pathAfterLoad = _data["PathAfterLoad"];
|
|
3958
3989
|
this.loadFromBasketId = _data["LoadFromBasketId"];
|
|
3990
|
+
this.loadToBasketId = _data["LoadToBasketId"];
|
|
3991
|
+
this.loadToBasketSlot = _data["LoadToBasketSlot"];
|
|
3959
3992
|
this.unloadIntoQueue = _data["UnloadIntoQueue"];
|
|
3960
3993
|
this.unloadToBasketId = _data["UnloadToBasketId"];
|
|
3961
3994
|
this.unloadToBasketSlot = _data["UnloadToBasketSlot"];
|
|
@@ -3974,11 +4007,14 @@ export class InProcessMaterialAction {
|
|
|
3974
4007
|
toJSON(data) {
|
|
3975
4008
|
data = typeof data === "object" ? data : {};
|
|
3976
4009
|
data["Type"] = this.type;
|
|
4010
|
+
data["WorkId"] = this.workId;
|
|
3977
4011
|
data["LoadOntoPalletNum"] = this.loadOntoPalletNum;
|
|
3978
4012
|
data["LoadOntoFace"] = this.loadOntoFace;
|
|
3979
4013
|
data["ProcessAfterLoad"] = this.processAfterLoad;
|
|
3980
4014
|
data["PathAfterLoad"] = this.pathAfterLoad;
|
|
3981
4015
|
data["LoadFromBasketId"] = this.loadFromBasketId;
|
|
4016
|
+
data["LoadToBasketId"] = this.loadToBasketId;
|
|
4017
|
+
data["LoadToBasketSlot"] = this.loadToBasketSlot;
|
|
3982
4018
|
data["UnloadIntoQueue"] = this.unloadIntoQueue;
|
|
3983
4019
|
data["UnloadToBasketId"] = this.unloadToBasketId;
|
|
3984
4020
|
data["UnloadToBasketSlot"] = this.unloadToBasketSlot;
|
|
@@ -3996,6 +4032,7 @@ export var ActionType;
|
|
|
3996
4032
|
ActionType["UnloadToInProcess"] = "UnloadToInProcess";
|
|
3997
4033
|
ActionType["UnloadToCompletedMaterial"] = "UnloadToCompletedMaterial";
|
|
3998
4034
|
ActionType["Machining"] = "Machining";
|
|
4035
|
+
ActionType["LoadingToBasket"] = "LoadingToBasket";
|
|
3999
4036
|
})(ActionType || (ActionType = {}));
|
|
4000
4037
|
export class QueueInfo {
|
|
4001
4038
|
constructor(data) {
|
|
@@ -54,4 +54,6 @@ export declare function registerNetworkBackend(): void;
|
|
|
54
54
|
export declare function setOtherLogBackends(servers: ReadonlyArray<string>): void;
|
|
55
55
|
export declare function registerBackend(log: LogAPI, job: JobAPI, fms: FmsAPI, machine: MachineAPI): void;
|
|
56
56
|
export declare function setUserToken(u: User): void;
|
|
57
|
+
/** Performs a request using the authenticated Insight user's bearer token, when present. */
|
|
58
|
+
export declare function authenticatedFetch(url: RequestInfo, init?: RequestInit): Promise<Response>;
|
|
57
59
|
export declare function instructionUrl(partName: string, type: string, matId: number, pallet: number | null, proc: number | null | undefined, operator: string | null): string;
|
package/dist/network/backend.js
CHANGED
|
@@ -37,6 +37,7 @@ export let LogBackend;
|
|
|
37
37
|
export let MachineBackend;
|
|
38
38
|
let otherLogServers = [];
|
|
39
39
|
export let OtherLogBackends = [];
|
|
40
|
+
let userAccessToken;
|
|
40
41
|
export function registerNetworkBackend() {
|
|
41
42
|
LogBackend = new api.LogClient();
|
|
42
43
|
MachineBackend = new api.MachinesClient();
|
|
@@ -54,16 +55,20 @@ export function registerBackend(log, job, fms, machine) {
|
|
|
54
55
|
MachineBackend = machine;
|
|
55
56
|
}
|
|
56
57
|
export function setUserToken(u) {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
58
|
+
userAccessToken = u.access_token;
|
|
59
|
+
const http = { fetch: authenticatedFetch };
|
|
60
|
+
FmsServerBackend = new api.FmsClient(undefined, http);
|
|
61
|
+
JobsBackend = new api.JobsClient(undefined, http);
|
|
62
|
+
LogBackend = new api.LogClient(undefined, http);
|
|
63
|
+
OtherLogBackends = otherLogServers.map((s) => new api.LogClient(s, http));
|
|
64
|
+
}
|
|
65
|
+
/** Performs a request using the authenticated Insight user's bearer token, when present. */
|
|
66
|
+
export function authenticatedFetch(url, init) {
|
|
67
|
+
const headers = new Headers(init?.headers);
|
|
68
|
+
if (userAccessToken) {
|
|
69
|
+
headers.set("Authorization", "Bearer " + userAccessToken);
|
|
62
70
|
}
|
|
63
|
-
|
|
64
|
-
JobsBackend = new api.JobsClient(undefined, { fetch });
|
|
65
|
-
LogBackend = new api.LogClient(undefined, { fetch });
|
|
66
|
-
OtherLogBackends = otherLogServers.map((s) => new api.LogClient(s, { fetch }));
|
|
71
|
+
return window.fetch(url, init ? { ...init, headers } : { headers });
|
|
67
72
|
}
|
|
68
73
|
export function instructionUrl(partName, type, matId, pallet, proc, operator) {
|
|
69
74
|
return ("/api/v1/fms/find-instructions/" +
|