@imperosoft/cris-webui-components 1.4.0 → 1.5.0
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/index.js +25 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +26 -7
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1134,6 +1134,7 @@ function CrisOfflinePage({
|
|
|
1134
1134
|
});
|
|
1135
1135
|
const processorHost = processorHostProp ?? (typeof window !== "undefined" ? window.location.hostname : "localhost");
|
|
1136
1136
|
const isError = connectionStatus === "error" || hasSeenError && connectionStatus !== "connected";
|
|
1137
|
+
const isWsTransport = (0, import_cris_webui_ch5_core6.getActiveTransport)() === "ws";
|
|
1137
1138
|
(0, import_react3.useEffect)(() => {
|
|
1138
1139
|
if (connectionStatus === "error") {
|
|
1139
1140
|
setHasSeenError(true);
|
|
@@ -1182,6 +1183,7 @@ function CrisOfflinePage({
|
|
|
1182
1183
|
return () => clearTimeout(timer);
|
|
1183
1184
|
}, [retryCountdown, retryConnection]);
|
|
1184
1185
|
(0, import_react3.useEffect)(() => {
|
|
1186
|
+
if (isWsTransport) return;
|
|
1185
1187
|
if (isError && isDeployedOnProcessor && loginRedirectDelay > 0 && !returnedFromLogin) {
|
|
1186
1188
|
const timer = setTimeout(() => {
|
|
1187
1189
|
try {
|
|
@@ -1192,7 +1194,7 @@ function CrisOfflinePage({
|
|
|
1192
1194
|
}, loginRedirectDelay);
|
|
1193
1195
|
return () => clearTimeout(timer);
|
|
1194
1196
|
}
|
|
1195
|
-
}, [isError, isDeployedOnProcessor, loginUrl, loginRedirectDelay, returnedFromLogin]);
|
|
1197
|
+
}, [isError, isDeployedOnProcessor, loginUrl, loginRedirectDelay, returnedFromLogin, isWsTransport]);
|
|
1196
1198
|
const envInfo = {
|
|
1197
1199
|
userAgent: typeof navigator !== "undefined" ? navigator.userAgent : "N/A",
|
|
1198
1200
|
hasCrComLib: typeof window !== "undefined" && typeof window.CrComLib !== "undefined",
|
|
@@ -1213,9 +1215,9 @@ function CrisOfflinePage({
|
|
|
1213
1215
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: `cris-offline-page absolute inset-0 bg-gray-900 flex flex-col items-center justify-center overflow-auto py-8 ${className}`, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "text-center max-w-4xl px-4", children: [
|
|
1214
1216
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "mb-8", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: `w-16 h-16 mx-auto rounded-full flex items-center justify-center ${isError ? "bg-red-500/20" : "bg-yellow-500/20"}`, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: `w-8 h-8 rounded-full ${isError ? "bg-red-500" : "bg-yellow-500 animate-pulse"}` }) }) }),
|
|
1215
1217
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("h1", { className: "text-2xl font-bold text-white mb-2", children: isError ? isTimeoutError ? "Processor Unreachable" : "Connection Error" : "Connecting..." }),
|
|
1216
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "text-gray-400", children: isError ? isDeployedOnProcessor ? returnedFromLogin ? "Connection failed after login. Please try again." : "Redirecting to login page..." : isTimeoutError ? "Could not connect to the processor. Check the IP address and network connection." : "WebSocket connection failed. SSL certificate may need to be accepted." : "Establishing connection to control system" }),
|
|
1217
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "mt-8", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: `px-4 py-2 rounded-full text-sm font-medium ${isError ? "bg-red-500/20 text-red-400" : "bg-yellow-500/20 text-yellow-400"}`, children: isError ? isTimeoutError ? "Connection Timeout" : isDevMode ? "Dev Mode - Auth Error" : isVC4 ? "VC4 - Not Authorized" : "Auth Error" : "Connecting" }) }),
|
|
1218
|
-
isError && !isDeployedOnProcessor && isTimeoutError && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "mt-[2em] bg-orange-500/10 border border-orange-500/30 rounded-xl", style: { overflow: "visible", padding: "1.5em 1.5em 2em 1.5em" }, children: [
|
|
1218
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "text-gray-400", children: isError ? isWsTransport ? "Control system is not responding. Reconnecting automatically..." : isDeployedOnProcessor ? returnedFromLogin ? "Connection failed after login. Please try again." : "Redirecting to login page..." : isTimeoutError ? "Could not connect to the processor. Check the IP address and network connection." : "WebSocket connection failed. SSL certificate may need to be accepted." : "Establishing connection to control system" }),
|
|
1219
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "mt-8", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: `px-4 py-2 rounded-full text-sm font-medium ${isError ? "bg-red-500/20 text-red-400" : "bg-yellow-500/20 text-yellow-400"}`, children: isError ? isWsTransport ? "Reconnecting" : isTimeoutError ? "Connection Timeout" : isDevMode ? "Dev Mode - Auth Error" : isVC4 ? "VC4 - Not Authorized" : "Auth Error" : "Connecting" }) }),
|
|
1220
|
+
isError && !isWsTransport && !isDeployedOnProcessor && isTimeoutError && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "mt-[2em] bg-orange-500/10 border border-orange-500/30 rounded-xl", style: { overflow: "visible", padding: "1.5em 1.5em 2em 1.5em" }, children: [
|
|
1219
1221
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("p", { className: "text-orange-400 font-medium", style: { fontSize: "1.2em", marginBottom: "1em" }, children: [
|
|
1220
1222
|
"The processor at ",
|
|
1221
1223
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "text-white", children: processorHost }),
|
|
@@ -1236,7 +1238,24 @@ function CrisOfflinePage({
|
|
|
1236
1238
|
}
|
|
1237
1239
|
) })
|
|
1238
1240
|
] }),
|
|
1239
|
-
isError &&
|
|
1241
|
+
isError && isWsTransport && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "mt-[2em] bg-orange-500/10 border border-orange-500/30 rounded-xl", style: { overflow: "visible", padding: "1.5em 1.5em 2em 1.5em" }, children: [
|
|
1242
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("p", { className: "text-orange-400 font-medium", style: { fontSize: "1.2em", marginBottom: "1em" }, children: [
|
|
1243
|
+
"The control system at ",
|
|
1244
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "text-white", children: processorHost }),
|
|
1245
|
+
" is not responding."
|
|
1246
|
+
] }),
|
|
1247
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "text-gray-400", style: { fontSize: "1em", marginBottom: "1em" }, children: "It may be restarting (e.g. a program update). The connection retries automatically." }),
|
|
1248
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "flex gap-[1em] justify-center", style: { overflow: "visible" }, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1249
|
+
"button",
|
|
1250
|
+
{
|
|
1251
|
+
onClick: retryConnection,
|
|
1252
|
+
className: "bg-orange-600 hover:bg-orange-500 text-white font-medium rounded-xl transition-colors",
|
|
1253
|
+
style: { padding: "1em 2em", fontSize: "1.2em", whiteSpace: "nowrap", overflow: "visible" },
|
|
1254
|
+
children: "Retry Now"
|
|
1255
|
+
}
|
|
1256
|
+
) })
|
|
1257
|
+
] }),
|
|
1258
|
+
isError && !isWsTransport && !isDeployedOnProcessor && !isTimeoutError && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "mt-[2em] bg-blue-500/10 border border-blue-500/30 rounded-xl", style: { overflow: "visible", padding: "1.5em 1.5em 2em 1.5em" }, children: retryCountdown !== null ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "text-center", style: { overflow: "visible" }, children: [
|
|
1240
1259
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("p", { className: "text-blue-400 font-medium", style: { fontSize: "1.4em", marginBottom: "1em" }, children: [
|
|
1241
1260
|
"Retrying connection in ",
|
|
1242
1261
|
retryCountdown,
|
|
@@ -1275,7 +1294,7 @@ function CrisOfflinePage({
|
|
|
1275
1294
|
] }),
|
|
1276
1295
|
certPageOpened && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "text-gray-400", style: { fontSize: "1em", marginTop: "1em" }, children: "Connection will auto-retry when you return to this page." })
|
|
1277
1296
|
] }) }),
|
|
1278
|
-
isError && isDeployedOnProcessor && returnedFromLogin && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "mt-[2em] bg-red-500/10 border border-red-500/30 rounded-xl", style: { overflow: "visible", padding: "1.5em 1.5em 2em 1.5em" }, children: [
|
|
1297
|
+
isError && !isWsTransport && isDeployedOnProcessor && returnedFromLogin && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "mt-[2em] bg-red-500/10 border border-red-500/30 rounded-xl", style: { overflow: "visible", padding: "1.5em 1.5em 2em 1.5em" }, children: [
|
|
1279
1298
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "text-red-400 font-medium", style: { fontSize: "1.2em", marginBottom: "1em" }, children: "Connection failed after authentication." }),
|
|
1280
1299
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "text-gray-400", style: { fontSize: "1em", marginBottom: "1em" }, children: "This may be due to an expired session or WebSocket connection issue." }),
|
|
1281
1300
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex gap-[1em] justify-center flex-wrap", style: { overflow: "visible" }, children: [
|