@nice2dev/ui-iot 1.2.2 → 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 +479 -393
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -1,9 +1,29 @@
|
|
|
1
1
|
import { jsx as e, jsxs as i, Fragment as S } from "react/jsx-runtime";
|
|
2
|
-
import { useContext as U, createContext as
|
|
3
|
-
const
|
|
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
4
|
function _() {
|
|
5
|
-
const a = U(
|
|
6
|
-
return { t: a, lang:
|
|
5
|
+
const a = U(J), r = U(Z);
|
|
6
|
+
return { t: a, lang: r };
|
|
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
|
+
);
|
|
7
27
|
}
|
|
8
28
|
const X = {
|
|
9
29
|
// Navigation
|
|
@@ -223,41 +243,90 @@ const X = {
|
|
|
223
243
|
midpoint: "M3 12h6 M15 12h6 M3 9v6 M21 9v6 M12 9a3 3 0 1 0 0 6a3 3 0 1 0 0-6z",
|
|
224
244
|
"angle-bisector": "M4 20h17 M4 20L16 5 M4 20l14.4-6.9 M10 20a6 6 0 0 0-2.25-4.68",
|
|
225
245
|
group: "M3 7V3h4 M17 3h4v4 M21 17v4h-4 M7 21H3v-4 M7 7h5v5H7z M12 12h5v5h-5z",
|
|
226
|
-
ungroup: "M3 3h8v8H3z M13 13h8v8h-8z"
|
|
227
|
-
|
|
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 = {
|
|
228
295
|
xs: 12,
|
|
229
296
|
sm: 16,
|
|
230
297
|
md: 20,
|
|
231
298
|
lg: 24,
|
|
232
299
|
xl: 32
|
|
233
|
-
},
|
|
234
|
-
function
|
|
300
|
+
}, ae = /* @__PURE__ */ O({});
|
|
301
|
+
function ie({
|
|
235
302
|
path: a,
|
|
236
|
-
size:
|
|
237
|
-
className:
|
|
303
|
+
size: r,
|
|
304
|
+
className: t,
|
|
238
305
|
style: n,
|
|
239
306
|
color: c,
|
|
240
307
|
title: l,
|
|
241
|
-
onClick:
|
|
308
|
+
onClick: o
|
|
242
309
|
}) {
|
|
243
310
|
return /* @__PURE__ */ i(
|
|
244
311
|
"svg",
|
|
245
312
|
{
|
|
246
313
|
xmlns: "http://www.w3.org/2000/svg",
|
|
247
|
-
width:
|
|
248
|
-
height:
|
|
314
|
+
width: r,
|
|
315
|
+
height: r,
|
|
249
316
|
viewBox: "0 0 24 24",
|
|
250
317
|
fill: "none",
|
|
251
318
|
stroke: c || "currentColor",
|
|
252
319
|
strokeWidth: 2,
|
|
253
320
|
strokeLinecap: "round",
|
|
254
321
|
strokeLinejoin: "round",
|
|
255
|
-
className: `nice-icon ${
|
|
322
|
+
className: `nice-icon ${t || ""}`,
|
|
256
323
|
style: n,
|
|
257
|
-
role: l ? "img" : "presentation",
|
|
324
|
+
role: o ? "button" : l ? "img" : "presentation",
|
|
325
|
+
tabIndex: o ? 0 : void 0,
|
|
326
|
+
onKeyDown: o ? P : void 0,
|
|
258
327
|
"aria-label": l,
|
|
259
|
-
"aria-hidden": !l,
|
|
260
|
-
onClick:
|
|
328
|
+
"aria-hidden": o ? void 0 : !l,
|
|
329
|
+
onClick: o,
|
|
261
330
|
children: [
|
|
262
331
|
l && /* @__PURE__ */ e("title", { children: l }),
|
|
263
332
|
/* @__PURE__ */ e("path", { d: a })
|
|
@@ -265,32 +334,43 @@ function ae({
|
|
|
265
334
|
}
|
|
266
335
|
);
|
|
267
336
|
}
|
|
268
|
-
const
|
|
337
|
+
const m = ({
|
|
269
338
|
name: a,
|
|
270
|
-
size:
|
|
271
|
-
className:
|
|
339
|
+
size: r = "md",
|
|
340
|
+
className: t,
|
|
272
341
|
style: n,
|
|
273
342
|
color: c,
|
|
274
343
|
title: l,
|
|
275
|
-
onClick:
|
|
344
|
+
onClick: o
|
|
276
345
|
}) => {
|
|
277
|
-
const { resolver: s } = U(
|
|
346
|
+
const { resolver: s } = U(ae), h = typeof r == "number" ? r : ee[r];
|
|
278
347
|
if (s) {
|
|
279
|
-
const
|
|
280
|
-
if (
|
|
281
|
-
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
|
+
);
|
|
282
362
|
}
|
|
283
|
-
const
|
|
284
|
-
return
|
|
285
|
-
|
|
363
|
+
const p = X[a];
|
|
364
|
+
return p ? /* @__PURE__ */ e(
|
|
365
|
+
ie,
|
|
286
366
|
{
|
|
287
|
-
path:
|
|
367
|
+
path: p,
|
|
288
368
|
size: h,
|
|
289
|
-
className:
|
|
369
|
+
className: t,
|
|
290
370
|
style: n,
|
|
291
371
|
color: c,
|
|
292
372
|
title: l,
|
|
293
|
-
onClick:
|
|
373
|
+
onClick: o
|
|
294
374
|
}
|
|
295
375
|
) : null;
|
|
296
376
|
};
|
|
@@ -300,19 +380,19 @@ process.env.NODE_ENV;
|
|
|
300
380
|
process.env.NODE_ENV;
|
|
301
381
|
process.env.NODE_ENV;
|
|
302
382
|
process.env.NODE_ENV;
|
|
303
|
-
function
|
|
383
|
+
function ne() {
|
|
304
384
|
const a = globalThis.crypto;
|
|
305
385
|
if (typeof (a == null ? void 0 : a.randomUUID) == "function")
|
|
306
386
|
return a.randomUUID();
|
|
307
|
-
const
|
|
387
|
+
const r = new Uint8Array(16);
|
|
308
388
|
if (typeof (a == null ? void 0 : a.getRandomValues) == "function")
|
|
309
|
-
a.getRandomValues(
|
|
389
|
+
a.getRandomValues(r);
|
|
310
390
|
else
|
|
311
|
-
for (let n = 0; n <
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
const
|
|
315
|
-
return `${
|
|
391
|
+
for (let n = 0; n < r.length; n++)
|
|
392
|
+
r[n] = Math.floor(Math.random() * 256);
|
|
393
|
+
r[6] = r[6] & 15 | 64, r[8] = r[8] & 63 | 128;
|
|
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)}`;
|
|
316
396
|
}
|
|
317
397
|
process.env.NODE_ENV;
|
|
318
398
|
process.env.NODE_ENV;
|
|
@@ -322,7 +402,7 @@ process.env.NODE_ENV;
|
|
|
322
402
|
process.env.NODE_ENV;
|
|
323
403
|
process.env.NODE_ENV;
|
|
324
404
|
process.env.NODE_ENV;
|
|
325
|
-
const
|
|
405
|
+
const B = {
|
|
326
406
|
display: "inline-block",
|
|
327
407
|
width: 10,
|
|
328
408
|
height: 10,
|
|
@@ -342,81 +422,81 @@ const R = {
|
|
|
342
422
|
];
|
|
343
423
|
function Ne({
|
|
344
424
|
devices: a = [],
|
|
345
|
-
widgets:
|
|
346
|
-
alarms:
|
|
425
|
+
widgets: r = [],
|
|
426
|
+
alarms: t = [],
|
|
347
427
|
onDeviceSelect: n,
|
|
348
428
|
onWidgetChange: c,
|
|
349
429
|
onCommand: l,
|
|
350
|
-
onAlarmAcknowledge:
|
|
430
|
+
onAlarmAcknowledge: o,
|
|
351
431
|
fetchTelemetry: s,
|
|
352
432
|
className: h = ""
|
|
353
433
|
}) {
|
|
354
|
-
const { t:
|
|
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(
|
|
355
435
|
(d) => {
|
|
356
|
-
V((
|
|
357
|
-
const
|
|
358
|
-
return c == null || c(
|
|
436
|
+
V((z) => {
|
|
437
|
+
const C = d(z);
|
|
438
|
+
return c == null || c(C), C;
|
|
359
439
|
});
|
|
360
440
|
},
|
|
361
441
|
[c]
|
|
362
|
-
),
|
|
442
|
+
), H = N(
|
|
363
443
|
(d) => {
|
|
364
|
-
var
|
|
365
|
-
const
|
|
366
|
-
id:
|
|
444
|
+
var C;
|
|
445
|
+
const z = {
|
|
446
|
+
id: ne(),
|
|
367
447
|
type: d,
|
|
368
|
-
title: ((
|
|
369
|
-
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 },
|
|
370
450
|
config: {}
|
|
371
451
|
};
|
|
372
|
-
|
|
452
|
+
M((x) => [...x, z]);
|
|
373
453
|
},
|
|
374
|
-
[
|
|
375
|
-
),
|
|
454
|
+
[v, M]
|
|
455
|
+
), I = N(
|
|
376
456
|
(d) => {
|
|
377
457
|
k(d), n == null || n(d);
|
|
378
458
|
},
|
|
379
459
|
[n]
|
|
380
|
-
),
|
|
460
|
+
), T = N(
|
|
381
461
|
(d) => {
|
|
382
|
-
|
|
462
|
+
o == null || o(d);
|
|
383
463
|
},
|
|
384
|
-
[
|
|
464
|
+
[o]
|
|
385
465
|
), j = a.filter(
|
|
386
466
|
(d) => !y || d.name.toLowerCase().includes(y.toLowerCase()) || d.type.toLowerCase().includes(y.toLowerCase())
|
|
387
|
-
), A =
|
|
467
|
+
), A = t.filter((d) => !d.cleared), R = A.filter(
|
|
388
468
|
(d) => d.severity === "critical" || d.severity === "high"
|
|
389
469
|
);
|
|
390
470
|
return /* @__PURE__ */ i("div", { className: `nice-iot-dashboard ${h}`, children: [
|
|
391
471
|
/* @__PURE__ */ i("header", { className: "nice-iot-dashboard__header", children: [
|
|
392
|
-
/* @__PURE__ */ e("h1", { children:
|
|
472
|
+
/* @__PURE__ */ e("h1", { children: p("ioTDashboard.iotDashboard", "IoT Dashboard") }),
|
|
393
473
|
/* @__PURE__ */ i("div", { className: "nice-iot-dashboard__stats", children: [
|
|
394
474
|
/* @__PURE__ */ i("span", { className: "nice-iot-dashboard__stat", children: [
|
|
395
|
-
/* @__PURE__ */ e("span", { className: "nice-iot-dashboard__stat-icon", children: /* @__PURE__ */ e(
|
|
396
|
-
|
|
475
|
+
/* @__PURE__ */ e("span", { className: "nice-iot-dashboard__stat-icon", children: /* @__PURE__ */ e(m, { name: "wifi", size: 14 }) }),
|
|
476
|
+
p("ioTDashboard.devices", "{devices} Devices").replace(
|
|
397
477
|
"{devices}",
|
|
398
478
|
String(a.length)
|
|
399
479
|
)
|
|
400
480
|
] }),
|
|
401
481
|
/* @__PURE__ */ i("span", { className: "nice-iot-dashboard__stat nice-iot-dashboard__stat--online", children: [
|
|
402
|
-
/* @__PURE__ */ e("span", { className: "nice-iot-dashboard__stat-icon", style:
|
|
403
|
-
|
|
482
|
+
/* @__PURE__ */ e("span", { className: "nice-iot-dashboard__stat-icon", style: B }),
|
|
483
|
+
p("ioTDashboard.online", "{online} Online").replace(
|
|
404
484
|
"{online}",
|
|
405
485
|
String(a.filter((d) => d.status === "online").length)
|
|
406
486
|
)
|
|
407
487
|
] }),
|
|
408
488
|
/* @__PURE__ */ i("span", { className: "nice-iot-dashboard__stat nice-iot-dashboard__stat--offline", children: [
|
|
409
|
-
/* @__PURE__ */ e("span", { className: "nice-iot-dashboard__stat-icon", style:
|
|
410
|
-
|
|
489
|
+
/* @__PURE__ */ e("span", { className: "nice-iot-dashboard__stat-icon", style: B }),
|
|
490
|
+
p("ioTDashboard.offline", "{offline} Offline").replace(
|
|
411
491
|
"{offline}",
|
|
412
492
|
String(a.filter((d) => d.status === "offline").length)
|
|
413
493
|
)
|
|
414
494
|
] }),
|
|
415
|
-
|
|
416
|
-
/* @__PURE__ */ e("span", { className: "nice-iot-dashboard__stat-icon", children: /* @__PURE__ */ e(
|
|
417
|
-
|
|
495
|
+
R.length > 0 && /* @__PURE__ */ i("span", { className: "nice-iot-dashboard__stat nice-iot-dashboard__stat--alarms", children: [
|
|
496
|
+
/* @__PURE__ */ e("span", { className: "nice-iot-dashboard__stat-icon", children: /* @__PURE__ */ e(m, { name: "bell", size: 14 }) }),
|
|
497
|
+
p("ioTDashboard.alarms", "{criticalAlarms} Alarms").replace(
|
|
418
498
|
"{criticalAlarms}",
|
|
419
|
-
String(
|
|
499
|
+
String(R.length)
|
|
420
500
|
)
|
|
421
501
|
] })
|
|
422
502
|
] }),
|
|
@@ -424,48 +504,48 @@ function Ne({
|
|
|
424
504
|
/* @__PURE__ */ e(
|
|
425
505
|
"button",
|
|
426
506
|
{
|
|
427
|
-
className: `nice-iot-dashboard__nav-button ${
|
|
507
|
+
className: `nice-iot-dashboard__nav-button ${u === "dashboard" ? "nice-iot-dashboard__nav-button--active" : ""}`,
|
|
428
508
|
onClick: () => w("dashboard"),
|
|
429
|
-
children:
|
|
509
|
+
children: p("ioTDashboard.dashboard", "Dashboard")
|
|
430
510
|
}
|
|
431
511
|
),
|
|
432
512
|
/* @__PURE__ */ e(
|
|
433
513
|
"button",
|
|
434
514
|
{
|
|
435
|
-
className: `nice-iot-dashboard__nav-button ${
|
|
515
|
+
className: `nice-iot-dashboard__nav-button ${u === "devices" ? "nice-iot-dashboard__nav-button--active" : ""}`,
|
|
436
516
|
onClick: () => w("devices"),
|
|
437
|
-
children:
|
|
517
|
+
children: p("ioTDashboard.devices2", "Devices")
|
|
438
518
|
}
|
|
439
519
|
),
|
|
440
520
|
/* @__PURE__ */ i(
|
|
441
521
|
"button",
|
|
442
522
|
{
|
|
443
|
-
className: `nice-iot-dashboard__nav-button ${
|
|
523
|
+
className: `nice-iot-dashboard__nav-button ${u === "alarms" ? "nice-iot-dashboard__nav-button--active" : ""}`,
|
|
444
524
|
onClick: () => w("alarms"),
|
|
445
525
|
children: [
|
|
446
|
-
|
|
526
|
+
p("ioTDashboard.alarms2", "Alarms"),
|
|
447
527
|
" ",
|
|
448
528
|
A.length > 0 && `(${A.length})`
|
|
449
529
|
]
|
|
450
530
|
}
|
|
451
531
|
)
|
|
452
532
|
] }),
|
|
453
|
-
/* @__PURE__ */ e("div", { className: "nice-iot-dashboard__actions", children:
|
|
454
|
-
/* @__PURE__ */ e(
|
|
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 }),
|
|
455
535
|
" ",
|
|
456
|
-
b ?
|
|
536
|
+
b ? p("ioTDashboard.done", "Done") : p("ioTDashboard.edit", "Edit")
|
|
457
537
|
] }) })
|
|
458
538
|
] }),
|
|
459
|
-
|
|
539
|
+
u === "dashboard" && /* @__PURE__ */ i("div", { className: "nice-iot-dashboard__main", children: [
|
|
460
540
|
b && /* @__PURE__ */ i("aside", { className: "nice-iot-dashboard__palette", children: [
|
|
461
|
-
/* @__PURE__ */ e("h4", { children:
|
|
541
|
+
/* @__PURE__ */ e("h4", { children: p("ioTDashboard.addWidget", "Add Widget") }),
|
|
462
542
|
$.map((d) => /* @__PURE__ */ i(
|
|
463
543
|
"button",
|
|
464
544
|
{
|
|
465
545
|
className: "nice-iot-dashboard__palette-item",
|
|
466
|
-
onClick: () =>
|
|
546
|
+
onClick: () => H(d.type),
|
|
467
547
|
children: [
|
|
468
|
-
/* @__PURE__ */ e(
|
|
548
|
+
/* @__PURE__ */ e(m, { name: d.icon, size: 16 }),
|
|
469
549
|
/* @__PURE__ */ e("span", { children: d.label })
|
|
470
550
|
]
|
|
471
551
|
},
|
|
@@ -473,63 +553,63 @@ function Ne({
|
|
|
473
553
|
))
|
|
474
554
|
] }),
|
|
475
555
|
/* @__PURE__ */ i("div", { className: "nice-iot-dashboard__grid", children: [
|
|
476
|
-
|
|
556
|
+
v.map((d) => /* @__PURE__ */ e(
|
|
477
557
|
re,
|
|
478
558
|
{
|
|
479
559
|
widget: d,
|
|
480
560
|
devices: a,
|
|
481
|
-
alarms:
|
|
561
|
+
alarms: t,
|
|
482
562
|
isEditing: b,
|
|
483
563
|
onCommand: l,
|
|
484
|
-
onDelete: () =>
|
|
564
|
+
onDelete: () => M((z) => z.filter((C) => C.id !== d.id))
|
|
485
565
|
},
|
|
486
566
|
d.id
|
|
487
567
|
)),
|
|
488
|
-
|
|
568
|
+
v.length === 0 && /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__empty", children: b ? p("ioTDashboard.addWidgetsFromThePalette", "Add widgets from the palette") : p(
|
|
489
569
|
"ioTDashboard.noWidgetsConfiguredClickEdit",
|
|
490
570
|
"No widgets configured. Click Edit to add widgets."
|
|
491
571
|
) })
|
|
492
572
|
] })
|
|
493
573
|
] }),
|
|
494
|
-
|
|
574
|
+
u === "devices" && /* @__PURE__ */ i("div", { className: "nice-iot-dashboard__devices", children: [
|
|
495
575
|
/* @__PURE__ */ e("div", { className: "nice-iot-dashboard__devices-toolbar", children: /* @__PURE__ */ e(
|
|
496
576
|
"input",
|
|
497
577
|
{
|
|
498
578
|
type: "search",
|
|
499
|
-
placeholder:
|
|
579
|
+
placeholder: p("ioTDashboard.searchDevices", "Search devices..."),
|
|
500
580
|
value: y,
|
|
501
|
-
onChange: (d) =>
|
|
581
|
+
onChange: (d) => L(d.target.value)
|
|
502
582
|
}
|
|
503
583
|
) }),
|
|
504
584
|
/* @__PURE__ */ e("div", { className: "nice-iot-dashboard__device-grid", children: j.map((d) => /* @__PURE__ */ e(
|
|
505
585
|
le,
|
|
506
586
|
{
|
|
507
587
|
device: d,
|
|
508
|
-
isSelected: (
|
|
509
|
-
onSelect: () =>
|
|
588
|
+
isSelected: (f == null ? void 0 : f.id) === d.id,
|
|
589
|
+
onSelect: () => I(d)
|
|
510
590
|
},
|
|
511
591
|
d.id
|
|
512
592
|
)) }),
|
|
513
|
-
|
|
514
|
-
|
|
593
|
+
f && /* @__PURE__ */ e(
|
|
594
|
+
ce,
|
|
515
595
|
{
|
|
516
|
-
device:
|
|
596
|
+
device: f,
|
|
517
597
|
onCommand: l,
|
|
518
598
|
onClose: () => k(null)
|
|
519
599
|
}
|
|
520
600
|
)
|
|
521
601
|
] }),
|
|
522
|
-
|
|
602
|
+
u === "alarms" && /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__alarms", children: /* @__PURE__ */ i("table", { className: "nice-iot-dashboard__alarm-table", children: [
|
|
523
603
|
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ i("tr", { children: [
|
|
524
|
-
/* @__PURE__ */ e("th", { children:
|
|
525
|
-
/* @__PURE__ */ e("th", { children:
|
|
526
|
-
/* @__PURE__ */ e("th", { children:
|
|
527
|
-
/* @__PURE__ */ e("th", { children:
|
|
528
|
-
/* @__PURE__ */ e("th", { children:
|
|
529
|
-
/* @__PURE__ */ e("th", { children:
|
|
604
|
+
/* @__PURE__ */ e("th", { children: p("ioTDashboard.severity", "Severity") }),
|
|
605
|
+
/* @__PURE__ */ e("th", { children: p("ioTDashboard.device", "Device") }),
|
|
606
|
+
/* @__PURE__ */ e("th", { children: p("ioTDashboard.message", "Message") }),
|
|
607
|
+
/* @__PURE__ */ e("th", { children: p("ioTDashboard.time", "Time") }),
|
|
608
|
+
/* @__PURE__ */ e("th", { children: p("ioTDashboard.status", "Status") }),
|
|
609
|
+
/* @__PURE__ */ e("th", { children: p("ioTDashboard.actions", "Actions") })
|
|
530
610
|
] }) }),
|
|
531
|
-
/* @__PURE__ */ e("tbody", { children: A.length === 0 ? /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e("td", { colSpan: 6, className: "nice-iot-dashboard__no-alarms", children:
|
|
532
|
-
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);
|
|
533
613
|
return /* @__PURE__ */ i(
|
|
534
614
|
"tr",
|
|
535
615
|
{
|
|
@@ -542,11 +622,11 @@ function Ne({
|
|
|
542
622
|
children: d.severity
|
|
543
623
|
}
|
|
544
624
|
) }),
|
|
545
|
-
/* @__PURE__ */ e("td", { children: (
|
|
625
|
+
/* @__PURE__ */ e("td", { children: (z == null ? void 0 : z.name) || d.deviceId }),
|
|
546
626
|
/* @__PURE__ */ e("td", { children: d.message }),
|
|
547
627
|
/* @__PURE__ */ e("td", { children: d.timestamp.toLocaleString() }),
|
|
548
|
-
/* @__PURE__ */ e("td", { children: d.acknowledged ?
|
|
549
|
-
/* @__PURE__ */ e("td", { children: !d.acknowledged && /* @__PURE__ */ e("button", { onClick: () =>
|
|
628
|
+
/* @__PURE__ */ e("td", { children: d.acknowledged ? p("ioTDashboard.acknowledged", "Acknowledged") : p("ioTDashboard.active", "Active") }),
|
|
629
|
+
/* @__PURE__ */ e("td", { children: !d.acknowledged && /* @__PURE__ */ e("button", { onClick: () => T(d.id), children: p("ioTDashboard.acknowledge", "Acknowledge") }) })
|
|
550
630
|
]
|
|
551
631
|
},
|
|
552
632
|
d.id
|
|
@@ -555,8 +635,8 @@ function Ne({
|
|
|
555
635
|
] }) })
|
|
556
636
|
] });
|
|
557
637
|
}
|
|
558
|
-
function
|
|
559
|
-
return a.length === 0 ? 0 : Math.max(...a.map((
|
|
638
|
+
function te(a) {
|
|
639
|
+
return a.length === 0 ? 0 : Math.max(...a.map((r) => r.position.y + r.position.height));
|
|
560
640
|
}
|
|
561
641
|
function E(a) {
|
|
562
642
|
switch (a) {
|
|
@@ -576,13 +656,13 @@ function E(a) {
|
|
|
576
656
|
}
|
|
577
657
|
function re({
|
|
578
658
|
widget: a,
|
|
579
|
-
devices:
|
|
580
|
-
alarms:
|
|
659
|
+
devices: r,
|
|
660
|
+
alarms: t,
|
|
581
661
|
isEditing: n,
|
|
582
662
|
onCommand: c,
|
|
583
663
|
onDelete: l
|
|
584
664
|
}) {
|
|
585
|
-
const { t } = _(), s = $.find((h) => h.type === a.type);
|
|
665
|
+
const { t: o } = _(), s = $.find((h) => h.type === a.type);
|
|
586
666
|
return /* @__PURE__ */ i(
|
|
587
667
|
"div",
|
|
588
668
|
{
|
|
@@ -593,33 +673,33 @@ function re({
|
|
|
593
673
|
},
|
|
594
674
|
children: [
|
|
595
675
|
/* @__PURE__ */ i("div", { className: "nice-iot-dashboard__widget-header", children: [
|
|
596
|
-
/* @__PURE__ */ e("span", { className: "nice-iot-dashboard__widget-icon", children: /* @__PURE__ */ e(
|
|
676
|
+
/* @__PURE__ */ e("span", { className: "nice-iot-dashboard__widget-icon", children: /* @__PURE__ */ e(m, { name: (s == null ? void 0 : s.icon) ?? "box", size: 14 }) }),
|
|
597
677
|
/* @__PURE__ */ e("span", { className: "nice-iot-dashboard__widget-title", children: a.title }),
|
|
598
678
|
n && /* @__PURE__ */ e(
|
|
599
679
|
"button",
|
|
600
680
|
{
|
|
601
|
-
"aria-label":
|
|
681
|
+
"aria-label": o("ioTDashboard.close", "Close"),
|
|
602
682
|
className: "nice-iot-dashboard__widget-delete",
|
|
603
683
|
onClick: l,
|
|
604
|
-
children: /* @__PURE__ */ e(
|
|
684
|
+
children: /* @__PURE__ */ e(m, { name: "close", size: 14 })
|
|
605
685
|
}
|
|
606
686
|
)
|
|
607
687
|
] }),
|
|
608
|
-
/* @__PURE__ */ e("div", { className: "nice-iot-dashboard__widget-content", children: /* @__PURE__ */ e(oe, { widget: a, devices:
|
|
688
|
+
/* @__PURE__ */ e("div", { className: "nice-iot-dashboard__widget-content", children: /* @__PURE__ */ e(oe, { widget: a, devices: r, alarms: t, onCommand: c }) })
|
|
609
689
|
]
|
|
610
690
|
}
|
|
611
691
|
);
|
|
612
692
|
}
|
|
613
693
|
function oe({
|
|
614
694
|
widget: a,
|
|
615
|
-
devices:
|
|
616
|
-
alarms:
|
|
695
|
+
devices: r,
|
|
696
|
+
alarms: t,
|
|
617
697
|
onCommand: n
|
|
618
698
|
}) {
|
|
619
699
|
const { t: c } = _();
|
|
620
700
|
switch (a.type) {
|
|
621
701
|
case "device-list":
|
|
622
|
-
return /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__device-list", children:
|
|
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: [
|
|
623
703
|
/* @__PURE__ */ e(
|
|
624
704
|
"span",
|
|
625
705
|
{
|
|
@@ -632,7 +712,7 @@ function oe({
|
|
|
632
712
|
] }, l.id)) });
|
|
633
713
|
case "device-status":
|
|
634
714
|
return /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__status-grid", children: ["online", "offline", "warning", "error"].map((l) => {
|
|
635
|
-
const
|
|
715
|
+
const o = r.filter((s) => s.status === l).length;
|
|
636
716
|
return /* @__PURE__ */ i("div", { className: "nice-iot-dashboard__status-card", children: [
|
|
637
717
|
/* @__PURE__ */ e(
|
|
638
718
|
"span",
|
|
@@ -641,13 +721,13 @@ function oe({
|
|
|
641
721
|
style: { background: E(l) }
|
|
642
722
|
}
|
|
643
723
|
),
|
|
644
|
-
/* @__PURE__ */ e("span", { className: "nice-iot-dashboard__status-count", children:
|
|
724
|
+
/* @__PURE__ */ e("span", { className: "nice-iot-dashboard__status-count", children: o }),
|
|
645
725
|
/* @__PURE__ */ e("span", { className: "nice-iot-dashboard__status-label", children: l })
|
|
646
726
|
] }, l);
|
|
647
727
|
}) });
|
|
648
728
|
case "telemetry-chart":
|
|
649
729
|
return /* @__PURE__ */ i("div", { className: "nice-iot-dashboard__chart-placeholder", children: [
|
|
650
|
-
/* @__PURE__ */ e(
|
|
730
|
+
/* @__PURE__ */ e(m, { name: "bar-chart", size: 32 }),
|
|
651
731
|
/* @__PURE__ */ e("span", { children: c("ioTDashboard.telemetryChart", "Telemetry Chart") }),
|
|
652
732
|
/* @__PURE__ */ e("small", { children: c("ioTDashboard.configureDeviceAndCapability", "Configure device and capability") })
|
|
653
733
|
] });
|
|
@@ -676,49 +756,52 @@ function oe({
|
|
|
676
756
|
] }) });
|
|
677
757
|
case "map":
|
|
678
758
|
return /* @__PURE__ */ i("div", { className: "nice-iot-dashboard__map-placeholder", children: [
|
|
679
|
-
/* @__PURE__ */ e(
|
|
759
|
+
/* @__PURE__ */ e(m, { name: "map-pin", size: 32 }),
|
|
680
760
|
/* @__PURE__ */ e("span", { children: c("ioTDashboard.deviceMap", "Device Map") }),
|
|
681
761
|
/* @__PURE__ */ e("small", { children: c("ioTDashboard.devicesWithLocation", "{devices} devices with location").replace(
|
|
682
762
|
"{devices}",
|
|
683
|
-
String(
|
|
763
|
+
String(r.filter((l) => l.location).length)
|
|
684
764
|
) })
|
|
685
765
|
] });
|
|
686
766
|
case "alarms": {
|
|
687
|
-
const l =
|
|
688
|
-
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((
|
|
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(
|
|
689
769
|
"div",
|
|
690
770
|
{
|
|
691
|
-
className: `nice-iot-dashboard__alarm-item nice-iot-dashboard__alarm-item--${
|
|
771
|
+
className: `nice-iot-dashboard__alarm-item nice-iot-dashboard__alarm-item--${o.severity}`,
|
|
692
772
|
children: [
|
|
693
|
-
/* @__PURE__ */ e("span", { className: "nice-iot-dashboard__alarm-severity", children:
|
|
694
|
-
/* @__PURE__ */ e("span", { className: "nice-iot-dashboard__alarm-message", children:
|
|
773
|
+
/* @__PURE__ */ e("span", { className: "nice-iot-dashboard__alarm-severity", children: o.severity }),
|
|
774
|
+
/* @__PURE__ */ e("span", { className: "nice-iot-dashboard__alarm-message", children: o.message })
|
|
695
775
|
]
|
|
696
776
|
},
|
|
697
|
-
|
|
777
|
+
o.id
|
|
698
778
|
)) });
|
|
699
779
|
}
|
|
700
780
|
case "control-panel":
|
|
701
781
|
return /* @__PURE__ */ i("div", { className: "nice-iot-dashboard__control-placeholder", children: [
|
|
702
|
-
/* @__PURE__ */ e(
|
|
782
|
+
/* @__PURE__ */ e(m, { name: "settings", size: 32 }),
|
|
703
783
|
/* @__PURE__ */ e("span", { children: c("ioTDashboard.controlPanel", "Control Panel") }),
|
|
704
784
|
/* @__PURE__ */ e("small", { children: c("ioTDashboard.configureDeviceControls", "Configure device controls") })
|
|
705
785
|
] });
|
|
706
786
|
case "kpi":
|
|
707
787
|
return /* @__PURE__ */ i("div", { className: "nice-iot-dashboard__kpi", children: [
|
|
708
|
-
/* @__PURE__ */ e("div", { className: "nice-iot-dashboard__kpi-value", children:
|
|
788
|
+
/* @__PURE__ */ e("div", { className: "nice-iot-dashboard__kpi-value", children: r.length }),
|
|
709
789
|
/* @__PURE__ */ e("div", { className: "nice-iot-dashboard__kpi-label", children: c("ioTDashboard.totalDevices", "Total Devices") })
|
|
710
790
|
] });
|
|
711
791
|
default:
|
|
712
792
|
return /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__widget-placeholder", children: a.type });
|
|
713
793
|
}
|
|
714
794
|
}
|
|
715
|
-
function le({ device: a, isSelected:
|
|
795
|
+
function le({ device: a, isSelected: r, onSelect: t }) {
|
|
716
796
|
const { t: n } = _();
|
|
717
797
|
return /* @__PURE__ */ i(
|
|
718
798
|
"div",
|
|
719
799
|
{
|
|
720
|
-
|
|
721
|
-
|
|
800
|
+
role: "button",
|
|
801
|
+
tabIndex: 0,
|
|
802
|
+
onKeyDown: P,
|
|
803
|
+
className: `nice-iot-dashboard__device-card ${r ? "nice-iot-dashboard__device-card--selected" : ""}`,
|
|
804
|
+
onClick: t,
|
|
722
805
|
children: [
|
|
723
806
|
/* @__PURE__ */ i("div", { className: "nice-iot-dashboard__device-card-header", children: [
|
|
724
807
|
/* @__PURE__ */ e(
|
|
@@ -754,16 +837,16 @@ function le({ device: a, isSelected: o, onSelect: r }) {
|
|
|
754
837
|
}
|
|
755
838
|
);
|
|
756
839
|
}
|
|
757
|
-
function
|
|
840
|
+
function ce({
|
|
758
841
|
device: a,
|
|
759
|
-
onCommand:
|
|
760
|
-
onClose:
|
|
842
|
+
onCommand: r,
|
|
843
|
+
onClose: t
|
|
761
844
|
}) {
|
|
762
845
|
const { t: n } = _();
|
|
763
846
|
return /* @__PURE__ */ i("aside", { className: "nice-iot-dashboard__device-detail", children: [
|
|
764
847
|
/* @__PURE__ */ i("div", { className: "nice-iot-dashboard__device-detail-header", children: [
|
|
765
848
|
/* @__PURE__ */ e("h3", { children: a.name }),
|
|
766
|
-
/* @__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 }) })
|
|
767
850
|
] }),
|
|
768
851
|
/* @__PURE__ */ i("div", { className: "nice-iot-dashboard__device-detail-content", children: [
|
|
769
852
|
/* @__PURE__ */ i("section", { children: [
|
|
@@ -815,11 +898,11 @@ function te({
|
|
|
815
898
|
/* @__PURE__ */ e("div", { className: "nice-iot-dashboard__capabilities-list", children: a.capabilities.map((c) => /* @__PURE__ */ i("div", { className: "nice-iot-dashboard__capability-item", children: [
|
|
816
899
|
/* @__PURE__ */ e("span", { className: "nice-iot-dashboard__capability-name", children: c.name }),
|
|
817
900
|
/* @__PURE__ */ e("span", { className: "nice-iot-dashboard__capability-type", children: c.type }),
|
|
818
|
-
c.writable &&
|
|
901
|
+
c.writable && r && /* @__PURE__ */ e(
|
|
819
902
|
"button",
|
|
820
903
|
{
|
|
821
904
|
className: "nice-iot-dashboard__capability-control",
|
|
822
|
-
onClick: () =>
|
|
905
|
+
onClick: () => r(a.id, c.id, !0),
|
|
823
906
|
children: n("ioTDashboard.control", "Control")
|
|
824
907
|
}
|
|
825
908
|
)
|
|
@@ -828,7 +911,7 @@ function te({
|
|
|
828
911
|
] })
|
|
829
912
|
] });
|
|
830
913
|
}
|
|
831
|
-
const
|
|
914
|
+
const se = [
|
|
832
915
|
{ name: "MQTT Broker", image: "eclipse-mosquitto:latest" },
|
|
833
916
|
{ name: "Node-RED", image: "nodered/node-red:latest" },
|
|
834
917
|
{ name: "InfluxDB", image: "influxdb:latest" },
|
|
@@ -836,42 +919,42 @@ const ce = [
|
|
|
836
919
|
{ name: "Telegraf", image: "telegraf:latest" },
|
|
837
920
|
{ name: "Protocol Adapter", image: "nice2dev/protocol-adapter:latest" }
|
|
838
921
|
];
|
|
839
|
-
function
|
|
922
|
+
function ye({
|
|
840
923
|
nodes: a = [],
|
|
841
|
-
modules:
|
|
842
|
-
onNodeSelect:
|
|
924
|
+
modules: r = [],
|
|
925
|
+
onNodeSelect: t,
|
|
843
926
|
onModuleDeploy: n,
|
|
844
927
|
onModuleAction: c,
|
|
845
928
|
onNodeSync: l,
|
|
846
|
-
className:
|
|
929
|
+
className: o = ""
|
|
847
930
|
}) {
|
|
848
|
-
const { t: s } = _(), [h,
|
|
931
|
+
const { t: s } = _(), [h, p] = g(null), [v, V] = g("nodes"), [f, k] = g(!1), [u, w] = g({
|
|
849
932
|
name: "",
|
|
850
933
|
image: "",
|
|
851
934
|
status: "pending"
|
|
852
|
-
}), b =
|
|
853
|
-
(
|
|
854
|
-
|
|
935
|
+
}), b = N(
|
|
936
|
+
(M) => {
|
|
937
|
+
p(M), t == null || t(M);
|
|
855
938
|
},
|
|
856
|
-
[
|
|
857
|
-
), D =
|
|
858
|
-
!h || !
|
|
859
|
-
}, [h,
|
|
860
|
-
async (
|
|
861
|
-
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));
|
|
862
945
|
},
|
|
863
946
|
[h, c]
|
|
864
|
-
),
|
|
947
|
+
), L = N(async () => {
|
|
865
948
|
h && await (l == null ? void 0 : l(h.id));
|
|
866
949
|
}, [h, l]);
|
|
867
|
-
return /* @__PURE__ */ i("div", { className: `nice-edge-manager ${
|
|
950
|
+
return /* @__PURE__ */ i("div", { className: `nice-edge-manager ${o}`, children: [
|
|
868
951
|
/* @__PURE__ */ i("header", { className: "nice-edge-manager__header", children: [
|
|
869
952
|
/* @__PURE__ */ e("h1", { children: s("edgeManager.edgeManager", "Edge Manager") }),
|
|
870
953
|
/* @__PURE__ */ i("nav", { className: "nice-edge-manager__nav", children: [
|
|
871
954
|
/* @__PURE__ */ e(
|
|
872
955
|
"button",
|
|
873
956
|
{
|
|
874
|
-
className: `nice-edge-manager__nav-button ${
|
|
957
|
+
className: `nice-edge-manager__nav-button ${v === "nodes" ? "nice-edge-manager__nav-button--active" : ""}`,
|
|
875
958
|
onClick: () => V("nodes"),
|
|
876
959
|
children: s("edgeManager.nodes", "Nodes ({nodes})").replace("{nodes}", String(a.length))
|
|
877
960
|
}
|
|
@@ -879,7 +962,7 @@ function fe({
|
|
|
879
962
|
/* @__PURE__ */ e(
|
|
880
963
|
"button",
|
|
881
964
|
{
|
|
882
|
-
className: `nice-edge-manager__nav-button ${
|
|
965
|
+
className: `nice-edge-manager__nav-button ${v === "modules" ? "nice-edge-manager__nav-button--active" : ""}`,
|
|
883
966
|
onClick: () => V("modules"),
|
|
884
967
|
children: s("edgeManager.modules", "Modules")
|
|
885
968
|
}
|
|
@@ -887,19 +970,19 @@ function fe({
|
|
|
887
970
|
] })
|
|
888
971
|
] }),
|
|
889
972
|
/* @__PURE__ */ i("div", { className: "nice-edge-manager__main", children: [
|
|
890
|
-
|
|
891
|
-
a.map((
|
|
892
|
-
|
|
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,
|
|
893
976
|
{
|
|
894
|
-
node:
|
|
895
|
-
isSelected: (h == null ? void 0 : h.id) ===
|
|
896
|
-
onSelect: () => b(
|
|
977
|
+
node: M,
|
|
978
|
+
isSelected: (h == null ? void 0 : h.id) === M.id,
|
|
979
|
+
onSelect: () => b(M)
|
|
897
980
|
},
|
|
898
|
-
|
|
981
|
+
M.id
|
|
899
982
|
)),
|
|
900
983
|
a.length === 0 && /* @__PURE__ */ e("div", { className: "nice-edge-manager__empty", children: s("edgeManager.noEdgeNodesConfigured", "No edge nodes configured") })
|
|
901
984
|
] }) }),
|
|
902
|
-
|
|
985
|
+
v === "modules" && h && /* @__PURE__ */ i("div", { className: "nice-edge-manager__modules", children: [
|
|
903
986
|
/* @__PURE__ */ i("div", { className: "nice-edge-manager__modules-header", children: [
|
|
904
987
|
/* @__PURE__ */ e("h3", { children: s("edgeManager.modulesOn", "Modules on {name}").replace(
|
|
905
988
|
"{name}",
|
|
@@ -915,18 +998,18 @@ function fe({
|
|
|
915
998
|
)
|
|
916
999
|
] }),
|
|
917
1000
|
/* @__PURE__ */ i("div", { className: "nice-edge-manager__module-grid", children: [
|
|
918
|
-
h.deployedModules.map((
|
|
919
|
-
|
|
1001
|
+
h.deployedModules.map((M) => /* @__PURE__ */ e(
|
|
1002
|
+
pe,
|
|
920
1003
|
{
|
|
921
|
-
module:
|
|
922
|
-
onAction: (
|
|
1004
|
+
module: M,
|
|
1005
|
+
onAction: (H) => y(M.id, H)
|
|
923
1006
|
},
|
|
924
|
-
|
|
1007
|
+
M.id
|
|
925
1008
|
)),
|
|
926
1009
|
h.deployedModules.length === 0 && /* @__PURE__ */ e("div", { className: "nice-edge-manager__empty", children: s("edgeManager.noModulesDeployedOnThis", "No modules deployed on this node") })
|
|
927
1010
|
] })
|
|
928
1011
|
] }),
|
|
929
|
-
|
|
1012
|
+
v === "modules" && !h && /* @__PURE__ */ e("div", { className: "nice-edge-manager__no-selection", children: s(
|
|
930
1013
|
"edgeManager.selectANodeFromThe",
|
|
931
1014
|
"Select a node from the Nodes tab to manage modules"
|
|
932
1015
|
) }),
|
|
@@ -934,16 +1017,16 @@ function fe({
|
|
|
934
1017
|
me,
|
|
935
1018
|
{
|
|
936
1019
|
node: h,
|
|
937
|
-
onSync:
|
|
938
|
-
onClose: () =>
|
|
1020
|
+
onSync: L,
|
|
1021
|
+
onClose: () => p(null)
|
|
939
1022
|
}
|
|
940
1023
|
)
|
|
941
1024
|
] }),
|
|
942
|
-
|
|
943
|
-
|
|
1025
|
+
f && /* @__PURE__ */ e(
|
|
1026
|
+
Me,
|
|
944
1027
|
{
|
|
945
|
-
config:
|
|
946
|
-
templates:
|
|
1028
|
+
config: u,
|
|
1029
|
+
templates: se,
|
|
947
1030
|
onChange: w,
|
|
948
1031
|
onDeploy: D,
|
|
949
1032
|
onClose: () => k(!1)
|
|
@@ -967,20 +1050,23 @@ function Q(a) {
|
|
|
967
1050
|
return "var(--nice-text-secondary, #6c757d)";
|
|
968
1051
|
}
|
|
969
1052
|
}
|
|
970
|
-
function
|
|
1053
|
+
function F(a) {
|
|
971
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`;
|
|
972
1055
|
}
|
|
973
|
-
function
|
|
974
|
-
const
|
|
975
|
-
return
|
|
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`;
|
|
976
1059
|
}
|
|
977
|
-
function
|
|
1060
|
+
function he({ node: a, isSelected: r, onSelect: t }) {
|
|
978
1061
|
const { t: n } = _();
|
|
979
1062
|
return /* @__PURE__ */ i(
|
|
980
1063
|
"div",
|
|
981
1064
|
{
|
|
982
|
-
|
|
983
|
-
|
|
1065
|
+
role: "button",
|
|
1066
|
+
tabIndex: 0,
|
|
1067
|
+
onKeyDown: P,
|
|
1068
|
+
className: `nice-edge-manager__node-card ${r ? "nice-edge-manager__node-card--selected" : ""}`,
|
|
1069
|
+
onClick: t,
|
|
984
1070
|
children: [
|
|
985
1071
|
/* @__PURE__ */ i("div", { className: "nice-edge-manager__node-header", children: [
|
|
986
1072
|
/* @__PURE__ */ e(
|
|
@@ -996,12 +1082,12 @@ function de({ node: a, isSelected: o, onSelect: r }) {
|
|
|
996
1082
|
/* @__PURE__ */ i("div", { className: "nice-edge-manager__node-body", children: [
|
|
997
1083
|
/* @__PURE__ */ i("div", { className: "nice-edge-manager__node-info", children: [
|
|
998
1084
|
/* @__PURE__ */ i("span", { children: [
|
|
999
|
-
/* @__PURE__ */ e(
|
|
1085
|
+
/* @__PURE__ */ e(m, { name: "server", size: 12 }),
|
|
1000
1086
|
" ",
|
|
1001
1087
|
a.hardware.cpu
|
|
1002
1088
|
] }),
|
|
1003
1089
|
/* @__PURE__ */ i("span", { children: [
|
|
1004
|
-
/* @__PURE__ */ e(
|
|
1090
|
+
/* @__PURE__ */ e(m, { name: "database", size: 12 }),
|
|
1005
1091
|
" ",
|
|
1006
1092
|
(a.hardware.memoryMB / 1024).toFixed(1),
|
|
1007
1093
|
" GB"
|
|
@@ -1046,8 +1132,8 @@ function de({ node: a, isSelected: o, onSelect: r }) {
|
|
|
1046
1132
|
}
|
|
1047
1133
|
);
|
|
1048
1134
|
}
|
|
1049
|
-
function
|
|
1050
|
-
const { t
|
|
1135
|
+
function pe({ module: a, onAction: r }) {
|
|
1136
|
+
const { t } = _();
|
|
1051
1137
|
return /* @__PURE__ */ i("div", { className: "nice-edge-manager__module-card", children: [
|
|
1052
1138
|
/* @__PURE__ */ i("div", { className: "nice-edge-manager__module-header", children: [
|
|
1053
1139
|
/* @__PURE__ */ e(
|
|
@@ -1073,42 +1159,42 @@ function he({ module: a, onAction: o }) {
|
|
|
1073
1159
|
/* @__PURE__ */ i("div", { className: "nice-edge-manager__module-body", children: [
|
|
1074
1160
|
/* @__PURE__ */ e("div", { className: "nice-edge-manager__module-image", children: a.image }),
|
|
1075
1161
|
a.resources && /* @__PURE__ */ i("div", { className: "nice-edge-manager__module-resources", children: [
|
|
1076
|
-
a.resources.cpuLimit && /* @__PURE__ */ e("span", { children:
|
|
1162
|
+
a.resources.cpuLimit && /* @__PURE__ */ e("span", { children: t("edgeManager.cpu", "CPU: {cpuLimit}").replace(
|
|
1077
1163
|
"{cpuLimit}",
|
|
1078
1164
|
String(a.resources.cpuLimit)
|
|
1079
1165
|
) }),
|
|
1080
|
-
a.resources.memoryLimitMB && /* @__PURE__ */ e("span", { children:
|
|
1166
|
+
a.resources.memoryLimitMB && /* @__PURE__ */ e("span", { children: t("edgeManager.ramMb", "RAM: {memoryLimitMB} MB").replace(
|
|
1081
1167
|
"{memoryLimitMB}",
|
|
1082
1168
|
String(a.resources.memoryLimitMB)
|
|
1083
1169
|
) })
|
|
1084
1170
|
] }),
|
|
1085
|
-
a.ports && a.ports.length > 0 && /* @__PURE__ */ e("div", { className: "nice-edge-manager__module-ports", children:
|
|
1171
|
+
a.ports && a.ports.length > 0 && /* @__PURE__ */ e("div", { className: "nice-edge-manager__module-ports", children: t("edgeManager.ports", "Ports: {ports}").replace(
|
|
1086
1172
|
"{ports}",
|
|
1087
1173
|
String(a.ports.map((c) => `${c.host}:${c.container}`).join(", "))
|
|
1088
1174
|
) })
|
|
1089
1175
|
] }),
|
|
1090
1176
|
/* @__PURE__ */ i("div", { className: "nice-edge-manager__module-actions", children: [
|
|
1091
1177
|
a.status === "running" && /* @__PURE__ */ i(S, { children: [
|
|
1092
|
-
/* @__PURE__ */ e("button", { onClick: () =>
|
|
1093
|
-
/* @__PURE__ */ e("button", { onClick: () =>
|
|
1178
|
+
/* @__PURE__ */ e("button", { onClick: () => r("stop"), children: t("edgeManager.stop", "Stop") }),
|
|
1179
|
+
/* @__PURE__ */ e("button", { onClick: () => r("restart"), children: t("edgeManager.restart", "Restart") })
|
|
1094
1180
|
] }),
|
|
1095
|
-
a.status === "stopped" && /* @__PURE__ */ e("button", { onClick: () =>
|
|
1096
|
-
/* @__PURE__ */ e("button", { className: "nice-edge-manager__module-remove", onClick: () =>
|
|
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") })
|
|
1097
1183
|
] })
|
|
1098
1184
|
] });
|
|
1099
1185
|
}
|
|
1100
|
-
function me({ node: a, onSync:
|
|
1186
|
+
function me({ node: a, onSync: r, onClose: t }) {
|
|
1101
1187
|
const { t: n } = _();
|
|
1102
1188
|
return /* @__PURE__ */ i("aside", { className: "nice-edge-manager__detail", children: [
|
|
1103
1189
|
/* @__PURE__ */ i("div", { className: "nice-edge-manager__detail-header", children: [
|
|
1104
1190
|
/* @__PURE__ */ e("h3", { children: a.name }),
|
|
1105
1191
|
/* @__PURE__ */ i("div", { className: "nice-edge-manager__detail-actions", children: [
|
|
1106
|
-
/* @__PURE__ */ i("button", { onClick:
|
|
1107
|
-
/* @__PURE__ */ e(
|
|
1192
|
+
/* @__PURE__ */ i("button", { onClick: r, children: [
|
|
1193
|
+
/* @__PURE__ */ e(m, { name: "refresh", size: 14 }),
|
|
1108
1194
|
" ",
|
|
1109
1195
|
n("edgeManager.sync", "Sync")
|
|
1110
1196
|
] }),
|
|
1111
|
-
/* @__PURE__ */ e("button", { onClick:
|
|
1197
|
+
/* @__PURE__ */ e("button", { onClick: t, "aria-label": n("edgeManager.close", "Close"), children: /* @__PURE__ */ e(m, { name: "close", size: 14 }) })
|
|
1112
1198
|
] })
|
|
1113
1199
|
] }),
|
|
1114
1200
|
/* @__PURE__ */ i("div", { className: "nice-edge-manager__detail-content", children: [
|
|
@@ -1127,7 +1213,7 @@ function me({ node: a, onSync: o, onClose: r }) {
|
|
|
1127
1213
|
] }),
|
|
1128
1214
|
a.metrics && /* @__PURE__ */ i("div", { className: "nice-edge-manager__detail-row", children: [
|
|
1129
1215
|
/* @__PURE__ */ e("span", { children: n("edgeManager.uptime", "Uptime:") }),
|
|
1130
|
-
/* @__PURE__ */ e("span", { children:
|
|
1216
|
+
/* @__PURE__ */ e("span", { children: de(a.metrics.uptime) })
|
|
1131
1217
|
] })
|
|
1132
1218
|
] }),
|
|
1133
1219
|
/* @__PURE__ */ i("section", { children: [
|
|
@@ -1187,7 +1273,7 @@ function me({ node: a, onSync: o, onClose: r }) {
|
|
|
1187
1273
|
/* @__PURE__ */ i("div", { className: "nice-edge-manager__detail-row", children: [
|
|
1188
1274
|
/* @__PURE__ */ e("span", { children: n("edgeManager.cloud", "Cloud:") }),
|
|
1189
1275
|
/* @__PURE__ */ i("span", { children: [
|
|
1190
|
-
/* @__PURE__ */ e(
|
|
1276
|
+
/* @__PURE__ */ e(m, { name: a.connectivity.cloudConnected ? "check" : "close", size: 12 }),
|
|
1191
1277
|
" ",
|
|
1192
1278
|
a.connectivity.cloudConnected ? n("edgeManager.connected", "Connected") : n("edgeManager.disconnected", "Disconnected")
|
|
1193
1279
|
] })
|
|
@@ -1253,24 +1339,24 @@ function me({ node: a, onSync: o, onClose: r }) {
|
|
|
1253
1339
|
] }),
|
|
1254
1340
|
/* @__PURE__ */ i("div", { className: "nice-edge-manager__network-stats", children: [
|
|
1255
1341
|
/* @__PURE__ */ i("span", { children: [
|
|
1256
|
-
/* @__PURE__ */ e(
|
|
1342
|
+
/* @__PURE__ */ e(m, { name: "arrow-down", size: 12 }),
|
|
1257
1343
|
" ",
|
|
1258
|
-
|
|
1344
|
+
F(a.metrics.networkIn)
|
|
1259
1345
|
] }),
|
|
1260
1346
|
/* @__PURE__ */ i("span", { children: [
|
|
1261
|
-
/* @__PURE__ */ e(
|
|
1347
|
+
/* @__PURE__ */ e(m, { name: "arrow-up", size: 12 }),
|
|
1262
1348
|
" ",
|
|
1263
|
-
|
|
1349
|
+
F(a.metrics.networkOut)
|
|
1264
1350
|
] })
|
|
1265
1351
|
] })
|
|
1266
1352
|
] })
|
|
1267
1353
|
] })
|
|
1268
1354
|
] });
|
|
1269
1355
|
}
|
|
1270
|
-
function
|
|
1356
|
+
function Me({
|
|
1271
1357
|
config: a,
|
|
1272
|
-
templates:
|
|
1273
|
-
onChange:
|
|
1358
|
+
templates: r,
|
|
1359
|
+
onChange: t,
|
|
1274
1360
|
onDeploy: n,
|
|
1275
1361
|
onClose: c
|
|
1276
1362
|
}) {
|
|
@@ -1278,7 +1364,7 @@ function pe({
|
|
|
1278
1364
|
return /* @__PURE__ */ e("div", { className: "nice-edge-manager__dialog-overlay", children: /* @__PURE__ */ i("div", { className: "nice-edge-manager__dialog", children: [
|
|
1279
1365
|
/* @__PURE__ */ i("div", { className: "nice-edge-manager__dialog-header", children: [
|
|
1280
1366
|
/* @__PURE__ */ e("h3", { children: l("edgeManager.deployModule", "Deploy Module") }),
|
|
1281
|
-
/* @__PURE__ */ e("button", { onClick: c, "aria-label": l("edgeManager.close", "Close"), children: /* @__PURE__ */ e(
|
|
1367
|
+
/* @__PURE__ */ e("button", { onClick: c, "aria-label": l("edgeManager.close", "Close"), children: /* @__PURE__ */ e(m, { name: "close", size: 14 }) })
|
|
1282
1368
|
] }),
|
|
1283
1369
|
/* @__PURE__ */ i("div", { className: "nice-edge-manager__dialog-content", children: [
|
|
1284
1370
|
/* @__PURE__ */ i("div", { className: "nice-edge-manager__field", children: [
|
|
@@ -1287,9 +1373,9 @@ function pe({
|
|
|
1287
1373
|
"select",
|
|
1288
1374
|
{
|
|
1289
1375
|
value: "",
|
|
1290
|
-
onChange: (
|
|
1291
|
-
const s =
|
|
1292
|
-
s &&
|
|
1376
|
+
onChange: (o) => {
|
|
1377
|
+
const s = r.find((h) => h.image === o.target.value);
|
|
1378
|
+
s && t({
|
|
1293
1379
|
...a,
|
|
1294
1380
|
name: s.name,
|
|
1295
1381
|
image: s.image
|
|
@@ -1297,7 +1383,7 @@ function pe({
|
|
|
1297
1383
|
},
|
|
1298
1384
|
children: [
|
|
1299
1385
|
/* @__PURE__ */ e("option", { value: "", children: l("edgeManager.selectATemplate", "Select a template...") }),
|
|
1300
|
-
|
|
1386
|
+
r.map((o) => /* @__PURE__ */ e("option", { value: o.image, children: o.name }, o.image))
|
|
1301
1387
|
]
|
|
1302
1388
|
}
|
|
1303
1389
|
)
|
|
@@ -1309,7 +1395,7 @@ function pe({
|
|
|
1309
1395
|
{
|
|
1310
1396
|
type: "text",
|
|
1311
1397
|
value: a.name || "",
|
|
1312
|
-
onChange: (
|
|
1398
|
+
onChange: (o) => t({ ...a, name: o.target.value }),
|
|
1313
1399
|
placeholder: l("edgeManager.eGMyModule", "e.g., my-module")
|
|
1314
1400
|
}
|
|
1315
1401
|
)
|
|
@@ -1321,7 +1407,7 @@ function pe({
|
|
|
1321
1407
|
{
|
|
1322
1408
|
type: "text",
|
|
1323
1409
|
value: a.image || "",
|
|
1324
|
-
onChange: (
|
|
1410
|
+
onChange: (o) => t({ ...a, image: o.target.value }),
|
|
1325
1411
|
placeholder: l("edgeManager.eGNginxLatest", "e.g., nginx:latest")
|
|
1326
1412
|
}
|
|
1327
1413
|
)
|
|
@@ -1333,7 +1419,7 @@ function pe({
|
|
|
1333
1419
|
{
|
|
1334
1420
|
type: "text",
|
|
1335
1421
|
value: a.version || "1.0.0",
|
|
1336
|
-
onChange: (
|
|
1422
|
+
onChange: (o) => t({ ...a, version: o.target.value })
|
|
1337
1423
|
}
|
|
1338
1424
|
)
|
|
1339
1425
|
] })
|
|
@@ -1344,7 +1430,7 @@ function pe({
|
|
|
1344
1430
|
] })
|
|
1345
1431
|
] }) });
|
|
1346
1432
|
}
|
|
1347
|
-
const
|
|
1433
|
+
const q = {
|
|
1348
1434
|
broker: "localhost",
|
|
1349
1435
|
port: 1883,
|
|
1350
1436
|
clientId: `nice2dev-${Date.now()}`,
|
|
@@ -1352,7 +1438,7 @@ const F = {
|
|
|
1352
1438
|
keepAlive: 60,
|
|
1353
1439
|
cleanSession: !0,
|
|
1354
1440
|
topics: []
|
|
1355
|
-
},
|
|
1441
|
+
}, K = {
|
|
1356
1442
|
host: "localhost",
|
|
1357
1443
|
port: 5683,
|
|
1358
1444
|
useDTLS: !1,
|
|
@@ -1371,56 +1457,56 @@ const F = {
|
|
|
1371
1457
|
applicationName: "Nice2Dev IoT Client",
|
|
1372
1458
|
nodes: []
|
|
1373
1459
|
};
|
|
1374
|
-
function
|
|
1460
|
+
function ze({
|
|
1375
1461
|
protocol: a = "mqtt",
|
|
1376
|
-
config:
|
|
1377
|
-
onSave:
|
|
1462
|
+
config: r,
|
|
1463
|
+
onSave: t,
|
|
1378
1464
|
onTest: n,
|
|
1379
1465
|
className: c = ""
|
|
1380
1466
|
}) {
|
|
1381
|
-
const { t: l } = _(), [
|
|
1382
|
-
(
|
|
1383
|
-
), [
|
|
1384
|
-
(
|
|
1385
|
-
), [
|
|
1386
|
-
(
|
|
1387
|
-
), [
|
|
1388
|
-
(
|
|
1389
|
-
), [b, D] =
|
|
1390
|
-
switch (
|
|
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(
|
|
1472
|
+
(r == null ? void 0 : r.type) === "modbus" ? { ...W, ...r.config } : W
|
|
1473
|
+
), [u, w] = g(
|
|
1474
|
+
(r == null ? void 0 : r.type) === "opcua" ? { ...G, ...r.config } : G
|
|
1475
|
+
), [b, D] = g(null), [y, L] = g(!1), M = N(() => {
|
|
1476
|
+
switch (o) {
|
|
1391
1477
|
case "mqtt":
|
|
1392
1478
|
return h;
|
|
1393
1479
|
case "coap":
|
|
1394
|
-
return
|
|
1480
|
+
return v;
|
|
1395
1481
|
case "modbus-tcp":
|
|
1396
1482
|
case "modbus-rtu":
|
|
1397
|
-
return
|
|
1483
|
+
return f;
|
|
1398
1484
|
case "opcua":
|
|
1399
|
-
return
|
|
1485
|
+
return u;
|
|
1400
1486
|
default:
|
|
1401
1487
|
return h;
|
|
1402
1488
|
}
|
|
1403
|
-
}, [
|
|
1404
|
-
|
|
1405
|
-
}, [
|
|
1489
|
+
}, [o, h, v, f, u]), H = N(() => {
|
|
1490
|
+
t == null || t(M());
|
|
1491
|
+
}, [M, t]), I = N(async () => {
|
|
1406
1492
|
if (n) {
|
|
1407
|
-
|
|
1493
|
+
L(!0), D(null);
|
|
1408
1494
|
try {
|
|
1409
|
-
const
|
|
1410
|
-
D(
|
|
1411
|
-
} catch (
|
|
1412
|
-
D({ success: !1, message: String(
|
|
1495
|
+
const T = await n(M());
|
|
1496
|
+
D(T);
|
|
1497
|
+
} catch (T) {
|
|
1498
|
+
D({ success: !1, message: String(T) });
|
|
1413
1499
|
} finally {
|
|
1414
|
-
|
|
1500
|
+
L(!1);
|
|
1415
1501
|
}
|
|
1416
1502
|
}
|
|
1417
|
-
}, [
|
|
1503
|
+
}, [M, n]);
|
|
1418
1504
|
return /* @__PURE__ */ i("div", { className: `nice-protocol-config ${c}`, children: [
|
|
1419
1505
|
/* @__PURE__ */ i("header", { className: "nice-protocol-config__header", children: [
|
|
1420
1506
|
/* @__PURE__ */ e("h2", { children: l("protocolConfig.title", "Protocol Configuration") }),
|
|
1421
1507
|
/* @__PURE__ */ i("div", { className: "nice-protocol-config__protocol-selector", children: [
|
|
1422
1508
|
/* @__PURE__ */ e("label", { children: l("protocolConfig.protocol", "Protocol:") }),
|
|
1423
|
-
/* @__PURE__ */ i("select", { value:
|
|
1509
|
+
/* @__PURE__ */ i("select", { value: o, onChange: (T) => s(T.target.value), children: [
|
|
1424
1510
|
/* @__PURE__ */ e("option", { value: "mqtt", children: l("protocolConfig.mqtt", "MQTT") }),
|
|
1425
1511
|
/* @__PURE__ */ e("option", { value: "coap", children: l("protocolConfig.coap", "CoAP") }),
|
|
1426
1512
|
/* @__PURE__ */ e("option", { value: "modbus-tcp", children: l("protocolConfig.modbusTcp", "Modbus TCP") }),
|
|
@@ -1430,24 +1516,24 @@ function ye({
|
|
|
1430
1516
|
] })
|
|
1431
1517
|
] }),
|
|
1432
1518
|
/* @__PURE__ */ i("div", { className: "nice-protocol-config__content", children: [
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
(
|
|
1519
|
+
o === "mqtt" && /* @__PURE__ */ e(ve, { config: h, onChange: p }),
|
|
1520
|
+
o === "coap" && /* @__PURE__ */ e(ue, { config: v, onChange: V }),
|
|
1521
|
+
(o === "modbus-tcp" || o === "modbus-rtu") && /* @__PURE__ */ e(
|
|
1436
1522
|
ge,
|
|
1437
1523
|
{
|
|
1438
|
-
config:
|
|
1439
|
-
type:
|
|
1524
|
+
config: f,
|
|
1525
|
+
type: o === "modbus-rtu" ? "rtu" : "tcp",
|
|
1440
1526
|
onChange: k
|
|
1441
1527
|
}
|
|
1442
1528
|
),
|
|
1443
|
-
|
|
1529
|
+
o === "opcua" && /* @__PURE__ */ e(_e, { config: u, onChange: w })
|
|
1444
1530
|
] }),
|
|
1445
1531
|
b && /* @__PURE__ */ i(
|
|
1446
1532
|
"div",
|
|
1447
1533
|
{
|
|
1448
1534
|
className: `nice-protocol-config__test-result nice-protocol-config__test-result--${b.success ? "success" : "error"}`,
|
|
1449
1535
|
children: [
|
|
1450
|
-
/* @__PURE__ */ e(
|
|
1536
|
+
/* @__PURE__ */ e(m, { name: b.success ? "check" : "close", size: 14 }),
|
|
1451
1537
|
" ",
|
|
1452
1538
|
b.message
|
|
1453
1539
|
]
|
|
@@ -1458,59 +1544,59 @@ function ye({
|
|
|
1458
1544
|
"button",
|
|
1459
1545
|
{
|
|
1460
1546
|
className: "nice-protocol-config__test-btn",
|
|
1461
|
-
onClick:
|
|
1547
|
+
onClick: I,
|
|
1462
1548
|
disabled: y || !n,
|
|
1463
1549
|
children: y ? l("protocolConfig.testing", "Testing...") : /* @__PURE__ */ i(S, { children: [
|
|
1464
|
-
/* @__PURE__ */ e(
|
|
1550
|
+
/* @__PURE__ */ e(m, { name: "plug", size: 14 }),
|
|
1465
1551
|
" ",
|
|
1466
1552
|
l("protocolConfig.testConnection", "Test Connection")
|
|
1467
1553
|
] })
|
|
1468
1554
|
}
|
|
1469
1555
|
),
|
|
1470
|
-
/* @__PURE__ */ i("button", { className: "nice-protocol-config__save-btn", onClick:
|
|
1471
|
-
/* @__PURE__ */ e(
|
|
1556
|
+
/* @__PURE__ */ i("button", { className: "nice-protocol-config__save-btn", onClick: H, children: [
|
|
1557
|
+
/* @__PURE__ */ e(m, { name: "save", size: 14 }),
|
|
1472
1558
|
" ",
|
|
1473
1559
|
l("save", "Save")
|
|
1474
1560
|
] })
|
|
1475
1561
|
] })
|
|
1476
1562
|
] });
|
|
1477
1563
|
}
|
|
1478
|
-
function ve({ config: a, onChange:
|
|
1479
|
-
const { t
|
|
1564
|
+
function ve({ config: a, onChange: r }) {
|
|
1565
|
+
const { t } = _();
|
|
1480
1566
|
return /* @__PURE__ */ i("div", { className: "nice-protocol-config__section", children: [
|
|
1481
|
-
/* @__PURE__ */ e("h3", { children:
|
|
1567
|
+
/* @__PURE__ */ e("h3", { children: t("protocolConfig.mqttConfiguration", "MQTT Configuration") }),
|
|
1482
1568
|
/* @__PURE__ */ i("div", { className: "nice-protocol-config__grid", children: [
|
|
1483
1569
|
/* @__PURE__ */ i("div", { className: "nice-protocol-config__field", children: [
|
|
1484
|
-
/* @__PURE__ */ e("label", { children:
|
|
1570
|
+
/* @__PURE__ */ e("label", { children: t("protocolConfig.broker", "Broker") }),
|
|
1485
1571
|
/* @__PURE__ */ e(
|
|
1486
1572
|
"input",
|
|
1487
1573
|
{
|
|
1488
1574
|
type: "text",
|
|
1489
1575
|
value: a.broker,
|
|
1490
|
-
onChange: (n) =>
|
|
1576
|
+
onChange: (n) => r({ ...a, broker: n.target.value }),
|
|
1491
1577
|
placeholder: "localhost"
|
|
1492
1578
|
}
|
|
1493
1579
|
)
|
|
1494
1580
|
] }),
|
|
1495
1581
|
/* @__PURE__ */ i("div", { className: "nice-protocol-config__field", children: [
|
|
1496
|
-
/* @__PURE__ */ e("label", { children:
|
|
1582
|
+
/* @__PURE__ */ e("label", { children: t("protocolConfig.port", "Port") }),
|
|
1497
1583
|
/* @__PURE__ */ e(
|
|
1498
1584
|
"input",
|
|
1499
1585
|
{
|
|
1500
1586
|
type: "number",
|
|
1501
1587
|
value: a.port,
|
|
1502
|
-
onChange: (n) =>
|
|
1588
|
+
onChange: (n) => r({ ...a, port: parseInt(n.target.value, 10) || 1883 })
|
|
1503
1589
|
}
|
|
1504
1590
|
)
|
|
1505
1591
|
] }),
|
|
1506
1592
|
/* @__PURE__ */ i("div", { className: "nice-protocol-config__field", children: [
|
|
1507
|
-
/* @__PURE__ */ e("label", { children:
|
|
1593
|
+
/* @__PURE__ */ e("label", { children: t("protocolConfig.clientId", "Client ID") }),
|
|
1508
1594
|
/* @__PURE__ */ e(
|
|
1509
1595
|
"input",
|
|
1510
1596
|
{
|
|
1511
1597
|
type: "text",
|
|
1512
1598
|
value: a.clientId,
|
|
1513
|
-
onChange: (n) =>
|
|
1599
|
+
onChange: (n) => r({ ...a, clientId: n.target.value })
|
|
1514
1600
|
}
|
|
1515
1601
|
)
|
|
1516
1602
|
] }),
|
|
@@ -1520,41 +1606,41 @@ function ve({ config: a, onChange: o }) {
|
|
|
1520
1606
|
{
|
|
1521
1607
|
type: "checkbox",
|
|
1522
1608
|
checked: a.useTLS,
|
|
1523
|
-
onChange: (n) =>
|
|
1609
|
+
onChange: (n) => r({ ...a, useTLS: n.target.checked })
|
|
1524
1610
|
}
|
|
1525
1611
|
),
|
|
1526
|
-
|
|
1612
|
+
t("protocolConfig.useTls", "Use TLS")
|
|
1527
1613
|
] }) }),
|
|
1528
1614
|
/* @__PURE__ */ i("div", { className: "nice-protocol-config__field", children: [
|
|
1529
|
-
/* @__PURE__ */ e("label", { children:
|
|
1615
|
+
/* @__PURE__ */ e("label", { children: t("protocolConfig.username", "Username") }),
|
|
1530
1616
|
/* @__PURE__ */ e(
|
|
1531
1617
|
"input",
|
|
1532
1618
|
{
|
|
1533
1619
|
type: "text",
|
|
1534
1620
|
value: a.username || "",
|
|
1535
|
-
onChange: (n) =>
|
|
1621
|
+
onChange: (n) => r({ ...a, username: n.target.value })
|
|
1536
1622
|
}
|
|
1537
1623
|
)
|
|
1538
1624
|
] }),
|
|
1539
1625
|
/* @__PURE__ */ i("div", { className: "nice-protocol-config__field", children: [
|
|
1540
|
-
/* @__PURE__ */ e("label", { children:
|
|
1626
|
+
/* @__PURE__ */ e("label", { children: t("protocolConfig.password", "Password") }),
|
|
1541
1627
|
/* @__PURE__ */ e(
|
|
1542
1628
|
"input",
|
|
1543
1629
|
{
|
|
1544
1630
|
type: "password",
|
|
1545
1631
|
value: a.password || "",
|
|
1546
|
-
onChange: (n) =>
|
|
1632
|
+
onChange: (n) => r({ ...a, password: n.target.value })
|
|
1547
1633
|
}
|
|
1548
1634
|
)
|
|
1549
1635
|
] }),
|
|
1550
1636
|
/* @__PURE__ */ i("div", { className: "nice-protocol-config__field", children: [
|
|
1551
|
-
/* @__PURE__ */ e("label", { children:
|
|
1637
|
+
/* @__PURE__ */ e("label", { children: t("protocolConfig.keepAlive", "Keep Alive (seconds)") }),
|
|
1552
1638
|
/* @__PURE__ */ e(
|
|
1553
1639
|
"input",
|
|
1554
1640
|
{
|
|
1555
1641
|
type: "number",
|
|
1556
1642
|
value: a.keepAlive,
|
|
1557
|
-
onChange: (n) =>
|
|
1643
|
+
onChange: (n) => r({ ...a, keepAlive: parseInt(n.target.value, 10) || 60 })
|
|
1558
1644
|
}
|
|
1559
1645
|
)
|
|
1560
1646
|
] }),
|
|
@@ -1564,13 +1650,13 @@ function ve({ config: a, onChange: o }) {
|
|
|
1564
1650
|
{
|
|
1565
1651
|
type: "checkbox",
|
|
1566
1652
|
checked: a.cleanSession,
|
|
1567
|
-
onChange: (n) =>
|
|
1653
|
+
onChange: (n) => r({ ...a, cleanSession: n.target.checked })
|
|
1568
1654
|
}
|
|
1569
1655
|
),
|
|
1570
|
-
|
|
1656
|
+
t("protocolConfig.cleanSession", "Clean Session")
|
|
1571
1657
|
] }) })
|
|
1572
1658
|
] }),
|
|
1573
|
-
/* @__PURE__ */ e("h4", { children:
|
|
1659
|
+
/* @__PURE__ */ e("h4", { children: t("protocolConfig.topics", "Topics") }),
|
|
1574
1660
|
/* @__PURE__ */ i("div", { className: "nice-protocol-config__topics", children: [
|
|
1575
1661
|
a.topics.map((n, c) => /* @__PURE__ */ i("div", { className: "nice-protocol-config__topic-row", children: [
|
|
1576
1662
|
/* @__PURE__ */ e(
|
|
@@ -1579,10 +1665,10 @@ function ve({ config: a, onChange: o }) {
|
|
|
1579
1665
|
type: "text",
|
|
1580
1666
|
value: n.pattern,
|
|
1581
1667
|
onChange: (l) => {
|
|
1582
|
-
const
|
|
1583
|
-
|
|
1668
|
+
const o = [...a.topics];
|
|
1669
|
+
o[c] = { ...o[c], pattern: l.target.value }, r({ ...a, topics: o });
|
|
1584
1670
|
},
|
|
1585
|
-
placeholder:
|
|
1671
|
+
placeholder: t("protocolConfig.topicPatternPlaceholder", "e.g., sensors/+/data")
|
|
1586
1672
|
}
|
|
1587
1673
|
),
|
|
1588
1674
|
/* @__PURE__ */ i(
|
|
@@ -1590,13 +1676,13 @@ function ve({ config: a, onChange: o }) {
|
|
|
1590
1676
|
{
|
|
1591
1677
|
value: n.qos,
|
|
1592
1678
|
onChange: (l) => {
|
|
1593
|
-
const
|
|
1594
|
-
|
|
1679
|
+
const o = [...a.topics];
|
|
1680
|
+
o[c] = { ...o[c], qos: parseInt(l.target.value, 10) }, r({ ...a, topics: o });
|
|
1595
1681
|
},
|
|
1596
1682
|
children: [
|
|
1597
|
-
/* @__PURE__ */ e("option", { value: 0, children:
|
|
1598
|
-
/* @__PURE__ */ e("option", { value: 1, children:
|
|
1599
|
-
/* @__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") })
|
|
1600
1686
|
]
|
|
1601
1687
|
}
|
|
1602
1688
|
),
|
|
@@ -1605,28 +1691,28 @@ function ve({ config: a, onChange: o }) {
|
|
|
1605
1691
|
{
|
|
1606
1692
|
value: n.direction,
|
|
1607
1693
|
onChange: (l) => {
|
|
1608
|
-
const
|
|
1609
|
-
|
|
1610
|
-
...
|
|
1694
|
+
const o = [...a.topics];
|
|
1695
|
+
o[c] = {
|
|
1696
|
+
...o[c],
|
|
1611
1697
|
direction: l.target.value
|
|
1612
|
-
},
|
|
1698
|
+
}, r({ ...a, topics: o });
|
|
1613
1699
|
},
|
|
1614
1700
|
children: [
|
|
1615
|
-
/* @__PURE__ */ e("option", { value: "subscribe", children:
|
|
1616
|
-
/* @__PURE__ */ e("option", { value: "publish", children:
|
|
1617
|
-
/* @__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") })
|
|
1618
1704
|
]
|
|
1619
1705
|
}
|
|
1620
1706
|
),
|
|
1621
1707
|
/* @__PURE__ */ e(
|
|
1622
1708
|
"button",
|
|
1623
1709
|
{
|
|
1624
|
-
"aria-label":
|
|
1710
|
+
"aria-label": t("protocolConfig.close", "Close"),
|
|
1625
1711
|
onClick: () => {
|
|
1626
|
-
const l = a.topics.filter((
|
|
1627
|
-
|
|
1712
|
+
const l = a.topics.filter((o, s) => s !== c);
|
|
1713
|
+
r({ ...a, topics: l });
|
|
1628
1714
|
},
|
|
1629
|
-
children: /* @__PURE__ */ e(
|
|
1715
|
+
children: /* @__PURE__ */ e(m, { name: "close", size: 14 })
|
|
1630
1716
|
}
|
|
1631
1717
|
)
|
|
1632
1718
|
] }, c)),
|
|
@@ -1634,7 +1720,7 @@ function ve({ config: a, onChange: o }) {
|
|
|
1634
1720
|
"button",
|
|
1635
1721
|
{
|
|
1636
1722
|
onClick: () => {
|
|
1637
|
-
|
|
1723
|
+
r({
|
|
1638
1724
|
...a,
|
|
1639
1725
|
topics: [
|
|
1640
1726
|
...a.topics,
|
|
@@ -1643,39 +1729,39 @@ function ve({ config: a, onChange: o }) {
|
|
|
1643
1729
|
});
|
|
1644
1730
|
},
|
|
1645
1731
|
children: [
|
|
1646
|
-
/* @__PURE__ */ e(
|
|
1732
|
+
/* @__PURE__ */ e(m, { name: "plus", size: 14 }),
|
|
1647
1733
|
" ",
|
|
1648
|
-
|
|
1734
|
+
t("protocolConfig.addTopic", "Add Topic")
|
|
1649
1735
|
]
|
|
1650
1736
|
}
|
|
1651
1737
|
)
|
|
1652
1738
|
] })
|
|
1653
1739
|
] });
|
|
1654
1740
|
}
|
|
1655
|
-
function ue({ config: a, onChange:
|
|
1656
|
-
const { t
|
|
1741
|
+
function ue({ config: a, onChange: r }) {
|
|
1742
|
+
const { t } = _();
|
|
1657
1743
|
return /* @__PURE__ */ i("div", { className: "nice-protocol-config__section", children: [
|
|
1658
|
-
/* @__PURE__ */ e("h3", { children:
|
|
1744
|
+
/* @__PURE__ */ e("h3", { children: t("protocolConfig.coapConfiguration", "CoAP Configuration") }),
|
|
1659
1745
|
/* @__PURE__ */ i("div", { className: "nice-protocol-config__grid", children: [
|
|
1660
1746
|
/* @__PURE__ */ i("div", { className: "nice-protocol-config__field", children: [
|
|
1661
|
-
/* @__PURE__ */ e("label", { children:
|
|
1747
|
+
/* @__PURE__ */ e("label", { children: t("protocolConfig.host", "Host") }),
|
|
1662
1748
|
/* @__PURE__ */ e(
|
|
1663
1749
|
"input",
|
|
1664
1750
|
{
|
|
1665
1751
|
type: "text",
|
|
1666
1752
|
value: a.host,
|
|
1667
|
-
onChange: (n) =>
|
|
1753
|
+
onChange: (n) => r({ ...a, host: n.target.value })
|
|
1668
1754
|
}
|
|
1669
1755
|
)
|
|
1670
1756
|
] }),
|
|
1671
1757
|
/* @__PURE__ */ i("div", { className: "nice-protocol-config__field", children: [
|
|
1672
|
-
/* @__PURE__ */ e("label", { children:
|
|
1758
|
+
/* @__PURE__ */ e("label", { children: t("protocolConfig.port", "Port") }),
|
|
1673
1759
|
/* @__PURE__ */ e(
|
|
1674
1760
|
"input",
|
|
1675
1761
|
{
|
|
1676
1762
|
type: "number",
|
|
1677
1763
|
value: a.port,
|
|
1678
|
-
onChange: (n) =>
|
|
1764
|
+
onChange: (n) => r({ ...a, port: parseInt(n.target.value, 10) || 5683 })
|
|
1679
1765
|
}
|
|
1680
1766
|
)
|
|
1681
1767
|
] }),
|
|
@@ -1685,10 +1771,10 @@ function ue({ config: a, onChange: o }) {
|
|
|
1685
1771
|
{
|
|
1686
1772
|
type: "checkbox",
|
|
1687
1773
|
checked: a.useDTLS,
|
|
1688
|
-
onChange: (n) =>
|
|
1774
|
+
onChange: (n) => r({ ...a, useDTLS: n.target.checked })
|
|
1689
1775
|
}
|
|
1690
1776
|
),
|
|
1691
|
-
|
|
1777
|
+
t("protocolConfig.useDtls", "Use DTLS")
|
|
1692
1778
|
] }) }),
|
|
1693
1779
|
/* @__PURE__ */ e("div", { className: "nice-protocol-config__field", children: /* @__PURE__ */ i("label", { children: [
|
|
1694
1780
|
/* @__PURE__ */ e(
|
|
@@ -1696,13 +1782,13 @@ function ue({ config: a, onChange: o }) {
|
|
|
1696
1782
|
{
|
|
1697
1783
|
type: "checkbox",
|
|
1698
1784
|
checked: a.observe || !1,
|
|
1699
|
-
onChange: (n) =>
|
|
1785
|
+
onChange: (n) => r({ ...a, observe: n.target.checked })
|
|
1700
1786
|
}
|
|
1701
1787
|
),
|
|
1702
|
-
|
|
1788
|
+
t("protocolConfig.enableObserve", "Enable Observe")
|
|
1703
1789
|
] }) })
|
|
1704
1790
|
] }),
|
|
1705
|
-
/* @__PURE__ */ e("h4", { children:
|
|
1791
|
+
/* @__PURE__ */ e("h4", { children: t("protocolConfig.resources", "Resources") }),
|
|
1706
1792
|
/* @__PURE__ */ i("div", { className: "nice-protocol-config__resources", children: [
|
|
1707
1793
|
a.resources.map((n, c) => /* @__PURE__ */ i("div", { className: "nice-protocol-config__resource-row", children: [
|
|
1708
1794
|
/* @__PURE__ */ e(
|
|
@@ -1711,8 +1797,8 @@ function ue({ config: a, onChange: o }) {
|
|
|
1711
1797
|
type: "text",
|
|
1712
1798
|
value: n.path,
|
|
1713
1799
|
onChange: (l) => {
|
|
1714
|
-
const
|
|
1715
|
-
|
|
1800
|
+
const o = [...a.resources];
|
|
1801
|
+
o[c] = { ...o[c], path: l.target.value }, r({ ...a, resources: o });
|
|
1716
1802
|
},
|
|
1717
1803
|
placeholder: "/sensors/temperature"
|
|
1718
1804
|
}
|
|
@@ -1720,12 +1806,12 @@ function ue({ config: a, onChange: o }) {
|
|
|
1720
1806
|
/* @__PURE__ */ e(
|
|
1721
1807
|
"button",
|
|
1722
1808
|
{
|
|
1723
|
-
"aria-label":
|
|
1809
|
+
"aria-label": t("protocolConfig.close", "Close"),
|
|
1724
1810
|
onClick: () => {
|
|
1725
|
-
const l = a.resources.filter((
|
|
1726
|
-
|
|
1811
|
+
const l = a.resources.filter((o, s) => s !== c);
|
|
1812
|
+
r({ ...a, resources: l });
|
|
1727
1813
|
},
|
|
1728
|
-
children: /* @__PURE__ */ e(
|
|
1814
|
+
children: /* @__PURE__ */ e(m, { name: "close", size: 14 })
|
|
1729
1815
|
}
|
|
1730
1816
|
)
|
|
1731
1817
|
] }, c)),
|
|
@@ -1733,7 +1819,7 @@ function ue({ config: a, onChange: o }) {
|
|
|
1733
1819
|
"button",
|
|
1734
1820
|
{
|
|
1735
1821
|
onClick: () => {
|
|
1736
|
-
|
|
1822
|
+
r({
|
|
1737
1823
|
...a,
|
|
1738
1824
|
resources: [
|
|
1739
1825
|
...a.resources,
|
|
@@ -1742,9 +1828,9 @@ function ue({ config: a, onChange: o }) {
|
|
|
1742
1828
|
});
|
|
1743
1829
|
},
|
|
1744
1830
|
children: [
|
|
1745
|
-
/* @__PURE__ */ e(
|
|
1831
|
+
/* @__PURE__ */ e(m, { name: "plus", size: 14 }),
|
|
1746
1832
|
" ",
|
|
1747
|
-
|
|
1833
|
+
t("protocolConfig.addResource", "Add Resource")
|
|
1748
1834
|
]
|
|
1749
1835
|
}
|
|
1750
1836
|
)
|
|
@@ -1753,17 +1839,17 @@ function ue({ config: a, onChange: o }) {
|
|
|
1753
1839
|
}
|
|
1754
1840
|
function ge({
|
|
1755
1841
|
config: a,
|
|
1756
|
-
type:
|
|
1757
|
-
onChange:
|
|
1842
|
+
type: r,
|
|
1843
|
+
onChange: t
|
|
1758
1844
|
}) {
|
|
1759
1845
|
const { t: n } = _();
|
|
1760
1846
|
return /* @__PURE__ */ i("div", { className: "nice-protocol-config__section", children: [
|
|
1761
1847
|
/* @__PURE__ */ e("h3", { children: n("protocolConfig.modbusConfiguration", "Modbus {type} Configuration").replace(
|
|
1762
1848
|
"{type}",
|
|
1763
|
-
String(
|
|
1849
|
+
String(r.toUpperCase())
|
|
1764
1850
|
) }),
|
|
1765
1851
|
/* @__PURE__ */ i("div", { className: "nice-protocol-config__grid", children: [
|
|
1766
|
-
|
|
1852
|
+
r === "tcp" && /* @__PURE__ */ i(S, { children: [
|
|
1767
1853
|
/* @__PURE__ */ i("div", { className: "nice-protocol-config__field", children: [
|
|
1768
1854
|
/* @__PURE__ */ e("label", { children: n("protocolConfig.host", "Host") }),
|
|
1769
1855
|
/* @__PURE__ */ e(
|
|
@@ -1771,7 +1857,7 @@ function ge({
|
|
|
1771
1857
|
{
|
|
1772
1858
|
type: "text",
|
|
1773
1859
|
value: a.host || "",
|
|
1774
|
-
onChange: (c) =>
|
|
1860
|
+
onChange: (c) => t({ ...a, host: c.target.value })
|
|
1775
1861
|
}
|
|
1776
1862
|
)
|
|
1777
1863
|
] }),
|
|
@@ -1782,12 +1868,12 @@ function ge({
|
|
|
1782
1868
|
{
|
|
1783
1869
|
type: "number",
|
|
1784
1870
|
value: a.port || 502,
|
|
1785
|
-
onChange: (c) =>
|
|
1871
|
+
onChange: (c) => t({ ...a, port: parseInt(c.target.value, 10) || 502 })
|
|
1786
1872
|
}
|
|
1787
1873
|
)
|
|
1788
1874
|
] })
|
|
1789
1875
|
] }),
|
|
1790
|
-
|
|
1876
|
+
r === "rtu" && /* @__PURE__ */ i(S, { children: [
|
|
1791
1877
|
/* @__PURE__ */ i("div", { className: "nice-protocol-config__field", children: [
|
|
1792
1878
|
/* @__PURE__ */ e("label", { children: n("protocolConfig.serialPort", "Serial Port") }),
|
|
1793
1879
|
/* @__PURE__ */ e(
|
|
@@ -1795,7 +1881,7 @@ function ge({
|
|
|
1795
1881
|
{
|
|
1796
1882
|
type: "text",
|
|
1797
1883
|
value: a.serialPort || "",
|
|
1798
|
-
onChange: (c) =>
|
|
1884
|
+
onChange: (c) => t({ ...a, serialPort: c.target.value }),
|
|
1799
1885
|
placeholder: n("protocolConfig.serialPortPlaceholder", "COM1 or /dev/ttyUSB0")
|
|
1800
1886
|
}
|
|
1801
1887
|
)
|
|
@@ -1806,7 +1892,7 @@ function ge({
|
|
|
1806
1892
|
"select",
|
|
1807
1893
|
{
|
|
1808
1894
|
value: a.baudRate || 9600,
|
|
1809
|
-
onChange: (c) =>
|
|
1895
|
+
onChange: (c) => t({ ...a, baudRate: parseInt(c.target.value, 10) }),
|
|
1810
1896
|
children: [
|
|
1811
1897
|
/* @__PURE__ */ e("option", { value: 9600, children: "9600" }),
|
|
1812
1898
|
/* @__PURE__ */ e("option", { value: 19200, children: "19200" }),
|
|
@@ -1823,7 +1909,7 @@ function ge({
|
|
|
1823
1909
|
"select",
|
|
1824
1910
|
{
|
|
1825
1911
|
value: a.parity || "none",
|
|
1826
|
-
onChange: (c) =>
|
|
1912
|
+
onChange: (c) => t({ ...a, parity: c.target.value }),
|
|
1827
1913
|
children: [
|
|
1828
1914
|
/* @__PURE__ */ e("option", { value: "none", children: n("protocolConfig.none", "None") }),
|
|
1829
1915
|
/* @__PURE__ */ e("option", { value: "even", children: n("protocolConfig.even", "Even") }),
|
|
@@ -1840,7 +1926,7 @@ function ge({
|
|
|
1840
1926
|
{
|
|
1841
1927
|
type: "number",
|
|
1842
1928
|
value: a.slaveId,
|
|
1843
|
-
onChange: (c) =>
|
|
1929
|
+
onChange: (c) => t({ ...a, slaveId: parseInt(c.target.value, 10) || 1 }),
|
|
1844
1930
|
min: 1,
|
|
1845
1931
|
max: 247
|
|
1846
1932
|
}
|
|
@@ -1853,7 +1939,7 @@ function ge({
|
|
|
1853
1939
|
{
|
|
1854
1940
|
type: "number",
|
|
1855
1941
|
value: a.timeout,
|
|
1856
|
-
onChange: (c) =>
|
|
1942
|
+
onChange: (c) => t({ ...a, timeout: parseInt(c.target.value, 10) || 1e3 })
|
|
1857
1943
|
}
|
|
1858
1944
|
)
|
|
1859
1945
|
] })
|
|
@@ -1874,9 +1960,9 @@ function ge({
|
|
|
1874
1960
|
{
|
|
1875
1961
|
type: "text",
|
|
1876
1962
|
value: c.name,
|
|
1877
|
-
onChange: (
|
|
1963
|
+
onChange: (o) => {
|
|
1878
1964
|
const s = [...a.registers];
|
|
1879
|
-
s[l] = { ...s[l], name:
|
|
1965
|
+
s[l] = { ...s[l], name: o.target.value }, t({ ...a, registers: s });
|
|
1880
1966
|
}
|
|
1881
1967
|
}
|
|
1882
1968
|
) }),
|
|
@@ -1885,12 +1971,12 @@ function ge({
|
|
|
1885
1971
|
{
|
|
1886
1972
|
type: "number",
|
|
1887
1973
|
value: c.address,
|
|
1888
|
-
onChange: (
|
|
1974
|
+
onChange: (o) => {
|
|
1889
1975
|
const s = [...a.registers];
|
|
1890
1976
|
s[l] = {
|
|
1891
1977
|
...s[l],
|
|
1892
|
-
address: parseInt(
|
|
1893
|
-
},
|
|
1978
|
+
address: parseInt(o.target.value, 10) || 0
|
|
1979
|
+
}, t({ ...a, registers: s });
|
|
1894
1980
|
}
|
|
1895
1981
|
}
|
|
1896
1982
|
) }),
|
|
@@ -1898,12 +1984,12 @@ function ge({
|
|
|
1898
1984
|
"select",
|
|
1899
1985
|
{
|
|
1900
1986
|
value: c.type,
|
|
1901
|
-
onChange: (
|
|
1987
|
+
onChange: (o) => {
|
|
1902
1988
|
const s = [...a.registers];
|
|
1903
1989
|
s[l] = {
|
|
1904
1990
|
...s[l],
|
|
1905
|
-
type:
|
|
1906
|
-
},
|
|
1991
|
+
type: o.target.value
|
|
1992
|
+
}, t({ ...a, registers: s });
|
|
1907
1993
|
},
|
|
1908
1994
|
children: [
|
|
1909
1995
|
/* @__PURE__ */ e("option", { value: "coil", children: n("protocolConfig.coil", "Coil") }),
|
|
@@ -1917,12 +2003,12 @@ function ge({
|
|
|
1917
2003
|
"select",
|
|
1918
2004
|
{
|
|
1919
2005
|
value: c.dataType,
|
|
1920
|
-
onChange: (
|
|
2006
|
+
onChange: (o) => {
|
|
1921
2007
|
const s = [...a.registers];
|
|
1922
2008
|
s[l] = {
|
|
1923
2009
|
...s[l],
|
|
1924
|
-
dataType:
|
|
1925
|
-
},
|
|
2010
|
+
dataType: o.target.value
|
|
2011
|
+
}, t({ ...a, registers: s });
|
|
1926
2012
|
},
|
|
1927
2013
|
children: [
|
|
1928
2014
|
/* @__PURE__ */ e("option", { value: "bool", children: n("protocolConfig.bool", "Bool") }),
|
|
@@ -1940,9 +2026,9 @@ function ge({
|
|
|
1940
2026
|
{
|
|
1941
2027
|
type: "checkbox",
|
|
1942
2028
|
checked: c.readable,
|
|
1943
|
-
onChange: (
|
|
2029
|
+
onChange: (o) => {
|
|
1944
2030
|
const s = [...a.registers];
|
|
1945
|
-
s[l] = { ...s[l], readable:
|
|
2031
|
+
s[l] = { ...s[l], readable: o.target.checked }, t({ ...a, registers: s });
|
|
1946
2032
|
},
|
|
1947
2033
|
title: n("protocolConfig.readable", "Readable")
|
|
1948
2034
|
}
|
|
@@ -1952,9 +2038,9 @@ function ge({
|
|
|
1952
2038
|
{
|
|
1953
2039
|
type: "checkbox",
|
|
1954
2040
|
checked: c.writable,
|
|
1955
|
-
onChange: (
|
|
2041
|
+
onChange: (o) => {
|
|
1956
2042
|
const s = [...a.registers];
|
|
1957
|
-
s[l] = { ...s[l], writable:
|
|
2043
|
+
s[l] = { ...s[l], writable: o.target.checked }, t({ ...a, registers: s });
|
|
1958
2044
|
},
|
|
1959
2045
|
title: n("protocolConfig.writable", "Writable")
|
|
1960
2046
|
}
|
|
@@ -1965,10 +2051,10 @@ function ge({
|
|
|
1965
2051
|
{
|
|
1966
2052
|
"aria-label": n("protocolConfig.close", "Close"),
|
|
1967
2053
|
onClick: () => {
|
|
1968
|
-
const
|
|
1969
|
-
|
|
2054
|
+
const o = a.registers.filter((s, h) => h !== l);
|
|
2055
|
+
t({ ...a, registers: o });
|
|
1970
2056
|
},
|
|
1971
|
-
children: /* @__PURE__ */ e(
|
|
2057
|
+
children: /* @__PURE__ */ e(m, { name: "close", size: 14 })
|
|
1972
2058
|
}
|
|
1973
2059
|
) })
|
|
1974
2060
|
] }, l)) })
|
|
@@ -1977,7 +2063,7 @@ function ge({
|
|
|
1977
2063
|
"button",
|
|
1978
2064
|
{
|
|
1979
2065
|
onClick: () => {
|
|
1980
|
-
|
|
2066
|
+
t({
|
|
1981
2067
|
...a,
|
|
1982
2068
|
registers: [
|
|
1983
2069
|
...a.registers,
|
|
@@ -1993,7 +2079,7 @@ function ge({
|
|
|
1993
2079
|
});
|
|
1994
2080
|
},
|
|
1995
2081
|
children: [
|
|
1996
|
-
/* @__PURE__ */ e(
|
|
2082
|
+
/* @__PURE__ */ e(m, { name: "plus", size: 14 }),
|
|
1997
2083
|
" ",
|
|
1998
2084
|
n("protocolConfig.addRegister", "Add Register")
|
|
1999
2085
|
]
|
|
@@ -2001,96 +2087,96 @@ function ge({
|
|
|
2001
2087
|
)
|
|
2002
2088
|
] });
|
|
2003
2089
|
}
|
|
2004
|
-
function
|
|
2005
|
-
const { t
|
|
2090
|
+
function _e({ config: a, onChange: r }) {
|
|
2091
|
+
const { t } = _();
|
|
2006
2092
|
return /* @__PURE__ */ i("div", { className: "nice-protocol-config__section", children: [
|
|
2007
|
-
/* @__PURE__ */ e("h3", { children:
|
|
2093
|
+
/* @__PURE__ */ e("h3", { children: t("protocolConfig.opcUaConfiguration", "OPC-UA Configuration") }),
|
|
2008
2094
|
/* @__PURE__ */ i("div", { className: "nice-protocol-config__grid", children: [
|
|
2009
2095
|
/* @__PURE__ */ i("div", { className: "nice-protocol-config__field nice-protocol-config__field--full", children: [
|
|
2010
|
-
/* @__PURE__ */ e("label", { children:
|
|
2096
|
+
/* @__PURE__ */ e("label", { children: t("protocolConfig.endpointUrl", "Endpoint URL") }),
|
|
2011
2097
|
/* @__PURE__ */ e(
|
|
2012
2098
|
"input",
|
|
2013
2099
|
{
|
|
2014
2100
|
type: "text",
|
|
2015
2101
|
value: a.endpointUrl,
|
|
2016
|
-
onChange: (n) =>
|
|
2017
|
-
placeholder:
|
|
2102
|
+
onChange: (n) => r({ ...a, endpointUrl: n.target.value }),
|
|
2103
|
+
placeholder: t("protocolConfig.endpointUrlPlaceholder", "opc.tcp://localhost:4840")
|
|
2018
2104
|
}
|
|
2019
2105
|
)
|
|
2020
2106
|
] }),
|
|
2021
2107
|
/* @__PURE__ */ i("div", { className: "nice-protocol-config__field", children: [
|
|
2022
|
-
/* @__PURE__ */ e("label", { children:
|
|
2108
|
+
/* @__PURE__ */ e("label", { children: t("protocolConfig.securityMode", "Security Mode") }),
|
|
2023
2109
|
/* @__PURE__ */ i(
|
|
2024
2110
|
"select",
|
|
2025
2111
|
{
|
|
2026
2112
|
value: a.securityMode,
|
|
2027
|
-
onChange: (n) =>
|
|
2113
|
+
onChange: (n) => r({
|
|
2028
2114
|
...a,
|
|
2029
2115
|
securityMode: n.target.value
|
|
2030
2116
|
}),
|
|
2031
2117
|
children: [
|
|
2032
|
-
/* @__PURE__ */ e("option", { value: "None", children:
|
|
2033
|
-
/* @__PURE__ */ e("option", { value: "Sign", children:
|
|
2034
|
-
/* @__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") })
|
|
2035
2121
|
]
|
|
2036
2122
|
}
|
|
2037
2123
|
)
|
|
2038
2124
|
] }),
|
|
2039
2125
|
/* @__PURE__ */ i("div", { className: "nice-protocol-config__field", children: [
|
|
2040
|
-
/* @__PURE__ */ e("label", { children:
|
|
2126
|
+
/* @__PURE__ */ e("label", { children: t("protocolConfig.authentication", "Authentication") }),
|
|
2041
2127
|
/* @__PURE__ */ i(
|
|
2042
2128
|
"select",
|
|
2043
2129
|
{
|
|
2044
2130
|
value: a.authentication,
|
|
2045
|
-
onChange: (n) =>
|
|
2131
|
+
onChange: (n) => r({
|
|
2046
2132
|
...a,
|
|
2047
2133
|
authentication: n.target.value
|
|
2048
2134
|
}),
|
|
2049
2135
|
children: [
|
|
2050
|
-
/* @__PURE__ */ e("option", { value: "anonymous", children:
|
|
2051
|
-
/* @__PURE__ */ e("option", { value: "username", children:
|
|
2052
|
-
/* @__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") })
|
|
2053
2139
|
]
|
|
2054
2140
|
}
|
|
2055
2141
|
)
|
|
2056
2142
|
] }),
|
|
2057
2143
|
a.authentication === "username" && /* @__PURE__ */ i(S, { children: [
|
|
2058
2144
|
/* @__PURE__ */ i("div", { className: "nice-protocol-config__field", children: [
|
|
2059
|
-
/* @__PURE__ */ e("label", { children:
|
|
2145
|
+
/* @__PURE__ */ e("label", { children: t("protocolConfig.username", "Username") }),
|
|
2060
2146
|
/* @__PURE__ */ e(
|
|
2061
2147
|
"input",
|
|
2062
2148
|
{
|
|
2063
2149
|
type: "text",
|
|
2064
2150
|
value: a.username || "",
|
|
2065
|
-
onChange: (n) =>
|
|
2151
|
+
onChange: (n) => r({ ...a, username: n.target.value })
|
|
2066
2152
|
}
|
|
2067
2153
|
)
|
|
2068
2154
|
] }),
|
|
2069
2155
|
/* @__PURE__ */ i("div", { className: "nice-protocol-config__field", children: [
|
|
2070
|
-
/* @__PURE__ */ e("label", { children:
|
|
2156
|
+
/* @__PURE__ */ e("label", { children: t("protocolConfig.password", "Password") }),
|
|
2071
2157
|
/* @__PURE__ */ e(
|
|
2072
2158
|
"input",
|
|
2073
2159
|
{
|
|
2074
2160
|
type: "password",
|
|
2075
2161
|
value: a.password || "",
|
|
2076
|
-
onChange: (n) =>
|
|
2162
|
+
onChange: (n) => r({ ...a, password: n.target.value })
|
|
2077
2163
|
}
|
|
2078
2164
|
)
|
|
2079
2165
|
] })
|
|
2080
2166
|
] }),
|
|
2081
2167
|
/* @__PURE__ */ i("div", { className: "nice-protocol-config__field nice-protocol-config__field--full", children: [
|
|
2082
|
-
/* @__PURE__ */ e("label", { children:
|
|
2168
|
+
/* @__PURE__ */ e("label", { children: t("protocolConfig.applicationName", "Application Name") }),
|
|
2083
2169
|
/* @__PURE__ */ e(
|
|
2084
2170
|
"input",
|
|
2085
2171
|
{
|
|
2086
2172
|
type: "text",
|
|
2087
2173
|
value: a.applicationName,
|
|
2088
|
-
onChange: (n) =>
|
|
2174
|
+
onChange: (n) => r({ ...a, applicationName: n.target.value })
|
|
2089
2175
|
}
|
|
2090
2176
|
)
|
|
2091
2177
|
] })
|
|
2092
2178
|
] }),
|
|
2093
|
-
/* @__PURE__ */ e("h4", { children:
|
|
2179
|
+
/* @__PURE__ */ e("h4", { children: t("protocolConfig.nodes", "Nodes") }),
|
|
2094
2180
|
/* @__PURE__ */ i("div", { className: "nice-protocol-config__nodes", children: [
|
|
2095
2181
|
a.nodes.map((n, c) => /* @__PURE__ */ i("div", { className: "nice-protocol-config__node-row", children: [
|
|
2096
2182
|
/* @__PURE__ */ e(
|
|
@@ -2099,10 +2185,10 @@ function Me({ config: a, onChange: o }) {
|
|
|
2099
2185
|
type: "text",
|
|
2100
2186
|
value: n.nodeId,
|
|
2101
2187
|
onChange: (l) => {
|
|
2102
|
-
const
|
|
2103
|
-
|
|
2188
|
+
const o = [...a.nodes];
|
|
2189
|
+
o[c] = { ...o[c], nodeId: l.target.value }, r({ ...a, nodes: o });
|
|
2104
2190
|
},
|
|
2105
|
-
placeholder:
|
|
2191
|
+
placeholder: t("protocolConfig.nodeIdPlaceholder", "ns=2;s=Temperature")
|
|
2106
2192
|
}
|
|
2107
2193
|
),
|
|
2108
2194
|
/* @__PURE__ */ e(
|
|
@@ -2111,21 +2197,21 @@ function Me({ config: a, onChange: o }) {
|
|
|
2111
2197
|
type: "text",
|
|
2112
2198
|
value: n.displayName,
|
|
2113
2199
|
onChange: (l) => {
|
|
2114
|
-
const
|
|
2115
|
-
|
|
2200
|
+
const o = [...a.nodes];
|
|
2201
|
+
o[c] = { ...o[c], displayName: l.target.value }, r({ ...a, nodes: o });
|
|
2116
2202
|
},
|
|
2117
|
-
placeholder:
|
|
2203
|
+
placeholder: t("protocolConfig.displayNamePlaceholder", "Display Name")
|
|
2118
2204
|
}
|
|
2119
2205
|
),
|
|
2120
2206
|
/* @__PURE__ */ e(
|
|
2121
2207
|
"button",
|
|
2122
2208
|
{
|
|
2123
|
-
"aria-label":
|
|
2209
|
+
"aria-label": t("protocolConfig.close", "Close"),
|
|
2124
2210
|
onClick: () => {
|
|
2125
|
-
const l = a.nodes.filter((
|
|
2126
|
-
|
|
2211
|
+
const l = a.nodes.filter((o, s) => s !== c);
|
|
2212
|
+
r({ ...a, nodes: l });
|
|
2127
2213
|
},
|
|
2128
|
-
children: /* @__PURE__ */ e(
|
|
2214
|
+
children: /* @__PURE__ */ e(m, { name: "close", size: 14 })
|
|
2129
2215
|
}
|
|
2130
2216
|
)
|
|
2131
2217
|
] }, c)),
|
|
@@ -2133,7 +2219,7 @@ function Me({ config: a, onChange: o }) {
|
|
|
2133
2219
|
"button",
|
|
2134
2220
|
{
|
|
2135
2221
|
onClick: () => {
|
|
2136
|
-
|
|
2222
|
+
r({
|
|
2137
2223
|
...a,
|
|
2138
2224
|
nodes: [
|
|
2139
2225
|
...a.nodes,
|
|
@@ -2142,9 +2228,9 @@ function Me({ config: a, onChange: o }) {
|
|
|
2142
2228
|
});
|
|
2143
2229
|
},
|
|
2144
2230
|
children: [
|
|
2145
|
-
/* @__PURE__ */ e(
|
|
2231
|
+
/* @__PURE__ */ e(m, { name: "plus", size: 14 }),
|
|
2146
2232
|
" ",
|
|
2147
|
-
|
|
2233
|
+
t("protocolConfig.addNode", "Add Node")
|
|
2148
2234
|
]
|
|
2149
2235
|
}
|
|
2150
2236
|
)
|
|
@@ -2152,7 +2238,7 @@ function Me({ config: a, onChange: o }) {
|
|
|
2152
2238
|
] });
|
|
2153
2239
|
}
|
|
2154
2240
|
export {
|
|
2155
|
-
|
|
2241
|
+
ye as NiceEdgeManager,
|
|
2156
2242
|
Ne as NiceIoTDashboard,
|
|
2157
|
-
|
|
2243
|
+
ze as NiceProtocolConfig
|
|
2158
2244
|
};
|