@overvis/hmi-workspace-ui 0.1.0 → 0.1.2
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/alarm-list-DKFio0hg.js +414 -0
- package/dist/alarm-rule-dialog-mb4_nHRW.js +417 -0
- package/dist/{alarm-rule-lists-C5v1Kf7A.js → alarm-rule-lists-CfZXTWkK.js} +123 -125
- package/dist/{alarm-rules-page-CqFzofPd.js → alarm-rules-page-DBLSkrrG.js} +15 -18
- package/dist/alert-dialog-D_iDv2lQ.js +891 -0
- package/dist/{base-revision-YCO27zR4.js → base-revision-DLF9EnGV.js} +26 -29
- package/dist/{breadcrumbs-0cjsV2cq.js → breadcrumbs-D5R6Fz74.js} +6 -7
- package/dist/{catalog-list-DjZojYLJ.js → catalog-list-BkWosvh1.js} +2 -4
- package/dist/{code-editor-BVimvjDV.js → code-editor-DCM0KdMJ.js} +9 -6
- package/dist/dashboard-bindings.js +1 -2
- package/dist/{dashboards-page-BlrJguNz.js → dashboards-page-DLc11Vzu.js} +335 -359
- package/dist/{de-14WdmJxZ.js → de-Z2er-E5v.js} +4 -2
- package/dist/diagnostic-text-CYZFPiND.js +116 -0
- package/dist/{dialogs-D_v1LeH4.js → dialogs-BX023zml.js} +2523 -2590
- package/dist/{dialogs-B6BRnf3Q.js → dialogs-DEOg9lxy.js} +219 -227
- package/dist/{display-DmOo23mi.js → display-VYGzneE0.js} +4 -6
- package/dist/{editor-language-To9MxloY.js → editor-language-CGENZxbI.js} +3 -5
- package/dist/editor-page-CaN52OQh.js +1337 -0
- package/dist/{en-BgercpT0.js → en-CKPPL6bQ.js} +4 -2
- package/dist/entity-controls-DJT47yeV.js +71 -0
- package/dist/errors-BAWoH_5w.js +25 -0
- package/dist/{footer-DC-Q0052.js → footer-CbPMP8aq.js} +2404 -2515
- package/dist/host.js +8254 -675
- package/dist/{i18n-BgzakKoC.js → i18n-ChjEbYEg.js} +77 -90
- package/dist/i18n.js +1 -2
- package/dist/index.js +5168 -5353
- package/dist/{lat-lng-B12P7QyY.js → lat-lng-Bl77AGSO.js} +1 -2
- package/dist/{list-page-CvsdZb86.js → list-page-Fa29SkaJ.js} +116 -123
- package/dist/{location-map-renderer-DO5yfdSU.js → location-map-renderer-DvXIYc1Z.js} +6 -6
- package/dist/{location-picker-renderer-CjCxg6ai.js → location-picker-renderer-B1_-n8lf.js} +3 -4
- package/dist/{model-B8gGi4OK.js → model-tpg_xpFB.js} +1 -2
- package/dist/{notice-card-DyGywFsW.js → notice-card-V_0K0lO0.js} +54 -58
- package/dist/page-B5te_1Lc.js +449 -0
- package/dist/{page-v6LCwswN.js → page-BorlLnMX.js} +92 -100
- package/dist/page-DxF7FOve.js +507 -0
- package/dist/panel-DuZD-cBP.js +949 -0
- package/dist/parameter-values.js +3 -16
- package/dist/{pl-lQ9HXV9k.js → pl-DVABrn5G.js} +4 -2
- package/dist/presence-code-DsabLTZs.js +73 -0
- package/dist/{query-gate-DVhNIkge.js → query-gate-BbIo1Xrj.js} +6 -6
- package/dist/{provider-DoEpKcQ-.js → quick-report-BcZsfkCZ.js} +9423 -5102
- package/dist/{retention-BYXNpYmR.js → retention-C7EZsq8u.js} +4 -6
- package/dist/retention-note-CmMeHV_u.js +40 -0
- package/dist/{rolldown-runtime-Dy4uBu1J.js → rolldown-runtime-CGnMp29N.js} +1 -2
- package/dist/{ru-qTKINoUj.js → ru-CBRLC_xM.js} +8 -6
- package/dist/run-text-CDdfbKbg.js +112 -0
- package/dist/{search-D4rDnE9T.js → search-C6xQ_Hvo.js} +26 -29
- package/dist/{sections-kCOyc4NR.js → sections-D_SBfVzV.js} +2 -3
- package/dist/{select-BKiOWdSr.js → select-nNLG-AMz.js} +17 -23
- package/dist/{spinner-C-HPNxOc.js → spinner-B-KLtBjp.js} +182 -201
- package/dist/src/code-editor/code-editor.d.ts +3 -0
- package/dist/src/code-editor/taskfile-language.d.ts +22 -2
- package/dist/src/i18n/catalogs/de/edge-program.d.ts +3 -0
- package/dist/src/i18n/catalogs/de.d.ts +3 -0
- package/dist/src/i18n/catalogs/en/edge-program.d.ts +3 -0
- package/dist/src/i18n/catalogs/en.d.ts +3 -0
- package/dist/src/i18n/catalogs/pl/edge-program.d.ts +3 -0
- package/dist/src/i18n/catalogs/pl.d.ts +3 -0
- package/dist/src/i18n/catalogs/ru/edge-program.d.ts +5 -2
- package/dist/src/i18n/catalogs/ru/graphics.d.ts +2 -2
- package/dist/src/i18n/catalogs/ru.d.ts +7 -4
- package/dist/src/i18n/catalogs/uk/edge-program.d.ts +5 -2
- package/dist/src/i18n/catalogs/uk/graphics.d.ts +2 -2
- package/dist/src/i18n/catalogs/uk.d.ts +7 -4
- package/dist/src/version.d.ts +1 -1
- package/dist/src/workspace/graphics/inspector/item.d.ts +6 -6
- package/dist/src/workspace/local-workspace-app.d.ts +1 -1
- package/dist/src/workspace/routes.d.ts +1 -1
- package/dist/{starter-fields-BRLX0z-v.js → starter-fields-7S3LmtGa.js} +154 -157
- package/dist/{starter-handoff-BA3ucMKL.js → starter-handoff-BaK8Ss8I.js} +1 -2
- package/dist/styles.css +1 -1
- package/dist/ui.js +334 -374
- package/dist/{uk-CwpJAxmx.js → uk-17pbVYZa.js} +8 -6
- package/dist/{wireguard-docs-AfU6NzTL.js → wireguard-docs-Clb-7xRY.js} +14 -17
- package/package.json +15 -9
- package/dist/alarm-list-BL3xQ5Lf.js +0 -423
- package/dist/alarm-rule-dialog-S1ZUg-74.js +0 -423
- package/dist/alert-B8MAoIO8.js +0 -45
- package/dist/alert-dialog-CYkuMg5D.js +0 -129
- package/dist/api-error-9rQmUN5L.js +0 -93
- package/dist/breadcrumb-DzVL1yHa.js +0 -74
- package/dist/button-6SxPBYMz.js +0 -44
- package/dist/context-u9KJQmdB.js +0 -102
- package/dist/copyable-id-DYGiAcnq.js +0 -40
- package/dist/dashboard-context-CBfG6DoT.js +0 -191
- package/dist/date-time-picker-C3FhMXk6.js +0 -266
- package/dist/diagnostic-text-BAkzW0SE.js +0 -111
- package/dist/diagnostic-text-DiKd2i1w.js +0 -76
- package/dist/dialog-BIhQXcZC.js +0 -237
- package/dist/dialog-BqyIxMD-.js +0 -54
- package/dist/dropdown-menu-DSzbBq3v.js +0 -136
- package/dist/editor-page-BiSZJz5b.js +0 -1353
- package/dist/empty-B-QJ-06w.js +0 -59
- package/dist/entity-controls-D1K4Ot3O.js +0 -76
- package/dist/errors-CcsvDHu8.js +0 -26
- package/dist/history-page-sAAhG54V.js +0 -1400
- package/dist/icon-D-pR9htW.js +0 -57
- package/dist/index-page-DMH82fZe.js +0 -214
- package/dist/item-B5SaTFQU.js +0 -120
- package/dist/mutation-form-validators-BNz5bsv1.js +0 -2408
- package/dist/mutations-THtGG6Ai.js +0 -240
- package/dist/page-2KPemaAj.js +0 -328
- package/dist/page-6rIoTg2L.js +0 -459
- package/dist/page-C6giEoEd.js +0 -1935
- package/dist/page-DCbTxKsi.js +0 -313
- package/dist/page-DWO427hT.js +0 -208
- package/dist/page-LXu_2zm3.js +0 -137
- package/dist/page-aaUiVOnk.js +0 -513
- package/dist/page-header-RB2YFWlE.js +0 -55
- package/dist/page-title-CdCbiLt8.js +0 -14
- package/dist/panel-DDy8tUNR.js +0 -338
- package/dist/presence-code-BfSXr50g.js +0 -83
- package/dist/progress-C7cxNJA1.js +0 -83
- package/dist/provider-BOeYHi0n.js +0 -134
- package/dist/quick-report-CUVJnbKP.js +0 -416
- package/dist/radio-group-CZGqVbkJ.js +0 -26
- package/dist/retention-note-CHhA6gjY.js +0 -42
- package/dist/run-text-DvaO8LDF.js +0 -113
- package/dist/select-eNgZdZ30.js +0 -521
- package/dist/skeleton-6yk8Tdh5.js +0 -19
- package/dist/slider-DorDsoF8.js +0 -37
- package/dist/status-page-DAHiKM9P.js +0 -3286
- package/dist/switch-BqD0RH_G.js +0 -18
- package/dist/table-Q2-voLuw.js +0 -65
- package/dist/tabs-CSIucYFP.js +0 -57
- package/dist/theme-provider-BkRohQFU.js +0 -61
- package/dist/toggle-group-9Bs0Mm3r.js +0 -82
- package/dist/trpc-CvJUuUXp.js +0 -153
- package/dist/utils-CX-Pz5p6.js +0 -8
- package/dist/writability-BuH-spxv.js +0 -57
|
@@ -1,416 +0,0 @@
|
|
|
1
|
-
import { r as e } from "./trpc-CvJUuUXp.js";
|
|
2
|
-
import { f as t, m as n, n as r, v as i } from "./i18n-BgzakKoC.js";
|
|
3
|
-
import { T as a } from "./mutation-form-validators-BNz5bsv1.js";
|
|
4
|
-
import { r as o } from "./writability-BuH-spxv.js";
|
|
5
|
-
import { useCallback as s } from "react";
|
|
6
|
-
import { canonicalJsonString as c, formatAppDateTime as l, parseAppDateTime as u, parseExactAppDateTime as d, resolveLocalized as f } from "@overvis/hmi-shared";
|
|
7
|
-
import "@overvis/hmi-shared/parameter";
|
|
8
|
-
import { REPORT_PRESET_TEMPORARY_MAX_PARAMETER_IDS as p } from "@overvis/hmi-shared/report";
|
|
9
|
-
//#region src/workspace/parameters/runtime-errors.ts
|
|
10
|
-
function m(e) {
|
|
11
|
-
switch (e) {
|
|
12
|
-
case "bad_request": return t("parameter_runtime_error_bad_request");
|
|
13
|
-
case "param_not_found": return t("parameter_runtime_error_param_not_found");
|
|
14
|
-
case "param_disabled": return t("parameter_runtime_error_param_disabled");
|
|
15
|
-
case "not_writable": return t("parameter_runtime_error_not_writable");
|
|
16
|
-
case "unsupported_value_type": return t("parameter_runtime_error_unsupported_value_type");
|
|
17
|
-
case "decode_error": return t("parameter_runtime_error_decode_error");
|
|
18
|
-
case "encode_error": return t("parameter_runtime_error_encode_error");
|
|
19
|
-
case "formula_error": return t("parameter_runtime_error_formula_error");
|
|
20
|
-
case "cycle_detected": return t("parameter_runtime_error_cycle_detected");
|
|
21
|
-
case "depth_exceeded": return t("parameter_runtime_error_depth_exceeded");
|
|
22
|
-
case "atomic_unsatisfiable": return t("parameter_runtime_error_atomic_unsatisfiable");
|
|
23
|
-
case "sparse_write_unsupported": return t("parameter_runtime_error_sparse_write_unsupported");
|
|
24
|
-
case "endpoint_not_found": return t("parameter_runtime_error_endpoint_not_found");
|
|
25
|
-
case "endpoint_disconnected": return t("parameter_runtime_error_endpoint_disconnected");
|
|
26
|
-
case "modbus_exception": return t("parameter_runtime_error_modbus_exception");
|
|
27
|
-
case "timeout": return t("parameter_runtime_error_timeout");
|
|
28
|
-
case "connector_rejected": return t("parameter_runtime_error_connector_rejected");
|
|
29
|
-
case "internal_error": return t("parameter_runtime_error_internal_error");
|
|
30
|
-
default: return e;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
function h(e, t) {
|
|
34
|
-
if (e == null || !(t in e)) return null;
|
|
35
|
-
let n = e[t];
|
|
36
|
-
return n == null ? null : String(n);
|
|
37
|
-
}
|
|
38
|
-
function g(e) {
|
|
39
|
-
switch (e) {
|
|
40
|
-
case "1": return t("parameter_runtime_error_modbus_exception_name_illegal_function");
|
|
41
|
-
case "2": return t("parameter_runtime_error_modbus_exception_name_illegal_data_address");
|
|
42
|
-
case "3": return t("parameter_runtime_error_modbus_exception_name_illegal_data_value");
|
|
43
|
-
case "4": return t("parameter_runtime_error_modbus_exception_name_slave_device_failure");
|
|
44
|
-
case "5": return t("parameter_runtime_error_modbus_exception_name_acknowledge");
|
|
45
|
-
case "6": return t("parameter_runtime_error_modbus_exception_name_slave_device_busy");
|
|
46
|
-
case "8": return t("parameter_runtime_error_modbus_exception_name_memory_parity_error");
|
|
47
|
-
case "10": return t("parameter_runtime_error_modbus_exception_name_gateway_path_unavailable");
|
|
48
|
-
case "11": return t("parameter_runtime_error_modbus_exception_name_gateway_target_failed");
|
|
49
|
-
default: return t("parameter_runtime_error_modbus_exception_name_unknown", { exceptionCode: e });
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
function _(e) {
|
|
53
|
-
let n = h(e, "exceptionCode");
|
|
54
|
-
return n == null ? null : t("parameter_runtime_error_modbus_exception_short", {
|
|
55
|
-
exceptionCode: n,
|
|
56
|
-
exceptionName: g(n)
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
function v(e) {
|
|
60
|
-
if (h(e, "exceptionCode") !== "2") return null;
|
|
61
|
-
let n = h(e, "functionCode") ?? "?";
|
|
62
|
-
return [
|
|
63
|
-
"5",
|
|
64
|
-
"6",
|
|
65
|
-
"15",
|
|
66
|
-
"16"
|
|
67
|
-
].includes(n) ? t("parameter_runtime_error_write_access_help") : [
|
|
68
|
-
"1",
|
|
69
|
-
"2",
|
|
70
|
-
"3",
|
|
71
|
-
"4"
|
|
72
|
-
].includes(n) ? t("parameter_runtime_error_read_access_help") : null;
|
|
73
|
-
}
|
|
74
|
-
function y(e) {
|
|
75
|
-
let n = h(e, "exceptionCode");
|
|
76
|
-
if (n == null) return null;
|
|
77
|
-
let r = t("parameter_runtime_error_modbus_exception_detailed", {
|
|
78
|
-
exceptionCode: n,
|
|
79
|
-
exceptionName: g(n),
|
|
80
|
-
functionCode: h(e, "functionCode") ?? "?",
|
|
81
|
-
address: h(e, "address") ?? "?",
|
|
82
|
-
quantity: h(e, "quantity") ?? "1",
|
|
83
|
-
unitId: h(e, "unitId") ?? "?",
|
|
84
|
-
table: h(e, "table") ?? "?"
|
|
85
|
-
}), i = v(e);
|
|
86
|
-
return i == null ? r : `${i} ${r}`;
|
|
87
|
-
}
|
|
88
|
-
var b = [
|
|
89
|
-
"holding-register",
|
|
90
|
-
"input-register",
|
|
91
|
-
"coil",
|
|
92
|
-
"discrete-input"
|
|
93
|
-
];
|
|
94
|
-
function x(e) {
|
|
95
|
-
let t = b.findIndex((t) => t === e);
|
|
96
|
-
return t < 0 ? b.length : t;
|
|
97
|
-
}
|
|
98
|
-
function S(e) {
|
|
99
|
-
let t = b.find((t) => t === e);
|
|
100
|
-
return t == null ? e : a(t);
|
|
101
|
-
}
|
|
102
|
-
function C(e, n = 8) {
|
|
103
|
-
let r = /* @__PURE__ */ new Map();
|
|
104
|
-
for (let t of e) {
|
|
105
|
-
let e = t.params?.address;
|
|
106
|
-
if (typeof e != "number") continue;
|
|
107
|
-
let n = t.params?.quantity, i = e + (typeof n == "number" && n > 1 ? n - 1 : 0), a = h(t.params, "table"), o = r.get(a) ?? [];
|
|
108
|
-
o.push([e, i]), r.set(a, o);
|
|
109
|
-
}
|
|
110
|
-
let i = [...r.keys()].sort((e, t) => x(e) - x(t)), a = 0, o = 0, s = [];
|
|
111
|
-
for (let e of i) {
|
|
112
|
-
let t = [];
|
|
113
|
-
for (let [n, i] of (r.get(e) ?? []).sort(([e], [t]) => e - t)) {
|
|
114
|
-
let e = t[t.length - 1];
|
|
115
|
-
e != null && n <= e[1] + 1 ? e[1] = Math.max(e[1], i) : t.push([n, i]);
|
|
116
|
-
}
|
|
117
|
-
let i = t.slice(0, Math.max(0, n - a));
|
|
118
|
-
if (a += i.length, o += t.length - i.length, i.length === 0) continue;
|
|
119
|
-
let c = i.map(([e, t]) => e === t ? String(e) : `${String(e)}-${String(t)}`).join(", "), l = S(e);
|
|
120
|
-
s.push(l == null ? c : `${l} ${c}`);
|
|
121
|
-
}
|
|
122
|
-
if (s.length === 0) return null;
|
|
123
|
-
let c = s.join("; ");
|
|
124
|
-
return o === 0 ? c : `${c} ${t("parameter_runtime_error_registers_more", { count: o })}`;
|
|
125
|
-
}
|
|
126
|
-
function w(e, n) {
|
|
127
|
-
switch (e) {
|
|
128
|
-
case "value_unavailable": return t("parameter_runtime_error_value_unavailable");
|
|
129
|
-
case "timestamp_unavailable": return t("parameter_runtime_error_timestamp_unavailable");
|
|
130
|
-
case "endpoint_connect_failed":
|
|
131
|
-
case "endpoint_connection_lost": return t("parameter_runtime_error_connection_help");
|
|
132
|
-
case "device_response_timeout": return t("parameter_runtime_error_response_timeout_help");
|
|
133
|
-
case "write_value_below_min": {
|
|
134
|
-
let e = h(n, "value"), r = h(n, "min");
|
|
135
|
-
return e == null || r == null ? null : t("parameter_runtime_error_write_value_below_min", {
|
|
136
|
-
value: e,
|
|
137
|
-
min: r
|
|
138
|
-
});
|
|
139
|
-
}
|
|
140
|
-
case "write_value_exceeds_max": {
|
|
141
|
-
let e = h(n, "value"), r = h(n, "max");
|
|
142
|
-
return e == null || r == null ? null : t("parameter_runtime_error_write_value_exceeds_max", {
|
|
143
|
-
value: e,
|
|
144
|
-
max: r
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
|
-
case "write_invalid_number": {
|
|
148
|
-
let e = h(n, "value");
|
|
149
|
-
return e == null ? null : t("parameter_runtime_error_write_invalid_number", { value: e });
|
|
150
|
-
}
|
|
151
|
-
case "write_invalid_integer": {
|
|
152
|
-
let e = h(n, "value");
|
|
153
|
-
return e == null ? null : t("parameter_runtime_error_write_invalid_integer", { value: e });
|
|
154
|
-
}
|
|
155
|
-
case "write_invalid_bigint": {
|
|
156
|
-
let e = h(n, "value");
|
|
157
|
-
return e == null ? null : t("parameter_runtime_error_write_invalid_bigint", { value: e });
|
|
158
|
-
}
|
|
159
|
-
case "write_value_not_allowed": {
|
|
160
|
-
let e = h(n, "value");
|
|
161
|
-
return e == null ? null : t("parameter_runtime_error_write_value_not_allowed", { value: e });
|
|
162
|
-
}
|
|
163
|
-
case "write_value_too_short": {
|
|
164
|
-
let e = h(n, "minLength");
|
|
165
|
-
return e == null ? null : t("parameter_runtime_error_write_value_too_short", { minLength: e });
|
|
166
|
-
}
|
|
167
|
-
case "write_value_too_long": {
|
|
168
|
-
let e = h(n, "maxLength");
|
|
169
|
-
return e == null ? null : t("parameter_runtime_error_write_value_too_long", { maxLength: e });
|
|
170
|
-
}
|
|
171
|
-
case "request_service_timeout": return t("parameter_runtime_error_request_service_timeout");
|
|
172
|
-
case "device_response_invalid": return t("parameter_runtime_error_device_response_invalid");
|
|
173
|
-
case "request_too_large": return t("parameter_runtime_error_request_too_large", {
|
|
174
|
-
aduBytes: h(n, "aduBytes") ?? "?",
|
|
175
|
-
maxTcpPacketSize: h(n, "maxTcpPacketSize") ?? "?"
|
|
176
|
-
});
|
|
177
|
-
default: return null;
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
function T(e) {
|
|
181
|
-
if (e.reason != null) {
|
|
182
|
-
let t = w(e.reason, e.params);
|
|
183
|
-
if (t != null) return t;
|
|
184
|
-
}
|
|
185
|
-
if (e.code === "modbus_exception") {
|
|
186
|
-
let t = y(e.params);
|
|
187
|
-
if (t != null) return t;
|
|
188
|
-
}
|
|
189
|
-
return m(e.code);
|
|
190
|
-
}
|
|
191
|
-
//#endregion
|
|
192
|
-
//#region src/workspace/reports/use-quick-report.ts
|
|
193
|
-
function E(e) {
|
|
194
|
-
e.result.skipped.length > 0 && e.onSkipped(e.result.skipped), e.navigateToReport(e.result.reportPreset.id);
|
|
195
|
-
}
|
|
196
|
-
function D(e, { parameterIds: t, title: n, counterParameterIds: r = [], cadence: i }) {
|
|
197
|
-
let a = [...new Set(t)];
|
|
198
|
-
if (a.length === 0) return null;
|
|
199
|
-
let o = [...new Set(r)];
|
|
200
|
-
return {
|
|
201
|
-
workspaceId: e,
|
|
202
|
-
parameterIds: a,
|
|
203
|
-
title: n,
|
|
204
|
-
...o.length === 0 ? {} : { counterParameterIds: o },
|
|
205
|
-
...i == null ? {} : { cadence: i }
|
|
206
|
-
};
|
|
207
|
-
}
|
|
208
|
-
function O({ workspaceId: t, navigateToReport: n, onSkipped: r, onError: i }) {
|
|
209
|
-
let a = e.report.preset.createTemporary.useMutation();
|
|
210
|
-
return {
|
|
211
|
-
create: s(async (e) => {
|
|
212
|
-
let o = D(t, e);
|
|
213
|
-
if (o != null) try {
|
|
214
|
-
E({
|
|
215
|
-
result: await a.mutateAsync(o),
|
|
216
|
-
navigateToReport: n,
|
|
217
|
-
onSkipped: r
|
|
218
|
-
});
|
|
219
|
-
} catch (e) {
|
|
220
|
-
i(e);
|
|
221
|
-
}
|
|
222
|
-
}, [
|
|
223
|
-
a,
|
|
224
|
-
n,
|
|
225
|
-
i,
|
|
226
|
-
r,
|
|
227
|
-
t
|
|
228
|
-
]),
|
|
229
|
-
isPending: a.isPending
|
|
230
|
-
};
|
|
231
|
-
}
|
|
232
|
-
function k(e) {
|
|
233
|
-
let t = n(), i = r();
|
|
234
|
-
return O({
|
|
235
|
-
workspaceId: e,
|
|
236
|
-
navigateToReport: (t) => {
|
|
237
|
-
window.location.assign(`/workspace/${e}/reports/${t}`);
|
|
238
|
-
},
|
|
239
|
-
onSkipped: () => {
|
|
240
|
-
i.warning(t("report_quick_skipped"));
|
|
241
|
-
},
|
|
242
|
-
onError: () => {
|
|
243
|
-
i.error(t("report_quick_failed"));
|
|
244
|
-
}
|
|
245
|
-
});
|
|
246
|
-
}
|
|
247
|
-
//#endregion
|
|
248
|
-
//#region src/workspace/parameters/value/state.ts
|
|
249
|
-
function A(e) {
|
|
250
|
-
return e.status === "loading" ? { status: "loading" } : e.status === "value" ? {
|
|
251
|
-
status: "ok",
|
|
252
|
-
value: e.snapshot.value,
|
|
253
|
-
rawHex: e.snapshot.rawHex,
|
|
254
|
-
...e.snapshot.numberValue === void 0 ? {} : { numberValue: e.snapshot.numberValue },
|
|
255
|
-
...e.snapshot.boolValue === void 0 ? {} : { boolValue: e.snapshot.boolValue },
|
|
256
|
-
receivedAt: e.snapshot.receivedAt,
|
|
257
|
-
freshness: e.freshness,
|
|
258
|
-
refreshing: e.refreshing,
|
|
259
|
-
saving: e.saving
|
|
260
|
-
} : e.status === "error" ? {
|
|
261
|
-
status: "error",
|
|
262
|
-
...j(e),
|
|
263
|
-
refreshing: e.refreshing,
|
|
264
|
-
saving: e.saving
|
|
265
|
-
} : null;
|
|
266
|
-
}
|
|
267
|
-
function j(e) {
|
|
268
|
-
return {
|
|
269
|
-
code: e.diagnostic.code === "permission_denied" || e.diagnostic.code === "request_failed" ? "internal_error" : e.diagnostic.code,
|
|
270
|
-
...e.diagnostic.reason == null ? {} : { reason: e.diagnostic.reason },
|
|
271
|
-
...e.diagnostic.params == null ? {} : { params: e.diagnostic.params }
|
|
272
|
-
};
|
|
273
|
-
}
|
|
274
|
-
function M(e) {
|
|
275
|
-
return e.status === "ok" || e.status === "lastKnown" || e.status === "failedReading";
|
|
276
|
-
}
|
|
277
|
-
function N(e, t) {
|
|
278
|
-
if (e.status === "lastKnown") return e;
|
|
279
|
-
let n = e.status === "failedReading" ? e.reading : e;
|
|
280
|
-
return n.status === "lastKnown" ? n : {
|
|
281
|
-
...n,
|
|
282
|
-
freshness: "stale",
|
|
283
|
-
refreshing: t.refreshing,
|
|
284
|
-
saving: t.saving
|
|
285
|
-
};
|
|
286
|
-
}
|
|
287
|
-
function P(e) {
|
|
288
|
-
switch (e.diagnostic.kind) {
|
|
289
|
-
case "device-timeout":
|
|
290
|
-
case "endpoint":
|
|
291
|
-
case "capacity":
|
|
292
|
-
case "internal": return !0;
|
|
293
|
-
case "unavailable":
|
|
294
|
-
case "permission":
|
|
295
|
-
case "configuration":
|
|
296
|
-
case "protocol": return !1;
|
|
297
|
-
default: return e.diagnostic.kind;
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
function F(e, t) {
|
|
301
|
-
return t.status === "idle" ? null : t.status === "loading" ? e == null || !M(e) ? { status: "loading" } : e.refreshing ? e : {
|
|
302
|
-
...e,
|
|
303
|
-
refreshing: !0
|
|
304
|
-
} : t.status === "error" && e != null && M(e) && P(t) ? {
|
|
305
|
-
status: "failedReading",
|
|
306
|
-
reading: N(e, t),
|
|
307
|
-
failure: j(t),
|
|
308
|
-
refreshing: t.refreshing,
|
|
309
|
-
saving: t.saving
|
|
310
|
-
} : A(t);
|
|
311
|
-
}
|
|
312
|
-
function I(e, t) {
|
|
313
|
-
return typeof e == "string" && typeof t == "string" ? e === t : c(e) === c(t);
|
|
314
|
-
}
|
|
315
|
-
function L(e, t = i()) {
|
|
316
|
-
return f(e, t);
|
|
317
|
-
}
|
|
318
|
-
function R(e) {
|
|
319
|
-
return e.length === 0 ? "\"\"" : e;
|
|
320
|
-
}
|
|
321
|
-
function z(e, t = i()) {
|
|
322
|
-
return e.boolValue === void 0 ? e.numberValue === void 0 ? L(e.value, t) : String(e.numberValue) : e.boolValue ? "1" : "0";
|
|
323
|
-
}
|
|
324
|
-
function B(e) {
|
|
325
|
-
return `0x${e.toUpperCase()}`;
|
|
326
|
-
}
|
|
327
|
-
function V(e) {
|
|
328
|
-
return e.length > 0 && e.length <= 8192 && e.length % 2 == 0 && /^[0-9a-fA-F]+$/.test(e);
|
|
329
|
-
}
|
|
330
|
-
function H(e) {
|
|
331
|
-
let t = e.trim().replace(/\s+/g, "").toLowerCase();
|
|
332
|
-
return t.startsWith("0x") && (t = t.slice(2)), t;
|
|
333
|
-
}
|
|
334
|
-
function U(e) {
|
|
335
|
-
return e == null || e.status === "loading" || e.status === "lastKnown" ? !1 : e.saving;
|
|
336
|
-
}
|
|
337
|
-
function W(e) {
|
|
338
|
-
return {
|
|
339
|
-
status: "lastKnown",
|
|
340
|
-
value: e.value,
|
|
341
|
-
rawHex: e.rawHex,
|
|
342
|
-
...e.numberValue === void 0 ? {} : { numberValue: e.numberValue },
|
|
343
|
-
...e.boolValue === void 0 ? {} : { boolValue: e.boolValue },
|
|
344
|
-
refreshing: !1
|
|
345
|
-
};
|
|
346
|
-
}
|
|
347
|
-
function G(e, t) {
|
|
348
|
-
return I(e.value, t.value) && e.rawHex === t.rawHex && e.numberValue === t.numberValue && e.boolValue === t.boolValue;
|
|
349
|
-
}
|
|
350
|
-
function K(e, t) {
|
|
351
|
-
let n = !1, r = new Map(e);
|
|
352
|
-
for (let e of t) {
|
|
353
|
-
let t = e.lastReading;
|
|
354
|
-
if (t == null) continue;
|
|
355
|
-
let i = r.get(e.id);
|
|
356
|
-
if (i != null && i.status !== "lastKnown") continue;
|
|
357
|
-
let a = W(t);
|
|
358
|
-
i?.status === "lastKnown" && G(i, a) || (r.set(e.id, a), n = !0);
|
|
359
|
-
}
|
|
360
|
-
return n ? r : e;
|
|
361
|
-
}
|
|
362
|
-
//#endregion
|
|
363
|
-
//#region src/workspace/parameters/value/edit-draft.ts
|
|
364
|
-
function q({ valueType: e, currentValue: t = "", rawHex: n = "", numberValue: r, boolValue: a, displayMode: s, locale: c = i() }) {
|
|
365
|
-
let u = f(t, c), d = z({
|
|
366
|
-
value: t,
|
|
367
|
-
...r === void 0 ? {} : { numberValue: r },
|
|
368
|
-
...a === void 0 ? {} : { boolValue: a }
|
|
369
|
-
}, c), p = e.name === "datetime", m = p ? l(u) : u, h = p ? l(d) : d, g = s === "repr" ? o(e, c) : null, _ = g?.find((e) => a === void 0 ? r === void 0 ? e.label === m || e.writeValue === m : e.writeValue === String(r) : e.writeValue === String(a)) ?? null;
|
|
370
|
-
return {
|
|
371
|
-
displayValue: m,
|
|
372
|
-
choices: g,
|
|
373
|
-
matchedChoice: _,
|
|
374
|
-
initialDraft: s === "hex" ? n : s === "number" ? h : _?.writeValue ?? (g === null ? p ? m : h : "")
|
|
375
|
-
};
|
|
376
|
-
}
|
|
377
|
-
function J({ text: e, valueType: t, strictDateTime: n = !1 }) {
|
|
378
|
-
return t.name === "datetime" ? (n ? d : u)(e)?.toISOString() ?? null : e;
|
|
379
|
-
}
|
|
380
|
-
//#endregion
|
|
381
|
-
//#region src/workspace/parameters/geo-value.ts
|
|
382
|
-
function Y(e) {
|
|
383
|
-
let t = e.trim(), n = t.indexOf(",");
|
|
384
|
-
if (n < 0) return null;
|
|
385
|
-
let r = t.slice(0, n).trim(), i = t.slice(n + 1).trim();
|
|
386
|
-
if (r.length === 0 || i.length === 0) return null;
|
|
387
|
-
let a = Number(r), o = Number(i);
|
|
388
|
-
return !Number.isFinite(a) || !Number.isFinite(o) || a < -90 || a > 90 || o < -180 || o > 180 ? null : {
|
|
389
|
-
lat: a,
|
|
390
|
-
lon: o
|
|
391
|
-
};
|
|
392
|
-
}
|
|
393
|
-
function X(e, t) {
|
|
394
|
-
return `${String(e)},${String(t)}`;
|
|
395
|
-
}
|
|
396
|
-
function Z(e, t, n) {
|
|
397
|
-
let r = Y(n);
|
|
398
|
-
return r == null ? X(e, t) === n : r.lat === e && r.lon === t;
|
|
399
|
-
}
|
|
400
|
-
//#endregion
|
|
401
|
-
//#region src/workspace/reports/quick-report.ts
|
|
402
|
-
function Q(e) {
|
|
403
|
-
let t = e.limit ?? p;
|
|
404
|
-
if (e.pending) return { kind: "pending" };
|
|
405
|
-
let n = [...new Set(e.parameterIds)];
|
|
406
|
-
return n.length === 0 ? { kind: "empty" } : n.length > t ? {
|
|
407
|
-
kind: "over_limit",
|
|
408
|
-
limit: t,
|
|
409
|
-
count: n.length
|
|
410
|
-
} : {
|
|
411
|
-
kind: "ready",
|
|
412
|
-
parameterIds: n
|
|
413
|
-
};
|
|
414
|
-
}
|
|
415
|
-
//#endregion
|
|
416
|
-
export { O as _, q as a, C as b, L as c, U as d, V as f, k as g, K as h, Y as i, z as l, H as m, X as n, J as o, F as p, Z as r, B as s, Q as t, R as u, v, T as x, _ as y };
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { t as e } from "./utils-CX-Pz5p6.js";
|
|
2
|
-
import { jsx as t } from "react/jsx-runtime";
|
|
3
|
-
import { Radio as n } from "@base-ui/react/radio";
|
|
4
|
-
import { RadioGroup as r } from "@base-ui/react/radio-group";
|
|
5
|
-
//#region src/ui/radio-group.tsx
|
|
6
|
-
function i({ className: n, ...i }) {
|
|
7
|
-
return /* @__PURE__ */ t(r, {
|
|
8
|
-
"data-slot": "radio-group",
|
|
9
|
-
className: e("grid w-full gap-2", n),
|
|
10
|
-
...i
|
|
11
|
-
});
|
|
12
|
-
}
|
|
13
|
-
function a({ className: r, ...i }) {
|
|
14
|
-
return /* @__PURE__ */ t(n.Root, {
|
|
15
|
-
"data-slot": "radio-group-item",
|
|
16
|
-
className: e("\n group/radio-group-item peer relative flex aspect-square size-4 shrink-0 rounded-full\n border border-input outline-none\n group-has-focus-visible/field-label:ring-0\n group-has-focus-visible/field-label:not-data-checked:border-input\n after:absolute after:-inset-x-3 after:-inset-y-2\n focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50\n disabled:cursor-not-allowed disabled:opacity-50\n aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20\n aria-invalid:aria-checked:border-primary\n dark:bg-input/30\n dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40\n data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground\n group-has-focus-visible/field-label:data-checked:border-primary\n dark:data-checked:bg-primary\n ", r),
|
|
17
|
-
...i,
|
|
18
|
-
children: /* @__PURE__ */ t(n.Indicator, {
|
|
19
|
-
"data-slot": "radio-group-indicator",
|
|
20
|
-
className: "flex size-4 items-center justify-center",
|
|
21
|
-
children: /* @__PURE__ */ t("span", { className: "\n absolute top-1/2 left-1/2 size-2 -translate-1/2 rounded-full bg-primary-foreground\n " })
|
|
22
|
-
})
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
//#endregion
|
|
26
|
-
export { a as n, i as t };
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { f as e, m as t } from "./i18n-BgzakKoC.js";
|
|
2
|
-
import { H as n, L as r, z as i } from "./spinner-C-HPNxOc.js";
|
|
3
|
-
import { r as a } from "./api-error-9rQmUN5L.js";
|
|
4
|
-
import { r as o, t as s } from "./retention-BYXNpYmR.js";
|
|
5
|
-
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
6
|
-
import { Link as u } from "@tanstack/react-router";
|
|
7
|
-
//#region src/workspace/parameters/errors.ts
|
|
8
|
-
var d = {
|
|
9
|
-
parameter_name_invalid: "name",
|
|
10
|
-
parameter_invalid_value_type: "valueType",
|
|
11
|
-
parameter_branch_not_found: "branchId",
|
|
12
|
-
parameter_endpoint_not_found: "source",
|
|
13
|
-
parameter_input_not_found: "source",
|
|
14
|
-
parameter_input_self_reference: "source",
|
|
15
|
-
parameter_input_cycle: "source"
|
|
16
|
-
};
|
|
17
|
-
function f(t) {
|
|
18
|
-
let n = a(t).details, r = n?.availableBytes, i = n?.requiredBytes;
|
|
19
|
-
return n?.reason !== "modbus_source_too_short" || typeof r != "number" || typeof i != "number" ? null : () => e("parameter_field_addresses_too_short", {
|
|
20
|
-
available: r,
|
|
21
|
-
required: i
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
//#endregion
|
|
25
|
-
//#region src/workspace/setup/storage/retention-note.tsx
|
|
26
|
-
function p({ workspaceId: e, target: a }) {
|
|
27
|
-
let d = t(), f = o(e);
|
|
28
|
-
if (f == null) return null;
|
|
29
|
-
let p = a.kind === "parameter" ? f.resolver.parameter(a.id) : f.resolver.branch(a.id);
|
|
30
|
-
return /* @__PURE__ */ l(r, { children: [/* @__PURE__ */ c(n, { children: d("storage_retention_field") }), /* @__PURE__ */ l(i, { children: [
|
|
31
|
-
s(p, f.branchName),
|
|
32
|
-
" ",
|
|
33
|
-
/* @__PURE__ */ c(u, {
|
|
34
|
-
to: "/workspace/$workspaceId/setup/storage",
|
|
35
|
-
params: { workspaceId: e },
|
|
36
|
-
className: "\n text-primary\n hover:underline\n ",
|
|
37
|
-
children: d("storage_retention_change_link")
|
|
38
|
-
})
|
|
39
|
-
] })] });
|
|
40
|
-
}
|
|
41
|
-
//#endregion
|
|
42
|
-
export { f as n, d as r, p as t };
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
import { f as e, p as t } from "./i18n-BgzakKoC.js";
|
|
2
|
-
import { n } from "./diagnostic-text-DiKd2i1w.js";
|
|
3
|
-
import { formatAppDateTime as r } from "@overvis/hmi-shared";
|
|
4
|
-
import { Value as i } from "typebox/value";
|
|
5
|
-
import { automationTypedValueType as a } from "@overvis/hmi-shared/automation";
|
|
6
|
-
import { expressionDiagnosticType as o } from "@overvis/hmi-shared/expression";
|
|
7
|
-
//#region src/workspace/automations/run-text.ts
|
|
8
|
-
function s(e) {
|
|
9
|
-
return typeof e == "string" || typeof e == "number" ? String(e) : "";
|
|
10
|
-
}
|
|
11
|
-
function c(e) {
|
|
12
|
-
let n = Array.isArray(e) ? e.map(s).filter((e) => e !== "") : [];
|
|
13
|
-
return new Intl.ListFormat(t(), { type: "conjunction" }).format(n);
|
|
14
|
-
}
|
|
15
|
-
function l(e) {
|
|
16
|
-
return i.Check(o, e) ? e : null;
|
|
17
|
-
}
|
|
18
|
-
function u(t) {
|
|
19
|
-
return t?.value == null ? e("automation_value_unknown") : t.type === "instant" && typeof t.value == "number" ? r(t.value) : t.type === "string" ? JSON.stringify(t.value) : String(t.value);
|
|
20
|
-
}
|
|
21
|
-
function d(t, n) {
|
|
22
|
-
switch (t) {
|
|
23
|
-
case "inputChange": return e("automation_trigger_input_change", { inputs: c(n.inputs) });
|
|
24
|
-
case "period": return e("automation_trigger_period");
|
|
25
|
-
case "timeOfDay": return e("automation_trigger_time_of_day");
|
|
26
|
-
case "sun": return e("automation_trigger_sun");
|
|
27
|
-
case "alarm": return e("automation_trigger_alarm");
|
|
28
|
-
case "automation": return e("automation_trigger_automation");
|
|
29
|
-
case "telegram": return e("automation_trigger_telegram", { command: s(n.command) });
|
|
30
|
-
case "init": return e("automation_trigger_init");
|
|
31
|
-
case "hold": return e("automation_trigger_hold");
|
|
32
|
-
case "load": return e("automation_trigger_load");
|
|
33
|
-
default: return t;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
function f(t, r) {
|
|
37
|
-
let i = r ?? {};
|
|
38
|
-
switch (t) {
|
|
39
|
-
case "fail": return e("automation_run_error_fail", { message: s(i.message) });
|
|
40
|
-
case "expression": {
|
|
41
|
-
let t = l(i.diagnostic);
|
|
42
|
-
return t === null ? e("automation_run_error_expression") : e("automation_run_error_expression_detail", { problem: n(t) });
|
|
43
|
-
}
|
|
44
|
-
case "invalid_formula": {
|
|
45
|
-
let t = i.diagnostics, r = l(Array.isArray(t) ? t[0] : null);
|
|
46
|
-
return r === null ? e("automation_run_error_invalid_formula") : e("automation_run_error_invalid_formula_detail", { problem: n(r) });
|
|
47
|
-
}
|
|
48
|
-
case "step_limit": return e("automation_run_error_step_limit", { limit: s(i.limit) });
|
|
49
|
-
case "value_too_long": return e("automation_run_error_value_too_long", { limit: s(i.limit) });
|
|
50
|
-
case "unknown_procedure": return e("automation_run_error_unknown_procedure", { name: s(i.procedure) });
|
|
51
|
-
case "invalid": return e("automation_run_error_invalid");
|
|
52
|
-
case "alarms_unavailable": return e("automation_run_error_alarms_unavailable");
|
|
53
|
-
case "location_missing": return e("automation_run_error_location_missing");
|
|
54
|
-
case "init_not_stored": return e("automation_run_error_init_not_stored");
|
|
55
|
-
case "not_stored": return e("automation_run_error_not_stored");
|
|
56
|
-
default: return t;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
function p(e) {
|
|
60
|
-
return i.Check(a, e) ? e : void 0;
|
|
61
|
-
}
|
|
62
|
-
function m(t) {
|
|
63
|
-
switch (t) {
|
|
64
|
-
case "if": return e("automation_step_if");
|
|
65
|
-
case "call": return e("automation_step_call");
|
|
66
|
-
case "repeat": return e("automation_step_repeat");
|
|
67
|
-
case "set": return e("automation_step_set");
|
|
68
|
-
case "writeParameter": return e("automation_step_write_parameter");
|
|
69
|
-
case "raiseAlarm": return e("automation_step_raise_alarm");
|
|
70
|
-
case "clearAlarm": return e("automation_step_clear_alarm");
|
|
71
|
-
case "notify": return e("automation_step_notify");
|
|
72
|
-
case "cancelNotify": return e("automation_step_cancel_notify");
|
|
73
|
-
case "writeLog": return e("automation_step_write_log");
|
|
74
|
-
case "fail": return e("automation_step_fail");
|
|
75
|
-
case "reply": return e("automation_step_reply");
|
|
76
|
-
case "writeLimited": return e("automation_step_write_limited");
|
|
77
|
-
case "writeDropped": return e("automation_step_write_dropped");
|
|
78
|
-
case "writeFailed": return e("automation_step_write_failed");
|
|
79
|
-
default: return t;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
function h(t, n) {
|
|
83
|
-
let r = t.detail, i = (e) => n(s(e)) ?? s(e);
|
|
84
|
-
switch (t.kind) {
|
|
85
|
-
case "if": {
|
|
86
|
-
let t = r.branch;
|
|
87
|
-
return t === "else" ? e("automation_step_if_else") : typeof t == "number" ? e("automation_step_if_branch", { branch: String(t + 1) }) : r.reason === "unknown" ? e("automation_step_if_unknown") : r.reason === "once" ? e("automation_step_if_once") : e("automation_step_if_none");
|
|
88
|
-
}
|
|
89
|
-
case "call": return s(r.procedure);
|
|
90
|
-
case "repeat": return e("automation_step_repeat_times", { times: s(r.times) });
|
|
91
|
-
case "set": return `${s(r.variable)} = ${u(p(r.value))}`;
|
|
92
|
-
case "writeParameter": return r.skipped === "unknown" ? e("automation_step_write_skipped", { parameter: i(r.parameterId) }) : `${i(r.parameterId)} ← ${u(p(r.value))}`;
|
|
93
|
-
case "writeLog": return u(p(r.value));
|
|
94
|
-
case "fail": return s(r.message);
|
|
95
|
-
case "reply": return r.skipped === "not_a_command" ? e("automation_step_reply_skipped") : "";
|
|
96
|
-
case "writeDropped": return r.reason === "late" ? e("automation_step_write_dropped_late") : e("automation_step_write_dropped_lease");
|
|
97
|
-
case "writeFailed": return e("automation_step_write_failed_detail", {
|
|
98
|
-
parameter: i(r.parameterId),
|
|
99
|
-
error: s(r.error)
|
|
100
|
-
});
|
|
101
|
-
default: return "";
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
function g(t) {
|
|
105
|
-
switch (t) {
|
|
106
|
-
case "info": return e("automation_severity_info");
|
|
107
|
-
case "warning": return e("automation_severity_warning");
|
|
108
|
-
case "urgent": return e("automation_severity_urgent");
|
|
109
|
-
default: return t;
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
//#endregion
|
|
113
|
-
export { h as a, g as i, d as n, m as o, u as r, f as t };
|