@nice2dev/ui-iot 1.2.1 → 1.3.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.cjs +1 -1
- package/dist/index.mjs +483 -396
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -1,10 +1,30 @@
|
|
|
1
|
-
import { jsx as e, jsxs as i, Fragment as
|
|
2
|
-
import { useContext as
|
|
3
|
-
const
|
|
4
|
-
function
|
|
5
|
-
const a =
|
|
1
|
+
import { jsx as e, jsxs as i, Fragment as S } from "react/jsx-runtime";
|
|
2
|
+
import { useContext as U, createContext as O, useState as g, useCallback as N } from "react";
|
|
3
|
+
const Y = (a, r) => r, J = /* @__PURE__ */ O(Y), Z = /* @__PURE__ */ O("en");
|
|
4
|
+
function _() {
|
|
5
|
+
const a = U(J), r = U(Z);
|
|
6
6
|
return { t: a, lang: r };
|
|
7
7
|
}
|
|
8
|
+
function P(a) {
|
|
9
|
+
if (a.defaultPrevented || a.repeat || a.target !== a.currentTarget || a.key !== "Enter" && a.key !== " " && a.key !== "Spacebar")
|
|
10
|
+
return;
|
|
11
|
+
const r = a.currentTarget;
|
|
12
|
+
if (!r || typeof r.dispatchEvent != "function")
|
|
13
|
+
return;
|
|
14
|
+
a.preventDefault();
|
|
15
|
+
const t = r.ownerDocument.defaultView;
|
|
16
|
+
r.dispatchEvent(
|
|
17
|
+
new ((t == null ? void 0 : t.MouseEvent) ?? MouseEvent)("click", {
|
|
18
|
+
bubbles: !0,
|
|
19
|
+
cancelable: !0,
|
|
20
|
+
composed: !0,
|
|
21
|
+
ctrlKey: !!a.ctrlKey,
|
|
22
|
+
shiftKey: !!a.shiftKey,
|
|
23
|
+
altKey: !!a.altKey,
|
|
24
|
+
metaKey: !!a.metaKey
|
|
25
|
+
})
|
|
26
|
+
);
|
|
27
|
+
}
|
|
8
28
|
const X = {
|
|
9
29
|
// Navigation
|
|
10
30
|
"chevron-down": "M6 9l6 6 6-6",
|
|
@@ -214,21 +234,77 @@ const X = {
|
|
|
214
234
|
"zoom-out": "M11 4a7 7 0 100 14 7 7 0 000-14z M21 21l-4.35-4.35 M8 11h6",
|
|
215
235
|
navigation: "M12 2l7 19-7-4-7 4z",
|
|
216
236
|
"refresh-ccw": "M1 4v6h6 M23 20v-6h-6 M20.49 9A9 9 0 005.64 5.64L1 10 M3.51 15a9 9 0 0014.85 3.36L23 14",
|
|
217
|
-
minimize: "M4 14h6v6 M20 10h-6V4 M14 10l7-7 M3 21l7-7"
|
|
218
|
-
|
|
237
|
+
minimize: "M4 14h6v6 M20 10h-6V4 M14 10l7-7 M3 21l7-7",
|
|
238
|
+
// 1.2.2: geometry tools and object grouping, drawn as glyphs before (Ntd* of the same names in icons)
|
|
239
|
+
point: "M12 8a4 4 0 1 0 0 8a4 4 0 1 0 0-8z M12 12h.01",
|
|
240
|
+
segment: "M6.5 17.5L17.5 6.5 M3 19a2 2 0 1 0 4 0a2 2 0 1 0-4 0 M17 5a2 2 0 1 0 4 0a2 2 0 1 0-4 0",
|
|
241
|
+
perpendicular: "M3 20h18 M12 20V4 M12 15h5v5",
|
|
242
|
+
parallel: "M4 16L14 6 M10 20L20 10",
|
|
243
|
+
midpoint: "M3 12h6 M15 12h6 M3 9v6 M21 9v6 M12 9a3 3 0 1 0 0 6a3 3 0 1 0 0-6z",
|
|
244
|
+
"angle-bisector": "M4 20h17 M4 20L16 5 M4 20l14.4-6.9 M10 20a6 6 0 0 0-2.25-4.68",
|
|
245
|
+
group: "M3 7V3h4 M17 3h4v4 M21 17v4h-4 M7 21H3v-4 M7 7h5v5H7z M12 12h5v5h-5z",
|
|
246
|
+
ungroup: "M3 3h8v8H3z M13 13h8v8h-8z",
|
|
247
|
+
// 1.3.0: button and key glyphs of the input prompts (ADR-005 § 8, decision 0.8). Outline here;
|
|
248
|
+
// the filled, coloured Ntd* of @nice2dev/icons carry the same names in its resolver.
|
|
249
|
+
"pad-xbox-a": "M12 3a9 9 0 1 0 0 18a9 9 0 1 0 0 -18z M9.25 16l2.75-8 2.75 8 M10.2 13.25h3.6",
|
|
250
|
+
"pad-xbox-b": "M12 3a9 9 0 1 0 0 18a9 9 0 1 0 0 -18z M9.75 8v8 M9.75 8h2.5a2 2 0 0 1 0 4h-2.5 M9.75 12h3a2 2 0 0 1 0 4h-3",
|
|
251
|
+
"pad-xbox-x": "M12 3a9 9 0 1 0 0 18a9 9 0 1 0 0 -18z M9.5 8l5 8 M14.5 8l-5 8",
|
|
252
|
+
"pad-xbox-y": "M12 3a9 9 0 1 0 0 18a9 9 0 1 0 0 -18z M9.5 8l2.5 4 2.5-4 M12 12v4",
|
|
253
|
+
"pad-nintendo-a": "M12 3a9 9 0 1 0 0 18a9 9 0 1 0 0 -18z M9.25 16l2.75-8 2.75 8 M10.2 13.25h3.6",
|
|
254
|
+
"pad-nintendo-b": "M12 3a9 9 0 1 0 0 18a9 9 0 1 0 0 -18z M9.75 8v8 M9.75 8h2.5a2 2 0 0 1 0 4h-2.5 M9.75 12h3a2 2 0 0 1 0 4h-3",
|
|
255
|
+
"pad-nintendo-x": "M12 3a9 9 0 1 0 0 18a9 9 0 1 0 0 -18z M9.5 8l5 8 M14.5 8l-5 8",
|
|
256
|
+
"pad-nintendo-y": "M12 3a9 9 0 1 0 0 18a9 9 0 1 0 0 -18z M9.5 8l2.5 4 2.5-4 M12 12v4",
|
|
257
|
+
"pad-playstation-cross": "M12 3a9 9 0 1 0 0 18a9 9 0 1 0 0 -18z M9 9l6 6 M15 9l-6 6",
|
|
258
|
+
"pad-playstation-circle": "M12 3a9 9 0 1 0 0 18a9 9 0 1 0 0 -18z M12 8.25a3.75 3.75 0 1 0 0 7.5a3.75 3.75 0 1 0 0 -7.5z",
|
|
259
|
+
"pad-playstation-square": "M12 3a9 9 0 1 0 0 18a9 9 0 1 0 0 -18z M8.5 8.5h7v7h-7z",
|
|
260
|
+
"pad-playstation-triangle": "M12 3a9 9 0 1 0 0 18a9 9 0 1 0 0 -18z M12 8l4.5 7.5h-9z",
|
|
261
|
+
"pad-generic-north": "M12 3a3 3 0 1 0 0 6a3 3 0 1 0 0 -6z M12 6h.01 M18 10.25a1.75 1.75 0 1 0 0 3.5a1.75 1.75 0 1 0 0 -3.5z M6 10.25a1.75 1.75 0 1 0 0 3.5a1.75 1.75 0 1 0 0 -3.5z M12 16.25a1.75 1.75 0 1 0 0 3.5a1.75 1.75 0 1 0 0 -3.5z",
|
|
262
|
+
"pad-generic-east": "M12 4.25a1.75 1.75 0 1 0 0 3.5a1.75 1.75 0 1 0 0 -3.5z M18 9a3 3 0 1 0 0 6a3 3 0 1 0 0 -6z M18 12h.01 M6 10.25a1.75 1.75 0 1 0 0 3.5a1.75 1.75 0 1 0 0 -3.5z M12 16.25a1.75 1.75 0 1 0 0 3.5a1.75 1.75 0 1 0 0 -3.5z",
|
|
263
|
+
"pad-generic-west": "M12 4.25a1.75 1.75 0 1 0 0 3.5a1.75 1.75 0 1 0 0 -3.5z M18 10.25a1.75 1.75 0 1 0 0 3.5a1.75 1.75 0 1 0 0 -3.5z M6 9a3 3 0 1 0 0 6a3 3 0 1 0 0 -6z M6 12h.01 M12 16.25a1.75 1.75 0 1 0 0 3.5a1.75 1.75 0 1 0 0 -3.5z",
|
|
264
|
+
"pad-generic-south": "M12 4.25a1.75 1.75 0 1 0 0 3.5a1.75 1.75 0 1 0 0 -3.5z M18 10.25a1.75 1.75 0 1 0 0 3.5a1.75 1.75 0 1 0 0 -3.5z M6 10.25a1.75 1.75 0 1 0 0 3.5a1.75 1.75 0 1 0 0 -3.5z M12 15a3 3 0 1 0 0 6a3 3 0 1 0 0 -6z M12 18h.01",
|
|
265
|
+
"pad-lb": "M6 9h12a3 3 0 0 1 0 6H6a3 3 0 0 1 0-6z M7.5 12h.01",
|
|
266
|
+
"pad-rb": "M6 9h12a3 3 0 0 1 0 6H6a3 3 0 0 1 0-6z M16.5 12h.01",
|
|
267
|
+
"pad-lt": "M9 3h6a3 3 0 0 1 3 3v7a6 6 0 0 1-12 0V6a3 3 0 0 1 3-3z M9.5 7h.01",
|
|
268
|
+
"pad-rt": "M9 3h6a3 3 0 0 1 3 3v7a6 6 0 0 1-12 0V6a3 3 0 0 1 3-3z M14.5 7h.01",
|
|
269
|
+
"pad-start": "M12 3a9 9 0 1 0 0 18a9 9 0 1 0 0 -18z M8.5 8.75h7 M8.5 12h7 M8.5 15.25h7",
|
|
270
|
+
"pad-select": "M12 3a9 9 0 1 0 0 18a9 9 0 1 0 0 -18z M7.75 7.75h5.5v5.5h-5.5z M10.75 16.25h5.5v-5.5",
|
|
271
|
+
"pad-home": "M12 3a9 9 0 1 0 0 18a9 9 0 1 0 0 -18z M7.95 12L12 8.6l4.05 3.4v4H7.95z",
|
|
272
|
+
"pad-dpad": "M9 3h6v6h6v6h-6v6H9v-6H3V9h6z",
|
|
273
|
+
"pad-dpad-up": "M9 3h6v6h6v6h-6v6H9v-6H3V9h6z M12 5.6l1.15 1.5h-2.3z",
|
|
274
|
+
"pad-dpad-down": "M9 3h6v6h6v6h-6v6H9v-6H3V9h6z M12 18.4l1.15-1.5h-2.3z",
|
|
275
|
+
"pad-dpad-left": "M9 3h6v6h6v6h-6v6H9v-6H3V9h6z M5.6 12l1.5-1.15v2.3z",
|
|
276
|
+
"pad-dpad-right": "M9 3h6v6h6v6h-6v6H9v-6H3V9h6z M18.4 12l-1.5-1.15v2.3z",
|
|
277
|
+
"pad-stick-left": "M12 3a9 9 0 1 0 0 18a9 9 0 1 0 0 -18z M12 7.5a4.5 4.5 0 1 0 0 9a4.5 4.5 0 1 0 0 -9z M4.5 12h1",
|
|
278
|
+
"pad-stick-right": "M12 3a9 9 0 1 0 0 18a9 9 0 1 0 0 -18z M12 7.5a4.5 4.5 0 1 0 0 9a4.5 4.5 0 1 0 0 -9z M18.5 12h1",
|
|
279
|
+
"pad-stick-left-press": "M12 3a9 9 0 1 0 0 18a9 9 0 1 0 0 -18z M12 7.5a4.5 4.5 0 1 0 0 9a4.5 4.5 0 1 0 0 -9z M12 12h.01 M4.5 12h1",
|
|
280
|
+
"pad-stick-right-press": "M12 3a9 9 0 1 0 0 18a9 9 0 1 0 0 -18z M12 7.5a4.5 4.5 0 1 0 0 9a4.5 4.5 0 1 0 0 -9z M12 12h.01 M18.5 12h1",
|
|
281
|
+
"remote-ok": "M12 3a9 9 0 1 0 0 18a9 9 0 1 0 0 -18z M12 8.5a3.5 3.5 0 1 0 0 7a3.5 3.5 0 1 0 0 -7z",
|
|
282
|
+
"remote-back": "M9 14l-4-4 4-4 M5 10h9a5 5 0 0 1 0 10h-2",
|
|
283
|
+
"remote-menu": "M4 6h16v12H4z M8 10h8 M8 14h8",
|
|
284
|
+
"key-command": "M9 9V6.5A2.5 2.5 0 1 0 6.5 9H9z M9 9h6 M9 9v6 M15 9V6.5A2.5 2.5 0 1 1 17.5 9H15z M15 9v6 M15 15H9 M15 15v2.5a2.5 2.5 0 1 0 2.5-2.5H15z M9 15H6.5A2.5 2.5 0 1 0 9 17.5V15z",
|
|
285
|
+
"key-option": "M4 6h5l6 12h5 M14 6h6",
|
|
286
|
+
"key-shift": "M12 4l-8 8h4v8h8v-8h4z",
|
|
287
|
+
"key-control": "M7 14l5-5 5 5",
|
|
288
|
+
"key-enter": "M20 5v7a3 3 0 0 1-3 3H5 M9 11l-4 4 4 4",
|
|
289
|
+
"key-tab": "M4 12h14 M14 8l4 4-4 4 M20 6v12",
|
|
290
|
+
// on-screen keyboard (1.3.0 H1)
|
|
291
|
+
"key-backspace": "M21 5H9l-6 7 6 7h12a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1z M17 9l-6 6 M11 9l6 6",
|
|
292
|
+
"key-space": "M4 10v4h16v-4",
|
|
293
|
+
"key-caps": "M12 4l-7 7h4v5h6v-5h4z M8 20h8"
|
|
294
|
+
}, ee = {
|
|
219
295
|
xs: 12,
|
|
220
296
|
sm: 16,
|
|
221
297
|
md: 20,
|
|
222
298
|
lg: 24,
|
|
223
299
|
xl: 32
|
|
224
|
-
},
|
|
225
|
-
function
|
|
300
|
+
}, ae = /* @__PURE__ */ O({});
|
|
301
|
+
function ie({
|
|
226
302
|
path: a,
|
|
227
303
|
size: r,
|
|
228
|
-
className:
|
|
304
|
+
className: t,
|
|
229
305
|
style: n,
|
|
230
306
|
color: c,
|
|
231
|
-
title:
|
|
307
|
+
title: l,
|
|
232
308
|
onClick: o
|
|
233
309
|
}) {
|
|
234
310
|
return /* @__PURE__ */ i(
|
|
@@ -243,14 +319,16 @@ function ae({
|
|
|
243
319
|
strokeWidth: 2,
|
|
244
320
|
strokeLinecap: "round",
|
|
245
321
|
strokeLinejoin: "round",
|
|
246
|
-
className: `nice-icon ${
|
|
322
|
+
className: `nice-icon ${t || ""}`,
|
|
247
323
|
style: n,
|
|
248
|
-
role:
|
|
249
|
-
|
|
250
|
-
|
|
324
|
+
role: o ? "button" : l ? "img" : "presentation",
|
|
325
|
+
tabIndex: o ? 0 : void 0,
|
|
326
|
+
onKeyDown: o ? P : void 0,
|
|
327
|
+
"aria-label": l,
|
|
328
|
+
"aria-hidden": o ? void 0 : !l,
|
|
251
329
|
onClick: o,
|
|
252
330
|
children: [
|
|
253
|
-
|
|
331
|
+
l && /* @__PURE__ */ e("title", { children: l }),
|
|
254
332
|
/* @__PURE__ */ e("path", { d: a })
|
|
255
333
|
]
|
|
256
334
|
}
|
|
@@ -259,28 +337,39 @@ function ae({
|
|
|
259
337
|
const m = ({
|
|
260
338
|
name: a,
|
|
261
339
|
size: r = "md",
|
|
262
|
-
className:
|
|
340
|
+
className: t,
|
|
263
341
|
style: n,
|
|
264
342
|
color: c,
|
|
265
|
-
title:
|
|
343
|
+
title: l,
|
|
266
344
|
onClick: o
|
|
267
345
|
}) => {
|
|
268
|
-
const { resolver: s } =
|
|
346
|
+
const { resolver: s } = U(ae), h = typeof r == "number" ? r : ee[r];
|
|
269
347
|
if (s) {
|
|
270
|
-
const
|
|
271
|
-
if (
|
|
272
|
-
return /* @__PURE__ */ e(
|
|
348
|
+
const v = s(a, h);
|
|
349
|
+
if (v)
|
|
350
|
+
return /* @__PURE__ */ e(
|
|
351
|
+
"span",
|
|
352
|
+
{
|
|
353
|
+
role: o ? "button" : void 0,
|
|
354
|
+
tabIndex: o ? 0 : void 0,
|
|
355
|
+
onKeyDown: o ? P : void 0,
|
|
356
|
+
className: `nice-icon-wrap ${t || ""}`,
|
|
357
|
+
style: n,
|
|
358
|
+
onClick: o,
|
|
359
|
+
children: v
|
|
360
|
+
}
|
|
361
|
+
);
|
|
273
362
|
}
|
|
274
363
|
const p = X[a];
|
|
275
364
|
return p ? /* @__PURE__ */ e(
|
|
276
|
-
|
|
365
|
+
ie,
|
|
277
366
|
{
|
|
278
367
|
path: p,
|
|
279
368
|
size: h,
|
|
280
|
-
className:
|
|
369
|
+
className: t,
|
|
281
370
|
style: n,
|
|
282
371
|
color: c,
|
|
283
|
-
title:
|
|
372
|
+
title: l,
|
|
284
373
|
onClick: o
|
|
285
374
|
}
|
|
286
375
|
) : null;
|
|
@@ -291,7 +380,7 @@ process.env.NODE_ENV;
|
|
|
291
380
|
process.env.NODE_ENV;
|
|
292
381
|
process.env.NODE_ENV;
|
|
293
382
|
process.env.NODE_ENV;
|
|
294
|
-
function
|
|
383
|
+
function ne() {
|
|
295
384
|
const a = globalThis.crypto;
|
|
296
385
|
if (typeof (a == null ? void 0 : a.randomUUID) == "function")
|
|
297
386
|
return a.randomUUID();
|
|
@@ -302,8 +391,8 @@ function ie() {
|
|
|
302
391
|
for (let n = 0; n < r.length; n++)
|
|
303
392
|
r[n] = Math.floor(Math.random() * 256);
|
|
304
393
|
r[6] = r[6] & 15 | 64, r[8] = r[8] & 63 | 128;
|
|
305
|
-
const
|
|
306
|
-
return `${
|
|
394
|
+
const t = Array.from(r, (n) => n.toString(16).padStart(2, "0")).join("");
|
|
395
|
+
return `${t.slice(0, 8)}-${t.slice(8, 12)}-${t.slice(12, 16)}-${t.slice(16, 20)}-${t.slice(20)}`;
|
|
307
396
|
}
|
|
308
397
|
process.env.NODE_ENV;
|
|
309
398
|
process.env.NODE_ENV;
|
|
@@ -313,7 +402,7 @@ process.env.NODE_ENV;
|
|
|
313
402
|
process.env.NODE_ENV;
|
|
314
403
|
process.env.NODE_ENV;
|
|
315
404
|
process.env.NODE_ENV;
|
|
316
|
-
const
|
|
405
|
+
const B = {
|
|
317
406
|
display: "inline-block",
|
|
318
407
|
width: 10,
|
|
319
408
|
height: 10,
|
|
@@ -334,48 +423,48 @@ const R = {
|
|
|
334
423
|
function Ne({
|
|
335
424
|
devices: a = [],
|
|
336
425
|
widgets: r = [],
|
|
337
|
-
alarms:
|
|
426
|
+
alarms: t = [],
|
|
338
427
|
onDeviceSelect: n,
|
|
339
428
|
onWidgetChange: c,
|
|
340
|
-
onCommand:
|
|
429
|
+
onCommand: l,
|
|
341
430
|
onAlarmAcknowledge: o,
|
|
342
431
|
fetchTelemetry: s,
|
|
343
432
|
className: h = ""
|
|
344
433
|
}) {
|
|
345
|
-
const { t: p } =
|
|
434
|
+
const { t: p } = _(), [v, V] = g(r), [f, k] = g(null), [u, w] = g("dashboard"), [b, D] = g(!1), [y, L] = g(""), M = N(
|
|
346
435
|
(d) => {
|
|
347
|
-
|
|
348
|
-
const
|
|
349
|
-
return c == null || c(
|
|
436
|
+
V((z) => {
|
|
437
|
+
const C = d(z);
|
|
438
|
+
return c == null || c(C), C;
|
|
350
439
|
});
|
|
351
440
|
},
|
|
352
441
|
[c]
|
|
353
|
-
),
|
|
442
|
+
), H = N(
|
|
354
443
|
(d) => {
|
|
355
|
-
var
|
|
356
|
-
const
|
|
357
|
-
id:
|
|
444
|
+
var C;
|
|
445
|
+
const z = {
|
|
446
|
+
id: ne(),
|
|
358
447
|
type: d,
|
|
359
|
-
title: ((
|
|
360
|
-
position: { x: 0, y:
|
|
448
|
+
title: ((C = $.find((x) => x.type === d)) == null ? void 0 : C.label) || d,
|
|
449
|
+
position: { x: 0, y: te(v), width: 4, height: 3 },
|
|
361
450
|
config: {}
|
|
362
451
|
};
|
|
363
|
-
|
|
452
|
+
M((x) => [...x, z]);
|
|
364
453
|
},
|
|
365
|
-
[
|
|
366
|
-
),
|
|
454
|
+
[v, M]
|
|
455
|
+
), I = N(
|
|
367
456
|
(d) => {
|
|
368
457
|
k(d), n == null || n(d);
|
|
369
458
|
},
|
|
370
459
|
[n]
|
|
371
|
-
), T =
|
|
460
|
+
), T = N(
|
|
372
461
|
(d) => {
|
|
373
462
|
o == null || o(d);
|
|
374
463
|
},
|
|
375
464
|
[o]
|
|
376
465
|
), j = a.filter(
|
|
377
466
|
(d) => !y || d.name.toLowerCase().includes(y.toLowerCase()) || d.type.toLowerCase().includes(y.toLowerCase())
|
|
378
|
-
),
|
|
467
|
+
), A = t.filter((d) => !d.cleared), R = A.filter(
|
|
379
468
|
(d) => d.severity === "critical" || d.severity === "high"
|
|
380
469
|
);
|
|
381
470
|
return /* @__PURE__ */ i("div", { className: `nice-iot-dashboard ${h}`, children: [
|
|
@@ -390,24 +479,24 @@ function Ne({
|
|
|
390
479
|
)
|
|
391
480
|
] }),
|
|
392
481
|
/* @__PURE__ */ i("span", { className: "nice-iot-dashboard__stat nice-iot-dashboard__stat--online", children: [
|
|
393
|
-
/* @__PURE__ */ e("span", { className: "nice-iot-dashboard__stat-icon", style:
|
|
482
|
+
/* @__PURE__ */ e("span", { className: "nice-iot-dashboard__stat-icon", style: B }),
|
|
394
483
|
p("ioTDashboard.online", "{online} Online").replace(
|
|
395
484
|
"{online}",
|
|
396
485
|
String(a.filter((d) => d.status === "online").length)
|
|
397
486
|
)
|
|
398
487
|
] }),
|
|
399
488
|
/* @__PURE__ */ i("span", { className: "nice-iot-dashboard__stat nice-iot-dashboard__stat--offline", children: [
|
|
400
|
-
/* @__PURE__ */ e("span", { className: "nice-iot-dashboard__stat-icon", style:
|
|
489
|
+
/* @__PURE__ */ e("span", { className: "nice-iot-dashboard__stat-icon", style: B }),
|
|
401
490
|
p("ioTDashboard.offline", "{offline} Offline").replace(
|
|
402
491
|
"{offline}",
|
|
403
492
|
String(a.filter((d) => d.status === "offline").length)
|
|
404
493
|
)
|
|
405
494
|
] }),
|
|
406
|
-
|
|
495
|
+
R.length > 0 && /* @__PURE__ */ i("span", { className: "nice-iot-dashboard__stat nice-iot-dashboard__stat--alarms", children: [
|
|
407
496
|
/* @__PURE__ */ e("span", { className: "nice-iot-dashboard__stat-icon", children: /* @__PURE__ */ e(m, { name: "bell", size: 14 }) }),
|
|
408
497
|
p("ioTDashboard.alarms", "{criticalAlarms} Alarms").replace(
|
|
409
498
|
"{criticalAlarms}",
|
|
410
|
-
String(
|
|
499
|
+
String(R.length)
|
|
411
500
|
)
|
|
412
501
|
] })
|
|
413
502
|
] }),
|
|
@@ -415,7 +504,7 @@ function Ne({
|
|
|
415
504
|
/* @__PURE__ */ e(
|
|
416
505
|
"button",
|
|
417
506
|
{
|
|
418
|
-
className: `nice-iot-dashboard__nav-button ${
|
|
507
|
+
className: `nice-iot-dashboard__nav-button ${u === "dashboard" ? "nice-iot-dashboard__nav-button--active" : ""}`,
|
|
419
508
|
onClick: () => w("dashboard"),
|
|
420
509
|
children: p("ioTDashboard.dashboard", "Dashboard")
|
|
421
510
|
}
|
|
@@ -423,7 +512,7 @@ function Ne({
|
|
|
423
512
|
/* @__PURE__ */ e(
|
|
424
513
|
"button",
|
|
425
514
|
{
|
|
426
|
-
className: `nice-iot-dashboard__nav-button ${
|
|
515
|
+
className: `nice-iot-dashboard__nav-button ${u === "devices" ? "nice-iot-dashboard__nav-button--active" : ""}`,
|
|
427
516
|
onClick: () => w("devices"),
|
|
428
517
|
children: p("ioTDashboard.devices2", "Devices")
|
|
429
518
|
}
|
|
@@ -431,30 +520,30 @@ function Ne({
|
|
|
431
520
|
/* @__PURE__ */ i(
|
|
432
521
|
"button",
|
|
433
522
|
{
|
|
434
|
-
className: `nice-iot-dashboard__nav-button ${
|
|
523
|
+
className: `nice-iot-dashboard__nav-button ${u === "alarms" ? "nice-iot-dashboard__nav-button--active" : ""}`,
|
|
435
524
|
onClick: () => w("alarms"),
|
|
436
525
|
children: [
|
|
437
526
|
p("ioTDashboard.alarms2", "Alarms"),
|
|
438
527
|
" ",
|
|
439
|
-
|
|
528
|
+
A.length > 0 && `(${A.length})`
|
|
440
529
|
]
|
|
441
530
|
}
|
|
442
531
|
)
|
|
443
532
|
] }),
|
|
444
|
-
/* @__PURE__ */ e("div", { className: "nice-iot-dashboard__actions", children:
|
|
445
|
-
/* @__PURE__ */ e(m, { name:
|
|
533
|
+
/* @__PURE__ */ e("div", { className: "nice-iot-dashboard__actions", children: u === "dashboard" && /* @__PURE__ */ i("button", { onClick: () => D(!b), children: [
|
|
534
|
+
/* @__PURE__ */ e(m, { name: b ? "check" : "edit", size: 14 }),
|
|
446
535
|
" ",
|
|
447
|
-
|
|
536
|
+
b ? p("ioTDashboard.done", "Done") : p("ioTDashboard.edit", "Edit")
|
|
448
537
|
] }) })
|
|
449
538
|
] }),
|
|
450
|
-
|
|
451
|
-
|
|
539
|
+
u === "dashboard" && /* @__PURE__ */ i("div", { className: "nice-iot-dashboard__main", children: [
|
|
540
|
+
b && /* @__PURE__ */ i("aside", { className: "nice-iot-dashboard__palette", children: [
|
|
452
541
|
/* @__PURE__ */ e("h4", { children: p("ioTDashboard.addWidget", "Add Widget") }),
|
|
453
542
|
$.map((d) => /* @__PURE__ */ i(
|
|
454
543
|
"button",
|
|
455
544
|
{
|
|
456
545
|
className: "nice-iot-dashboard__palette-item",
|
|
457
|
-
onClick: () =>
|
|
546
|
+
onClick: () => H(d.type),
|
|
458
547
|
children: [
|
|
459
548
|
/* @__PURE__ */ e(m, { name: d.icon, size: 16 }),
|
|
460
549
|
/* @__PURE__ */ e("span", { children: d.label })
|
|
@@ -464,22 +553,25 @@ function Ne({
|
|
|
464
553
|
))
|
|
465
554
|
] }),
|
|
466
555
|
/* @__PURE__ */ i("div", { className: "nice-iot-dashboard__grid", children: [
|
|
467
|
-
|
|
468
|
-
|
|
556
|
+
v.map((d) => /* @__PURE__ */ e(
|
|
557
|
+
re,
|
|
469
558
|
{
|
|
470
559
|
widget: d,
|
|
471
560
|
devices: a,
|
|
472
|
-
alarms:
|
|
473
|
-
isEditing:
|
|
474
|
-
onCommand:
|
|
475
|
-
onDelete: () =>
|
|
561
|
+
alarms: t,
|
|
562
|
+
isEditing: b,
|
|
563
|
+
onCommand: l,
|
|
564
|
+
onDelete: () => M((z) => z.filter((C) => C.id !== d.id))
|
|
476
565
|
},
|
|
477
566
|
d.id
|
|
478
567
|
)),
|
|
479
|
-
|
|
568
|
+
v.length === 0 && /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__empty", children: b ? p("ioTDashboard.addWidgetsFromThePalette", "Add widgets from the palette") : p(
|
|
569
|
+
"ioTDashboard.noWidgetsConfiguredClickEdit",
|
|
570
|
+
"No widgets configured. Click Edit to add widgets."
|
|
571
|
+
) })
|
|
480
572
|
] })
|
|
481
573
|
] }),
|
|
482
|
-
|
|
574
|
+
u === "devices" && /* @__PURE__ */ i("div", { className: "nice-iot-dashboard__devices", children: [
|
|
483
575
|
/* @__PURE__ */ e("div", { className: "nice-iot-dashboard__devices-toolbar", children: /* @__PURE__ */ e(
|
|
484
576
|
"input",
|
|
485
577
|
{
|
|
@@ -490,24 +582,24 @@ function Ne({
|
|
|
490
582
|
}
|
|
491
583
|
) }),
|
|
492
584
|
/* @__PURE__ */ e("div", { className: "nice-iot-dashboard__device-grid", children: j.map((d) => /* @__PURE__ */ e(
|
|
493
|
-
|
|
585
|
+
le,
|
|
494
586
|
{
|
|
495
587
|
device: d,
|
|
496
|
-
isSelected: (
|
|
497
|
-
onSelect: () =>
|
|
588
|
+
isSelected: (f == null ? void 0 : f.id) === d.id,
|
|
589
|
+
onSelect: () => I(d)
|
|
498
590
|
},
|
|
499
591
|
d.id
|
|
500
592
|
)) }),
|
|
501
|
-
|
|
502
|
-
|
|
593
|
+
f && /* @__PURE__ */ e(
|
|
594
|
+
ce,
|
|
503
595
|
{
|
|
504
|
-
device:
|
|
505
|
-
onCommand:
|
|
596
|
+
device: f,
|
|
597
|
+
onCommand: l,
|
|
506
598
|
onClose: () => k(null)
|
|
507
599
|
}
|
|
508
600
|
)
|
|
509
601
|
] }),
|
|
510
|
-
|
|
602
|
+
u === "alarms" && /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__alarms", children: /* @__PURE__ */ i("table", { className: "nice-iot-dashboard__alarm-table", children: [
|
|
511
603
|
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ i("tr", { children: [
|
|
512
604
|
/* @__PURE__ */ e("th", { children: p("ioTDashboard.severity", "Severity") }),
|
|
513
605
|
/* @__PURE__ */ e("th", { children: p("ioTDashboard.device", "Device") }),
|
|
@@ -516,8 +608,8 @@ function Ne({
|
|
|
516
608
|
/* @__PURE__ */ e("th", { children: p("ioTDashboard.status", "Status") }),
|
|
517
609
|
/* @__PURE__ */ e("th", { children: p("ioTDashboard.actions", "Actions") })
|
|
518
610
|
] }) }),
|
|
519
|
-
/* @__PURE__ */ e("tbody", { children:
|
|
520
|
-
const
|
|
611
|
+
/* @__PURE__ */ e("tbody", { children: A.length === 0 ? /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e("td", { colSpan: 6, className: "nice-iot-dashboard__no-alarms", children: p("ioTDashboard.noActiveAlarms", "No active alarms") }) }) : A.map((d) => {
|
|
612
|
+
const z = a.find((C) => C.id === d.deviceId);
|
|
521
613
|
return /* @__PURE__ */ i(
|
|
522
614
|
"tr",
|
|
523
615
|
{
|
|
@@ -530,10 +622,10 @@ function Ne({
|
|
|
530
622
|
children: d.severity
|
|
531
623
|
}
|
|
532
624
|
) }),
|
|
533
|
-
/* @__PURE__ */ e("td", { children: (
|
|
625
|
+
/* @__PURE__ */ e("td", { children: (z == null ? void 0 : z.name) || d.deviceId }),
|
|
534
626
|
/* @__PURE__ */ e("td", { children: d.message }),
|
|
535
627
|
/* @__PURE__ */ e("td", { children: d.timestamp.toLocaleString() }),
|
|
536
|
-
/* @__PURE__ */ e("td", { children: d.acknowledged ? "Acknowledged" : "Active" }),
|
|
628
|
+
/* @__PURE__ */ e("td", { children: d.acknowledged ? p("ioTDashboard.acknowledged", "Acknowledged") : p("ioTDashboard.active", "Active") }),
|
|
537
629
|
/* @__PURE__ */ e("td", { children: !d.acknowledged && /* @__PURE__ */ e("button", { onClick: () => T(d.id), children: p("ioTDashboard.acknowledge", "Acknowledge") }) })
|
|
538
630
|
]
|
|
539
631
|
},
|
|
@@ -543,7 +635,7 @@ function Ne({
|
|
|
543
635
|
] }) })
|
|
544
636
|
] });
|
|
545
637
|
}
|
|
546
|
-
function
|
|
638
|
+
function te(a) {
|
|
547
639
|
return a.length === 0 ? 0 : Math.max(...a.map((r) => r.position.y + r.position.height));
|
|
548
640
|
}
|
|
549
641
|
function E(a) {
|
|
@@ -562,15 +654,15 @@ function E(a) {
|
|
|
562
654
|
return "var(--nice-text-secondary, #6c757d)";
|
|
563
655
|
}
|
|
564
656
|
}
|
|
565
|
-
function
|
|
657
|
+
function re({
|
|
566
658
|
widget: a,
|
|
567
659
|
devices: r,
|
|
568
|
-
alarms:
|
|
660
|
+
alarms: t,
|
|
569
661
|
isEditing: n,
|
|
570
662
|
onCommand: c,
|
|
571
|
-
onDelete:
|
|
663
|
+
onDelete: l
|
|
572
664
|
}) {
|
|
573
|
-
const { t: o } =
|
|
665
|
+
const { t: o } = _(), s = $.find((h) => h.type === a.type);
|
|
574
666
|
return /* @__PURE__ */ i(
|
|
575
667
|
"div",
|
|
576
668
|
{
|
|
@@ -588,50 +680,50 @@ function le({
|
|
|
588
680
|
{
|
|
589
681
|
"aria-label": o("ioTDashboard.close", "Close"),
|
|
590
682
|
className: "nice-iot-dashboard__widget-delete",
|
|
591
|
-
onClick:
|
|
683
|
+
onClick: l,
|
|
592
684
|
children: /* @__PURE__ */ e(m, { name: "close", size: 14 })
|
|
593
685
|
}
|
|
594
686
|
)
|
|
595
687
|
] }),
|
|
596
|
-
/* @__PURE__ */ e("div", { className: "nice-iot-dashboard__widget-content", children: /* @__PURE__ */ e(
|
|
688
|
+
/* @__PURE__ */ e("div", { className: "nice-iot-dashboard__widget-content", children: /* @__PURE__ */ e(oe, { widget: a, devices: r, alarms: t, onCommand: c }) })
|
|
597
689
|
]
|
|
598
690
|
}
|
|
599
691
|
);
|
|
600
692
|
}
|
|
601
|
-
function
|
|
693
|
+
function oe({
|
|
602
694
|
widget: a,
|
|
603
695
|
devices: r,
|
|
604
|
-
alarms:
|
|
696
|
+
alarms: t,
|
|
605
697
|
onCommand: n
|
|
606
698
|
}) {
|
|
607
|
-
const { t: c } =
|
|
699
|
+
const { t: c } = _();
|
|
608
700
|
switch (a.type) {
|
|
609
701
|
case "device-list":
|
|
610
|
-
return /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__device-list", children: r.slice(0, 10).map((
|
|
702
|
+
return /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__device-list", children: r.slice(0, 10).map((l) => /* @__PURE__ */ i("div", { className: "nice-iot-dashboard__device-list-item", children: [
|
|
611
703
|
/* @__PURE__ */ e(
|
|
612
704
|
"span",
|
|
613
705
|
{
|
|
614
706
|
className: "nice-iot-dashboard__device-status",
|
|
615
|
-
style: { background: E(
|
|
707
|
+
style: { background: E(l.status) }
|
|
616
708
|
}
|
|
617
709
|
),
|
|
618
|
-
/* @__PURE__ */ e("span", { children:
|
|
619
|
-
/* @__PURE__ */ e("span", { className: "nice-iot-dashboard__device-type", children:
|
|
620
|
-
] },
|
|
710
|
+
/* @__PURE__ */ e("span", { children: l.name }),
|
|
711
|
+
/* @__PURE__ */ e("span", { className: "nice-iot-dashboard__device-type", children: l.type })
|
|
712
|
+
] }, l.id)) });
|
|
621
713
|
case "device-status":
|
|
622
|
-
return /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__status-grid", children: ["online", "offline", "warning", "error"].map((
|
|
623
|
-
const o = r.filter((s) => s.status ===
|
|
714
|
+
return /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__status-grid", children: ["online", "offline", "warning", "error"].map((l) => {
|
|
715
|
+
const o = r.filter((s) => s.status === l).length;
|
|
624
716
|
return /* @__PURE__ */ i("div", { className: "nice-iot-dashboard__status-card", children: [
|
|
625
717
|
/* @__PURE__ */ e(
|
|
626
718
|
"span",
|
|
627
719
|
{
|
|
628
720
|
className: "nice-iot-dashboard__status-indicator",
|
|
629
|
-
style: { background: E(
|
|
721
|
+
style: { background: E(l) }
|
|
630
722
|
}
|
|
631
723
|
),
|
|
632
724
|
/* @__PURE__ */ e("span", { className: "nice-iot-dashboard__status-count", children: o }),
|
|
633
|
-
/* @__PURE__ */ e("span", { className: "nice-iot-dashboard__status-label", children:
|
|
634
|
-
] },
|
|
725
|
+
/* @__PURE__ */ e("span", { className: "nice-iot-dashboard__status-label", children: l })
|
|
726
|
+
] }, l);
|
|
635
727
|
}) });
|
|
636
728
|
case "telemetry-chart":
|
|
637
729
|
return /* @__PURE__ */ i("div", { className: "nice-iot-dashboard__chart-placeholder", children: [
|
|
@@ -666,14 +758,14 @@ function re({
|
|
|
666
758
|
return /* @__PURE__ */ i("div", { className: "nice-iot-dashboard__map-placeholder", children: [
|
|
667
759
|
/* @__PURE__ */ e(m, { name: "map-pin", size: 32 }),
|
|
668
760
|
/* @__PURE__ */ e("span", { children: c("ioTDashboard.deviceMap", "Device Map") }),
|
|
669
|
-
/* @__PURE__ */
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
761
|
+
/* @__PURE__ */ e("small", { children: c("ioTDashboard.devicesWithLocation", "{devices} devices with location").replace(
|
|
762
|
+
"{devices}",
|
|
763
|
+
String(r.filter((l) => l.location).length)
|
|
764
|
+
) })
|
|
673
765
|
] });
|
|
674
766
|
case "alarms": {
|
|
675
|
-
const
|
|
676
|
-
return /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__alarm-list", children:
|
|
767
|
+
const l = t.filter((o) => !o.cleared).slice(0, 5);
|
|
768
|
+
return /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__alarm-list", children: l.length === 0 ? /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__alarm-empty", children: c("ioTDashboard.noActiveAlarms", "No active alarms") }) : l.map((o) => /* @__PURE__ */ i(
|
|
677
769
|
"div",
|
|
678
770
|
{
|
|
679
771
|
className: `nice-iot-dashboard__alarm-item nice-iot-dashboard__alarm-item--${o.severity}`,
|
|
@@ -700,12 +792,16 @@ function re({
|
|
|
700
792
|
return /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__widget-placeholder", children: a.type });
|
|
701
793
|
}
|
|
702
794
|
}
|
|
703
|
-
function
|
|
795
|
+
function le({ device: a, isSelected: r, onSelect: t }) {
|
|
796
|
+
const { t: n } = _();
|
|
704
797
|
return /* @__PURE__ */ i(
|
|
705
798
|
"div",
|
|
706
799
|
{
|
|
800
|
+
role: "button",
|
|
801
|
+
tabIndex: 0,
|
|
802
|
+
onKeyDown: P,
|
|
707
803
|
className: `nice-iot-dashboard__device-card ${r ? "nice-iot-dashboard__device-card--selected" : ""}`,
|
|
708
|
-
onClick:
|
|
804
|
+
onClick: t,
|
|
709
805
|
children: [
|
|
710
806
|
/* @__PURE__ */ i("div", { className: "nice-iot-dashboard__device-card-header", children: [
|
|
711
807
|
/* @__PURE__ */ e(
|
|
@@ -719,21 +815,18 @@ function te({ device: a, isSelected: r, onSelect: l }) {
|
|
|
719
815
|
] }),
|
|
720
816
|
/* @__PURE__ */ i("div", { className: "nice-iot-dashboard__device-card-body", children: [
|
|
721
817
|
/* @__PURE__ */ i("div", { className: "nice-iot-dashboard__device-info", children: [
|
|
722
|
-
/* @__PURE__ */
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
"Protocol: ",
|
|
728
|
-
a.protocol
|
|
729
|
-
] })
|
|
730
|
-
] }),
|
|
731
|
-
a.lastSeen && /* @__PURE__ */ i("div", { className: "nice-iot-dashboard__device-lastseen", children: [
|
|
732
|
-
"Last seen: ",
|
|
733
|
-
a.lastSeen.toLocaleString()
|
|
818
|
+
/* @__PURE__ */ e("span", { children: n("ioTDashboard.type", "Type: {type}").replace("{type}", String(a.type)) }),
|
|
819
|
+
/* @__PURE__ */ e("span", { children: n("ioTDashboard.protocol", "Protocol: {protocol}").replace(
|
|
820
|
+
"{protocol}",
|
|
821
|
+
String(a.protocol)
|
|
822
|
+
) })
|
|
734
823
|
] }),
|
|
824
|
+
a.lastSeen && /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__device-lastseen", children: n("ioTDashboard.lastSeen", "Last seen: {lastSeen}").replace(
|
|
825
|
+
"{lastSeen}",
|
|
826
|
+
String(a.lastSeen.toLocaleString())
|
|
827
|
+
) }),
|
|
735
828
|
/* @__PURE__ */ i("div", { className: "nice-iot-dashboard__device-capabilities", children: [
|
|
736
|
-
a.capabilities.slice(0, 3).map((
|
|
829
|
+
a.capabilities.slice(0, 3).map((c) => /* @__PURE__ */ e("span", { className: "nice-iot-dashboard__capability-badge", children: c.name }, c.id)),
|
|
737
830
|
a.capabilities.length > 3 && /* @__PURE__ */ i("span", { className: "nice-iot-dashboard__capability-more", children: [
|
|
738
831
|
"+",
|
|
739
832
|
a.capabilities.length - 3
|
|
@@ -744,22 +837,22 @@ function te({ device: a, isSelected: r, onSelect: l }) {
|
|
|
744
837
|
}
|
|
745
838
|
);
|
|
746
839
|
}
|
|
747
|
-
function
|
|
840
|
+
function ce({
|
|
748
841
|
device: a,
|
|
749
842
|
onCommand: r,
|
|
750
|
-
onClose:
|
|
843
|
+
onClose: t
|
|
751
844
|
}) {
|
|
752
|
-
const { t: n } =
|
|
845
|
+
const { t: n } = _();
|
|
753
846
|
return /* @__PURE__ */ i("aside", { className: "nice-iot-dashboard__device-detail", children: [
|
|
754
847
|
/* @__PURE__ */ i("div", { className: "nice-iot-dashboard__device-detail-header", children: [
|
|
755
848
|
/* @__PURE__ */ e("h3", { children: a.name }),
|
|
756
|
-
/* @__PURE__ */ e("button", { "aria-label": n("ioTDashboard.close", "Close"), onClick:
|
|
849
|
+
/* @__PURE__ */ e("button", { "aria-label": n("ioTDashboard.close", "Close"), onClick: t, children: /* @__PURE__ */ e(m, { name: "close", size: 14 }) })
|
|
757
850
|
] }),
|
|
758
851
|
/* @__PURE__ */ i("div", { className: "nice-iot-dashboard__device-detail-content", children: [
|
|
759
852
|
/* @__PURE__ */ i("section", { children: [
|
|
760
853
|
/* @__PURE__ */ e("h4", { children: n("ioTDashboard.status", "Status") }),
|
|
761
854
|
/* @__PURE__ */ i("div", { className: "nice-iot-dashboard__detail-row", children: [
|
|
762
|
-
/* @__PURE__ */ e("span", { children: "Status:" }),
|
|
855
|
+
/* @__PURE__ */ e("span", { children: n("ioTDashboard.status2", "Status:") }),
|
|
763
856
|
/* @__PURE__ */ e(
|
|
764
857
|
"span",
|
|
765
858
|
{
|
|
@@ -770,18 +863,18 @@ function oe({
|
|
|
770
863
|
)
|
|
771
864
|
] }),
|
|
772
865
|
a.lastSeen && /* @__PURE__ */ i("div", { className: "nice-iot-dashboard__detail-row", children: [
|
|
773
|
-
/* @__PURE__ */ e("span", { children: "Last Seen:" }),
|
|
866
|
+
/* @__PURE__ */ e("span", { children: n("ioTDashboard.lastSeen2", "Last Seen:") }),
|
|
774
867
|
/* @__PURE__ */ e("span", { children: a.lastSeen.toLocaleString() })
|
|
775
868
|
] })
|
|
776
869
|
] }),
|
|
777
870
|
/* @__PURE__ */ i("section", { children: [
|
|
778
871
|
/* @__PURE__ */ e("h4", { children: n("ioTDashboard.connection", "Connection") }),
|
|
779
872
|
/* @__PURE__ */ i("div", { className: "nice-iot-dashboard__detail-row", children: [
|
|
780
|
-
/* @__PURE__ */ e("span", { children: "Protocol:" }),
|
|
873
|
+
/* @__PURE__ */ e("span", { children: n("ioTDashboard.protocol2", "Protocol:") }),
|
|
781
874
|
/* @__PURE__ */ e("span", { children: a.protocol })
|
|
782
875
|
] }),
|
|
783
876
|
a.connectionInfo.host && /* @__PURE__ */ i("div", { className: "nice-iot-dashboard__detail-row", children: [
|
|
784
|
-
/* @__PURE__ */ e("span", { children: "Host:" }),
|
|
877
|
+
/* @__PURE__ */ e("span", { children: n("ioTDashboard.host", "Host:") }),
|
|
785
878
|
/* @__PURE__ */ i("span", { children: [
|
|
786
879
|
a.connectionInfo.host,
|
|
787
880
|
":",
|
|
@@ -792,11 +885,11 @@ function oe({
|
|
|
792
885
|
a.metadata && /* @__PURE__ */ i("section", { children: [
|
|
793
886
|
/* @__PURE__ */ e("h4", { children: n("ioTDashboard.metadata", "Metadata") }),
|
|
794
887
|
a.metadata.manufacturer && /* @__PURE__ */ i("div", { className: "nice-iot-dashboard__detail-row", children: [
|
|
795
|
-
/* @__PURE__ */ e("span", { children: "Manufacturer:" }),
|
|
888
|
+
/* @__PURE__ */ e("span", { children: n("ioTDashboard.manufacturer", "Manufacturer:") }),
|
|
796
889
|
/* @__PURE__ */ e("span", { children: a.metadata.manufacturer })
|
|
797
890
|
] }),
|
|
798
891
|
a.metadata.model && /* @__PURE__ */ i("div", { className: "nice-iot-dashboard__detail-row", children: [
|
|
799
|
-
/* @__PURE__ */ e("span", { children: "Model:" }),
|
|
892
|
+
/* @__PURE__ */ e("span", { children: n("ioTDashboard.model", "Model:") }),
|
|
800
893
|
/* @__PURE__ */ e("span", { children: a.metadata.model })
|
|
801
894
|
] })
|
|
802
895
|
] }),
|
|
@@ -818,7 +911,7 @@ function oe({
|
|
|
818
911
|
] })
|
|
819
912
|
] });
|
|
820
913
|
}
|
|
821
|
-
const
|
|
914
|
+
const se = [
|
|
822
915
|
{ name: "MQTT Broker", image: "eclipse-mosquitto:latest" },
|
|
823
916
|
{ name: "Node-RED", image: "nodered/node-red:latest" },
|
|
824
917
|
{ name: "InfluxDB", image: "influxdb:latest" },
|
|
@@ -826,74 +919,70 @@ const ce = [
|
|
|
826
919
|
{ name: "Telegraf", image: "telegraf:latest" },
|
|
827
920
|
{ name: "Protocol Adapter", image: "nice2dev/protocol-adapter:latest" }
|
|
828
921
|
];
|
|
829
|
-
function
|
|
922
|
+
function ye({
|
|
830
923
|
nodes: a = [],
|
|
831
924
|
modules: r = [],
|
|
832
|
-
onNodeSelect:
|
|
925
|
+
onNodeSelect: t,
|
|
833
926
|
onModuleDeploy: n,
|
|
834
927
|
onModuleAction: c,
|
|
835
|
-
onNodeSync:
|
|
928
|
+
onNodeSync: l,
|
|
836
929
|
className: o = ""
|
|
837
930
|
}) {
|
|
838
|
-
const { t: s } =
|
|
931
|
+
const { t: s } = _(), [h, p] = g(null), [v, V] = g("nodes"), [f, k] = g(!1), [u, w] = g({
|
|
839
932
|
name: "",
|
|
840
933
|
image: "",
|
|
841
934
|
status: "pending"
|
|
842
|
-
}),
|
|
843
|
-
(
|
|
844
|
-
p(
|
|
935
|
+
}), b = N(
|
|
936
|
+
(M) => {
|
|
937
|
+
p(M), t == null || t(M);
|
|
845
938
|
},
|
|
846
|
-
[
|
|
847
|
-
),
|
|
848
|
-
!h || !
|
|
849
|
-
}, [h,
|
|
850
|
-
async (
|
|
851
|
-
h && await (c == null ? void 0 : c(h.id,
|
|
939
|
+
[t]
|
|
940
|
+
), D = N(async () => {
|
|
941
|
+
!h || !u.name || !u.image || (await (n == null ? void 0 : n(h.id, u)), k(!1), w({ name: "", image: "", status: "pending" }));
|
|
942
|
+
}, [h, u, n]), y = N(
|
|
943
|
+
async (M, H) => {
|
|
944
|
+
h && await (c == null ? void 0 : c(h.id, M, H));
|
|
852
945
|
},
|
|
853
946
|
[h, c]
|
|
854
|
-
), L =
|
|
855
|
-
h && await (
|
|
856
|
-
}, [h,
|
|
947
|
+
), L = N(async () => {
|
|
948
|
+
h && await (l == null ? void 0 : l(h.id));
|
|
949
|
+
}, [h, l]);
|
|
857
950
|
return /* @__PURE__ */ i("div", { className: `nice-edge-manager ${o}`, children: [
|
|
858
951
|
/* @__PURE__ */ i("header", { className: "nice-edge-manager__header", children: [
|
|
859
952
|
/* @__PURE__ */ e("h1", { children: s("edgeManager.edgeManager", "Edge Manager") }),
|
|
860
953
|
/* @__PURE__ */ i("nav", { className: "nice-edge-manager__nav", children: [
|
|
861
|
-
/* @__PURE__ */
|
|
954
|
+
/* @__PURE__ */ e(
|
|
862
955
|
"button",
|
|
863
956
|
{
|
|
864
|
-
className: `nice-edge-manager__nav-button ${
|
|
865
|
-
onClick: () =>
|
|
866
|
-
children:
|
|
867
|
-
"Nodes (",
|
|
868
|
-
a.length,
|
|
869
|
-
")"
|
|
870
|
-
]
|
|
957
|
+
className: `nice-edge-manager__nav-button ${v === "nodes" ? "nice-edge-manager__nav-button--active" : ""}`,
|
|
958
|
+
onClick: () => V("nodes"),
|
|
959
|
+
children: s("edgeManager.nodes", "Nodes ({nodes})").replace("{nodes}", String(a.length))
|
|
871
960
|
}
|
|
872
961
|
),
|
|
873
962
|
/* @__PURE__ */ e(
|
|
874
963
|
"button",
|
|
875
964
|
{
|
|
876
|
-
className: `nice-edge-manager__nav-button ${
|
|
877
|
-
onClick: () =>
|
|
965
|
+
className: `nice-edge-manager__nav-button ${v === "modules" ? "nice-edge-manager__nav-button--active" : ""}`,
|
|
966
|
+
onClick: () => V("modules"),
|
|
878
967
|
children: s("edgeManager.modules", "Modules")
|
|
879
968
|
}
|
|
880
969
|
)
|
|
881
970
|
] })
|
|
882
971
|
] }),
|
|
883
972
|
/* @__PURE__ */ i("div", { className: "nice-edge-manager__main", children: [
|
|
884
|
-
|
|
885
|
-
a.map((
|
|
886
|
-
|
|
973
|
+
v === "nodes" && /* @__PURE__ */ e("div", { className: "nice-edge-manager__nodes", children: /* @__PURE__ */ i("div", { className: "nice-edge-manager__node-grid", children: [
|
|
974
|
+
a.map((M) => /* @__PURE__ */ e(
|
|
975
|
+
he,
|
|
887
976
|
{
|
|
888
|
-
node:
|
|
889
|
-
isSelected: (h == null ? void 0 : h.id) ===
|
|
890
|
-
onSelect: () =>
|
|
977
|
+
node: M,
|
|
978
|
+
isSelected: (h == null ? void 0 : h.id) === M.id,
|
|
979
|
+
onSelect: () => b(M)
|
|
891
980
|
},
|
|
892
|
-
|
|
981
|
+
M.id
|
|
893
982
|
)),
|
|
894
983
|
a.length === 0 && /* @__PURE__ */ e("div", { className: "nice-edge-manager__empty", children: s("edgeManager.noEdgeNodesConfigured", "No edge nodes configured") })
|
|
895
984
|
] }) }),
|
|
896
|
-
|
|
985
|
+
v === "modules" && h && /* @__PURE__ */ i("div", { className: "nice-edge-manager__modules", children: [
|
|
897
986
|
/* @__PURE__ */ i("div", { className: "nice-edge-manager__modules-header", children: [
|
|
898
987
|
/* @__PURE__ */ e("h3", { children: s("edgeManager.modulesOn", "Modules on {name}").replace(
|
|
899
988
|
"{name}",
|
|
@@ -904,23 +993,23 @@ function fe({
|
|
|
904
993
|
{
|
|
905
994
|
className: "nice-edge-manager__deploy-btn",
|
|
906
995
|
onClick: () => k(!0),
|
|
907
|
-
children: "+ Deploy Module"
|
|
996
|
+
children: s("edgeManager.deployModule2", "+ Deploy Module")
|
|
908
997
|
}
|
|
909
998
|
)
|
|
910
999
|
] }),
|
|
911
1000
|
/* @__PURE__ */ i("div", { className: "nice-edge-manager__module-grid", children: [
|
|
912
|
-
h.deployedModules.map((
|
|
913
|
-
|
|
1001
|
+
h.deployedModules.map((M) => /* @__PURE__ */ e(
|
|
1002
|
+
pe,
|
|
914
1003
|
{
|
|
915
|
-
module:
|
|
916
|
-
onAction: (
|
|
1004
|
+
module: M,
|
|
1005
|
+
onAction: (H) => y(M.id, H)
|
|
917
1006
|
},
|
|
918
|
-
|
|
1007
|
+
M.id
|
|
919
1008
|
)),
|
|
920
1009
|
h.deployedModules.length === 0 && /* @__PURE__ */ e("div", { className: "nice-edge-manager__empty", children: s("edgeManager.noModulesDeployedOnThis", "No modules deployed on this node") })
|
|
921
1010
|
] })
|
|
922
1011
|
] }),
|
|
923
|
-
|
|
1012
|
+
v === "modules" && !h && /* @__PURE__ */ e("div", { className: "nice-edge-manager__no-selection", children: s(
|
|
924
1013
|
"edgeManager.selectANodeFromThe",
|
|
925
1014
|
"Select a node from the Nodes tab to manage modules"
|
|
926
1015
|
) }),
|
|
@@ -933,13 +1022,13 @@ function fe({
|
|
|
933
1022
|
}
|
|
934
1023
|
)
|
|
935
1024
|
] }),
|
|
936
|
-
|
|
937
|
-
|
|
1025
|
+
f && /* @__PURE__ */ e(
|
|
1026
|
+
Me,
|
|
938
1027
|
{
|
|
939
|
-
config:
|
|
940
|
-
templates:
|
|
1028
|
+
config: u,
|
|
1029
|
+
templates: se,
|
|
941
1030
|
onChange: w,
|
|
942
|
-
onDeploy:
|
|
1031
|
+
onDeploy: D,
|
|
943
1032
|
onClose: () => k(!1)
|
|
944
1033
|
}
|
|
945
1034
|
)
|
|
@@ -961,19 +1050,23 @@ function Q(a) {
|
|
|
961
1050
|
return "var(--nice-text-secondary, #6c757d)";
|
|
962
1051
|
}
|
|
963
1052
|
}
|
|
964
|
-
function
|
|
1053
|
+
function F(a) {
|
|
965
1054
|
return a < 1024 ? `${a} B` : a < 1024 * 1024 ? `${(a / 1024).toFixed(1)} KB` : a < 1024 * 1024 * 1024 ? `${(a / 1024 / 1024).toFixed(1)} MB` : `${(a / 1024 / 1024 / 1024).toFixed(2)} GB`;
|
|
966
1055
|
}
|
|
967
|
-
function
|
|
968
|
-
const r = Math.floor(a / 86400),
|
|
969
|
-
return r > 0 ? `${r}d ${
|
|
1056
|
+
function de(a) {
|
|
1057
|
+
const r = Math.floor(a / 86400), t = Math.floor(a % 86400 / 3600), n = Math.floor(a % 3600 / 60);
|
|
1058
|
+
return r > 0 ? `${r}d ${t}h` : t > 0 ? `${t}h ${n}m` : `${n}m`;
|
|
970
1059
|
}
|
|
971
|
-
function
|
|
1060
|
+
function he({ node: a, isSelected: r, onSelect: t }) {
|
|
1061
|
+
const { t: n } = _();
|
|
972
1062
|
return /* @__PURE__ */ i(
|
|
973
1063
|
"div",
|
|
974
1064
|
{
|
|
1065
|
+
role: "button",
|
|
1066
|
+
tabIndex: 0,
|
|
1067
|
+
onKeyDown: P,
|
|
975
1068
|
className: `nice-edge-manager__node-card ${r ? "nice-edge-manager__node-card--selected" : ""}`,
|
|
976
|
-
onClick:
|
|
1069
|
+
onClick: t,
|
|
977
1070
|
children: [
|
|
978
1071
|
/* @__PURE__ */ i("div", { className: "nice-edge-manager__node-header", children: [
|
|
979
1072
|
/* @__PURE__ */ e(
|
|
@@ -1000,7 +1093,7 @@ function de({ node: a, isSelected: r, onSelect: l }) {
|
|
|
1000
1093
|
" GB"
|
|
1001
1094
|
] })
|
|
1002
1095
|
] }),
|
|
1003
|
-
/* @__PURE__ */ e("div", { className: "nice-edge-manager__node-metrics", children: a.metrics && /* @__PURE__ */ i(
|
|
1096
|
+
/* @__PURE__ */ e("div", { className: "nice-edge-manager__node-metrics", children: a.metrics && /* @__PURE__ */ i(S, { children: [
|
|
1004
1097
|
/* @__PURE__ */ i("div", { className: "nice-edge-manager__metric", children: [
|
|
1005
1098
|
/* @__PURE__ */ e("span", { className: "nice-edge-manager__metric-label", children: "CPU" }),
|
|
1006
1099
|
/* @__PURE__ */ e("div", { className: "nice-edge-manager__metric-bar", children: /* @__PURE__ */ e(
|
|
@@ -1016,7 +1109,7 @@ function de({ node: a, isSelected: r, onSelect: l }) {
|
|
|
1016
1109
|
] })
|
|
1017
1110
|
] }),
|
|
1018
1111
|
/* @__PURE__ */ i("div", { className: "nice-edge-manager__metric", children: [
|
|
1019
|
-
/* @__PURE__ */ e("span", { className: "nice-edge-manager__metric-label", children: "MEM" }),
|
|
1112
|
+
/* @__PURE__ */ e("span", { className: "nice-edge-manager__metric-label", children: n("edgeManager.mem", "MEM") }),
|
|
1020
1113
|
/* @__PURE__ */ e("div", { className: "nice-edge-manager__metric-bar", children: /* @__PURE__ */ e(
|
|
1021
1114
|
"div",
|
|
1022
1115
|
{
|
|
@@ -1030,17 +1123,17 @@ function de({ node: a, isSelected: r, onSelect: l }) {
|
|
|
1030
1123
|
] })
|
|
1031
1124
|
] })
|
|
1032
1125
|
] }) }),
|
|
1033
|
-
/* @__PURE__ */
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1126
|
+
/* @__PURE__ */ e("div", { className: "nice-edge-manager__node-modules", children: n("edgeManager.modulesDeployed", "{deployedModules} modules deployed").replace(
|
|
1127
|
+
"{deployedModules}",
|
|
1128
|
+
String(a.deployedModules.length)
|
|
1129
|
+
) })
|
|
1037
1130
|
] })
|
|
1038
1131
|
]
|
|
1039
1132
|
}
|
|
1040
1133
|
);
|
|
1041
1134
|
}
|
|
1042
|
-
function
|
|
1043
|
-
const { t
|
|
1135
|
+
function pe({ module: a, onAction: r }) {
|
|
1136
|
+
const { t } = _();
|
|
1044
1137
|
return /* @__PURE__ */ i("div", { className: "nice-edge-manager__module-card", children: [
|
|
1045
1138
|
/* @__PURE__ */ i("div", { className: "nice-edge-manager__module-header", children: [
|
|
1046
1139
|
/* @__PURE__ */ e(
|
|
@@ -1066,33 +1159,32 @@ function he({ module: a, onAction: r }) {
|
|
|
1066
1159
|
/* @__PURE__ */ i("div", { className: "nice-edge-manager__module-body", children: [
|
|
1067
1160
|
/* @__PURE__ */ e("div", { className: "nice-edge-manager__module-image", children: a.image }),
|
|
1068
1161
|
a.resources && /* @__PURE__ */ i("div", { className: "nice-edge-manager__module-resources", children: [
|
|
1069
|
-
a.resources.cpuLimit && /* @__PURE__ */
|
|
1070
|
-
"
|
|
1071
|
-
a.resources.cpuLimit
|
|
1072
|
-
|
|
1073
|
-
a.resources.memoryLimitMB && /* @__PURE__ */
|
|
1074
|
-
"
|
|
1075
|
-
a.resources.memoryLimitMB
|
|
1076
|
-
|
|
1077
|
-
] })
|
|
1162
|
+
a.resources.cpuLimit && /* @__PURE__ */ e("span", { children: t("edgeManager.cpu", "CPU: {cpuLimit}").replace(
|
|
1163
|
+
"{cpuLimit}",
|
|
1164
|
+
String(a.resources.cpuLimit)
|
|
1165
|
+
) }),
|
|
1166
|
+
a.resources.memoryLimitMB && /* @__PURE__ */ e("span", { children: t("edgeManager.ramMb", "RAM: {memoryLimitMB} MB").replace(
|
|
1167
|
+
"{memoryLimitMB}",
|
|
1168
|
+
String(a.resources.memoryLimitMB)
|
|
1169
|
+
) })
|
|
1078
1170
|
] }),
|
|
1079
|
-
a.ports && a.ports.length > 0 && /* @__PURE__ */
|
|
1080
|
-
"
|
|
1081
|
-
a.ports.map((c) => `${c.host}:${c.container}`).join(", ")
|
|
1082
|
-
|
|
1171
|
+
a.ports && a.ports.length > 0 && /* @__PURE__ */ e("div", { className: "nice-edge-manager__module-ports", children: t("edgeManager.ports", "Ports: {ports}").replace(
|
|
1172
|
+
"{ports}",
|
|
1173
|
+
String(a.ports.map((c) => `${c.host}:${c.container}`).join(", "))
|
|
1174
|
+
) })
|
|
1083
1175
|
] }),
|
|
1084
1176
|
/* @__PURE__ */ i("div", { className: "nice-edge-manager__module-actions", children: [
|
|
1085
|
-
a.status === "running" && /* @__PURE__ */ i(
|
|
1086
|
-
/* @__PURE__ */ e("button", { onClick: () => r("stop"), children:
|
|
1087
|
-
/* @__PURE__ */ e("button", { onClick: () => r("restart"), children:
|
|
1177
|
+
a.status === "running" && /* @__PURE__ */ i(S, { children: [
|
|
1178
|
+
/* @__PURE__ */ e("button", { onClick: () => r("stop"), children: t("edgeManager.stop", "Stop") }),
|
|
1179
|
+
/* @__PURE__ */ e("button", { onClick: () => r("restart"), children: t("edgeManager.restart", "Restart") })
|
|
1088
1180
|
] }),
|
|
1089
|
-
a.status === "stopped" && /* @__PURE__ */ e("button", { onClick: () => r("start"), children:
|
|
1090
|
-
/* @__PURE__ */ e("button", { className: "nice-edge-manager__module-remove", onClick: () => r("remove"), children:
|
|
1181
|
+
a.status === "stopped" && /* @__PURE__ */ e("button", { onClick: () => r("start"), children: t("edgeManager.start", "Start") }),
|
|
1182
|
+
/* @__PURE__ */ e("button", { className: "nice-edge-manager__module-remove", onClick: () => r("remove"), children: t("edgeManager.remove", "Remove") })
|
|
1091
1183
|
] })
|
|
1092
1184
|
] });
|
|
1093
1185
|
}
|
|
1094
|
-
function me({ node: a, onSync: r, onClose:
|
|
1095
|
-
const { t: n } =
|
|
1186
|
+
function me({ node: a, onSync: r, onClose: t }) {
|
|
1187
|
+
const { t: n } = _();
|
|
1096
1188
|
return /* @__PURE__ */ i("aside", { className: "nice-edge-manager__detail", children: [
|
|
1097
1189
|
/* @__PURE__ */ i("div", { className: "nice-edge-manager__detail-header", children: [
|
|
1098
1190
|
/* @__PURE__ */ e("h3", { children: a.name }),
|
|
@@ -1102,14 +1194,14 @@ function me({ node: a, onSync: r, onClose: l }) {
|
|
|
1102
1194
|
" ",
|
|
1103
1195
|
n("edgeManager.sync", "Sync")
|
|
1104
1196
|
] }),
|
|
1105
|
-
/* @__PURE__ */ e("button", { onClick:
|
|
1197
|
+
/* @__PURE__ */ e("button", { onClick: t, "aria-label": n("edgeManager.close", "Close"), children: /* @__PURE__ */ e(m, { name: "close", size: 14 }) })
|
|
1106
1198
|
] })
|
|
1107
1199
|
] }),
|
|
1108
1200
|
/* @__PURE__ */ i("div", { className: "nice-edge-manager__detail-content", children: [
|
|
1109
1201
|
/* @__PURE__ */ i("section", { children: [
|
|
1110
1202
|
/* @__PURE__ */ e("h4", { children: n("edgeManager.status", "Status") }),
|
|
1111
1203
|
/* @__PURE__ */ i("div", { className: "nice-edge-manager__detail-row", children: [
|
|
1112
|
-
/* @__PURE__ */ e("span", { children: "Status:" }),
|
|
1204
|
+
/* @__PURE__ */ e("span", { children: n("edgeManager.status2", "Status:") }),
|
|
1113
1205
|
/* @__PURE__ */ e(
|
|
1114
1206
|
"span",
|
|
1115
1207
|
{
|
|
@@ -1120,44 +1212,39 @@ function me({ node: a, onSync: r, onClose: l }) {
|
|
|
1120
1212
|
)
|
|
1121
1213
|
] }),
|
|
1122
1214
|
a.metrics && /* @__PURE__ */ i("div", { className: "nice-edge-manager__detail-row", children: [
|
|
1123
|
-
/* @__PURE__ */ e("span", { children: "Uptime:" }),
|
|
1124
|
-
/* @__PURE__ */ e("span", { children:
|
|
1215
|
+
/* @__PURE__ */ e("span", { children: n("edgeManager.uptime", "Uptime:") }),
|
|
1216
|
+
/* @__PURE__ */ e("span", { children: de(a.metrics.uptime) })
|
|
1125
1217
|
] })
|
|
1126
1218
|
] }),
|
|
1127
1219
|
/* @__PURE__ */ i("section", { children: [
|
|
1128
1220
|
/* @__PURE__ */ e("h4", { children: n("edgeManager.hardware", "Hardware") }),
|
|
1129
1221
|
/* @__PURE__ */ i("div", { className: "nice-edge-manager__detail-row", children: [
|
|
1130
|
-
/* @__PURE__ */ e("span", { children: "CPU:" }),
|
|
1131
|
-
/* @__PURE__ */
|
|
1132
|
-
a.hardware.cpu,
|
|
1133
|
-
" (",
|
|
1134
|
-
a.hardware.cores,
|
|
1135
|
-
" cores)"
|
|
1136
|
-
] })
|
|
1222
|
+
/* @__PURE__ */ e("span", { children: n("edgeManager.cpu2", "CPU:") }),
|
|
1223
|
+
/* @__PURE__ */ e("span", { children: n("edgeManager.cores", "{cpu} ({cores} cores)").replace("{cpu}", String(a.hardware.cpu)).replace("{cores}", String(a.hardware.cores)) })
|
|
1137
1224
|
] }),
|
|
1138
1225
|
/* @__PURE__ */ i("div", { className: "nice-edge-manager__detail-row", children: [
|
|
1139
|
-
/* @__PURE__ */ e("span", { children: "Memory:" }),
|
|
1226
|
+
/* @__PURE__ */ e("span", { children: n("edgeManager.memory2", "Memory:") }),
|
|
1140
1227
|
/* @__PURE__ */ i("span", { children: [
|
|
1141
1228
|
(a.hardware.memoryMB / 1024).toFixed(1),
|
|
1142
1229
|
" GB"
|
|
1143
1230
|
] })
|
|
1144
1231
|
] }),
|
|
1145
1232
|
/* @__PURE__ */ i("div", { className: "nice-edge-manager__detail-row", children: [
|
|
1146
|
-
/* @__PURE__ */ e("span", { children: "Storage:" }),
|
|
1233
|
+
/* @__PURE__ */ e("span", { children: n("edgeManager.storage", "Storage:") }),
|
|
1147
1234
|
/* @__PURE__ */ i("span", { children: [
|
|
1148
1235
|
(a.hardware.storageMB / 1024).toFixed(1),
|
|
1149
1236
|
" GB"
|
|
1150
1237
|
] })
|
|
1151
1238
|
] }),
|
|
1152
1239
|
/* @__PURE__ */ i("div", { className: "nice-edge-manager__detail-row", children: [
|
|
1153
|
-
/* @__PURE__ */ e("span", { children: "Architecture:" }),
|
|
1240
|
+
/* @__PURE__ */ e("span", { children: n("edgeManager.architecture", "Architecture:") }),
|
|
1154
1241
|
/* @__PURE__ */ e("span", { children: a.hardware.architecture })
|
|
1155
1242
|
] })
|
|
1156
1243
|
] }),
|
|
1157
1244
|
/* @__PURE__ */ i("section", { children: [
|
|
1158
1245
|
/* @__PURE__ */ e("h4", { children: n("edgeManager.software", "Software") }),
|
|
1159
1246
|
/* @__PURE__ */ i("div", { className: "nice-edge-manager__detail-row", children: [
|
|
1160
|
-
/* @__PURE__ */ e("span", { children: "OS:" }),
|
|
1247
|
+
/* @__PURE__ */ e("span", { children: n("edgeManager.os", "OS:") }),
|
|
1161
1248
|
/* @__PURE__ */ i("span", { children: [
|
|
1162
1249
|
a.software.os,
|
|
1163
1250
|
" ",
|
|
@@ -1165,7 +1252,7 @@ function me({ node: a, onSync: r, onClose: l }) {
|
|
|
1165
1252
|
] })
|
|
1166
1253
|
] }),
|
|
1167
1254
|
/* @__PURE__ */ i("div", { className: "nice-edge-manager__detail-row", children: [
|
|
1168
|
-
/* @__PURE__ */ e("span", { children: "Runtime:" }),
|
|
1255
|
+
/* @__PURE__ */ e("span", { children: n("edgeManager.runtime", "Runtime:") }),
|
|
1169
1256
|
/* @__PURE__ */ i("span", { children: [
|
|
1170
1257
|
a.software.runtime,
|
|
1171
1258
|
" ",
|
|
@@ -1173,7 +1260,7 @@ function me({ node: a, onSync: r, onClose: l }) {
|
|
|
1173
1260
|
] })
|
|
1174
1261
|
] }),
|
|
1175
1262
|
/* @__PURE__ */ i("div", { className: "nice-edge-manager__detail-row", children: [
|
|
1176
|
-
/* @__PURE__ */ e("span", { children: "Agent:" }),
|
|
1263
|
+
/* @__PURE__ */ e("span", { children: n("edgeManager.agent", "Agent:") }),
|
|
1177
1264
|
/* @__PURE__ */ i("span", { children: [
|
|
1178
1265
|
a.software.agent,
|
|
1179
1266
|
" v",
|
|
@@ -1184,23 +1271,23 @@ function me({ node: a, onSync: r, onClose: l }) {
|
|
|
1184
1271
|
/* @__PURE__ */ i("section", { children: [
|
|
1185
1272
|
/* @__PURE__ */ e("h4", { children: n("edgeManager.connectivity", "Connectivity") }),
|
|
1186
1273
|
/* @__PURE__ */ i("div", { className: "nice-edge-manager__detail-row", children: [
|
|
1187
|
-
/* @__PURE__ */ e("span", { children: "Cloud:" }),
|
|
1274
|
+
/* @__PURE__ */ e("span", { children: n("edgeManager.cloud", "Cloud:") }),
|
|
1188
1275
|
/* @__PURE__ */ i("span", { children: [
|
|
1189
1276
|
/* @__PURE__ */ e(m, { name: a.connectivity.cloudConnected ? "check" : "close", size: 12 }),
|
|
1190
1277
|
" ",
|
|
1191
|
-
a.connectivity.cloudConnected ? "Connected" : "Disconnected"
|
|
1278
|
+
a.connectivity.cloudConnected ? n("edgeManager.connected", "Connected") : n("edgeManager.disconnected", "Disconnected")
|
|
1192
1279
|
] })
|
|
1193
1280
|
] }),
|
|
1194
1281
|
/* @__PURE__ */ i("div", { className: "nice-edge-manager__detail-row", children: [
|
|
1195
|
-
/* @__PURE__ */ e("span", { children: "Network:" }),
|
|
1282
|
+
/* @__PURE__ */ e("span", { children: n("edgeManager.network", "Network:") }),
|
|
1196
1283
|
/* @__PURE__ */ e("span", { children: a.connectivity.localNetwork })
|
|
1197
1284
|
] }),
|
|
1198
1285
|
a.connectivity.publicIP && /* @__PURE__ */ i("div", { className: "nice-edge-manager__detail-row", children: [
|
|
1199
|
-
/* @__PURE__ */ e("span", { children: "Public IP:" }),
|
|
1286
|
+
/* @__PURE__ */ e("span", { children: n("edgeManager.publicIp", "Public IP:") }),
|
|
1200
1287
|
/* @__PURE__ */ e("span", { children: a.connectivity.publicIP })
|
|
1201
1288
|
] }),
|
|
1202
1289
|
a.connectivity.lastSync && /* @__PURE__ */ i("div", { className: "nice-edge-manager__detail-row", children: [
|
|
1203
|
-
/* @__PURE__ */ e("span", { children: "Last Sync:" }),
|
|
1290
|
+
/* @__PURE__ */ e("span", { children: n("edgeManager.lastSync", "Last Sync:") }),
|
|
1204
1291
|
/* @__PURE__ */ e("span", { children: a.connectivity.lastSync.toLocaleString() })
|
|
1205
1292
|
] })
|
|
1206
1293
|
] }),
|
|
@@ -1254,96 +1341,96 @@ function me({ node: a, onSync: r, onClose: l }) {
|
|
|
1254
1341
|
/* @__PURE__ */ i("span", { children: [
|
|
1255
1342
|
/* @__PURE__ */ e(m, { name: "arrow-down", size: 12 }),
|
|
1256
1343
|
" ",
|
|
1257
|
-
|
|
1344
|
+
F(a.metrics.networkIn)
|
|
1258
1345
|
] }),
|
|
1259
1346
|
/* @__PURE__ */ i("span", { children: [
|
|
1260
1347
|
/* @__PURE__ */ e(m, { name: "arrow-up", size: 12 }),
|
|
1261
1348
|
" ",
|
|
1262
|
-
|
|
1349
|
+
F(a.metrics.networkOut)
|
|
1263
1350
|
] })
|
|
1264
1351
|
] })
|
|
1265
1352
|
] })
|
|
1266
1353
|
] })
|
|
1267
1354
|
] });
|
|
1268
1355
|
}
|
|
1269
|
-
function
|
|
1356
|
+
function Me({
|
|
1270
1357
|
config: a,
|
|
1271
1358
|
templates: r,
|
|
1272
|
-
onChange:
|
|
1359
|
+
onChange: t,
|
|
1273
1360
|
onDeploy: n,
|
|
1274
1361
|
onClose: c
|
|
1275
1362
|
}) {
|
|
1276
|
-
const { t } =
|
|
1363
|
+
const { t: l } = _();
|
|
1277
1364
|
return /* @__PURE__ */ e("div", { className: "nice-edge-manager__dialog-overlay", children: /* @__PURE__ */ i("div", { className: "nice-edge-manager__dialog", children: [
|
|
1278
1365
|
/* @__PURE__ */ i("div", { className: "nice-edge-manager__dialog-header", children: [
|
|
1279
|
-
/* @__PURE__ */ e("h3", { children:
|
|
1280
|
-
/* @__PURE__ */ e("button", { onClick: c, "aria-label":
|
|
1366
|
+
/* @__PURE__ */ e("h3", { children: l("edgeManager.deployModule", "Deploy Module") }),
|
|
1367
|
+
/* @__PURE__ */ e("button", { onClick: c, "aria-label": l("edgeManager.close", "Close"), children: /* @__PURE__ */ e(m, { name: "close", size: 14 }) })
|
|
1281
1368
|
] }),
|
|
1282
1369
|
/* @__PURE__ */ i("div", { className: "nice-edge-manager__dialog-content", children: [
|
|
1283
1370
|
/* @__PURE__ */ i("div", { className: "nice-edge-manager__field", children: [
|
|
1284
|
-
/* @__PURE__ */ e("label", { children: "Template (optional)" }),
|
|
1371
|
+
/* @__PURE__ */ e("label", { children: l("edgeManager.templateOptional", "Template (optional)") }),
|
|
1285
1372
|
/* @__PURE__ */ i(
|
|
1286
1373
|
"select",
|
|
1287
1374
|
{
|
|
1288
1375
|
value: "",
|
|
1289
1376
|
onChange: (o) => {
|
|
1290
1377
|
const s = r.find((h) => h.image === o.target.value);
|
|
1291
|
-
s &&
|
|
1378
|
+
s && t({
|
|
1292
1379
|
...a,
|
|
1293
1380
|
name: s.name,
|
|
1294
1381
|
image: s.image
|
|
1295
1382
|
});
|
|
1296
1383
|
},
|
|
1297
1384
|
children: [
|
|
1298
|
-
/* @__PURE__ */ e("option", { value: "", children:
|
|
1385
|
+
/* @__PURE__ */ e("option", { value: "", children: l("edgeManager.selectATemplate", "Select a template...") }),
|
|
1299
1386
|
r.map((o) => /* @__PURE__ */ e("option", { value: o.image, children: o.name }, o.image))
|
|
1300
1387
|
]
|
|
1301
1388
|
}
|
|
1302
1389
|
)
|
|
1303
1390
|
] }),
|
|
1304
1391
|
/* @__PURE__ */ i("div", { className: "nice-edge-manager__field", children: [
|
|
1305
|
-
/* @__PURE__ */ e("label", { children:
|
|
1392
|
+
/* @__PURE__ */ e("label", { children: l("edgeManager.moduleName", "Module Name") }),
|
|
1306
1393
|
/* @__PURE__ */ e(
|
|
1307
1394
|
"input",
|
|
1308
1395
|
{
|
|
1309
1396
|
type: "text",
|
|
1310
1397
|
value: a.name || "",
|
|
1311
|
-
onChange: (o) =>
|
|
1312
|
-
placeholder:
|
|
1398
|
+
onChange: (o) => t({ ...a, name: o.target.value }),
|
|
1399
|
+
placeholder: l("edgeManager.eGMyModule", "e.g., my-module")
|
|
1313
1400
|
}
|
|
1314
1401
|
)
|
|
1315
1402
|
] }),
|
|
1316
1403
|
/* @__PURE__ */ i("div", { className: "nice-edge-manager__field", children: [
|
|
1317
|
-
/* @__PURE__ */ e("label", { children:
|
|
1404
|
+
/* @__PURE__ */ e("label", { children: l("edgeManager.containerImage", "Container Image") }),
|
|
1318
1405
|
/* @__PURE__ */ e(
|
|
1319
1406
|
"input",
|
|
1320
1407
|
{
|
|
1321
1408
|
type: "text",
|
|
1322
1409
|
value: a.image || "",
|
|
1323
|
-
onChange: (o) =>
|
|
1324
|
-
placeholder:
|
|
1410
|
+
onChange: (o) => t({ ...a, image: o.target.value }),
|
|
1411
|
+
placeholder: l("edgeManager.eGNginxLatest", "e.g., nginx:latest")
|
|
1325
1412
|
}
|
|
1326
1413
|
)
|
|
1327
1414
|
] }),
|
|
1328
1415
|
/* @__PURE__ */ i("div", { className: "nice-edge-manager__field", children: [
|
|
1329
|
-
/* @__PURE__ */ e("label", { children:
|
|
1416
|
+
/* @__PURE__ */ e("label", { children: l("edgeManager.version", "Version") }),
|
|
1330
1417
|
/* @__PURE__ */ e(
|
|
1331
1418
|
"input",
|
|
1332
1419
|
{
|
|
1333
1420
|
type: "text",
|
|
1334
1421
|
value: a.version || "1.0.0",
|
|
1335
|
-
onChange: (o) =>
|
|
1422
|
+
onChange: (o) => t({ ...a, version: o.target.value })
|
|
1336
1423
|
}
|
|
1337
1424
|
)
|
|
1338
1425
|
] })
|
|
1339
1426
|
] }),
|
|
1340
1427
|
/* @__PURE__ */ i("div", { className: "nice-edge-manager__dialog-footer", children: [
|
|
1341
|
-
/* @__PURE__ */ e("button", { onClick: c, children:
|
|
1342
|
-
/* @__PURE__ */ e("button", { className: "nice-edge-manager__deploy-confirm", onClick: n, children:
|
|
1428
|
+
/* @__PURE__ */ e("button", { onClick: c, children: l("edgeManager.cancel", "Cancel") }),
|
|
1429
|
+
/* @__PURE__ */ e("button", { className: "nice-edge-manager__deploy-confirm", onClick: n, children: l("edgeManager.deploy", "Deploy") })
|
|
1343
1430
|
] })
|
|
1344
1431
|
] }) });
|
|
1345
1432
|
}
|
|
1346
|
-
const
|
|
1433
|
+
const q = {
|
|
1347
1434
|
broker: "localhost",
|
|
1348
1435
|
port: 1883,
|
|
1349
1436
|
clientId: `nice2dev-${Date.now()}`,
|
|
@@ -1351,7 +1438,7 @@ const F = {
|
|
|
1351
1438
|
keepAlive: 60,
|
|
1352
1439
|
cleanSession: !0,
|
|
1353
1440
|
topics: []
|
|
1354
|
-
},
|
|
1441
|
+
}, K = {
|
|
1355
1442
|
host: "localhost",
|
|
1356
1443
|
port: 5683,
|
|
1357
1444
|
useDTLS: !1,
|
|
@@ -1370,85 +1457,85 @@ const F = {
|
|
|
1370
1457
|
applicationName: "Nice2Dev IoT Client",
|
|
1371
1458
|
nodes: []
|
|
1372
1459
|
};
|
|
1373
|
-
function
|
|
1460
|
+
function ze({
|
|
1374
1461
|
protocol: a = "mqtt",
|
|
1375
1462
|
config: r,
|
|
1376
|
-
onSave:
|
|
1463
|
+
onSave: t,
|
|
1377
1464
|
onTest: n,
|
|
1378
1465
|
className: c = ""
|
|
1379
1466
|
}) {
|
|
1380
|
-
const { t } =
|
|
1381
|
-
(r == null ? void 0 : r.type) === "mqtt" ? { ...
|
|
1382
|
-
), [
|
|
1383
|
-
(r == null ? void 0 : r.type) === "coap" ? { ...
|
|
1384
|
-
), [
|
|
1467
|
+
const { t: l } = _(), [o, s] = g(a), [h, p] = g(
|
|
1468
|
+
(r == null ? void 0 : r.type) === "mqtt" ? { ...q, ...r.config } : q
|
|
1469
|
+
), [v, V] = g(
|
|
1470
|
+
(r == null ? void 0 : r.type) === "coap" ? { ...K, ...r.config } : K
|
|
1471
|
+
), [f, k] = g(
|
|
1385
1472
|
(r == null ? void 0 : r.type) === "modbus" ? { ...W, ...r.config } : W
|
|
1386
|
-
), [
|
|
1473
|
+
), [u, w] = g(
|
|
1387
1474
|
(r == null ? void 0 : r.type) === "opcua" ? { ...G, ...r.config } : G
|
|
1388
|
-
), [
|
|
1475
|
+
), [b, D] = g(null), [y, L] = g(!1), M = N(() => {
|
|
1389
1476
|
switch (o) {
|
|
1390
1477
|
case "mqtt":
|
|
1391
1478
|
return h;
|
|
1392
1479
|
case "coap":
|
|
1393
|
-
return
|
|
1480
|
+
return v;
|
|
1394
1481
|
case "modbus-tcp":
|
|
1395
1482
|
case "modbus-rtu":
|
|
1396
|
-
return
|
|
1483
|
+
return f;
|
|
1397
1484
|
case "opcua":
|
|
1398
|
-
return
|
|
1485
|
+
return u;
|
|
1399
1486
|
default:
|
|
1400
1487
|
return h;
|
|
1401
1488
|
}
|
|
1402
|
-
}, [o, h,
|
|
1403
|
-
|
|
1404
|
-
}, [
|
|
1489
|
+
}, [o, h, v, f, u]), H = N(() => {
|
|
1490
|
+
t == null || t(M());
|
|
1491
|
+
}, [M, t]), I = N(async () => {
|
|
1405
1492
|
if (n) {
|
|
1406
|
-
L(!0),
|
|
1493
|
+
L(!0), D(null);
|
|
1407
1494
|
try {
|
|
1408
|
-
const T = await n(
|
|
1409
|
-
|
|
1495
|
+
const T = await n(M());
|
|
1496
|
+
D(T);
|
|
1410
1497
|
} catch (T) {
|
|
1411
|
-
|
|
1498
|
+
D({ success: !1, message: String(T) });
|
|
1412
1499
|
} finally {
|
|
1413
1500
|
L(!1);
|
|
1414
1501
|
}
|
|
1415
1502
|
}
|
|
1416
|
-
}, [
|
|
1503
|
+
}, [M, n]);
|
|
1417
1504
|
return /* @__PURE__ */ i("div", { className: `nice-protocol-config ${c}`, children: [
|
|
1418
1505
|
/* @__PURE__ */ i("header", { className: "nice-protocol-config__header", children: [
|
|
1419
|
-
/* @__PURE__ */ e("h2", { children:
|
|
1506
|
+
/* @__PURE__ */ e("h2", { children: l("protocolConfig.title", "Protocol Configuration") }),
|
|
1420
1507
|
/* @__PURE__ */ i("div", { className: "nice-protocol-config__protocol-selector", children: [
|
|
1421
|
-
/* @__PURE__ */ e("label", { children:
|
|
1508
|
+
/* @__PURE__ */ e("label", { children: l("protocolConfig.protocol", "Protocol:") }),
|
|
1422
1509
|
/* @__PURE__ */ i("select", { value: o, onChange: (T) => s(T.target.value), children: [
|
|
1423
|
-
/* @__PURE__ */ e("option", { value: "mqtt", children:
|
|
1424
|
-
/* @__PURE__ */ e("option", { value: "coap", children:
|
|
1425
|
-
/* @__PURE__ */ e("option", { value: "modbus-tcp", children:
|
|
1426
|
-
/* @__PURE__ */ e("option", { value: "modbus-rtu", children:
|
|
1427
|
-
/* @__PURE__ */ e("option", { value: "opcua", children:
|
|
1510
|
+
/* @__PURE__ */ e("option", { value: "mqtt", children: l("protocolConfig.mqtt", "MQTT") }),
|
|
1511
|
+
/* @__PURE__ */ e("option", { value: "coap", children: l("protocolConfig.coap", "CoAP") }),
|
|
1512
|
+
/* @__PURE__ */ e("option", { value: "modbus-tcp", children: l("protocolConfig.modbusTcp", "Modbus TCP") }),
|
|
1513
|
+
/* @__PURE__ */ e("option", { value: "modbus-rtu", children: l("protocolConfig.modbusRtu", "Modbus RTU") }),
|
|
1514
|
+
/* @__PURE__ */ e("option", { value: "opcua", children: l("protocolConfig.opcUa", "OPC-UA") })
|
|
1428
1515
|
] })
|
|
1429
1516
|
] })
|
|
1430
1517
|
] }),
|
|
1431
1518
|
/* @__PURE__ */ i("div", { className: "nice-protocol-config__content", children: [
|
|
1432
1519
|
o === "mqtt" && /* @__PURE__ */ e(ve, { config: h, onChange: p }),
|
|
1433
|
-
o === "coap" && /* @__PURE__ */ e(ue, { config:
|
|
1520
|
+
o === "coap" && /* @__PURE__ */ e(ue, { config: v, onChange: V }),
|
|
1434
1521
|
(o === "modbus-tcp" || o === "modbus-rtu") && /* @__PURE__ */ e(
|
|
1435
|
-
|
|
1522
|
+
ge,
|
|
1436
1523
|
{
|
|
1437
|
-
config:
|
|
1524
|
+
config: f,
|
|
1438
1525
|
type: o === "modbus-rtu" ? "rtu" : "tcp",
|
|
1439
1526
|
onChange: k
|
|
1440
1527
|
}
|
|
1441
1528
|
),
|
|
1442
|
-
o === "opcua" && /* @__PURE__ */ e(
|
|
1529
|
+
o === "opcua" && /* @__PURE__ */ e(_e, { config: u, onChange: w })
|
|
1443
1530
|
] }),
|
|
1444
|
-
|
|
1531
|
+
b && /* @__PURE__ */ i(
|
|
1445
1532
|
"div",
|
|
1446
1533
|
{
|
|
1447
|
-
className: `nice-protocol-config__test-result nice-protocol-config__test-result--${
|
|
1534
|
+
className: `nice-protocol-config__test-result nice-protocol-config__test-result--${b.success ? "success" : "error"}`,
|
|
1448
1535
|
children: [
|
|
1449
|
-
/* @__PURE__ */ e(m, { name:
|
|
1536
|
+
/* @__PURE__ */ e(m, { name: b.success ? "check" : "close", size: 14 }),
|
|
1450
1537
|
" ",
|
|
1451
|
-
|
|
1538
|
+
b.message
|
|
1452
1539
|
]
|
|
1453
1540
|
}
|
|
1454
1541
|
),
|
|
@@ -1457,30 +1544,30 @@ function ye({
|
|
|
1457
1544
|
"button",
|
|
1458
1545
|
{
|
|
1459
1546
|
className: "nice-protocol-config__test-btn",
|
|
1460
|
-
onClick:
|
|
1547
|
+
onClick: I,
|
|
1461
1548
|
disabled: y || !n,
|
|
1462
|
-
children: y ?
|
|
1549
|
+
children: y ? l("protocolConfig.testing", "Testing...") : /* @__PURE__ */ i(S, { children: [
|
|
1463
1550
|
/* @__PURE__ */ e(m, { name: "plug", size: 14 }),
|
|
1464
1551
|
" ",
|
|
1465
|
-
|
|
1552
|
+
l("protocolConfig.testConnection", "Test Connection")
|
|
1466
1553
|
] })
|
|
1467
1554
|
}
|
|
1468
1555
|
),
|
|
1469
|
-
/* @__PURE__ */ i("button", { className: "nice-protocol-config__save-btn", onClick:
|
|
1556
|
+
/* @__PURE__ */ i("button", { className: "nice-protocol-config__save-btn", onClick: H, children: [
|
|
1470
1557
|
/* @__PURE__ */ e(m, { name: "save", size: 14 }),
|
|
1471
1558
|
" ",
|
|
1472
|
-
|
|
1559
|
+
l("save", "Save")
|
|
1473
1560
|
] })
|
|
1474
1561
|
] })
|
|
1475
1562
|
] });
|
|
1476
1563
|
}
|
|
1477
1564
|
function ve({ config: a, onChange: r }) {
|
|
1478
|
-
const { t
|
|
1565
|
+
const { t } = _();
|
|
1479
1566
|
return /* @__PURE__ */ i("div", { className: "nice-protocol-config__section", children: [
|
|
1480
|
-
/* @__PURE__ */ e("h3", { children:
|
|
1567
|
+
/* @__PURE__ */ e("h3", { children: t("protocolConfig.mqttConfiguration", "MQTT Configuration") }),
|
|
1481
1568
|
/* @__PURE__ */ i("div", { className: "nice-protocol-config__grid", children: [
|
|
1482
1569
|
/* @__PURE__ */ i("div", { className: "nice-protocol-config__field", children: [
|
|
1483
|
-
/* @__PURE__ */ e("label", { children:
|
|
1570
|
+
/* @__PURE__ */ e("label", { children: t("protocolConfig.broker", "Broker") }),
|
|
1484
1571
|
/* @__PURE__ */ e(
|
|
1485
1572
|
"input",
|
|
1486
1573
|
{
|
|
@@ -1492,7 +1579,7 @@ function ve({ config: a, onChange: r }) {
|
|
|
1492
1579
|
)
|
|
1493
1580
|
] }),
|
|
1494
1581
|
/* @__PURE__ */ i("div", { className: "nice-protocol-config__field", children: [
|
|
1495
|
-
/* @__PURE__ */ e("label", { children:
|
|
1582
|
+
/* @__PURE__ */ e("label", { children: t("protocolConfig.port", "Port") }),
|
|
1496
1583
|
/* @__PURE__ */ e(
|
|
1497
1584
|
"input",
|
|
1498
1585
|
{
|
|
@@ -1503,7 +1590,7 @@ function ve({ config: a, onChange: r }) {
|
|
|
1503
1590
|
)
|
|
1504
1591
|
] }),
|
|
1505
1592
|
/* @__PURE__ */ i("div", { className: "nice-protocol-config__field", children: [
|
|
1506
|
-
/* @__PURE__ */ e("label", { children:
|
|
1593
|
+
/* @__PURE__ */ e("label", { children: t("protocolConfig.clientId", "Client ID") }),
|
|
1507
1594
|
/* @__PURE__ */ e(
|
|
1508
1595
|
"input",
|
|
1509
1596
|
{
|
|
@@ -1522,10 +1609,10 @@ function ve({ config: a, onChange: r }) {
|
|
|
1522
1609
|
onChange: (n) => r({ ...a, useTLS: n.target.checked })
|
|
1523
1610
|
}
|
|
1524
1611
|
),
|
|
1525
|
-
|
|
1612
|
+
t("protocolConfig.useTls", "Use TLS")
|
|
1526
1613
|
] }) }),
|
|
1527
1614
|
/* @__PURE__ */ i("div", { className: "nice-protocol-config__field", children: [
|
|
1528
|
-
/* @__PURE__ */ e("label", { children:
|
|
1615
|
+
/* @__PURE__ */ e("label", { children: t("protocolConfig.username", "Username") }),
|
|
1529
1616
|
/* @__PURE__ */ e(
|
|
1530
1617
|
"input",
|
|
1531
1618
|
{
|
|
@@ -1536,7 +1623,7 @@ function ve({ config: a, onChange: r }) {
|
|
|
1536
1623
|
)
|
|
1537
1624
|
] }),
|
|
1538
1625
|
/* @__PURE__ */ i("div", { className: "nice-protocol-config__field", children: [
|
|
1539
|
-
/* @__PURE__ */ e("label", { children:
|
|
1626
|
+
/* @__PURE__ */ e("label", { children: t("protocolConfig.password", "Password") }),
|
|
1540
1627
|
/* @__PURE__ */ e(
|
|
1541
1628
|
"input",
|
|
1542
1629
|
{
|
|
@@ -1547,7 +1634,7 @@ function ve({ config: a, onChange: r }) {
|
|
|
1547
1634
|
)
|
|
1548
1635
|
] }),
|
|
1549
1636
|
/* @__PURE__ */ i("div", { className: "nice-protocol-config__field", children: [
|
|
1550
|
-
/* @__PURE__ */ e("label", { children:
|
|
1637
|
+
/* @__PURE__ */ e("label", { children: t("protocolConfig.keepAlive", "Keep Alive (seconds)") }),
|
|
1551
1638
|
/* @__PURE__ */ e(
|
|
1552
1639
|
"input",
|
|
1553
1640
|
{
|
|
@@ -1566,10 +1653,10 @@ function ve({ config: a, onChange: r }) {
|
|
|
1566
1653
|
onChange: (n) => r({ ...a, cleanSession: n.target.checked })
|
|
1567
1654
|
}
|
|
1568
1655
|
),
|
|
1569
|
-
|
|
1656
|
+
t("protocolConfig.cleanSession", "Clean Session")
|
|
1570
1657
|
] }) })
|
|
1571
1658
|
] }),
|
|
1572
|
-
/* @__PURE__ */ e("h4", { children:
|
|
1659
|
+
/* @__PURE__ */ e("h4", { children: t("protocolConfig.topics", "Topics") }),
|
|
1573
1660
|
/* @__PURE__ */ i("div", { className: "nice-protocol-config__topics", children: [
|
|
1574
1661
|
a.topics.map((n, c) => /* @__PURE__ */ i("div", { className: "nice-protocol-config__topic-row", children: [
|
|
1575
1662
|
/* @__PURE__ */ e(
|
|
@@ -1577,25 +1664,25 @@ function ve({ config: a, onChange: r }) {
|
|
|
1577
1664
|
{
|
|
1578
1665
|
type: "text",
|
|
1579
1666
|
value: n.pattern,
|
|
1580
|
-
onChange: (
|
|
1667
|
+
onChange: (l) => {
|
|
1581
1668
|
const o = [...a.topics];
|
|
1582
|
-
o[c] = { ...o[c], pattern:
|
|
1669
|
+
o[c] = { ...o[c], pattern: l.target.value }, r({ ...a, topics: o });
|
|
1583
1670
|
},
|
|
1584
|
-
placeholder:
|
|
1671
|
+
placeholder: t("protocolConfig.topicPatternPlaceholder", "e.g., sensors/+/data")
|
|
1585
1672
|
}
|
|
1586
1673
|
),
|
|
1587
1674
|
/* @__PURE__ */ i(
|
|
1588
1675
|
"select",
|
|
1589
1676
|
{
|
|
1590
1677
|
value: n.qos,
|
|
1591
|
-
onChange: (
|
|
1678
|
+
onChange: (l) => {
|
|
1592
1679
|
const o = [...a.topics];
|
|
1593
|
-
o[c] = { ...o[c], qos: parseInt(
|
|
1680
|
+
o[c] = { ...o[c], qos: parseInt(l.target.value, 10) }, r({ ...a, topics: o });
|
|
1594
1681
|
},
|
|
1595
1682
|
children: [
|
|
1596
|
-
/* @__PURE__ */ e("option", { value: 0, children:
|
|
1597
|
-
/* @__PURE__ */ e("option", { value: 1, children:
|
|
1598
|
-
/* @__PURE__ */ e("option", { value: 2, children:
|
|
1683
|
+
/* @__PURE__ */ e("option", { value: 0, children: t("protocolConfig.qos0", "QoS 0") }),
|
|
1684
|
+
/* @__PURE__ */ e("option", { value: 1, children: t("protocolConfig.qos1", "QoS 1") }),
|
|
1685
|
+
/* @__PURE__ */ e("option", { value: 2, children: t("protocolConfig.qos2", "QoS 2") })
|
|
1599
1686
|
]
|
|
1600
1687
|
}
|
|
1601
1688
|
),
|
|
@@ -1603,27 +1690,27 @@ function ve({ config: a, onChange: r }) {
|
|
|
1603
1690
|
"select",
|
|
1604
1691
|
{
|
|
1605
1692
|
value: n.direction,
|
|
1606
|
-
onChange: (
|
|
1693
|
+
onChange: (l) => {
|
|
1607
1694
|
const o = [...a.topics];
|
|
1608
1695
|
o[c] = {
|
|
1609
1696
|
...o[c],
|
|
1610
|
-
direction:
|
|
1697
|
+
direction: l.target.value
|
|
1611
1698
|
}, r({ ...a, topics: o });
|
|
1612
1699
|
},
|
|
1613
1700
|
children: [
|
|
1614
|
-
/* @__PURE__ */ e("option", { value: "subscribe", children:
|
|
1615
|
-
/* @__PURE__ */ e("option", { value: "publish", children:
|
|
1616
|
-
/* @__PURE__ */ e("option", { value: "both", children:
|
|
1701
|
+
/* @__PURE__ */ e("option", { value: "subscribe", children: t("protocolConfig.subscribe", "Subscribe") }),
|
|
1702
|
+
/* @__PURE__ */ e("option", { value: "publish", children: t("protocolConfig.publish", "Publish") }),
|
|
1703
|
+
/* @__PURE__ */ e("option", { value: "both", children: t("protocolConfig.both", "Both") })
|
|
1617
1704
|
]
|
|
1618
1705
|
}
|
|
1619
1706
|
),
|
|
1620
1707
|
/* @__PURE__ */ e(
|
|
1621
1708
|
"button",
|
|
1622
1709
|
{
|
|
1623
|
-
"aria-label":
|
|
1710
|
+
"aria-label": t("protocolConfig.close", "Close"),
|
|
1624
1711
|
onClick: () => {
|
|
1625
|
-
const
|
|
1626
|
-
r({ ...a, topics:
|
|
1712
|
+
const l = a.topics.filter((o, s) => s !== c);
|
|
1713
|
+
r({ ...a, topics: l });
|
|
1627
1714
|
},
|
|
1628
1715
|
children: /* @__PURE__ */ e(m, { name: "close", size: 14 })
|
|
1629
1716
|
}
|
|
@@ -1644,7 +1731,7 @@ function ve({ config: a, onChange: r }) {
|
|
|
1644
1731
|
children: [
|
|
1645
1732
|
/* @__PURE__ */ e(m, { name: "plus", size: 14 }),
|
|
1646
1733
|
" ",
|
|
1647
|
-
|
|
1734
|
+
t("protocolConfig.addTopic", "Add Topic")
|
|
1648
1735
|
]
|
|
1649
1736
|
}
|
|
1650
1737
|
)
|
|
@@ -1652,12 +1739,12 @@ function ve({ config: a, onChange: r }) {
|
|
|
1652
1739
|
] });
|
|
1653
1740
|
}
|
|
1654
1741
|
function ue({ config: a, onChange: r }) {
|
|
1655
|
-
const { t
|
|
1742
|
+
const { t } = _();
|
|
1656
1743
|
return /* @__PURE__ */ i("div", { className: "nice-protocol-config__section", children: [
|
|
1657
|
-
/* @__PURE__ */ e("h3", { children:
|
|
1744
|
+
/* @__PURE__ */ e("h3", { children: t("protocolConfig.coapConfiguration", "CoAP Configuration") }),
|
|
1658
1745
|
/* @__PURE__ */ i("div", { className: "nice-protocol-config__grid", children: [
|
|
1659
1746
|
/* @__PURE__ */ i("div", { className: "nice-protocol-config__field", children: [
|
|
1660
|
-
/* @__PURE__ */ e("label", { children:
|
|
1747
|
+
/* @__PURE__ */ e("label", { children: t("protocolConfig.host", "Host") }),
|
|
1661
1748
|
/* @__PURE__ */ e(
|
|
1662
1749
|
"input",
|
|
1663
1750
|
{
|
|
@@ -1668,7 +1755,7 @@ function ue({ config: a, onChange: r }) {
|
|
|
1668
1755
|
)
|
|
1669
1756
|
] }),
|
|
1670
1757
|
/* @__PURE__ */ i("div", { className: "nice-protocol-config__field", children: [
|
|
1671
|
-
/* @__PURE__ */ e("label", { children:
|
|
1758
|
+
/* @__PURE__ */ e("label", { children: t("protocolConfig.port", "Port") }),
|
|
1672
1759
|
/* @__PURE__ */ e(
|
|
1673
1760
|
"input",
|
|
1674
1761
|
{
|
|
@@ -1687,7 +1774,7 @@ function ue({ config: a, onChange: r }) {
|
|
|
1687
1774
|
onChange: (n) => r({ ...a, useDTLS: n.target.checked })
|
|
1688
1775
|
}
|
|
1689
1776
|
),
|
|
1690
|
-
|
|
1777
|
+
t("protocolConfig.useDtls", "Use DTLS")
|
|
1691
1778
|
] }) }),
|
|
1692
1779
|
/* @__PURE__ */ e("div", { className: "nice-protocol-config__field", children: /* @__PURE__ */ i("label", { children: [
|
|
1693
1780
|
/* @__PURE__ */ e(
|
|
@@ -1698,10 +1785,10 @@ function ue({ config: a, onChange: r }) {
|
|
|
1698
1785
|
onChange: (n) => r({ ...a, observe: n.target.checked })
|
|
1699
1786
|
}
|
|
1700
1787
|
),
|
|
1701
|
-
|
|
1788
|
+
t("protocolConfig.enableObserve", "Enable Observe")
|
|
1702
1789
|
] }) })
|
|
1703
1790
|
] }),
|
|
1704
|
-
/* @__PURE__ */ e("h4", { children:
|
|
1791
|
+
/* @__PURE__ */ e("h4", { children: t("protocolConfig.resources", "Resources") }),
|
|
1705
1792
|
/* @__PURE__ */ i("div", { className: "nice-protocol-config__resources", children: [
|
|
1706
1793
|
a.resources.map((n, c) => /* @__PURE__ */ i("div", { className: "nice-protocol-config__resource-row", children: [
|
|
1707
1794
|
/* @__PURE__ */ e(
|
|
@@ -1709,9 +1796,9 @@ function ue({ config: a, onChange: r }) {
|
|
|
1709
1796
|
{
|
|
1710
1797
|
type: "text",
|
|
1711
1798
|
value: n.path,
|
|
1712
|
-
onChange: (
|
|
1799
|
+
onChange: (l) => {
|
|
1713
1800
|
const o = [...a.resources];
|
|
1714
|
-
o[c] = { ...o[c], path:
|
|
1801
|
+
o[c] = { ...o[c], path: l.target.value }, r({ ...a, resources: o });
|
|
1715
1802
|
},
|
|
1716
1803
|
placeholder: "/sensors/temperature"
|
|
1717
1804
|
}
|
|
@@ -1719,10 +1806,10 @@ function ue({ config: a, onChange: r }) {
|
|
|
1719
1806
|
/* @__PURE__ */ e(
|
|
1720
1807
|
"button",
|
|
1721
1808
|
{
|
|
1722
|
-
"aria-label":
|
|
1809
|
+
"aria-label": t("protocolConfig.close", "Close"),
|
|
1723
1810
|
onClick: () => {
|
|
1724
|
-
const
|
|
1725
|
-
r({ ...a, resources:
|
|
1811
|
+
const l = a.resources.filter((o, s) => s !== c);
|
|
1812
|
+
r({ ...a, resources: l });
|
|
1726
1813
|
},
|
|
1727
1814
|
children: /* @__PURE__ */ e(m, { name: "close", size: 14 })
|
|
1728
1815
|
}
|
|
@@ -1743,26 +1830,26 @@ function ue({ config: a, onChange: r }) {
|
|
|
1743
1830
|
children: [
|
|
1744
1831
|
/* @__PURE__ */ e(m, { name: "plus", size: 14 }),
|
|
1745
1832
|
" ",
|
|
1746
|
-
|
|
1833
|
+
t("protocolConfig.addResource", "Add Resource")
|
|
1747
1834
|
]
|
|
1748
1835
|
}
|
|
1749
1836
|
)
|
|
1750
1837
|
] })
|
|
1751
1838
|
] });
|
|
1752
1839
|
}
|
|
1753
|
-
function
|
|
1840
|
+
function ge({
|
|
1754
1841
|
config: a,
|
|
1755
1842
|
type: r,
|
|
1756
|
-
onChange:
|
|
1843
|
+
onChange: t
|
|
1757
1844
|
}) {
|
|
1758
|
-
const { t: n } =
|
|
1845
|
+
const { t: n } = _();
|
|
1759
1846
|
return /* @__PURE__ */ i("div", { className: "nice-protocol-config__section", children: [
|
|
1760
1847
|
/* @__PURE__ */ e("h3", { children: n("protocolConfig.modbusConfiguration", "Modbus {type} Configuration").replace(
|
|
1761
1848
|
"{type}",
|
|
1762
1849
|
String(r.toUpperCase())
|
|
1763
1850
|
) }),
|
|
1764
1851
|
/* @__PURE__ */ i("div", { className: "nice-protocol-config__grid", children: [
|
|
1765
|
-
r === "tcp" && /* @__PURE__ */ i(
|
|
1852
|
+
r === "tcp" && /* @__PURE__ */ i(S, { children: [
|
|
1766
1853
|
/* @__PURE__ */ i("div", { className: "nice-protocol-config__field", children: [
|
|
1767
1854
|
/* @__PURE__ */ e("label", { children: n("protocolConfig.host", "Host") }),
|
|
1768
1855
|
/* @__PURE__ */ e(
|
|
@@ -1770,7 +1857,7 @@ function Me({
|
|
|
1770
1857
|
{
|
|
1771
1858
|
type: "text",
|
|
1772
1859
|
value: a.host || "",
|
|
1773
|
-
onChange: (c) =>
|
|
1860
|
+
onChange: (c) => t({ ...a, host: c.target.value })
|
|
1774
1861
|
}
|
|
1775
1862
|
)
|
|
1776
1863
|
] }),
|
|
@@ -1781,12 +1868,12 @@ function Me({
|
|
|
1781
1868
|
{
|
|
1782
1869
|
type: "number",
|
|
1783
1870
|
value: a.port || 502,
|
|
1784
|
-
onChange: (c) =>
|
|
1871
|
+
onChange: (c) => t({ ...a, port: parseInt(c.target.value, 10) || 502 })
|
|
1785
1872
|
}
|
|
1786
1873
|
)
|
|
1787
1874
|
] })
|
|
1788
1875
|
] }),
|
|
1789
|
-
r === "rtu" && /* @__PURE__ */ i(
|
|
1876
|
+
r === "rtu" && /* @__PURE__ */ i(S, { children: [
|
|
1790
1877
|
/* @__PURE__ */ i("div", { className: "nice-protocol-config__field", children: [
|
|
1791
1878
|
/* @__PURE__ */ e("label", { children: n("protocolConfig.serialPort", "Serial Port") }),
|
|
1792
1879
|
/* @__PURE__ */ e(
|
|
@@ -1794,7 +1881,7 @@ function Me({
|
|
|
1794
1881
|
{
|
|
1795
1882
|
type: "text",
|
|
1796
1883
|
value: a.serialPort || "",
|
|
1797
|
-
onChange: (c) =>
|
|
1884
|
+
onChange: (c) => t({ ...a, serialPort: c.target.value }),
|
|
1798
1885
|
placeholder: n("protocolConfig.serialPortPlaceholder", "COM1 or /dev/ttyUSB0")
|
|
1799
1886
|
}
|
|
1800
1887
|
)
|
|
@@ -1805,7 +1892,7 @@ function Me({
|
|
|
1805
1892
|
"select",
|
|
1806
1893
|
{
|
|
1807
1894
|
value: a.baudRate || 9600,
|
|
1808
|
-
onChange: (c) =>
|
|
1895
|
+
onChange: (c) => t({ ...a, baudRate: parseInt(c.target.value, 10) }),
|
|
1809
1896
|
children: [
|
|
1810
1897
|
/* @__PURE__ */ e("option", { value: 9600, children: "9600" }),
|
|
1811
1898
|
/* @__PURE__ */ e("option", { value: 19200, children: "19200" }),
|
|
@@ -1822,7 +1909,7 @@ function Me({
|
|
|
1822
1909
|
"select",
|
|
1823
1910
|
{
|
|
1824
1911
|
value: a.parity || "none",
|
|
1825
|
-
onChange: (c) =>
|
|
1912
|
+
onChange: (c) => t({ ...a, parity: c.target.value }),
|
|
1826
1913
|
children: [
|
|
1827
1914
|
/* @__PURE__ */ e("option", { value: "none", children: n("protocolConfig.none", "None") }),
|
|
1828
1915
|
/* @__PURE__ */ e("option", { value: "even", children: n("protocolConfig.even", "Even") }),
|
|
@@ -1839,7 +1926,7 @@ function Me({
|
|
|
1839
1926
|
{
|
|
1840
1927
|
type: "number",
|
|
1841
1928
|
value: a.slaveId,
|
|
1842
|
-
onChange: (c) =>
|
|
1929
|
+
onChange: (c) => t({ ...a, slaveId: parseInt(c.target.value, 10) || 1 }),
|
|
1843
1930
|
min: 1,
|
|
1844
1931
|
max: 247
|
|
1845
1932
|
}
|
|
@@ -1852,7 +1939,7 @@ function Me({
|
|
|
1852
1939
|
{
|
|
1853
1940
|
type: "number",
|
|
1854
1941
|
value: a.timeout,
|
|
1855
|
-
onChange: (c) =>
|
|
1942
|
+
onChange: (c) => t({ ...a, timeout: parseInt(c.target.value, 10) || 1e3 })
|
|
1856
1943
|
}
|
|
1857
1944
|
)
|
|
1858
1945
|
] })
|
|
@@ -1867,7 +1954,7 @@ function Me({
|
|
|
1867
1954
|
/* @__PURE__ */ e("th", { children: n("protocolConfig.readWrite", "R/W") }),
|
|
1868
1955
|
/* @__PURE__ */ e("th", {})
|
|
1869
1956
|
] }) }),
|
|
1870
|
-
/* @__PURE__ */ e("tbody", { children: a.registers.map((c,
|
|
1957
|
+
/* @__PURE__ */ e("tbody", { children: a.registers.map((c, l) => /* @__PURE__ */ i("tr", { children: [
|
|
1871
1958
|
/* @__PURE__ */ e("td", { children: /* @__PURE__ */ e(
|
|
1872
1959
|
"input",
|
|
1873
1960
|
{
|
|
@@ -1875,7 +1962,7 @@ function Me({
|
|
|
1875
1962
|
value: c.name,
|
|
1876
1963
|
onChange: (o) => {
|
|
1877
1964
|
const s = [...a.registers];
|
|
1878
|
-
s[
|
|
1965
|
+
s[l] = { ...s[l], name: o.target.value }, t({ ...a, registers: s });
|
|
1879
1966
|
}
|
|
1880
1967
|
}
|
|
1881
1968
|
) }),
|
|
@@ -1886,10 +1973,10 @@ function Me({
|
|
|
1886
1973
|
value: c.address,
|
|
1887
1974
|
onChange: (o) => {
|
|
1888
1975
|
const s = [...a.registers];
|
|
1889
|
-
s[
|
|
1890
|
-
...s[
|
|
1976
|
+
s[l] = {
|
|
1977
|
+
...s[l],
|
|
1891
1978
|
address: parseInt(o.target.value, 10) || 0
|
|
1892
|
-
},
|
|
1979
|
+
}, t({ ...a, registers: s });
|
|
1893
1980
|
}
|
|
1894
1981
|
}
|
|
1895
1982
|
) }),
|
|
@@ -1899,10 +1986,10 @@ function Me({
|
|
|
1899
1986
|
value: c.type,
|
|
1900
1987
|
onChange: (o) => {
|
|
1901
1988
|
const s = [...a.registers];
|
|
1902
|
-
s[
|
|
1903
|
-
...s[
|
|
1989
|
+
s[l] = {
|
|
1990
|
+
...s[l],
|
|
1904
1991
|
type: o.target.value
|
|
1905
|
-
},
|
|
1992
|
+
}, t({ ...a, registers: s });
|
|
1906
1993
|
},
|
|
1907
1994
|
children: [
|
|
1908
1995
|
/* @__PURE__ */ e("option", { value: "coil", children: n("protocolConfig.coil", "Coil") }),
|
|
@@ -1918,10 +2005,10 @@ function Me({
|
|
|
1918
2005
|
value: c.dataType,
|
|
1919
2006
|
onChange: (o) => {
|
|
1920
2007
|
const s = [...a.registers];
|
|
1921
|
-
s[
|
|
1922
|
-
...s[
|
|
2008
|
+
s[l] = {
|
|
2009
|
+
...s[l],
|
|
1923
2010
|
dataType: o.target.value
|
|
1924
|
-
},
|
|
2011
|
+
}, t({ ...a, registers: s });
|
|
1925
2012
|
},
|
|
1926
2013
|
children: [
|
|
1927
2014
|
/* @__PURE__ */ e("option", { value: "bool", children: n("protocolConfig.bool", "Bool") }),
|
|
@@ -1941,7 +2028,7 @@ function Me({
|
|
|
1941
2028
|
checked: c.readable,
|
|
1942
2029
|
onChange: (o) => {
|
|
1943
2030
|
const s = [...a.registers];
|
|
1944
|
-
s[
|
|
2031
|
+
s[l] = { ...s[l], readable: o.target.checked }, t({ ...a, registers: s });
|
|
1945
2032
|
},
|
|
1946
2033
|
title: n("protocolConfig.readable", "Readable")
|
|
1947
2034
|
}
|
|
@@ -1953,7 +2040,7 @@ function Me({
|
|
|
1953
2040
|
checked: c.writable,
|
|
1954
2041
|
onChange: (o) => {
|
|
1955
2042
|
const s = [...a.registers];
|
|
1956
|
-
s[
|
|
2043
|
+
s[l] = { ...s[l], writable: o.target.checked }, t({ ...a, registers: s });
|
|
1957
2044
|
},
|
|
1958
2045
|
title: n("protocolConfig.writable", "Writable")
|
|
1959
2046
|
}
|
|
@@ -1964,19 +2051,19 @@ function Me({
|
|
|
1964
2051
|
{
|
|
1965
2052
|
"aria-label": n("protocolConfig.close", "Close"),
|
|
1966
2053
|
onClick: () => {
|
|
1967
|
-
const o = a.registers.filter((s, h) => h !==
|
|
1968
|
-
|
|
2054
|
+
const o = a.registers.filter((s, h) => h !== l);
|
|
2055
|
+
t({ ...a, registers: o });
|
|
1969
2056
|
},
|
|
1970
2057
|
children: /* @__PURE__ */ e(m, { name: "close", size: 14 })
|
|
1971
2058
|
}
|
|
1972
2059
|
) })
|
|
1973
|
-
] },
|
|
2060
|
+
] }, l)) })
|
|
1974
2061
|
] }),
|
|
1975
2062
|
/* @__PURE__ */ i(
|
|
1976
2063
|
"button",
|
|
1977
2064
|
{
|
|
1978
2065
|
onClick: () => {
|
|
1979
|
-
|
|
2066
|
+
t({
|
|
1980
2067
|
...a,
|
|
1981
2068
|
registers: [
|
|
1982
2069
|
...a.registers,
|
|
@@ -2000,25 +2087,25 @@ function Me({
|
|
|
2000
2087
|
)
|
|
2001
2088
|
] });
|
|
2002
2089
|
}
|
|
2003
|
-
function
|
|
2004
|
-
const { t
|
|
2090
|
+
function _e({ config: a, onChange: r }) {
|
|
2091
|
+
const { t } = _();
|
|
2005
2092
|
return /* @__PURE__ */ i("div", { className: "nice-protocol-config__section", children: [
|
|
2006
|
-
/* @__PURE__ */ e("h3", { children:
|
|
2093
|
+
/* @__PURE__ */ e("h3", { children: t("protocolConfig.opcUaConfiguration", "OPC-UA Configuration") }),
|
|
2007
2094
|
/* @__PURE__ */ i("div", { className: "nice-protocol-config__grid", children: [
|
|
2008
2095
|
/* @__PURE__ */ i("div", { className: "nice-protocol-config__field nice-protocol-config__field--full", children: [
|
|
2009
|
-
/* @__PURE__ */ e("label", { children:
|
|
2096
|
+
/* @__PURE__ */ e("label", { children: t("protocolConfig.endpointUrl", "Endpoint URL") }),
|
|
2010
2097
|
/* @__PURE__ */ e(
|
|
2011
2098
|
"input",
|
|
2012
2099
|
{
|
|
2013
2100
|
type: "text",
|
|
2014
2101
|
value: a.endpointUrl,
|
|
2015
2102
|
onChange: (n) => r({ ...a, endpointUrl: n.target.value }),
|
|
2016
|
-
placeholder:
|
|
2103
|
+
placeholder: t("protocolConfig.endpointUrlPlaceholder", "opc.tcp://localhost:4840")
|
|
2017
2104
|
}
|
|
2018
2105
|
)
|
|
2019
2106
|
] }),
|
|
2020
2107
|
/* @__PURE__ */ i("div", { className: "nice-protocol-config__field", children: [
|
|
2021
|
-
/* @__PURE__ */ e("label", { children:
|
|
2108
|
+
/* @__PURE__ */ e("label", { children: t("protocolConfig.securityMode", "Security Mode") }),
|
|
2022
2109
|
/* @__PURE__ */ i(
|
|
2023
2110
|
"select",
|
|
2024
2111
|
{
|
|
@@ -2028,15 +2115,15 @@ function ge({ config: a, onChange: r }) {
|
|
|
2028
2115
|
securityMode: n.target.value
|
|
2029
2116
|
}),
|
|
2030
2117
|
children: [
|
|
2031
|
-
/* @__PURE__ */ e("option", { value: "None", children:
|
|
2032
|
-
/* @__PURE__ */ e("option", { value: "Sign", children:
|
|
2033
|
-
/* @__PURE__ */ e("option", { value: "SignAndEncrypt", children:
|
|
2118
|
+
/* @__PURE__ */ e("option", { value: "None", children: t("protocolConfig.securityNone", "None") }),
|
|
2119
|
+
/* @__PURE__ */ e("option", { value: "Sign", children: t("protocolConfig.sign", "Sign") }),
|
|
2120
|
+
/* @__PURE__ */ e("option", { value: "SignAndEncrypt", children: t("protocolConfig.signAndEncrypt", "Sign and Encrypt") })
|
|
2034
2121
|
]
|
|
2035
2122
|
}
|
|
2036
2123
|
)
|
|
2037
2124
|
] }),
|
|
2038
2125
|
/* @__PURE__ */ i("div", { className: "nice-protocol-config__field", children: [
|
|
2039
|
-
/* @__PURE__ */ e("label", { children:
|
|
2126
|
+
/* @__PURE__ */ e("label", { children: t("protocolConfig.authentication", "Authentication") }),
|
|
2040
2127
|
/* @__PURE__ */ i(
|
|
2041
2128
|
"select",
|
|
2042
2129
|
{
|
|
@@ -2046,16 +2133,16 @@ function ge({ config: a, onChange: r }) {
|
|
|
2046
2133
|
authentication: n.target.value
|
|
2047
2134
|
}),
|
|
2048
2135
|
children: [
|
|
2049
|
-
/* @__PURE__ */ e("option", { value: "anonymous", children:
|
|
2050
|
-
/* @__PURE__ */ e("option", { value: "username", children:
|
|
2051
|
-
/* @__PURE__ */ e("option", { value: "certificate", children:
|
|
2136
|
+
/* @__PURE__ */ e("option", { value: "anonymous", children: t("protocolConfig.anonymous", "Anonymous") }),
|
|
2137
|
+
/* @__PURE__ */ e("option", { value: "username", children: t("protocolConfig.usernamePassword", "Username/Password") }),
|
|
2138
|
+
/* @__PURE__ */ e("option", { value: "certificate", children: t("protocolConfig.certificate", "Certificate") })
|
|
2052
2139
|
]
|
|
2053
2140
|
}
|
|
2054
2141
|
)
|
|
2055
2142
|
] }),
|
|
2056
|
-
a.authentication === "username" && /* @__PURE__ */ i(
|
|
2143
|
+
a.authentication === "username" && /* @__PURE__ */ i(S, { children: [
|
|
2057
2144
|
/* @__PURE__ */ i("div", { className: "nice-protocol-config__field", children: [
|
|
2058
|
-
/* @__PURE__ */ e("label", { children:
|
|
2145
|
+
/* @__PURE__ */ e("label", { children: t("protocolConfig.username", "Username") }),
|
|
2059
2146
|
/* @__PURE__ */ e(
|
|
2060
2147
|
"input",
|
|
2061
2148
|
{
|
|
@@ -2066,7 +2153,7 @@ function ge({ config: a, onChange: r }) {
|
|
|
2066
2153
|
)
|
|
2067
2154
|
] }),
|
|
2068
2155
|
/* @__PURE__ */ i("div", { className: "nice-protocol-config__field", children: [
|
|
2069
|
-
/* @__PURE__ */ e("label", { children:
|
|
2156
|
+
/* @__PURE__ */ e("label", { children: t("protocolConfig.password", "Password") }),
|
|
2070
2157
|
/* @__PURE__ */ e(
|
|
2071
2158
|
"input",
|
|
2072
2159
|
{
|
|
@@ -2078,7 +2165,7 @@ function ge({ config: a, onChange: r }) {
|
|
|
2078
2165
|
] })
|
|
2079
2166
|
] }),
|
|
2080
2167
|
/* @__PURE__ */ i("div", { className: "nice-protocol-config__field nice-protocol-config__field--full", children: [
|
|
2081
|
-
/* @__PURE__ */ e("label", { children:
|
|
2168
|
+
/* @__PURE__ */ e("label", { children: t("protocolConfig.applicationName", "Application Name") }),
|
|
2082
2169
|
/* @__PURE__ */ e(
|
|
2083
2170
|
"input",
|
|
2084
2171
|
{
|
|
@@ -2089,7 +2176,7 @@ function ge({ config: a, onChange: r }) {
|
|
|
2089
2176
|
)
|
|
2090
2177
|
] })
|
|
2091
2178
|
] }),
|
|
2092
|
-
/* @__PURE__ */ e("h4", { children:
|
|
2179
|
+
/* @__PURE__ */ e("h4", { children: t("protocolConfig.nodes", "Nodes") }),
|
|
2093
2180
|
/* @__PURE__ */ i("div", { className: "nice-protocol-config__nodes", children: [
|
|
2094
2181
|
a.nodes.map((n, c) => /* @__PURE__ */ i("div", { className: "nice-protocol-config__node-row", children: [
|
|
2095
2182
|
/* @__PURE__ */ e(
|
|
@@ -2097,11 +2184,11 @@ function ge({ config: a, onChange: r }) {
|
|
|
2097
2184
|
{
|
|
2098
2185
|
type: "text",
|
|
2099
2186
|
value: n.nodeId,
|
|
2100
|
-
onChange: (
|
|
2187
|
+
onChange: (l) => {
|
|
2101
2188
|
const o = [...a.nodes];
|
|
2102
|
-
o[c] = { ...o[c], nodeId:
|
|
2189
|
+
o[c] = { ...o[c], nodeId: l.target.value }, r({ ...a, nodes: o });
|
|
2103
2190
|
},
|
|
2104
|
-
placeholder:
|
|
2191
|
+
placeholder: t("protocolConfig.nodeIdPlaceholder", "ns=2;s=Temperature")
|
|
2105
2192
|
}
|
|
2106
2193
|
),
|
|
2107
2194
|
/* @__PURE__ */ e(
|
|
@@ -2109,20 +2196,20 @@ function ge({ config: a, onChange: r }) {
|
|
|
2109
2196
|
{
|
|
2110
2197
|
type: "text",
|
|
2111
2198
|
value: n.displayName,
|
|
2112
|
-
onChange: (
|
|
2199
|
+
onChange: (l) => {
|
|
2113
2200
|
const o = [...a.nodes];
|
|
2114
|
-
o[c] = { ...o[c], displayName:
|
|
2201
|
+
o[c] = { ...o[c], displayName: l.target.value }, r({ ...a, nodes: o });
|
|
2115
2202
|
},
|
|
2116
|
-
placeholder:
|
|
2203
|
+
placeholder: t("protocolConfig.displayNamePlaceholder", "Display Name")
|
|
2117
2204
|
}
|
|
2118
2205
|
),
|
|
2119
2206
|
/* @__PURE__ */ e(
|
|
2120
2207
|
"button",
|
|
2121
2208
|
{
|
|
2122
|
-
"aria-label":
|
|
2209
|
+
"aria-label": t("protocolConfig.close", "Close"),
|
|
2123
2210
|
onClick: () => {
|
|
2124
|
-
const
|
|
2125
|
-
r({ ...a, nodes:
|
|
2211
|
+
const l = a.nodes.filter((o, s) => s !== c);
|
|
2212
|
+
r({ ...a, nodes: l });
|
|
2126
2213
|
},
|
|
2127
2214
|
children: /* @__PURE__ */ e(m, { name: "close", size: 14 })
|
|
2128
2215
|
}
|
|
@@ -2143,7 +2230,7 @@ function ge({ config: a, onChange: r }) {
|
|
|
2143
2230
|
children: [
|
|
2144
2231
|
/* @__PURE__ */ e(m, { name: "plus", size: 14 }),
|
|
2145
2232
|
" ",
|
|
2146
|
-
|
|
2233
|
+
t("protocolConfig.addNode", "Add Node")
|
|
2147
2234
|
]
|
|
2148
2235
|
}
|
|
2149
2236
|
)
|
|
@@ -2151,7 +2238,7 @@ function ge({ config: a, onChange: r }) {
|
|
|
2151
2238
|
] });
|
|
2152
2239
|
}
|
|
2153
2240
|
export {
|
|
2154
|
-
|
|
2241
|
+
ye as NiceEdgeManager,
|
|
2155
2242
|
Ne as NiceIoTDashboard,
|
|
2156
|
-
|
|
2243
|
+
ze as NiceProtocolConfig
|
|
2157
2244
|
};
|