@nice2dev/ui-iot 1.2.1 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +474 -473
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsx as e, jsxs as i, Fragment as
|
|
2
|
-
import { useContext as
|
|
3
|
-
const K = (a,
|
|
4
|
-
function
|
|
5
|
-
const a =
|
|
6
|
-
return { t: a, lang:
|
|
1
|
+
import { jsx as e, jsxs as i, Fragment as S } from "react/jsx-runtime";
|
|
2
|
+
import { useContext as U, createContext as x, useState as M, useCallback as f } from "react";
|
|
3
|
+
const K = (a, o) => o, Y = /* @__PURE__ */ x(K), J = /* @__PURE__ */ x("en");
|
|
4
|
+
function _() {
|
|
5
|
+
const a = U(Y), o = U(J);
|
|
6
|
+
return { t: a, lang: o };
|
|
7
7
|
}
|
|
8
8
|
const X = {
|
|
9
9
|
// Navigation
|
|
@@ -214,7 +214,16 @@ const X = {
|
|
|
214
214
|
"zoom-out": "M11 4a7 7 0 100 14 7 7 0 000-14z M21 21l-4.35-4.35 M8 11h6",
|
|
215
215
|
navigation: "M12 2l7 19-7-4-7 4z",
|
|
216
216
|
"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"
|
|
217
|
+
minimize: "M4 14h6v6 M20 10h-6V4 M14 10l7-7 M3 21l7-7",
|
|
218
|
+
// 1.2.2: geometry tools and object grouping, drawn as glyphs before (Ntd* of the same names in icons)
|
|
219
|
+
point: "M12 8a4 4 0 1 0 0 8a4 4 0 1 0 0-8z M12 12h.01",
|
|
220
|
+
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",
|
|
221
|
+
perpendicular: "M3 20h18 M12 20V4 M12 15h5v5",
|
|
222
|
+
parallel: "M4 16L14 6 M10 20L20 10",
|
|
223
|
+
midpoint: "M3 12h6 M15 12h6 M3 9v6 M21 9v6 M12 9a3 3 0 1 0 0 6a3 3 0 1 0 0-6z",
|
|
224
|
+
"angle-bisector": "M4 20h17 M4 20L16 5 M4 20l14.4-6.9 M10 20a6 6 0 0 0-2.25-4.68",
|
|
225
|
+
group: "M3 7V3h4 M17 3h4v4 M21 17v4h-4 M7 21H3v-4 M7 7h5v5H7z M12 12h5v5h-5z",
|
|
226
|
+
ungroup: "M3 3h8v8H3z M13 13h8v8h-8z"
|
|
218
227
|
}, Z = {
|
|
219
228
|
xs: 12,
|
|
220
229
|
sm: 16,
|
|
@@ -224,64 +233,64 @@ const X = {
|
|
|
224
233
|
}, ee = /* @__PURE__ */ x({});
|
|
225
234
|
function ae({
|
|
226
235
|
path: a,
|
|
227
|
-
size:
|
|
228
|
-
className:
|
|
236
|
+
size: o,
|
|
237
|
+
className: r,
|
|
229
238
|
style: n,
|
|
230
239
|
color: c,
|
|
231
|
-
title:
|
|
232
|
-
onClick:
|
|
240
|
+
title: l,
|
|
241
|
+
onClick: t
|
|
233
242
|
}) {
|
|
234
243
|
return /* @__PURE__ */ i(
|
|
235
244
|
"svg",
|
|
236
245
|
{
|
|
237
246
|
xmlns: "http://www.w3.org/2000/svg",
|
|
238
|
-
width:
|
|
239
|
-
height:
|
|
247
|
+
width: o,
|
|
248
|
+
height: o,
|
|
240
249
|
viewBox: "0 0 24 24",
|
|
241
250
|
fill: "none",
|
|
242
251
|
stroke: c || "currentColor",
|
|
243
252
|
strokeWidth: 2,
|
|
244
253
|
strokeLinecap: "round",
|
|
245
254
|
strokeLinejoin: "round",
|
|
246
|
-
className: `nice-icon ${
|
|
255
|
+
className: `nice-icon ${r || ""}`,
|
|
247
256
|
style: n,
|
|
248
|
-
role:
|
|
249
|
-
"aria-label":
|
|
250
|
-
"aria-hidden": !
|
|
251
|
-
onClick:
|
|
257
|
+
role: l ? "img" : "presentation",
|
|
258
|
+
"aria-label": l,
|
|
259
|
+
"aria-hidden": !l,
|
|
260
|
+
onClick: t,
|
|
252
261
|
children: [
|
|
253
|
-
|
|
262
|
+
l && /* @__PURE__ */ e("title", { children: l }),
|
|
254
263
|
/* @__PURE__ */ e("path", { d: a })
|
|
255
264
|
]
|
|
256
265
|
}
|
|
257
266
|
);
|
|
258
267
|
}
|
|
259
|
-
const
|
|
268
|
+
const p = ({
|
|
260
269
|
name: a,
|
|
261
|
-
size:
|
|
262
|
-
className:
|
|
270
|
+
size: o = "md",
|
|
271
|
+
className: r,
|
|
263
272
|
style: n,
|
|
264
273
|
color: c,
|
|
265
|
-
title:
|
|
266
|
-
onClick:
|
|
274
|
+
title: l,
|
|
275
|
+
onClick: t
|
|
267
276
|
}) => {
|
|
268
|
-
const { resolver: s } =
|
|
277
|
+
const { resolver: s } = U(ee), h = typeof o == "number" ? o : Z[o];
|
|
269
278
|
if (s) {
|
|
270
279
|
const u = s(a, h);
|
|
271
280
|
if (u)
|
|
272
|
-
return /* @__PURE__ */ e("span", { className: `nice-icon-wrap ${
|
|
281
|
+
return /* @__PURE__ */ e("span", { className: `nice-icon-wrap ${r || ""}`, style: n, onClick: t, children: u });
|
|
273
282
|
}
|
|
274
|
-
const
|
|
275
|
-
return
|
|
283
|
+
const m = X[a];
|
|
284
|
+
return m ? /* @__PURE__ */ e(
|
|
276
285
|
ae,
|
|
277
286
|
{
|
|
278
|
-
path:
|
|
287
|
+
path: m,
|
|
279
288
|
size: h,
|
|
280
|
-
className:
|
|
289
|
+
className: r,
|
|
281
290
|
style: n,
|
|
282
291
|
color: c,
|
|
283
|
-
title:
|
|
284
|
-
onClick:
|
|
292
|
+
title: l,
|
|
293
|
+
onClick: t
|
|
285
294
|
}
|
|
286
295
|
) : null;
|
|
287
296
|
};
|
|
@@ -295,15 +304,15 @@ function ie() {
|
|
|
295
304
|
const a = globalThis.crypto;
|
|
296
305
|
if (typeof (a == null ? void 0 : a.randomUUID) == "function")
|
|
297
306
|
return a.randomUUID();
|
|
298
|
-
const
|
|
307
|
+
const o = new Uint8Array(16);
|
|
299
308
|
if (typeof (a == null ? void 0 : a.getRandomValues) == "function")
|
|
300
|
-
a.getRandomValues(
|
|
309
|
+
a.getRandomValues(o);
|
|
301
310
|
else
|
|
302
|
-
for (let n = 0; n <
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
const
|
|
306
|
-
return `${
|
|
311
|
+
for (let n = 0; n < o.length; n++)
|
|
312
|
+
o[n] = Math.floor(Math.random() * 256);
|
|
313
|
+
o[6] = o[6] & 15 | 64, o[8] = o[8] & 63 | 128;
|
|
314
|
+
const r = Array.from(o, (n) => n.toString(16).padStart(2, "0")).join("");
|
|
315
|
+
return `${r.slice(0, 8)}-${r.slice(8, 12)}-${r.slice(12, 16)}-${r.slice(16, 20)}-${r.slice(20)}`;
|
|
307
316
|
}
|
|
308
317
|
process.env.NODE_ENV;
|
|
309
318
|
process.env.NODE_ENV;
|
|
@@ -333,34 +342,34 @@ const R = {
|
|
|
333
342
|
];
|
|
334
343
|
function Ne({
|
|
335
344
|
devices: a = [],
|
|
336
|
-
widgets:
|
|
337
|
-
alarms:
|
|
345
|
+
widgets: o = [],
|
|
346
|
+
alarms: r = [],
|
|
338
347
|
onDeviceSelect: n,
|
|
339
348
|
onWidgetChange: c,
|
|
340
|
-
onCommand:
|
|
341
|
-
onAlarmAcknowledge:
|
|
349
|
+
onCommand: l,
|
|
350
|
+
onAlarmAcknowledge: t,
|
|
342
351
|
fetchTelemetry: s,
|
|
343
352
|
className: h = ""
|
|
344
353
|
}) {
|
|
345
|
-
const { t:
|
|
354
|
+
const { t: m } = _(), [u, V] = M(o), [N, k] = M(null), [g, w] = M("dashboard"), [b, D] = M(!1), [y, H] = M(""), v = f(
|
|
346
355
|
(d) => {
|
|
347
|
-
|
|
356
|
+
V((C) => {
|
|
348
357
|
const z = d(C);
|
|
349
358
|
return c == null || c(z), z;
|
|
350
359
|
});
|
|
351
360
|
},
|
|
352
361
|
[c]
|
|
353
|
-
),
|
|
362
|
+
), T = f(
|
|
354
363
|
(d) => {
|
|
355
364
|
var z;
|
|
356
365
|
const C = {
|
|
357
366
|
id: ie(),
|
|
358
367
|
type: d,
|
|
359
|
-
title: ((z = $.find((
|
|
368
|
+
title: ((z = $.find((I) => I.type === d)) == null ? void 0 : z.label) || d,
|
|
360
369
|
position: { x: 0, y: ne(u), width: 4, height: 3 },
|
|
361
370
|
config: {}
|
|
362
371
|
};
|
|
363
|
-
v((
|
|
372
|
+
v((I) => [...I, C]);
|
|
364
373
|
},
|
|
365
374
|
[u, v]
|
|
366
375
|
), P = f(
|
|
@@ -368,44 +377,44 @@ function Ne({
|
|
|
368
377
|
k(d), n == null || n(d);
|
|
369
378
|
},
|
|
370
379
|
[n]
|
|
371
|
-
),
|
|
380
|
+
), L = f(
|
|
372
381
|
(d) => {
|
|
373
|
-
|
|
382
|
+
t == null || t(d);
|
|
374
383
|
},
|
|
375
|
-
[
|
|
384
|
+
[t]
|
|
376
385
|
), j = a.filter(
|
|
377
386
|
(d) => !y || d.name.toLowerCase().includes(y.toLowerCase()) || d.type.toLowerCase().includes(y.toLowerCase())
|
|
378
|
-
),
|
|
387
|
+
), A = r.filter((d) => !d.cleared), O = A.filter(
|
|
379
388
|
(d) => d.severity === "critical" || d.severity === "high"
|
|
380
389
|
);
|
|
381
390
|
return /* @__PURE__ */ i("div", { className: `nice-iot-dashboard ${h}`, children: [
|
|
382
391
|
/* @__PURE__ */ i("header", { className: "nice-iot-dashboard__header", children: [
|
|
383
|
-
/* @__PURE__ */ e("h1", { children:
|
|
392
|
+
/* @__PURE__ */ e("h1", { children: m("ioTDashboard.iotDashboard", "IoT Dashboard") }),
|
|
384
393
|
/* @__PURE__ */ i("div", { className: "nice-iot-dashboard__stats", children: [
|
|
385
394
|
/* @__PURE__ */ i("span", { className: "nice-iot-dashboard__stat", children: [
|
|
386
|
-
/* @__PURE__ */ e("span", { className: "nice-iot-dashboard__stat-icon", children: /* @__PURE__ */ e(
|
|
387
|
-
|
|
395
|
+
/* @__PURE__ */ e("span", { className: "nice-iot-dashboard__stat-icon", children: /* @__PURE__ */ e(p, { name: "wifi", size: 14 }) }),
|
|
396
|
+
m("ioTDashboard.devices", "{devices} Devices").replace(
|
|
388
397
|
"{devices}",
|
|
389
398
|
String(a.length)
|
|
390
399
|
)
|
|
391
400
|
] }),
|
|
392
401
|
/* @__PURE__ */ i("span", { className: "nice-iot-dashboard__stat nice-iot-dashboard__stat--online", children: [
|
|
393
402
|
/* @__PURE__ */ e("span", { className: "nice-iot-dashboard__stat-icon", style: R }),
|
|
394
|
-
|
|
403
|
+
m("ioTDashboard.online", "{online} Online").replace(
|
|
395
404
|
"{online}",
|
|
396
405
|
String(a.filter((d) => d.status === "online").length)
|
|
397
406
|
)
|
|
398
407
|
] }),
|
|
399
408
|
/* @__PURE__ */ i("span", { className: "nice-iot-dashboard__stat nice-iot-dashboard__stat--offline", children: [
|
|
400
409
|
/* @__PURE__ */ e("span", { className: "nice-iot-dashboard__stat-icon", style: R }),
|
|
401
|
-
|
|
410
|
+
m("ioTDashboard.offline", "{offline} Offline").replace(
|
|
402
411
|
"{offline}",
|
|
403
412
|
String(a.filter((d) => d.status === "offline").length)
|
|
404
413
|
)
|
|
405
414
|
] }),
|
|
406
415
|
O.length > 0 && /* @__PURE__ */ i("span", { className: "nice-iot-dashboard__stat nice-iot-dashboard__stat--alarms", children: [
|
|
407
|
-
/* @__PURE__ */ e("span", { className: "nice-iot-dashboard__stat-icon", children: /* @__PURE__ */ e(
|
|
408
|
-
|
|
416
|
+
/* @__PURE__ */ e("span", { className: "nice-iot-dashboard__stat-icon", children: /* @__PURE__ */ e(p, { name: "bell", size: 14 }) }),
|
|
417
|
+
m("ioTDashboard.alarms", "{criticalAlarms} Alarms").replace(
|
|
409
418
|
"{criticalAlarms}",
|
|
410
419
|
String(O.length)
|
|
411
420
|
)
|
|
@@ -415,48 +424,48 @@ function Ne({
|
|
|
415
424
|
/* @__PURE__ */ e(
|
|
416
425
|
"button",
|
|
417
426
|
{
|
|
418
|
-
className: `nice-iot-dashboard__nav-button ${
|
|
427
|
+
className: `nice-iot-dashboard__nav-button ${g === "dashboard" ? "nice-iot-dashboard__nav-button--active" : ""}`,
|
|
419
428
|
onClick: () => w("dashboard"),
|
|
420
|
-
children:
|
|
429
|
+
children: m("ioTDashboard.dashboard", "Dashboard")
|
|
421
430
|
}
|
|
422
431
|
),
|
|
423
432
|
/* @__PURE__ */ e(
|
|
424
433
|
"button",
|
|
425
434
|
{
|
|
426
|
-
className: `nice-iot-dashboard__nav-button ${
|
|
435
|
+
className: `nice-iot-dashboard__nav-button ${g === "devices" ? "nice-iot-dashboard__nav-button--active" : ""}`,
|
|
427
436
|
onClick: () => w("devices"),
|
|
428
|
-
children:
|
|
437
|
+
children: m("ioTDashboard.devices2", "Devices")
|
|
429
438
|
}
|
|
430
439
|
),
|
|
431
440
|
/* @__PURE__ */ i(
|
|
432
441
|
"button",
|
|
433
442
|
{
|
|
434
|
-
className: `nice-iot-dashboard__nav-button ${
|
|
443
|
+
className: `nice-iot-dashboard__nav-button ${g === "alarms" ? "nice-iot-dashboard__nav-button--active" : ""}`,
|
|
435
444
|
onClick: () => w("alarms"),
|
|
436
445
|
children: [
|
|
437
|
-
|
|
446
|
+
m("ioTDashboard.alarms2", "Alarms"),
|
|
438
447
|
" ",
|
|
439
|
-
|
|
448
|
+
A.length > 0 && `(${A.length})`
|
|
440
449
|
]
|
|
441
450
|
}
|
|
442
451
|
)
|
|
443
452
|
] }),
|
|
444
|
-
/* @__PURE__ */ e("div", { className: "nice-iot-dashboard__actions", children:
|
|
445
|
-
/* @__PURE__ */ e(
|
|
453
|
+
/* @__PURE__ */ e("div", { className: "nice-iot-dashboard__actions", children: g === "dashboard" && /* @__PURE__ */ i("button", { onClick: () => D(!b), children: [
|
|
454
|
+
/* @__PURE__ */ e(p, { name: b ? "check" : "edit", size: 14 }),
|
|
446
455
|
" ",
|
|
447
|
-
|
|
456
|
+
b ? m("ioTDashboard.done", "Done") : m("ioTDashboard.edit", "Edit")
|
|
448
457
|
] }) })
|
|
449
458
|
] }),
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
/* @__PURE__ */ e("h4", { children:
|
|
459
|
+
g === "dashboard" && /* @__PURE__ */ i("div", { className: "nice-iot-dashboard__main", children: [
|
|
460
|
+
b && /* @__PURE__ */ i("aside", { className: "nice-iot-dashboard__palette", children: [
|
|
461
|
+
/* @__PURE__ */ e("h4", { children: m("ioTDashboard.addWidget", "Add Widget") }),
|
|
453
462
|
$.map((d) => /* @__PURE__ */ i(
|
|
454
463
|
"button",
|
|
455
464
|
{
|
|
456
465
|
className: "nice-iot-dashboard__palette-item",
|
|
457
|
-
onClick: () =>
|
|
466
|
+
onClick: () => T(d.type),
|
|
458
467
|
children: [
|
|
459
|
-
/* @__PURE__ */ e(
|
|
468
|
+
/* @__PURE__ */ e(p, { name: d.icon, size: 16 }),
|
|
460
469
|
/* @__PURE__ */ e("span", { children: d.label })
|
|
461
470
|
]
|
|
462
471
|
},
|
|
@@ -465,32 +474,35 @@ function Ne({
|
|
|
465
474
|
] }),
|
|
466
475
|
/* @__PURE__ */ i("div", { className: "nice-iot-dashboard__grid", children: [
|
|
467
476
|
u.map((d) => /* @__PURE__ */ e(
|
|
468
|
-
|
|
477
|
+
re,
|
|
469
478
|
{
|
|
470
479
|
widget: d,
|
|
471
480
|
devices: a,
|
|
472
|
-
alarms:
|
|
473
|
-
isEditing:
|
|
474
|
-
onCommand:
|
|
481
|
+
alarms: r,
|
|
482
|
+
isEditing: b,
|
|
483
|
+
onCommand: l,
|
|
475
484
|
onDelete: () => v((C) => C.filter((z) => z.id !== d.id))
|
|
476
485
|
},
|
|
477
486
|
d.id
|
|
478
487
|
)),
|
|
479
|
-
u.length === 0 && /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__empty", children:
|
|
488
|
+
u.length === 0 && /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__empty", children: b ? m("ioTDashboard.addWidgetsFromThePalette", "Add widgets from the palette") : m(
|
|
489
|
+
"ioTDashboard.noWidgetsConfiguredClickEdit",
|
|
490
|
+
"No widgets configured. Click Edit to add widgets."
|
|
491
|
+
) })
|
|
480
492
|
] })
|
|
481
493
|
] }),
|
|
482
|
-
|
|
494
|
+
g === "devices" && /* @__PURE__ */ i("div", { className: "nice-iot-dashboard__devices", children: [
|
|
483
495
|
/* @__PURE__ */ e("div", { className: "nice-iot-dashboard__devices-toolbar", children: /* @__PURE__ */ e(
|
|
484
496
|
"input",
|
|
485
497
|
{
|
|
486
498
|
type: "search",
|
|
487
|
-
placeholder:
|
|
499
|
+
placeholder: m("ioTDashboard.searchDevices", "Search devices..."),
|
|
488
500
|
value: y,
|
|
489
|
-
onChange: (d) =>
|
|
501
|
+
onChange: (d) => H(d.target.value)
|
|
490
502
|
}
|
|
491
503
|
) }),
|
|
492
504
|
/* @__PURE__ */ e("div", { className: "nice-iot-dashboard__device-grid", children: j.map((d) => /* @__PURE__ */ e(
|
|
493
|
-
|
|
505
|
+
le,
|
|
494
506
|
{
|
|
495
507
|
device: d,
|
|
496
508
|
isSelected: (N == null ? void 0 : N.id) === d.id,
|
|
@@ -499,24 +511,24 @@ function Ne({
|
|
|
499
511
|
d.id
|
|
500
512
|
)) }),
|
|
501
513
|
N && /* @__PURE__ */ e(
|
|
502
|
-
|
|
514
|
+
te,
|
|
503
515
|
{
|
|
504
516
|
device: N,
|
|
505
|
-
onCommand:
|
|
517
|
+
onCommand: l,
|
|
506
518
|
onClose: () => k(null)
|
|
507
519
|
}
|
|
508
520
|
)
|
|
509
521
|
] }),
|
|
510
|
-
|
|
522
|
+
g === "alarms" && /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__alarms", children: /* @__PURE__ */ i("table", { className: "nice-iot-dashboard__alarm-table", children: [
|
|
511
523
|
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ i("tr", { children: [
|
|
512
|
-
/* @__PURE__ */ e("th", { children:
|
|
513
|
-
/* @__PURE__ */ e("th", { children:
|
|
514
|
-
/* @__PURE__ */ e("th", { children:
|
|
515
|
-
/* @__PURE__ */ e("th", { children:
|
|
516
|
-
/* @__PURE__ */ e("th", { children:
|
|
517
|
-
/* @__PURE__ */ e("th", { children:
|
|
524
|
+
/* @__PURE__ */ e("th", { children: m("ioTDashboard.severity", "Severity") }),
|
|
525
|
+
/* @__PURE__ */ e("th", { children: m("ioTDashboard.device", "Device") }),
|
|
526
|
+
/* @__PURE__ */ e("th", { children: m("ioTDashboard.message", "Message") }),
|
|
527
|
+
/* @__PURE__ */ e("th", { children: m("ioTDashboard.time", "Time") }),
|
|
528
|
+
/* @__PURE__ */ e("th", { children: m("ioTDashboard.status", "Status") }),
|
|
529
|
+
/* @__PURE__ */ e("th", { children: m("ioTDashboard.actions", "Actions") })
|
|
518
530
|
] }) }),
|
|
519
|
-
/* @__PURE__ */ e("tbody", { children:
|
|
531
|
+
/* @__PURE__ */ e("tbody", { children: A.length === 0 ? /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e("td", { colSpan: 6, className: "nice-iot-dashboard__no-alarms", children: m("ioTDashboard.noActiveAlarms", "No active alarms") }) }) : A.map((d) => {
|
|
520
532
|
const C = a.find((z) => z.id === d.deviceId);
|
|
521
533
|
return /* @__PURE__ */ i(
|
|
522
534
|
"tr",
|
|
@@ -533,8 +545,8 @@ function Ne({
|
|
|
533
545
|
/* @__PURE__ */ e("td", { children: (C == null ? void 0 : C.name) || d.deviceId }),
|
|
534
546
|
/* @__PURE__ */ e("td", { children: d.message }),
|
|
535
547
|
/* @__PURE__ */ e("td", { children: d.timestamp.toLocaleString() }),
|
|
536
|
-
/* @__PURE__ */ e("td", { children: d.acknowledged ? "Acknowledged" : "Active" }),
|
|
537
|
-
/* @__PURE__ */ e("td", { children: !d.acknowledged && /* @__PURE__ */ e("button", { onClick: () =>
|
|
548
|
+
/* @__PURE__ */ e("td", { children: d.acknowledged ? m("ioTDashboard.acknowledged", "Acknowledged") : m("ioTDashboard.active", "Active") }),
|
|
549
|
+
/* @__PURE__ */ e("td", { children: !d.acknowledged && /* @__PURE__ */ e("button", { onClick: () => L(d.id), children: m("ioTDashboard.acknowledge", "Acknowledge") }) })
|
|
538
550
|
]
|
|
539
551
|
},
|
|
540
552
|
d.id
|
|
@@ -544,7 +556,7 @@ function Ne({
|
|
|
544
556
|
] });
|
|
545
557
|
}
|
|
546
558
|
function ne(a) {
|
|
547
|
-
return a.length === 0 ? 0 : Math.max(...a.map((
|
|
559
|
+
return a.length === 0 ? 0 : Math.max(...a.map((o) => o.position.y + o.position.height));
|
|
548
560
|
}
|
|
549
561
|
function E(a) {
|
|
550
562
|
switch (a) {
|
|
@@ -562,15 +574,15 @@ function E(a) {
|
|
|
562
574
|
return "var(--nice-text-secondary, #6c757d)";
|
|
563
575
|
}
|
|
564
576
|
}
|
|
565
|
-
function
|
|
577
|
+
function re({
|
|
566
578
|
widget: a,
|
|
567
|
-
devices:
|
|
568
|
-
alarms:
|
|
579
|
+
devices: o,
|
|
580
|
+
alarms: r,
|
|
569
581
|
isEditing: n,
|
|
570
582
|
onCommand: c,
|
|
571
|
-
onDelete:
|
|
583
|
+
onDelete: l
|
|
572
584
|
}) {
|
|
573
|
-
const { t
|
|
585
|
+
const { t } = _(), s = $.find((h) => h.type === a.type);
|
|
574
586
|
return /* @__PURE__ */ i(
|
|
575
587
|
"div",
|
|
576
588
|
{
|
|
@@ -581,61 +593,61 @@ function le({
|
|
|
581
593
|
},
|
|
582
594
|
children: [
|
|
583
595
|
/* @__PURE__ */ i("div", { className: "nice-iot-dashboard__widget-header", children: [
|
|
584
|
-
/* @__PURE__ */ e("span", { className: "nice-iot-dashboard__widget-icon", children: /* @__PURE__ */ e(
|
|
596
|
+
/* @__PURE__ */ e("span", { className: "nice-iot-dashboard__widget-icon", children: /* @__PURE__ */ e(p, { name: (s == null ? void 0 : s.icon) ?? "box", size: 14 }) }),
|
|
585
597
|
/* @__PURE__ */ e("span", { className: "nice-iot-dashboard__widget-title", children: a.title }),
|
|
586
598
|
n && /* @__PURE__ */ e(
|
|
587
599
|
"button",
|
|
588
600
|
{
|
|
589
|
-
"aria-label":
|
|
601
|
+
"aria-label": t("ioTDashboard.close", "Close"),
|
|
590
602
|
className: "nice-iot-dashboard__widget-delete",
|
|
591
|
-
onClick:
|
|
592
|
-
children: /* @__PURE__ */ e(
|
|
603
|
+
onClick: l,
|
|
604
|
+
children: /* @__PURE__ */ e(p, { name: "close", size: 14 })
|
|
593
605
|
}
|
|
594
606
|
)
|
|
595
607
|
] }),
|
|
596
|
-
/* @__PURE__ */ e("div", { className: "nice-iot-dashboard__widget-content", children: /* @__PURE__ */ e(
|
|
608
|
+
/* @__PURE__ */ e("div", { className: "nice-iot-dashboard__widget-content", children: /* @__PURE__ */ e(oe, { widget: a, devices: o, alarms: r, onCommand: c }) })
|
|
597
609
|
]
|
|
598
610
|
}
|
|
599
611
|
);
|
|
600
612
|
}
|
|
601
|
-
function
|
|
613
|
+
function oe({
|
|
602
614
|
widget: a,
|
|
603
|
-
devices:
|
|
604
|
-
alarms:
|
|
615
|
+
devices: o,
|
|
616
|
+
alarms: r,
|
|
605
617
|
onCommand: n
|
|
606
618
|
}) {
|
|
607
|
-
const { t: c } =
|
|
619
|
+
const { t: c } = _();
|
|
608
620
|
switch (a.type) {
|
|
609
621
|
case "device-list":
|
|
610
|
-
return /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__device-list", children:
|
|
622
|
+
return /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__device-list", children: o.slice(0, 10).map((l) => /* @__PURE__ */ i("div", { className: "nice-iot-dashboard__device-list-item", children: [
|
|
611
623
|
/* @__PURE__ */ e(
|
|
612
624
|
"span",
|
|
613
625
|
{
|
|
614
626
|
className: "nice-iot-dashboard__device-status",
|
|
615
|
-
style: { background: E(
|
|
627
|
+
style: { background: E(l.status) }
|
|
616
628
|
}
|
|
617
629
|
),
|
|
618
|
-
/* @__PURE__ */ e("span", { children:
|
|
619
|
-
/* @__PURE__ */ e("span", { className: "nice-iot-dashboard__device-type", children:
|
|
620
|
-
] },
|
|
630
|
+
/* @__PURE__ */ e("span", { children: l.name }),
|
|
631
|
+
/* @__PURE__ */ e("span", { className: "nice-iot-dashboard__device-type", children: l.type })
|
|
632
|
+
] }, l.id)) });
|
|
621
633
|
case "device-status":
|
|
622
|
-
return /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__status-grid", children: ["online", "offline", "warning", "error"].map((
|
|
623
|
-
const
|
|
634
|
+
return /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__status-grid", children: ["online", "offline", "warning", "error"].map((l) => {
|
|
635
|
+
const t = o.filter((s) => s.status === l).length;
|
|
624
636
|
return /* @__PURE__ */ i("div", { className: "nice-iot-dashboard__status-card", children: [
|
|
625
637
|
/* @__PURE__ */ e(
|
|
626
638
|
"span",
|
|
627
639
|
{
|
|
628
640
|
className: "nice-iot-dashboard__status-indicator",
|
|
629
|
-
style: { background: E(
|
|
641
|
+
style: { background: E(l) }
|
|
630
642
|
}
|
|
631
643
|
),
|
|
632
|
-
/* @__PURE__ */ e("span", { className: "nice-iot-dashboard__status-count", children:
|
|
633
|
-
/* @__PURE__ */ e("span", { className: "nice-iot-dashboard__status-label", children:
|
|
634
|
-
] },
|
|
644
|
+
/* @__PURE__ */ e("span", { className: "nice-iot-dashboard__status-count", children: t }),
|
|
645
|
+
/* @__PURE__ */ e("span", { className: "nice-iot-dashboard__status-label", children: l })
|
|
646
|
+
] }, l);
|
|
635
647
|
}) });
|
|
636
648
|
case "telemetry-chart":
|
|
637
649
|
return /* @__PURE__ */ i("div", { className: "nice-iot-dashboard__chart-placeholder", children: [
|
|
638
|
-
/* @__PURE__ */ e(
|
|
650
|
+
/* @__PURE__ */ e(p, { name: "bar-chart", size: 32 }),
|
|
639
651
|
/* @__PURE__ */ e("span", { children: c("ioTDashboard.telemetryChart", "Telemetry Chart") }),
|
|
640
652
|
/* @__PURE__ */ e("small", { children: c("ioTDashboard.configureDeviceAndCapability", "Configure device and capability") })
|
|
641
653
|
] });
|
|
@@ -664,48 +676,49 @@ function re({
|
|
|
664
676
|
] }) });
|
|
665
677
|
case "map":
|
|
666
678
|
return /* @__PURE__ */ i("div", { className: "nice-iot-dashboard__map-placeholder", children: [
|
|
667
|
-
/* @__PURE__ */ e(
|
|
679
|
+
/* @__PURE__ */ e(p, { name: "map-pin", size: 32 }),
|
|
668
680
|
/* @__PURE__ */ e("span", { children: c("ioTDashboard.deviceMap", "Device Map") }),
|
|
669
|
-
/* @__PURE__ */
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
681
|
+
/* @__PURE__ */ e("small", { children: c("ioTDashboard.devicesWithLocation", "{devices} devices with location").replace(
|
|
682
|
+
"{devices}",
|
|
683
|
+
String(o.filter((l) => l.location).length)
|
|
684
|
+
) })
|
|
673
685
|
] });
|
|
674
686
|
case "alarms": {
|
|
675
|
-
const
|
|
676
|
-
return /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__alarm-list", children:
|
|
687
|
+
const l = r.filter((t) => !t.cleared).slice(0, 5);
|
|
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((t) => /* @__PURE__ */ i(
|
|
677
689
|
"div",
|
|
678
690
|
{
|
|
679
|
-
className: `nice-iot-dashboard__alarm-item nice-iot-dashboard__alarm-item--${
|
|
691
|
+
className: `nice-iot-dashboard__alarm-item nice-iot-dashboard__alarm-item--${t.severity}`,
|
|
680
692
|
children: [
|
|
681
|
-
/* @__PURE__ */ e("span", { className: "nice-iot-dashboard__alarm-severity", children:
|
|
682
|
-
/* @__PURE__ */ e("span", { className: "nice-iot-dashboard__alarm-message", children:
|
|
693
|
+
/* @__PURE__ */ e("span", { className: "nice-iot-dashboard__alarm-severity", children: t.severity }),
|
|
694
|
+
/* @__PURE__ */ e("span", { className: "nice-iot-dashboard__alarm-message", children: t.message })
|
|
683
695
|
]
|
|
684
696
|
},
|
|
685
|
-
|
|
697
|
+
t.id
|
|
686
698
|
)) });
|
|
687
699
|
}
|
|
688
700
|
case "control-panel":
|
|
689
701
|
return /* @__PURE__ */ i("div", { className: "nice-iot-dashboard__control-placeholder", children: [
|
|
690
|
-
/* @__PURE__ */ e(
|
|
702
|
+
/* @__PURE__ */ e(p, { name: "settings", size: 32 }),
|
|
691
703
|
/* @__PURE__ */ e("span", { children: c("ioTDashboard.controlPanel", "Control Panel") }),
|
|
692
704
|
/* @__PURE__ */ e("small", { children: c("ioTDashboard.configureDeviceControls", "Configure device controls") })
|
|
693
705
|
] });
|
|
694
706
|
case "kpi":
|
|
695
707
|
return /* @__PURE__ */ i("div", { className: "nice-iot-dashboard__kpi", children: [
|
|
696
|
-
/* @__PURE__ */ e("div", { className: "nice-iot-dashboard__kpi-value", children:
|
|
708
|
+
/* @__PURE__ */ e("div", { className: "nice-iot-dashboard__kpi-value", children: o.length }),
|
|
697
709
|
/* @__PURE__ */ e("div", { className: "nice-iot-dashboard__kpi-label", children: c("ioTDashboard.totalDevices", "Total Devices") })
|
|
698
710
|
] });
|
|
699
711
|
default:
|
|
700
712
|
return /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__widget-placeholder", children: a.type });
|
|
701
713
|
}
|
|
702
714
|
}
|
|
703
|
-
function
|
|
715
|
+
function le({ device: a, isSelected: o, onSelect: r }) {
|
|
716
|
+
const { t: n } = _();
|
|
704
717
|
return /* @__PURE__ */ i(
|
|
705
718
|
"div",
|
|
706
719
|
{
|
|
707
|
-
className: `nice-iot-dashboard__device-card ${
|
|
708
|
-
onClick:
|
|
720
|
+
className: `nice-iot-dashboard__device-card ${o ? "nice-iot-dashboard__device-card--selected" : ""}`,
|
|
721
|
+
onClick: r,
|
|
709
722
|
children: [
|
|
710
723
|
/* @__PURE__ */ i("div", { className: "nice-iot-dashboard__device-card-header", children: [
|
|
711
724
|
/* @__PURE__ */ e(
|
|
@@ -719,21 +732,18 @@ function te({ device: a, isSelected: r, onSelect: l }) {
|
|
|
719
732
|
] }),
|
|
720
733
|
/* @__PURE__ */ i("div", { className: "nice-iot-dashboard__device-card-body", children: [
|
|
721
734
|
/* @__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()
|
|
735
|
+
/* @__PURE__ */ e("span", { children: n("ioTDashboard.type", "Type: {type}").replace("{type}", String(a.type)) }),
|
|
736
|
+
/* @__PURE__ */ e("span", { children: n("ioTDashboard.protocol", "Protocol: {protocol}").replace(
|
|
737
|
+
"{protocol}",
|
|
738
|
+
String(a.protocol)
|
|
739
|
+
) })
|
|
734
740
|
] }),
|
|
741
|
+
a.lastSeen && /* @__PURE__ */ e("div", { className: "nice-iot-dashboard__device-lastseen", children: n("ioTDashboard.lastSeen", "Last seen: {lastSeen}").replace(
|
|
742
|
+
"{lastSeen}",
|
|
743
|
+
String(a.lastSeen.toLocaleString())
|
|
744
|
+
) }),
|
|
735
745
|
/* @__PURE__ */ i("div", { className: "nice-iot-dashboard__device-capabilities", children: [
|
|
736
|
-
a.capabilities.slice(0, 3).map((
|
|
746
|
+
a.capabilities.slice(0, 3).map((c) => /* @__PURE__ */ e("span", { className: "nice-iot-dashboard__capability-badge", children: c.name }, c.id)),
|
|
737
747
|
a.capabilities.length > 3 && /* @__PURE__ */ i("span", { className: "nice-iot-dashboard__capability-more", children: [
|
|
738
748
|
"+",
|
|
739
749
|
a.capabilities.length - 3
|
|
@@ -744,22 +754,22 @@ function te({ device: a, isSelected: r, onSelect: l }) {
|
|
|
744
754
|
}
|
|
745
755
|
);
|
|
746
756
|
}
|
|
747
|
-
function
|
|
757
|
+
function te({
|
|
748
758
|
device: a,
|
|
749
|
-
onCommand:
|
|
750
|
-
onClose:
|
|
759
|
+
onCommand: o,
|
|
760
|
+
onClose: r
|
|
751
761
|
}) {
|
|
752
|
-
const { t: n } =
|
|
762
|
+
const { t: n } = _();
|
|
753
763
|
return /* @__PURE__ */ i("aside", { className: "nice-iot-dashboard__device-detail", children: [
|
|
754
764
|
/* @__PURE__ */ i("div", { className: "nice-iot-dashboard__device-detail-header", children: [
|
|
755
765
|
/* @__PURE__ */ e("h3", { children: a.name }),
|
|
756
|
-
/* @__PURE__ */ e("button", { "aria-label": n("ioTDashboard.close", "Close"), onClick:
|
|
766
|
+
/* @__PURE__ */ e("button", { "aria-label": n("ioTDashboard.close", "Close"), onClick: r, children: /* @__PURE__ */ e(p, { name: "close", size: 14 }) })
|
|
757
767
|
] }),
|
|
758
768
|
/* @__PURE__ */ i("div", { className: "nice-iot-dashboard__device-detail-content", children: [
|
|
759
769
|
/* @__PURE__ */ i("section", { children: [
|
|
760
770
|
/* @__PURE__ */ e("h4", { children: n("ioTDashboard.status", "Status") }),
|
|
761
771
|
/* @__PURE__ */ i("div", { className: "nice-iot-dashboard__detail-row", children: [
|
|
762
|
-
/* @__PURE__ */ e("span", { children: "Status:" }),
|
|
772
|
+
/* @__PURE__ */ e("span", { children: n("ioTDashboard.status2", "Status:") }),
|
|
763
773
|
/* @__PURE__ */ e(
|
|
764
774
|
"span",
|
|
765
775
|
{
|
|
@@ -770,18 +780,18 @@ function oe({
|
|
|
770
780
|
)
|
|
771
781
|
] }),
|
|
772
782
|
a.lastSeen && /* @__PURE__ */ i("div", { className: "nice-iot-dashboard__detail-row", children: [
|
|
773
|
-
/* @__PURE__ */ e("span", { children: "Last Seen:" }),
|
|
783
|
+
/* @__PURE__ */ e("span", { children: n("ioTDashboard.lastSeen2", "Last Seen:") }),
|
|
774
784
|
/* @__PURE__ */ e("span", { children: a.lastSeen.toLocaleString() })
|
|
775
785
|
] })
|
|
776
786
|
] }),
|
|
777
787
|
/* @__PURE__ */ i("section", { children: [
|
|
778
788
|
/* @__PURE__ */ e("h4", { children: n("ioTDashboard.connection", "Connection") }),
|
|
779
789
|
/* @__PURE__ */ i("div", { className: "nice-iot-dashboard__detail-row", children: [
|
|
780
|
-
/* @__PURE__ */ e("span", { children: "Protocol:" }),
|
|
790
|
+
/* @__PURE__ */ e("span", { children: n("ioTDashboard.protocol2", "Protocol:") }),
|
|
781
791
|
/* @__PURE__ */ e("span", { children: a.protocol })
|
|
782
792
|
] }),
|
|
783
793
|
a.connectionInfo.host && /* @__PURE__ */ i("div", { className: "nice-iot-dashboard__detail-row", children: [
|
|
784
|
-
/* @__PURE__ */ e("span", { children: "Host:" }),
|
|
794
|
+
/* @__PURE__ */ e("span", { children: n("ioTDashboard.host", "Host:") }),
|
|
785
795
|
/* @__PURE__ */ i("span", { children: [
|
|
786
796
|
a.connectionInfo.host,
|
|
787
797
|
":",
|
|
@@ -792,11 +802,11 @@ function oe({
|
|
|
792
802
|
a.metadata && /* @__PURE__ */ i("section", { children: [
|
|
793
803
|
/* @__PURE__ */ e("h4", { children: n("ioTDashboard.metadata", "Metadata") }),
|
|
794
804
|
a.metadata.manufacturer && /* @__PURE__ */ i("div", { className: "nice-iot-dashboard__detail-row", children: [
|
|
795
|
-
/* @__PURE__ */ e("span", { children: "Manufacturer:" }),
|
|
805
|
+
/* @__PURE__ */ e("span", { children: n("ioTDashboard.manufacturer", "Manufacturer:") }),
|
|
796
806
|
/* @__PURE__ */ e("span", { children: a.metadata.manufacturer })
|
|
797
807
|
] }),
|
|
798
808
|
a.metadata.model && /* @__PURE__ */ i("div", { className: "nice-iot-dashboard__detail-row", children: [
|
|
799
|
-
/* @__PURE__ */ e("span", { children: "Model:" }),
|
|
809
|
+
/* @__PURE__ */ e("span", { children: n("ioTDashboard.model", "Model:") }),
|
|
800
810
|
/* @__PURE__ */ e("span", { children: a.metadata.model })
|
|
801
811
|
] })
|
|
802
812
|
] }),
|
|
@@ -805,11 +815,11 @@ function oe({
|
|
|
805
815
|
/* @__PURE__ */ e("div", { className: "nice-iot-dashboard__capabilities-list", children: a.capabilities.map((c) => /* @__PURE__ */ i("div", { className: "nice-iot-dashboard__capability-item", children: [
|
|
806
816
|
/* @__PURE__ */ e("span", { className: "nice-iot-dashboard__capability-name", children: c.name }),
|
|
807
817
|
/* @__PURE__ */ e("span", { className: "nice-iot-dashboard__capability-type", children: c.type }),
|
|
808
|
-
c.writable &&
|
|
818
|
+
c.writable && o && /* @__PURE__ */ e(
|
|
809
819
|
"button",
|
|
810
820
|
{
|
|
811
821
|
className: "nice-iot-dashboard__capability-control",
|
|
812
|
-
onClick: () =>
|
|
822
|
+
onClick: () => o(a.id, c.id, !0),
|
|
813
823
|
children: n("ioTDashboard.control", "Control")
|
|
814
824
|
}
|
|
815
825
|
)
|
|
@@ -828,53 +838,49 @@ const ce = [
|
|
|
828
838
|
];
|
|
829
839
|
function fe({
|
|
830
840
|
nodes: a = [],
|
|
831
|
-
modules:
|
|
832
|
-
onNodeSelect:
|
|
841
|
+
modules: o = [],
|
|
842
|
+
onNodeSelect: r,
|
|
833
843
|
onModuleDeploy: n,
|
|
834
844
|
onModuleAction: c,
|
|
835
|
-
onNodeSync:
|
|
836
|
-
className:
|
|
845
|
+
onNodeSync: l,
|
|
846
|
+
className: t = ""
|
|
837
847
|
}) {
|
|
838
|
-
const { t: s } =
|
|
848
|
+
const { t: s } = _(), [h, m] = M(null), [u, V] = M("nodes"), [N, k] = M(!1), [g, w] = M({
|
|
839
849
|
name: "",
|
|
840
850
|
image: "",
|
|
841
851
|
status: "pending"
|
|
842
|
-
}),
|
|
852
|
+
}), b = f(
|
|
843
853
|
(v) => {
|
|
844
|
-
|
|
854
|
+
m(v), r == null || r(v);
|
|
845
855
|
},
|
|
846
|
-
[
|
|
847
|
-
),
|
|
848
|
-
!h || !
|
|
849
|
-
}, [h,
|
|
850
|
-
async (v,
|
|
851
|
-
h && await (c == null ? void 0 : c(h.id, v,
|
|
856
|
+
[r]
|
|
857
|
+
), D = f(async () => {
|
|
858
|
+
!h || !g.name || !g.image || (await (n == null ? void 0 : n(h.id, g)), k(!1), w({ name: "", image: "", status: "pending" }));
|
|
859
|
+
}, [h, g, n]), y = f(
|
|
860
|
+
async (v, T) => {
|
|
861
|
+
h && await (c == null ? void 0 : c(h.id, v, T));
|
|
852
862
|
},
|
|
853
863
|
[h, c]
|
|
854
|
-
),
|
|
855
|
-
h && await (
|
|
856
|
-
}, [h,
|
|
857
|
-
return /* @__PURE__ */ i("div", { className: `nice-edge-manager ${
|
|
864
|
+
), H = f(async () => {
|
|
865
|
+
h && await (l == null ? void 0 : l(h.id));
|
|
866
|
+
}, [h, l]);
|
|
867
|
+
return /* @__PURE__ */ i("div", { className: `nice-edge-manager ${t}`, children: [
|
|
858
868
|
/* @__PURE__ */ i("header", { className: "nice-edge-manager__header", children: [
|
|
859
869
|
/* @__PURE__ */ e("h1", { children: s("edgeManager.edgeManager", "Edge Manager") }),
|
|
860
870
|
/* @__PURE__ */ i("nav", { className: "nice-edge-manager__nav", children: [
|
|
861
|
-
/* @__PURE__ */
|
|
871
|
+
/* @__PURE__ */ e(
|
|
862
872
|
"button",
|
|
863
873
|
{
|
|
864
874
|
className: `nice-edge-manager__nav-button ${u === "nodes" ? "nice-edge-manager__nav-button--active" : ""}`,
|
|
865
|
-
onClick: () =>
|
|
866
|
-
children:
|
|
867
|
-
"Nodes (",
|
|
868
|
-
a.length,
|
|
869
|
-
")"
|
|
870
|
-
]
|
|
875
|
+
onClick: () => V("nodes"),
|
|
876
|
+
children: s("edgeManager.nodes", "Nodes ({nodes})").replace("{nodes}", String(a.length))
|
|
871
877
|
}
|
|
872
878
|
),
|
|
873
879
|
/* @__PURE__ */ e(
|
|
874
880
|
"button",
|
|
875
881
|
{
|
|
876
882
|
className: `nice-edge-manager__nav-button ${u === "modules" ? "nice-edge-manager__nav-button--active" : ""}`,
|
|
877
|
-
onClick: () =>
|
|
883
|
+
onClick: () => V("modules"),
|
|
878
884
|
children: s("edgeManager.modules", "Modules")
|
|
879
885
|
}
|
|
880
886
|
)
|
|
@@ -887,7 +893,7 @@ function fe({
|
|
|
887
893
|
{
|
|
888
894
|
node: v,
|
|
889
895
|
isSelected: (h == null ? void 0 : h.id) === v.id,
|
|
890
|
-
onSelect: () =>
|
|
896
|
+
onSelect: () => b(v)
|
|
891
897
|
},
|
|
892
898
|
v.id
|
|
893
899
|
)),
|
|
@@ -904,7 +910,7 @@ function fe({
|
|
|
904
910
|
{
|
|
905
911
|
className: "nice-edge-manager__deploy-btn",
|
|
906
912
|
onClick: () => k(!0),
|
|
907
|
-
children: "+ Deploy Module"
|
|
913
|
+
children: s("edgeManager.deployModule2", "+ Deploy Module")
|
|
908
914
|
}
|
|
909
915
|
)
|
|
910
916
|
] }),
|
|
@@ -913,7 +919,7 @@ function fe({
|
|
|
913
919
|
he,
|
|
914
920
|
{
|
|
915
921
|
module: v,
|
|
916
|
-
onAction: (
|
|
922
|
+
onAction: (T) => y(v.id, T)
|
|
917
923
|
},
|
|
918
924
|
v.id
|
|
919
925
|
)),
|
|
@@ -928,18 +934,18 @@ function fe({
|
|
|
928
934
|
me,
|
|
929
935
|
{
|
|
930
936
|
node: h,
|
|
931
|
-
onSync:
|
|
932
|
-
onClose: () =>
|
|
937
|
+
onSync: H,
|
|
938
|
+
onClose: () => m(null)
|
|
933
939
|
}
|
|
934
940
|
)
|
|
935
941
|
] }),
|
|
936
942
|
N && /* @__PURE__ */ e(
|
|
937
943
|
pe,
|
|
938
944
|
{
|
|
939
|
-
config:
|
|
945
|
+
config: g,
|
|
940
946
|
templates: ce,
|
|
941
947
|
onChange: w,
|
|
942
|
-
onDeploy:
|
|
948
|
+
onDeploy: D,
|
|
943
949
|
onClose: () => k(!1)
|
|
944
950
|
}
|
|
945
951
|
)
|
|
@@ -965,15 +971,16 @@ function B(a) {
|
|
|
965
971
|
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
972
|
}
|
|
967
973
|
function se(a) {
|
|
968
|
-
const
|
|
969
|
-
return
|
|
974
|
+
const o = Math.floor(a / 86400), r = Math.floor(a % 86400 / 3600), n = Math.floor(a % 3600 / 60);
|
|
975
|
+
return o > 0 ? `${o}d ${r}h` : r > 0 ? `${r}h ${n}m` : `${n}m`;
|
|
970
976
|
}
|
|
971
|
-
function de({ node: a, isSelected:
|
|
977
|
+
function de({ node: a, isSelected: o, onSelect: r }) {
|
|
978
|
+
const { t: n } = _();
|
|
972
979
|
return /* @__PURE__ */ i(
|
|
973
980
|
"div",
|
|
974
981
|
{
|
|
975
|
-
className: `nice-edge-manager__node-card ${
|
|
976
|
-
onClick:
|
|
982
|
+
className: `nice-edge-manager__node-card ${o ? "nice-edge-manager__node-card--selected" : ""}`,
|
|
983
|
+
onClick: r,
|
|
977
984
|
children: [
|
|
978
985
|
/* @__PURE__ */ i("div", { className: "nice-edge-manager__node-header", children: [
|
|
979
986
|
/* @__PURE__ */ e(
|
|
@@ -989,18 +996,18 @@ function de({ node: a, isSelected: r, onSelect: l }) {
|
|
|
989
996
|
/* @__PURE__ */ i("div", { className: "nice-edge-manager__node-body", children: [
|
|
990
997
|
/* @__PURE__ */ i("div", { className: "nice-edge-manager__node-info", children: [
|
|
991
998
|
/* @__PURE__ */ i("span", { children: [
|
|
992
|
-
/* @__PURE__ */ e(
|
|
999
|
+
/* @__PURE__ */ e(p, { name: "server", size: 12 }),
|
|
993
1000
|
" ",
|
|
994
1001
|
a.hardware.cpu
|
|
995
1002
|
] }),
|
|
996
1003
|
/* @__PURE__ */ i("span", { children: [
|
|
997
|
-
/* @__PURE__ */ e(
|
|
1004
|
+
/* @__PURE__ */ e(p, { name: "database", size: 12 }),
|
|
998
1005
|
" ",
|
|
999
1006
|
(a.hardware.memoryMB / 1024).toFixed(1),
|
|
1000
1007
|
" GB"
|
|
1001
1008
|
] })
|
|
1002
1009
|
] }),
|
|
1003
|
-
/* @__PURE__ */ e("div", { className: "nice-edge-manager__node-metrics", children: a.metrics && /* @__PURE__ */ i(
|
|
1010
|
+
/* @__PURE__ */ e("div", { className: "nice-edge-manager__node-metrics", children: a.metrics && /* @__PURE__ */ i(S, { children: [
|
|
1004
1011
|
/* @__PURE__ */ i("div", { className: "nice-edge-manager__metric", children: [
|
|
1005
1012
|
/* @__PURE__ */ e("span", { className: "nice-edge-manager__metric-label", children: "CPU" }),
|
|
1006
1013
|
/* @__PURE__ */ e("div", { className: "nice-edge-manager__metric-bar", children: /* @__PURE__ */ e(
|
|
@@ -1016,7 +1023,7 @@ function de({ node: a, isSelected: r, onSelect: l }) {
|
|
|
1016
1023
|
] })
|
|
1017
1024
|
] }),
|
|
1018
1025
|
/* @__PURE__ */ i("div", { className: "nice-edge-manager__metric", children: [
|
|
1019
|
-
/* @__PURE__ */ e("span", { className: "nice-edge-manager__metric-label", children: "MEM" }),
|
|
1026
|
+
/* @__PURE__ */ e("span", { className: "nice-edge-manager__metric-label", children: n("edgeManager.mem", "MEM") }),
|
|
1020
1027
|
/* @__PURE__ */ e("div", { className: "nice-edge-manager__metric-bar", children: /* @__PURE__ */ e(
|
|
1021
1028
|
"div",
|
|
1022
1029
|
{
|
|
@@ -1030,17 +1037,17 @@ function de({ node: a, isSelected: r, onSelect: l }) {
|
|
|
1030
1037
|
] })
|
|
1031
1038
|
] })
|
|
1032
1039
|
] }) }),
|
|
1033
|
-
/* @__PURE__ */
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1040
|
+
/* @__PURE__ */ e("div", { className: "nice-edge-manager__node-modules", children: n("edgeManager.modulesDeployed", "{deployedModules} modules deployed").replace(
|
|
1041
|
+
"{deployedModules}",
|
|
1042
|
+
String(a.deployedModules.length)
|
|
1043
|
+
) })
|
|
1037
1044
|
] })
|
|
1038
1045
|
]
|
|
1039
1046
|
}
|
|
1040
1047
|
);
|
|
1041
1048
|
}
|
|
1042
|
-
function he({ module: a, onAction:
|
|
1043
|
-
const { t:
|
|
1049
|
+
function he({ module: a, onAction: o }) {
|
|
1050
|
+
const { t: r } = _();
|
|
1044
1051
|
return /* @__PURE__ */ i("div", { className: "nice-edge-manager__module-card", children: [
|
|
1045
1052
|
/* @__PURE__ */ i("div", { className: "nice-edge-manager__module-header", children: [
|
|
1046
1053
|
/* @__PURE__ */ e(
|
|
@@ -1066,50 +1073,49 @@ function he({ module: a, onAction: r }) {
|
|
|
1066
1073
|
/* @__PURE__ */ i("div", { className: "nice-edge-manager__module-body", children: [
|
|
1067
1074
|
/* @__PURE__ */ e("div", { className: "nice-edge-manager__module-image", children: a.image }),
|
|
1068
1075
|
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
|
-
] })
|
|
1076
|
+
a.resources.cpuLimit && /* @__PURE__ */ e("span", { children: r("edgeManager.cpu", "CPU: {cpuLimit}").replace(
|
|
1077
|
+
"{cpuLimit}",
|
|
1078
|
+
String(a.resources.cpuLimit)
|
|
1079
|
+
) }),
|
|
1080
|
+
a.resources.memoryLimitMB && /* @__PURE__ */ e("span", { children: r("edgeManager.ramMb", "RAM: {memoryLimitMB} MB").replace(
|
|
1081
|
+
"{memoryLimitMB}",
|
|
1082
|
+
String(a.resources.memoryLimitMB)
|
|
1083
|
+
) })
|
|
1078
1084
|
] }),
|
|
1079
|
-
a.ports && a.ports.length > 0 && /* @__PURE__ */
|
|
1080
|
-
"
|
|
1081
|
-
a.ports.map((c) => `${c.host}:${c.container}`).join(", ")
|
|
1082
|
-
|
|
1085
|
+
a.ports && a.ports.length > 0 && /* @__PURE__ */ e("div", { className: "nice-edge-manager__module-ports", children: r("edgeManager.ports", "Ports: {ports}").replace(
|
|
1086
|
+
"{ports}",
|
|
1087
|
+
String(a.ports.map((c) => `${c.host}:${c.container}`).join(", "))
|
|
1088
|
+
) })
|
|
1083
1089
|
] }),
|
|
1084
1090
|
/* @__PURE__ */ i("div", { className: "nice-edge-manager__module-actions", children: [
|
|
1085
|
-
a.status === "running" && /* @__PURE__ */ i(
|
|
1086
|
-
/* @__PURE__ */ e("button", { onClick: () =>
|
|
1087
|
-
/* @__PURE__ */ e("button", { onClick: () =>
|
|
1091
|
+
a.status === "running" && /* @__PURE__ */ i(S, { children: [
|
|
1092
|
+
/* @__PURE__ */ e("button", { onClick: () => o("stop"), children: r("edgeManager.stop", "Stop") }),
|
|
1093
|
+
/* @__PURE__ */ e("button", { onClick: () => o("restart"), children: r("edgeManager.restart", "Restart") })
|
|
1088
1094
|
] }),
|
|
1089
|
-
a.status === "stopped" && /* @__PURE__ */ e("button", { onClick: () =>
|
|
1090
|
-
/* @__PURE__ */ e("button", { className: "nice-edge-manager__module-remove", onClick: () =>
|
|
1095
|
+
a.status === "stopped" && /* @__PURE__ */ e("button", { onClick: () => o("start"), children: r("edgeManager.start", "Start") }),
|
|
1096
|
+
/* @__PURE__ */ e("button", { className: "nice-edge-manager__module-remove", onClick: () => o("remove"), children: r("edgeManager.remove", "Remove") })
|
|
1091
1097
|
] })
|
|
1092
1098
|
] });
|
|
1093
1099
|
}
|
|
1094
|
-
function me({ node: a, onSync:
|
|
1095
|
-
const { t: n } =
|
|
1100
|
+
function me({ node: a, onSync: o, onClose: r }) {
|
|
1101
|
+
const { t: n } = _();
|
|
1096
1102
|
return /* @__PURE__ */ i("aside", { className: "nice-edge-manager__detail", children: [
|
|
1097
1103
|
/* @__PURE__ */ i("div", { className: "nice-edge-manager__detail-header", children: [
|
|
1098
1104
|
/* @__PURE__ */ e("h3", { children: a.name }),
|
|
1099
1105
|
/* @__PURE__ */ i("div", { className: "nice-edge-manager__detail-actions", children: [
|
|
1100
|
-
/* @__PURE__ */ i("button", { onClick:
|
|
1101
|
-
/* @__PURE__ */ e(
|
|
1106
|
+
/* @__PURE__ */ i("button", { onClick: o, children: [
|
|
1107
|
+
/* @__PURE__ */ e(p, { name: "refresh", size: 14 }),
|
|
1102
1108
|
" ",
|
|
1103
1109
|
n("edgeManager.sync", "Sync")
|
|
1104
1110
|
] }),
|
|
1105
|
-
/* @__PURE__ */ e("button", { onClick:
|
|
1111
|
+
/* @__PURE__ */ e("button", { onClick: r, "aria-label": n("edgeManager.close", "Close"), children: /* @__PURE__ */ e(p, { name: "close", size: 14 }) })
|
|
1106
1112
|
] })
|
|
1107
1113
|
] }),
|
|
1108
1114
|
/* @__PURE__ */ i("div", { className: "nice-edge-manager__detail-content", children: [
|
|
1109
1115
|
/* @__PURE__ */ i("section", { children: [
|
|
1110
1116
|
/* @__PURE__ */ e("h4", { children: n("edgeManager.status", "Status") }),
|
|
1111
1117
|
/* @__PURE__ */ i("div", { className: "nice-edge-manager__detail-row", children: [
|
|
1112
|
-
/* @__PURE__ */ e("span", { children: "Status:" }),
|
|
1118
|
+
/* @__PURE__ */ e("span", { children: n("edgeManager.status2", "Status:") }),
|
|
1113
1119
|
/* @__PURE__ */ e(
|
|
1114
1120
|
"span",
|
|
1115
1121
|
{
|
|
@@ -1120,44 +1126,39 @@ function me({ node: a, onSync: r, onClose: l }) {
|
|
|
1120
1126
|
)
|
|
1121
1127
|
] }),
|
|
1122
1128
|
a.metrics && /* @__PURE__ */ i("div", { className: "nice-edge-manager__detail-row", children: [
|
|
1123
|
-
/* @__PURE__ */ e("span", { children: "Uptime:" }),
|
|
1129
|
+
/* @__PURE__ */ e("span", { children: n("edgeManager.uptime", "Uptime:") }),
|
|
1124
1130
|
/* @__PURE__ */ e("span", { children: se(a.metrics.uptime) })
|
|
1125
1131
|
] })
|
|
1126
1132
|
] }),
|
|
1127
1133
|
/* @__PURE__ */ i("section", { children: [
|
|
1128
1134
|
/* @__PURE__ */ e("h4", { children: n("edgeManager.hardware", "Hardware") }),
|
|
1129
1135
|
/* @__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
|
-
] })
|
|
1136
|
+
/* @__PURE__ */ e("span", { children: n("edgeManager.cpu2", "CPU:") }),
|
|
1137
|
+
/* @__PURE__ */ e("span", { children: n("edgeManager.cores", "{cpu} ({cores} cores)").replace("{cpu}", String(a.hardware.cpu)).replace("{cores}", String(a.hardware.cores)) })
|
|
1137
1138
|
] }),
|
|
1138
1139
|
/* @__PURE__ */ i("div", { className: "nice-edge-manager__detail-row", children: [
|
|
1139
|
-
/* @__PURE__ */ e("span", { children: "Memory:" }),
|
|
1140
|
+
/* @__PURE__ */ e("span", { children: n("edgeManager.memory2", "Memory:") }),
|
|
1140
1141
|
/* @__PURE__ */ i("span", { children: [
|
|
1141
1142
|
(a.hardware.memoryMB / 1024).toFixed(1),
|
|
1142
1143
|
" GB"
|
|
1143
1144
|
] })
|
|
1144
1145
|
] }),
|
|
1145
1146
|
/* @__PURE__ */ i("div", { className: "nice-edge-manager__detail-row", children: [
|
|
1146
|
-
/* @__PURE__ */ e("span", { children: "Storage:" }),
|
|
1147
|
+
/* @__PURE__ */ e("span", { children: n("edgeManager.storage", "Storage:") }),
|
|
1147
1148
|
/* @__PURE__ */ i("span", { children: [
|
|
1148
1149
|
(a.hardware.storageMB / 1024).toFixed(1),
|
|
1149
1150
|
" GB"
|
|
1150
1151
|
] })
|
|
1151
1152
|
] }),
|
|
1152
1153
|
/* @__PURE__ */ i("div", { className: "nice-edge-manager__detail-row", children: [
|
|
1153
|
-
/* @__PURE__ */ e("span", { children: "Architecture:" }),
|
|
1154
|
+
/* @__PURE__ */ e("span", { children: n("edgeManager.architecture", "Architecture:") }),
|
|
1154
1155
|
/* @__PURE__ */ e("span", { children: a.hardware.architecture })
|
|
1155
1156
|
] })
|
|
1156
1157
|
] }),
|
|
1157
1158
|
/* @__PURE__ */ i("section", { children: [
|
|
1158
1159
|
/* @__PURE__ */ e("h4", { children: n("edgeManager.software", "Software") }),
|
|
1159
1160
|
/* @__PURE__ */ i("div", { className: "nice-edge-manager__detail-row", children: [
|
|
1160
|
-
/* @__PURE__ */ e("span", { children: "OS:" }),
|
|
1161
|
+
/* @__PURE__ */ e("span", { children: n("edgeManager.os", "OS:") }),
|
|
1161
1162
|
/* @__PURE__ */ i("span", { children: [
|
|
1162
1163
|
a.software.os,
|
|
1163
1164
|
" ",
|
|
@@ -1165,7 +1166,7 @@ function me({ node: a, onSync: r, onClose: l }) {
|
|
|
1165
1166
|
] })
|
|
1166
1167
|
] }),
|
|
1167
1168
|
/* @__PURE__ */ i("div", { className: "nice-edge-manager__detail-row", children: [
|
|
1168
|
-
/* @__PURE__ */ e("span", { children: "Runtime:" }),
|
|
1169
|
+
/* @__PURE__ */ e("span", { children: n("edgeManager.runtime", "Runtime:") }),
|
|
1169
1170
|
/* @__PURE__ */ i("span", { children: [
|
|
1170
1171
|
a.software.runtime,
|
|
1171
1172
|
" ",
|
|
@@ -1173,7 +1174,7 @@ function me({ node: a, onSync: r, onClose: l }) {
|
|
|
1173
1174
|
] })
|
|
1174
1175
|
] }),
|
|
1175
1176
|
/* @__PURE__ */ i("div", { className: "nice-edge-manager__detail-row", children: [
|
|
1176
|
-
/* @__PURE__ */ e("span", { children: "Agent:" }),
|
|
1177
|
+
/* @__PURE__ */ e("span", { children: n("edgeManager.agent", "Agent:") }),
|
|
1177
1178
|
/* @__PURE__ */ i("span", { children: [
|
|
1178
1179
|
a.software.agent,
|
|
1179
1180
|
" v",
|
|
@@ -1184,23 +1185,23 @@ function me({ node: a, onSync: r, onClose: l }) {
|
|
|
1184
1185
|
/* @__PURE__ */ i("section", { children: [
|
|
1185
1186
|
/* @__PURE__ */ e("h4", { children: n("edgeManager.connectivity", "Connectivity") }),
|
|
1186
1187
|
/* @__PURE__ */ i("div", { className: "nice-edge-manager__detail-row", children: [
|
|
1187
|
-
/* @__PURE__ */ e("span", { children: "Cloud:" }),
|
|
1188
|
+
/* @__PURE__ */ e("span", { children: n("edgeManager.cloud", "Cloud:") }),
|
|
1188
1189
|
/* @__PURE__ */ i("span", { children: [
|
|
1189
|
-
/* @__PURE__ */ e(
|
|
1190
|
+
/* @__PURE__ */ e(p, { name: a.connectivity.cloudConnected ? "check" : "close", size: 12 }),
|
|
1190
1191
|
" ",
|
|
1191
|
-
a.connectivity.cloudConnected ? "Connected" : "Disconnected"
|
|
1192
|
+
a.connectivity.cloudConnected ? n("edgeManager.connected", "Connected") : n("edgeManager.disconnected", "Disconnected")
|
|
1192
1193
|
] })
|
|
1193
1194
|
] }),
|
|
1194
1195
|
/* @__PURE__ */ i("div", { className: "nice-edge-manager__detail-row", children: [
|
|
1195
|
-
/* @__PURE__ */ e("span", { children: "Network:" }),
|
|
1196
|
+
/* @__PURE__ */ e("span", { children: n("edgeManager.network", "Network:") }),
|
|
1196
1197
|
/* @__PURE__ */ e("span", { children: a.connectivity.localNetwork })
|
|
1197
1198
|
] }),
|
|
1198
1199
|
a.connectivity.publicIP && /* @__PURE__ */ i("div", { className: "nice-edge-manager__detail-row", children: [
|
|
1199
|
-
/* @__PURE__ */ e("span", { children: "Public IP:" }),
|
|
1200
|
+
/* @__PURE__ */ e("span", { children: n("edgeManager.publicIp", "Public IP:") }),
|
|
1200
1201
|
/* @__PURE__ */ e("span", { children: a.connectivity.publicIP })
|
|
1201
1202
|
] }),
|
|
1202
1203
|
a.connectivity.lastSync && /* @__PURE__ */ i("div", { className: "nice-edge-manager__detail-row", children: [
|
|
1203
|
-
/* @__PURE__ */ e("span", { children: "Last Sync:" }),
|
|
1204
|
+
/* @__PURE__ */ e("span", { children: n("edgeManager.lastSync", "Last Sync:") }),
|
|
1204
1205
|
/* @__PURE__ */ e("span", { children: a.connectivity.lastSync.toLocaleString() })
|
|
1205
1206
|
] })
|
|
1206
1207
|
] }),
|
|
@@ -1252,12 +1253,12 @@ function me({ node: a, onSync: r, onClose: l }) {
|
|
|
1252
1253
|
] }),
|
|
1253
1254
|
/* @__PURE__ */ i("div", { className: "nice-edge-manager__network-stats", children: [
|
|
1254
1255
|
/* @__PURE__ */ i("span", { children: [
|
|
1255
|
-
/* @__PURE__ */ e(
|
|
1256
|
+
/* @__PURE__ */ e(p, { name: "arrow-down", size: 12 }),
|
|
1256
1257
|
" ",
|
|
1257
1258
|
B(a.metrics.networkIn)
|
|
1258
1259
|
] }),
|
|
1259
1260
|
/* @__PURE__ */ i("span", { children: [
|
|
1260
|
-
/* @__PURE__ */ e(
|
|
1261
|
+
/* @__PURE__ */ e(p, { name: "arrow-up", size: 12 }),
|
|
1261
1262
|
" ",
|
|
1262
1263
|
B(a.metrics.networkOut)
|
|
1263
1264
|
] })
|
|
@@ -1268,78 +1269,78 @@ function me({ node: a, onSync: r, onClose: l }) {
|
|
|
1268
1269
|
}
|
|
1269
1270
|
function pe({
|
|
1270
1271
|
config: a,
|
|
1271
|
-
templates:
|
|
1272
|
-
onChange:
|
|
1272
|
+
templates: o,
|
|
1273
|
+
onChange: r,
|
|
1273
1274
|
onDeploy: n,
|
|
1274
1275
|
onClose: c
|
|
1275
1276
|
}) {
|
|
1276
|
-
const { t } =
|
|
1277
|
+
const { t: l } = _();
|
|
1277
1278
|
return /* @__PURE__ */ e("div", { className: "nice-edge-manager__dialog-overlay", children: /* @__PURE__ */ i("div", { className: "nice-edge-manager__dialog", children: [
|
|
1278
1279
|
/* @__PURE__ */ i("div", { className: "nice-edge-manager__dialog-header", children: [
|
|
1279
|
-
/* @__PURE__ */ e("h3", { children:
|
|
1280
|
-
/* @__PURE__ */ e("button", { onClick: c, "aria-label":
|
|
1280
|
+
/* @__PURE__ */ e("h3", { children: l("edgeManager.deployModule", "Deploy Module") }),
|
|
1281
|
+
/* @__PURE__ */ e("button", { onClick: c, "aria-label": l("edgeManager.close", "Close"), children: /* @__PURE__ */ e(p, { name: "close", size: 14 }) })
|
|
1281
1282
|
] }),
|
|
1282
1283
|
/* @__PURE__ */ i("div", { className: "nice-edge-manager__dialog-content", children: [
|
|
1283
1284
|
/* @__PURE__ */ i("div", { className: "nice-edge-manager__field", children: [
|
|
1284
|
-
/* @__PURE__ */ e("label", { children: "Template (optional)" }),
|
|
1285
|
+
/* @__PURE__ */ e("label", { children: l("edgeManager.templateOptional", "Template (optional)") }),
|
|
1285
1286
|
/* @__PURE__ */ i(
|
|
1286
1287
|
"select",
|
|
1287
1288
|
{
|
|
1288
1289
|
value: "",
|
|
1289
|
-
onChange: (
|
|
1290
|
-
const s =
|
|
1291
|
-
s &&
|
|
1290
|
+
onChange: (t) => {
|
|
1291
|
+
const s = o.find((h) => h.image === t.target.value);
|
|
1292
|
+
s && r({
|
|
1292
1293
|
...a,
|
|
1293
1294
|
name: s.name,
|
|
1294
1295
|
image: s.image
|
|
1295
1296
|
});
|
|
1296
1297
|
},
|
|
1297
1298
|
children: [
|
|
1298
|
-
/* @__PURE__ */ e("option", { value: "", children:
|
|
1299
|
-
|
|
1299
|
+
/* @__PURE__ */ e("option", { value: "", children: l("edgeManager.selectATemplate", "Select a template...") }),
|
|
1300
|
+
o.map((t) => /* @__PURE__ */ e("option", { value: t.image, children: t.name }, t.image))
|
|
1300
1301
|
]
|
|
1301
1302
|
}
|
|
1302
1303
|
)
|
|
1303
1304
|
] }),
|
|
1304
1305
|
/* @__PURE__ */ i("div", { className: "nice-edge-manager__field", children: [
|
|
1305
|
-
/* @__PURE__ */ e("label", { children:
|
|
1306
|
+
/* @__PURE__ */ e("label", { children: l("edgeManager.moduleName", "Module Name") }),
|
|
1306
1307
|
/* @__PURE__ */ e(
|
|
1307
1308
|
"input",
|
|
1308
1309
|
{
|
|
1309
1310
|
type: "text",
|
|
1310
1311
|
value: a.name || "",
|
|
1311
|
-
onChange: (
|
|
1312
|
-
placeholder:
|
|
1312
|
+
onChange: (t) => r({ ...a, name: t.target.value }),
|
|
1313
|
+
placeholder: l("edgeManager.eGMyModule", "e.g., my-module")
|
|
1313
1314
|
}
|
|
1314
1315
|
)
|
|
1315
1316
|
] }),
|
|
1316
1317
|
/* @__PURE__ */ i("div", { className: "nice-edge-manager__field", children: [
|
|
1317
|
-
/* @__PURE__ */ e("label", { children:
|
|
1318
|
+
/* @__PURE__ */ e("label", { children: l("edgeManager.containerImage", "Container Image") }),
|
|
1318
1319
|
/* @__PURE__ */ e(
|
|
1319
1320
|
"input",
|
|
1320
1321
|
{
|
|
1321
1322
|
type: "text",
|
|
1322
1323
|
value: a.image || "",
|
|
1323
|
-
onChange: (
|
|
1324
|
-
placeholder:
|
|
1324
|
+
onChange: (t) => r({ ...a, image: t.target.value }),
|
|
1325
|
+
placeholder: l("edgeManager.eGNginxLatest", "e.g., nginx:latest")
|
|
1325
1326
|
}
|
|
1326
1327
|
)
|
|
1327
1328
|
] }),
|
|
1328
1329
|
/* @__PURE__ */ i("div", { className: "nice-edge-manager__field", children: [
|
|
1329
|
-
/* @__PURE__ */ e("label", { children:
|
|
1330
|
+
/* @__PURE__ */ e("label", { children: l("edgeManager.version", "Version") }),
|
|
1330
1331
|
/* @__PURE__ */ e(
|
|
1331
1332
|
"input",
|
|
1332
1333
|
{
|
|
1333
1334
|
type: "text",
|
|
1334
1335
|
value: a.version || "1.0.0",
|
|
1335
|
-
onChange: (
|
|
1336
|
+
onChange: (t) => r({ ...a, version: t.target.value })
|
|
1336
1337
|
}
|
|
1337
1338
|
)
|
|
1338
1339
|
] })
|
|
1339
1340
|
] }),
|
|
1340
1341
|
/* @__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:
|
|
1342
|
+
/* @__PURE__ */ e("button", { onClick: c, children: l("edgeManager.cancel", "Cancel") }),
|
|
1343
|
+
/* @__PURE__ */ e("button", { className: "nice-edge-manager__deploy-confirm", onClick: n, children: l("edgeManager.deploy", "Deploy") })
|
|
1343
1344
|
] })
|
|
1344
1345
|
] }) });
|
|
1345
1346
|
}
|
|
@@ -1372,21 +1373,21 @@ const F = {
|
|
|
1372
1373
|
};
|
|
1373
1374
|
function ye({
|
|
1374
1375
|
protocol: a = "mqtt",
|
|
1375
|
-
config:
|
|
1376
|
-
onSave:
|
|
1376
|
+
config: o,
|
|
1377
|
+
onSave: r,
|
|
1377
1378
|
onTest: n,
|
|
1378
1379
|
className: c = ""
|
|
1379
1380
|
}) {
|
|
1380
|
-
const { t } =
|
|
1381
|
-
(
|
|
1382
|
-
), [u,
|
|
1383
|
-
(
|
|
1384
|
-
), [N, k] =
|
|
1385
|
-
(
|
|
1386
|
-
), [
|
|
1387
|
-
(
|
|
1388
|
-
), [
|
|
1389
|
-
switch (
|
|
1381
|
+
const { t: l } = _(), [t, s] = M(a), [h, m] = M(
|
|
1382
|
+
(o == null ? void 0 : o.type) === "mqtt" ? { ...F, ...o.config } : F
|
|
1383
|
+
), [u, V] = M(
|
|
1384
|
+
(o == null ? void 0 : o.type) === "coap" ? { ...q, ...o.config } : q
|
|
1385
|
+
), [N, k] = M(
|
|
1386
|
+
(o == null ? void 0 : o.type) === "modbus" ? { ...W, ...o.config } : W
|
|
1387
|
+
), [g, w] = M(
|
|
1388
|
+
(o == null ? void 0 : o.type) === "opcua" ? { ...G, ...o.config } : G
|
|
1389
|
+
), [b, D] = M(null), [y, H] = M(!1), v = f(() => {
|
|
1390
|
+
switch (t) {
|
|
1390
1391
|
case "mqtt":
|
|
1391
1392
|
return h;
|
|
1392
1393
|
case "coap":
|
|
@@ -1395,60 +1396,60 @@ function ye({
|
|
|
1395
1396
|
case "modbus-rtu":
|
|
1396
1397
|
return N;
|
|
1397
1398
|
case "opcua":
|
|
1398
|
-
return
|
|
1399
|
+
return g;
|
|
1399
1400
|
default:
|
|
1400
1401
|
return h;
|
|
1401
1402
|
}
|
|
1402
|
-
}, [
|
|
1403
|
-
|
|
1404
|
-
}, [v,
|
|
1403
|
+
}, [t, h, u, N, g]), T = f(() => {
|
|
1404
|
+
r == null || r(v());
|
|
1405
|
+
}, [v, r]), P = f(async () => {
|
|
1405
1406
|
if (n) {
|
|
1406
|
-
|
|
1407
|
+
H(!0), D(null);
|
|
1407
1408
|
try {
|
|
1408
|
-
const
|
|
1409
|
-
|
|
1410
|
-
} catch (
|
|
1411
|
-
|
|
1409
|
+
const L = await n(v());
|
|
1410
|
+
D(L);
|
|
1411
|
+
} catch (L) {
|
|
1412
|
+
D({ success: !1, message: String(L) });
|
|
1412
1413
|
} finally {
|
|
1413
|
-
|
|
1414
|
+
H(!1);
|
|
1414
1415
|
}
|
|
1415
1416
|
}
|
|
1416
1417
|
}, [v, n]);
|
|
1417
1418
|
return /* @__PURE__ */ i("div", { className: `nice-protocol-config ${c}`, children: [
|
|
1418
1419
|
/* @__PURE__ */ i("header", { className: "nice-protocol-config__header", children: [
|
|
1419
|
-
/* @__PURE__ */ e("h2", { children:
|
|
1420
|
+
/* @__PURE__ */ e("h2", { children: l("protocolConfig.title", "Protocol Configuration") }),
|
|
1420
1421
|
/* @__PURE__ */ i("div", { className: "nice-protocol-config__protocol-selector", children: [
|
|
1421
|
-
/* @__PURE__ */ e("label", { children:
|
|
1422
|
-
/* @__PURE__ */ i("select", { value:
|
|
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:
|
|
1422
|
+
/* @__PURE__ */ e("label", { children: l("protocolConfig.protocol", "Protocol:") }),
|
|
1423
|
+
/* @__PURE__ */ i("select", { value: t, onChange: (L) => s(L.target.value), children: [
|
|
1424
|
+
/* @__PURE__ */ e("option", { value: "mqtt", children: l("protocolConfig.mqtt", "MQTT") }),
|
|
1425
|
+
/* @__PURE__ */ e("option", { value: "coap", children: l("protocolConfig.coap", "CoAP") }),
|
|
1426
|
+
/* @__PURE__ */ e("option", { value: "modbus-tcp", children: l("protocolConfig.modbusTcp", "Modbus TCP") }),
|
|
1427
|
+
/* @__PURE__ */ e("option", { value: "modbus-rtu", children: l("protocolConfig.modbusRtu", "Modbus RTU") }),
|
|
1428
|
+
/* @__PURE__ */ e("option", { value: "opcua", children: l("protocolConfig.opcUa", "OPC-UA") })
|
|
1428
1429
|
] })
|
|
1429
1430
|
] })
|
|
1430
1431
|
] }),
|
|
1431
1432
|
/* @__PURE__ */ i("div", { className: "nice-protocol-config__content", children: [
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
(
|
|
1435
|
-
|
|
1433
|
+
t === "mqtt" && /* @__PURE__ */ e(ve, { config: h, onChange: m }),
|
|
1434
|
+
t === "coap" && /* @__PURE__ */ e(ue, { config: u, onChange: V }),
|
|
1435
|
+
(t === "modbus-tcp" || t === "modbus-rtu") && /* @__PURE__ */ e(
|
|
1436
|
+
ge,
|
|
1436
1437
|
{
|
|
1437
1438
|
config: N,
|
|
1438
|
-
type:
|
|
1439
|
+
type: t === "modbus-rtu" ? "rtu" : "tcp",
|
|
1439
1440
|
onChange: k
|
|
1440
1441
|
}
|
|
1441
1442
|
),
|
|
1442
|
-
|
|
1443
|
+
t === "opcua" && /* @__PURE__ */ e(Me, { config: g, onChange: w })
|
|
1443
1444
|
] }),
|
|
1444
|
-
|
|
1445
|
+
b && /* @__PURE__ */ i(
|
|
1445
1446
|
"div",
|
|
1446
1447
|
{
|
|
1447
|
-
className: `nice-protocol-config__test-result nice-protocol-config__test-result--${
|
|
1448
|
+
className: `nice-protocol-config__test-result nice-protocol-config__test-result--${b.success ? "success" : "error"}`,
|
|
1448
1449
|
children: [
|
|
1449
|
-
/* @__PURE__ */ e(
|
|
1450
|
+
/* @__PURE__ */ e(p, { name: b.success ? "check" : "close", size: 14 }),
|
|
1450
1451
|
" ",
|
|
1451
|
-
|
|
1452
|
+
b.message
|
|
1452
1453
|
]
|
|
1453
1454
|
}
|
|
1454
1455
|
),
|
|
@@ -1459,57 +1460,57 @@ function ye({
|
|
|
1459
1460
|
className: "nice-protocol-config__test-btn",
|
|
1460
1461
|
onClick: P,
|
|
1461
1462
|
disabled: y || !n,
|
|
1462
|
-
children: y ?
|
|
1463
|
-
/* @__PURE__ */ e(
|
|
1463
|
+
children: y ? l("protocolConfig.testing", "Testing...") : /* @__PURE__ */ i(S, { children: [
|
|
1464
|
+
/* @__PURE__ */ e(p, { name: "plug", size: 14 }),
|
|
1464
1465
|
" ",
|
|
1465
|
-
|
|
1466
|
+
l("protocolConfig.testConnection", "Test Connection")
|
|
1466
1467
|
] })
|
|
1467
1468
|
}
|
|
1468
1469
|
),
|
|
1469
|
-
/* @__PURE__ */ i("button", { className: "nice-protocol-config__save-btn", onClick:
|
|
1470
|
-
/* @__PURE__ */ e(
|
|
1470
|
+
/* @__PURE__ */ i("button", { className: "nice-protocol-config__save-btn", onClick: T, children: [
|
|
1471
|
+
/* @__PURE__ */ e(p, { name: "save", size: 14 }),
|
|
1471
1472
|
" ",
|
|
1472
|
-
|
|
1473
|
+
l("save", "Save")
|
|
1473
1474
|
] })
|
|
1474
1475
|
] })
|
|
1475
1476
|
] });
|
|
1476
1477
|
}
|
|
1477
|
-
function ve({ config: a, onChange:
|
|
1478
|
-
const { t:
|
|
1478
|
+
function ve({ config: a, onChange: o }) {
|
|
1479
|
+
const { t: r } = _();
|
|
1479
1480
|
return /* @__PURE__ */ i("div", { className: "nice-protocol-config__section", children: [
|
|
1480
|
-
/* @__PURE__ */ e("h3", { children:
|
|
1481
|
+
/* @__PURE__ */ e("h3", { children: r("protocolConfig.mqttConfiguration", "MQTT Configuration") }),
|
|
1481
1482
|
/* @__PURE__ */ i("div", { className: "nice-protocol-config__grid", children: [
|
|
1482
1483
|
/* @__PURE__ */ i("div", { className: "nice-protocol-config__field", children: [
|
|
1483
|
-
/* @__PURE__ */ e("label", { children:
|
|
1484
|
+
/* @__PURE__ */ e("label", { children: r("protocolConfig.broker", "Broker") }),
|
|
1484
1485
|
/* @__PURE__ */ e(
|
|
1485
1486
|
"input",
|
|
1486
1487
|
{
|
|
1487
1488
|
type: "text",
|
|
1488
1489
|
value: a.broker,
|
|
1489
|
-
onChange: (n) =>
|
|
1490
|
+
onChange: (n) => o({ ...a, broker: n.target.value }),
|
|
1490
1491
|
placeholder: "localhost"
|
|
1491
1492
|
}
|
|
1492
1493
|
)
|
|
1493
1494
|
] }),
|
|
1494
1495
|
/* @__PURE__ */ i("div", { className: "nice-protocol-config__field", children: [
|
|
1495
|
-
/* @__PURE__ */ e("label", { children:
|
|
1496
|
+
/* @__PURE__ */ e("label", { children: r("protocolConfig.port", "Port") }),
|
|
1496
1497
|
/* @__PURE__ */ e(
|
|
1497
1498
|
"input",
|
|
1498
1499
|
{
|
|
1499
1500
|
type: "number",
|
|
1500
1501
|
value: a.port,
|
|
1501
|
-
onChange: (n) =>
|
|
1502
|
+
onChange: (n) => o({ ...a, port: parseInt(n.target.value, 10) || 1883 })
|
|
1502
1503
|
}
|
|
1503
1504
|
)
|
|
1504
1505
|
] }),
|
|
1505
1506
|
/* @__PURE__ */ i("div", { className: "nice-protocol-config__field", children: [
|
|
1506
|
-
/* @__PURE__ */ e("label", { children:
|
|
1507
|
+
/* @__PURE__ */ e("label", { children: r("protocolConfig.clientId", "Client ID") }),
|
|
1507
1508
|
/* @__PURE__ */ e(
|
|
1508
1509
|
"input",
|
|
1509
1510
|
{
|
|
1510
1511
|
type: "text",
|
|
1511
1512
|
value: a.clientId,
|
|
1512
|
-
onChange: (n) =>
|
|
1513
|
+
onChange: (n) => o({ ...a, clientId: n.target.value })
|
|
1513
1514
|
}
|
|
1514
1515
|
)
|
|
1515
1516
|
] }),
|
|
@@ -1519,41 +1520,41 @@ function ve({ config: a, onChange: r }) {
|
|
|
1519
1520
|
{
|
|
1520
1521
|
type: "checkbox",
|
|
1521
1522
|
checked: a.useTLS,
|
|
1522
|
-
onChange: (n) =>
|
|
1523
|
+
onChange: (n) => o({ ...a, useTLS: n.target.checked })
|
|
1523
1524
|
}
|
|
1524
1525
|
),
|
|
1525
|
-
|
|
1526
|
+
r("protocolConfig.useTls", "Use TLS")
|
|
1526
1527
|
] }) }),
|
|
1527
1528
|
/* @__PURE__ */ i("div", { className: "nice-protocol-config__field", children: [
|
|
1528
|
-
/* @__PURE__ */ e("label", { children:
|
|
1529
|
+
/* @__PURE__ */ e("label", { children: r("protocolConfig.username", "Username") }),
|
|
1529
1530
|
/* @__PURE__ */ e(
|
|
1530
1531
|
"input",
|
|
1531
1532
|
{
|
|
1532
1533
|
type: "text",
|
|
1533
1534
|
value: a.username || "",
|
|
1534
|
-
onChange: (n) =>
|
|
1535
|
+
onChange: (n) => o({ ...a, username: n.target.value })
|
|
1535
1536
|
}
|
|
1536
1537
|
)
|
|
1537
1538
|
] }),
|
|
1538
1539
|
/* @__PURE__ */ i("div", { className: "nice-protocol-config__field", children: [
|
|
1539
|
-
/* @__PURE__ */ e("label", { children:
|
|
1540
|
+
/* @__PURE__ */ e("label", { children: r("protocolConfig.password", "Password") }),
|
|
1540
1541
|
/* @__PURE__ */ e(
|
|
1541
1542
|
"input",
|
|
1542
1543
|
{
|
|
1543
1544
|
type: "password",
|
|
1544
1545
|
value: a.password || "",
|
|
1545
|
-
onChange: (n) =>
|
|
1546
|
+
onChange: (n) => o({ ...a, password: n.target.value })
|
|
1546
1547
|
}
|
|
1547
1548
|
)
|
|
1548
1549
|
] }),
|
|
1549
1550
|
/* @__PURE__ */ i("div", { className: "nice-protocol-config__field", children: [
|
|
1550
|
-
/* @__PURE__ */ e("label", { children:
|
|
1551
|
+
/* @__PURE__ */ e("label", { children: r("protocolConfig.keepAlive", "Keep Alive (seconds)") }),
|
|
1551
1552
|
/* @__PURE__ */ e(
|
|
1552
1553
|
"input",
|
|
1553
1554
|
{
|
|
1554
1555
|
type: "number",
|
|
1555
1556
|
value: a.keepAlive,
|
|
1556
|
-
onChange: (n) =>
|
|
1557
|
+
onChange: (n) => o({ ...a, keepAlive: parseInt(n.target.value, 10) || 60 })
|
|
1557
1558
|
}
|
|
1558
1559
|
)
|
|
1559
1560
|
] }),
|
|
@@ -1563,13 +1564,13 @@ function ve({ config: a, onChange: r }) {
|
|
|
1563
1564
|
{
|
|
1564
1565
|
type: "checkbox",
|
|
1565
1566
|
checked: a.cleanSession,
|
|
1566
|
-
onChange: (n) =>
|
|
1567
|
+
onChange: (n) => o({ ...a, cleanSession: n.target.checked })
|
|
1567
1568
|
}
|
|
1568
1569
|
),
|
|
1569
|
-
|
|
1570
|
+
r("protocolConfig.cleanSession", "Clean Session")
|
|
1570
1571
|
] }) })
|
|
1571
1572
|
] }),
|
|
1572
|
-
/* @__PURE__ */ e("h4", { children:
|
|
1573
|
+
/* @__PURE__ */ e("h4", { children: r("protocolConfig.topics", "Topics") }),
|
|
1573
1574
|
/* @__PURE__ */ i("div", { className: "nice-protocol-config__topics", children: [
|
|
1574
1575
|
a.topics.map((n, c) => /* @__PURE__ */ i("div", { className: "nice-protocol-config__topic-row", children: [
|
|
1575
1576
|
/* @__PURE__ */ e(
|
|
@@ -1577,25 +1578,25 @@ function ve({ config: a, onChange: r }) {
|
|
|
1577
1578
|
{
|
|
1578
1579
|
type: "text",
|
|
1579
1580
|
value: n.pattern,
|
|
1580
|
-
onChange: (
|
|
1581
|
-
const
|
|
1582
|
-
|
|
1581
|
+
onChange: (l) => {
|
|
1582
|
+
const t = [...a.topics];
|
|
1583
|
+
t[c] = { ...t[c], pattern: l.target.value }, o({ ...a, topics: t });
|
|
1583
1584
|
},
|
|
1584
|
-
placeholder:
|
|
1585
|
+
placeholder: r("protocolConfig.topicPatternPlaceholder", "e.g., sensors/+/data")
|
|
1585
1586
|
}
|
|
1586
1587
|
),
|
|
1587
1588
|
/* @__PURE__ */ i(
|
|
1588
1589
|
"select",
|
|
1589
1590
|
{
|
|
1590
1591
|
value: n.qos,
|
|
1591
|
-
onChange: (
|
|
1592
|
-
const
|
|
1593
|
-
|
|
1592
|
+
onChange: (l) => {
|
|
1593
|
+
const t = [...a.topics];
|
|
1594
|
+
t[c] = { ...t[c], qos: parseInt(l.target.value, 10) }, o({ ...a, topics: t });
|
|
1594
1595
|
},
|
|
1595
1596
|
children: [
|
|
1596
|
-
/* @__PURE__ */ e("option", { value: 0, children:
|
|
1597
|
-
/* @__PURE__ */ e("option", { value: 1, children:
|
|
1598
|
-
/* @__PURE__ */ e("option", { value: 2, children:
|
|
1597
|
+
/* @__PURE__ */ e("option", { value: 0, children: r("protocolConfig.qos0", "QoS 0") }),
|
|
1598
|
+
/* @__PURE__ */ e("option", { value: 1, children: r("protocolConfig.qos1", "QoS 1") }),
|
|
1599
|
+
/* @__PURE__ */ e("option", { value: 2, children: r("protocolConfig.qos2", "QoS 2") })
|
|
1599
1600
|
]
|
|
1600
1601
|
}
|
|
1601
1602
|
),
|
|
@@ -1603,29 +1604,29 @@ function ve({ config: a, onChange: r }) {
|
|
|
1603
1604
|
"select",
|
|
1604
1605
|
{
|
|
1605
1606
|
value: n.direction,
|
|
1606
|
-
onChange: (
|
|
1607
|
-
const
|
|
1608
|
-
|
|
1609
|
-
...
|
|
1610
|
-
direction:
|
|
1611
|
-
},
|
|
1607
|
+
onChange: (l) => {
|
|
1608
|
+
const t = [...a.topics];
|
|
1609
|
+
t[c] = {
|
|
1610
|
+
...t[c],
|
|
1611
|
+
direction: l.target.value
|
|
1612
|
+
}, o({ ...a, topics: t });
|
|
1612
1613
|
},
|
|
1613
1614
|
children: [
|
|
1614
|
-
/* @__PURE__ */ e("option", { value: "subscribe", children:
|
|
1615
|
-
/* @__PURE__ */ e("option", { value: "publish", children:
|
|
1616
|
-
/* @__PURE__ */ e("option", { value: "both", children:
|
|
1615
|
+
/* @__PURE__ */ e("option", { value: "subscribe", children: r("protocolConfig.subscribe", "Subscribe") }),
|
|
1616
|
+
/* @__PURE__ */ e("option", { value: "publish", children: r("protocolConfig.publish", "Publish") }),
|
|
1617
|
+
/* @__PURE__ */ e("option", { value: "both", children: r("protocolConfig.both", "Both") })
|
|
1617
1618
|
]
|
|
1618
1619
|
}
|
|
1619
1620
|
),
|
|
1620
1621
|
/* @__PURE__ */ e(
|
|
1621
1622
|
"button",
|
|
1622
1623
|
{
|
|
1623
|
-
"aria-label":
|
|
1624
|
+
"aria-label": r("protocolConfig.close", "Close"),
|
|
1624
1625
|
onClick: () => {
|
|
1625
|
-
const
|
|
1626
|
-
|
|
1626
|
+
const l = a.topics.filter((t, s) => s !== c);
|
|
1627
|
+
o({ ...a, topics: l });
|
|
1627
1628
|
},
|
|
1628
|
-
children: /* @__PURE__ */ e(
|
|
1629
|
+
children: /* @__PURE__ */ e(p, { name: "close", size: 14 })
|
|
1629
1630
|
}
|
|
1630
1631
|
)
|
|
1631
1632
|
] }, c)),
|
|
@@ -1633,7 +1634,7 @@ function ve({ config: a, onChange: r }) {
|
|
|
1633
1634
|
"button",
|
|
1634
1635
|
{
|
|
1635
1636
|
onClick: () => {
|
|
1636
|
-
|
|
1637
|
+
o({
|
|
1637
1638
|
...a,
|
|
1638
1639
|
topics: [
|
|
1639
1640
|
...a.topics,
|
|
@@ -1642,39 +1643,39 @@ function ve({ config: a, onChange: r }) {
|
|
|
1642
1643
|
});
|
|
1643
1644
|
},
|
|
1644
1645
|
children: [
|
|
1645
|
-
/* @__PURE__ */ e(
|
|
1646
|
+
/* @__PURE__ */ e(p, { name: "plus", size: 14 }),
|
|
1646
1647
|
" ",
|
|
1647
|
-
|
|
1648
|
+
r("protocolConfig.addTopic", "Add Topic")
|
|
1648
1649
|
]
|
|
1649
1650
|
}
|
|
1650
1651
|
)
|
|
1651
1652
|
] })
|
|
1652
1653
|
] });
|
|
1653
1654
|
}
|
|
1654
|
-
function ue({ config: a, onChange:
|
|
1655
|
-
const { t:
|
|
1655
|
+
function ue({ config: a, onChange: o }) {
|
|
1656
|
+
const { t: r } = _();
|
|
1656
1657
|
return /* @__PURE__ */ i("div", { className: "nice-protocol-config__section", children: [
|
|
1657
|
-
/* @__PURE__ */ e("h3", { children:
|
|
1658
|
+
/* @__PURE__ */ e("h3", { children: r("protocolConfig.coapConfiguration", "CoAP Configuration") }),
|
|
1658
1659
|
/* @__PURE__ */ i("div", { className: "nice-protocol-config__grid", children: [
|
|
1659
1660
|
/* @__PURE__ */ i("div", { className: "nice-protocol-config__field", children: [
|
|
1660
|
-
/* @__PURE__ */ e("label", { children:
|
|
1661
|
+
/* @__PURE__ */ e("label", { children: r("protocolConfig.host", "Host") }),
|
|
1661
1662
|
/* @__PURE__ */ e(
|
|
1662
1663
|
"input",
|
|
1663
1664
|
{
|
|
1664
1665
|
type: "text",
|
|
1665
1666
|
value: a.host,
|
|
1666
|
-
onChange: (n) =>
|
|
1667
|
+
onChange: (n) => o({ ...a, host: n.target.value })
|
|
1667
1668
|
}
|
|
1668
1669
|
)
|
|
1669
1670
|
] }),
|
|
1670
1671
|
/* @__PURE__ */ i("div", { className: "nice-protocol-config__field", children: [
|
|
1671
|
-
/* @__PURE__ */ e("label", { children:
|
|
1672
|
+
/* @__PURE__ */ e("label", { children: r("protocolConfig.port", "Port") }),
|
|
1672
1673
|
/* @__PURE__ */ e(
|
|
1673
1674
|
"input",
|
|
1674
1675
|
{
|
|
1675
1676
|
type: "number",
|
|
1676
1677
|
value: a.port,
|
|
1677
|
-
onChange: (n) =>
|
|
1678
|
+
onChange: (n) => o({ ...a, port: parseInt(n.target.value, 10) || 5683 })
|
|
1678
1679
|
}
|
|
1679
1680
|
)
|
|
1680
1681
|
] }),
|
|
@@ -1684,10 +1685,10 @@ function ue({ config: a, onChange: r }) {
|
|
|
1684
1685
|
{
|
|
1685
1686
|
type: "checkbox",
|
|
1686
1687
|
checked: a.useDTLS,
|
|
1687
|
-
onChange: (n) =>
|
|
1688
|
+
onChange: (n) => o({ ...a, useDTLS: n.target.checked })
|
|
1688
1689
|
}
|
|
1689
1690
|
),
|
|
1690
|
-
|
|
1691
|
+
r("protocolConfig.useDtls", "Use DTLS")
|
|
1691
1692
|
] }) }),
|
|
1692
1693
|
/* @__PURE__ */ e("div", { className: "nice-protocol-config__field", children: /* @__PURE__ */ i("label", { children: [
|
|
1693
1694
|
/* @__PURE__ */ e(
|
|
@@ -1695,13 +1696,13 @@ function ue({ config: a, onChange: r }) {
|
|
|
1695
1696
|
{
|
|
1696
1697
|
type: "checkbox",
|
|
1697
1698
|
checked: a.observe || !1,
|
|
1698
|
-
onChange: (n) =>
|
|
1699
|
+
onChange: (n) => o({ ...a, observe: n.target.checked })
|
|
1699
1700
|
}
|
|
1700
1701
|
),
|
|
1701
|
-
|
|
1702
|
+
r("protocolConfig.enableObserve", "Enable Observe")
|
|
1702
1703
|
] }) })
|
|
1703
1704
|
] }),
|
|
1704
|
-
/* @__PURE__ */ e("h4", { children:
|
|
1705
|
+
/* @__PURE__ */ e("h4", { children: r("protocolConfig.resources", "Resources") }),
|
|
1705
1706
|
/* @__PURE__ */ i("div", { className: "nice-protocol-config__resources", children: [
|
|
1706
1707
|
a.resources.map((n, c) => /* @__PURE__ */ i("div", { className: "nice-protocol-config__resource-row", children: [
|
|
1707
1708
|
/* @__PURE__ */ e(
|
|
@@ -1709,9 +1710,9 @@ function ue({ config: a, onChange: r }) {
|
|
|
1709
1710
|
{
|
|
1710
1711
|
type: "text",
|
|
1711
1712
|
value: n.path,
|
|
1712
|
-
onChange: (
|
|
1713
|
-
const
|
|
1714
|
-
|
|
1713
|
+
onChange: (l) => {
|
|
1714
|
+
const t = [...a.resources];
|
|
1715
|
+
t[c] = { ...t[c], path: l.target.value }, o({ ...a, resources: t });
|
|
1715
1716
|
},
|
|
1716
1717
|
placeholder: "/sensors/temperature"
|
|
1717
1718
|
}
|
|
@@ -1719,12 +1720,12 @@ function ue({ config: a, onChange: r }) {
|
|
|
1719
1720
|
/* @__PURE__ */ e(
|
|
1720
1721
|
"button",
|
|
1721
1722
|
{
|
|
1722
|
-
"aria-label":
|
|
1723
|
+
"aria-label": r("protocolConfig.close", "Close"),
|
|
1723
1724
|
onClick: () => {
|
|
1724
|
-
const
|
|
1725
|
-
|
|
1725
|
+
const l = a.resources.filter((t, s) => s !== c);
|
|
1726
|
+
o({ ...a, resources: l });
|
|
1726
1727
|
},
|
|
1727
|
-
children: /* @__PURE__ */ e(
|
|
1728
|
+
children: /* @__PURE__ */ e(p, { name: "close", size: 14 })
|
|
1728
1729
|
}
|
|
1729
1730
|
)
|
|
1730
1731
|
] }, c)),
|
|
@@ -1732,7 +1733,7 @@ function ue({ config: a, onChange: r }) {
|
|
|
1732
1733
|
"button",
|
|
1733
1734
|
{
|
|
1734
1735
|
onClick: () => {
|
|
1735
|
-
|
|
1736
|
+
o({
|
|
1736
1737
|
...a,
|
|
1737
1738
|
resources: [
|
|
1738
1739
|
...a.resources,
|
|
@@ -1741,28 +1742,28 @@ function ue({ config: a, onChange: r }) {
|
|
|
1741
1742
|
});
|
|
1742
1743
|
},
|
|
1743
1744
|
children: [
|
|
1744
|
-
/* @__PURE__ */ e(
|
|
1745
|
+
/* @__PURE__ */ e(p, { name: "plus", size: 14 }),
|
|
1745
1746
|
" ",
|
|
1746
|
-
|
|
1747
|
+
r("protocolConfig.addResource", "Add Resource")
|
|
1747
1748
|
]
|
|
1748
1749
|
}
|
|
1749
1750
|
)
|
|
1750
1751
|
] })
|
|
1751
1752
|
] });
|
|
1752
1753
|
}
|
|
1753
|
-
function
|
|
1754
|
+
function ge({
|
|
1754
1755
|
config: a,
|
|
1755
|
-
type:
|
|
1756
|
-
onChange:
|
|
1756
|
+
type: o,
|
|
1757
|
+
onChange: r
|
|
1757
1758
|
}) {
|
|
1758
|
-
const { t: n } =
|
|
1759
|
+
const { t: n } = _();
|
|
1759
1760
|
return /* @__PURE__ */ i("div", { className: "nice-protocol-config__section", children: [
|
|
1760
1761
|
/* @__PURE__ */ e("h3", { children: n("protocolConfig.modbusConfiguration", "Modbus {type} Configuration").replace(
|
|
1761
1762
|
"{type}",
|
|
1762
|
-
String(
|
|
1763
|
+
String(o.toUpperCase())
|
|
1763
1764
|
) }),
|
|
1764
1765
|
/* @__PURE__ */ i("div", { className: "nice-protocol-config__grid", children: [
|
|
1765
|
-
|
|
1766
|
+
o === "tcp" && /* @__PURE__ */ i(S, { children: [
|
|
1766
1767
|
/* @__PURE__ */ i("div", { className: "nice-protocol-config__field", children: [
|
|
1767
1768
|
/* @__PURE__ */ e("label", { children: n("protocolConfig.host", "Host") }),
|
|
1768
1769
|
/* @__PURE__ */ e(
|
|
@@ -1770,7 +1771,7 @@ function Me({
|
|
|
1770
1771
|
{
|
|
1771
1772
|
type: "text",
|
|
1772
1773
|
value: a.host || "",
|
|
1773
|
-
onChange: (c) =>
|
|
1774
|
+
onChange: (c) => r({ ...a, host: c.target.value })
|
|
1774
1775
|
}
|
|
1775
1776
|
)
|
|
1776
1777
|
] }),
|
|
@@ -1781,12 +1782,12 @@ function Me({
|
|
|
1781
1782
|
{
|
|
1782
1783
|
type: "number",
|
|
1783
1784
|
value: a.port || 502,
|
|
1784
|
-
onChange: (c) =>
|
|
1785
|
+
onChange: (c) => r({ ...a, port: parseInt(c.target.value, 10) || 502 })
|
|
1785
1786
|
}
|
|
1786
1787
|
)
|
|
1787
1788
|
] })
|
|
1788
1789
|
] }),
|
|
1789
|
-
|
|
1790
|
+
o === "rtu" && /* @__PURE__ */ i(S, { children: [
|
|
1790
1791
|
/* @__PURE__ */ i("div", { className: "nice-protocol-config__field", children: [
|
|
1791
1792
|
/* @__PURE__ */ e("label", { children: n("protocolConfig.serialPort", "Serial Port") }),
|
|
1792
1793
|
/* @__PURE__ */ e(
|
|
@@ -1794,7 +1795,7 @@ function Me({
|
|
|
1794
1795
|
{
|
|
1795
1796
|
type: "text",
|
|
1796
1797
|
value: a.serialPort || "",
|
|
1797
|
-
onChange: (c) =>
|
|
1798
|
+
onChange: (c) => r({ ...a, serialPort: c.target.value }),
|
|
1798
1799
|
placeholder: n("protocolConfig.serialPortPlaceholder", "COM1 or /dev/ttyUSB0")
|
|
1799
1800
|
}
|
|
1800
1801
|
)
|
|
@@ -1805,7 +1806,7 @@ function Me({
|
|
|
1805
1806
|
"select",
|
|
1806
1807
|
{
|
|
1807
1808
|
value: a.baudRate || 9600,
|
|
1808
|
-
onChange: (c) =>
|
|
1809
|
+
onChange: (c) => r({ ...a, baudRate: parseInt(c.target.value, 10) }),
|
|
1809
1810
|
children: [
|
|
1810
1811
|
/* @__PURE__ */ e("option", { value: 9600, children: "9600" }),
|
|
1811
1812
|
/* @__PURE__ */ e("option", { value: 19200, children: "19200" }),
|
|
@@ -1822,7 +1823,7 @@ function Me({
|
|
|
1822
1823
|
"select",
|
|
1823
1824
|
{
|
|
1824
1825
|
value: a.parity || "none",
|
|
1825
|
-
onChange: (c) =>
|
|
1826
|
+
onChange: (c) => r({ ...a, parity: c.target.value }),
|
|
1826
1827
|
children: [
|
|
1827
1828
|
/* @__PURE__ */ e("option", { value: "none", children: n("protocolConfig.none", "None") }),
|
|
1828
1829
|
/* @__PURE__ */ e("option", { value: "even", children: n("protocolConfig.even", "Even") }),
|
|
@@ -1839,7 +1840,7 @@ function Me({
|
|
|
1839
1840
|
{
|
|
1840
1841
|
type: "number",
|
|
1841
1842
|
value: a.slaveId,
|
|
1842
|
-
onChange: (c) =>
|
|
1843
|
+
onChange: (c) => r({ ...a, slaveId: parseInt(c.target.value, 10) || 1 }),
|
|
1843
1844
|
min: 1,
|
|
1844
1845
|
max: 247
|
|
1845
1846
|
}
|
|
@@ -1852,7 +1853,7 @@ function Me({
|
|
|
1852
1853
|
{
|
|
1853
1854
|
type: "number",
|
|
1854
1855
|
value: a.timeout,
|
|
1855
|
-
onChange: (c) =>
|
|
1856
|
+
onChange: (c) => r({ ...a, timeout: parseInt(c.target.value, 10) || 1e3 })
|
|
1856
1857
|
}
|
|
1857
1858
|
)
|
|
1858
1859
|
] })
|
|
@@ -1867,15 +1868,15 @@ function Me({
|
|
|
1867
1868
|
/* @__PURE__ */ e("th", { children: n("protocolConfig.readWrite", "R/W") }),
|
|
1868
1869
|
/* @__PURE__ */ e("th", {})
|
|
1869
1870
|
] }) }),
|
|
1870
|
-
/* @__PURE__ */ e("tbody", { children: a.registers.map((c,
|
|
1871
|
+
/* @__PURE__ */ e("tbody", { children: a.registers.map((c, l) => /* @__PURE__ */ i("tr", { children: [
|
|
1871
1872
|
/* @__PURE__ */ e("td", { children: /* @__PURE__ */ e(
|
|
1872
1873
|
"input",
|
|
1873
1874
|
{
|
|
1874
1875
|
type: "text",
|
|
1875
1876
|
value: c.name,
|
|
1876
|
-
onChange: (
|
|
1877
|
+
onChange: (t) => {
|
|
1877
1878
|
const s = [...a.registers];
|
|
1878
|
-
s[
|
|
1879
|
+
s[l] = { ...s[l], name: t.target.value }, r({ ...a, registers: s });
|
|
1879
1880
|
}
|
|
1880
1881
|
}
|
|
1881
1882
|
) }),
|
|
@@ -1884,12 +1885,12 @@ function Me({
|
|
|
1884
1885
|
{
|
|
1885
1886
|
type: "number",
|
|
1886
1887
|
value: c.address,
|
|
1887
|
-
onChange: (
|
|
1888
|
+
onChange: (t) => {
|
|
1888
1889
|
const s = [...a.registers];
|
|
1889
|
-
s[
|
|
1890
|
-
...s[
|
|
1891
|
-
address: parseInt(
|
|
1892
|
-
},
|
|
1890
|
+
s[l] = {
|
|
1891
|
+
...s[l],
|
|
1892
|
+
address: parseInt(t.target.value, 10) || 0
|
|
1893
|
+
}, r({ ...a, registers: s });
|
|
1893
1894
|
}
|
|
1894
1895
|
}
|
|
1895
1896
|
) }),
|
|
@@ -1897,12 +1898,12 @@ function Me({
|
|
|
1897
1898
|
"select",
|
|
1898
1899
|
{
|
|
1899
1900
|
value: c.type,
|
|
1900
|
-
onChange: (
|
|
1901
|
+
onChange: (t) => {
|
|
1901
1902
|
const s = [...a.registers];
|
|
1902
|
-
s[
|
|
1903
|
-
...s[
|
|
1904
|
-
type:
|
|
1905
|
-
},
|
|
1903
|
+
s[l] = {
|
|
1904
|
+
...s[l],
|
|
1905
|
+
type: t.target.value
|
|
1906
|
+
}, r({ ...a, registers: s });
|
|
1906
1907
|
},
|
|
1907
1908
|
children: [
|
|
1908
1909
|
/* @__PURE__ */ e("option", { value: "coil", children: n("protocolConfig.coil", "Coil") }),
|
|
@@ -1916,12 +1917,12 @@ function Me({
|
|
|
1916
1917
|
"select",
|
|
1917
1918
|
{
|
|
1918
1919
|
value: c.dataType,
|
|
1919
|
-
onChange: (
|
|
1920
|
+
onChange: (t) => {
|
|
1920
1921
|
const s = [...a.registers];
|
|
1921
|
-
s[
|
|
1922
|
-
...s[
|
|
1923
|
-
dataType:
|
|
1924
|
-
},
|
|
1922
|
+
s[l] = {
|
|
1923
|
+
...s[l],
|
|
1924
|
+
dataType: t.target.value
|
|
1925
|
+
}, r({ ...a, registers: s });
|
|
1925
1926
|
},
|
|
1926
1927
|
children: [
|
|
1927
1928
|
/* @__PURE__ */ e("option", { value: "bool", children: n("protocolConfig.bool", "Bool") }),
|
|
@@ -1939,9 +1940,9 @@ function Me({
|
|
|
1939
1940
|
{
|
|
1940
1941
|
type: "checkbox",
|
|
1941
1942
|
checked: c.readable,
|
|
1942
|
-
onChange: (
|
|
1943
|
+
onChange: (t) => {
|
|
1943
1944
|
const s = [...a.registers];
|
|
1944
|
-
s[
|
|
1945
|
+
s[l] = { ...s[l], readable: t.target.checked }, r({ ...a, registers: s });
|
|
1945
1946
|
},
|
|
1946
1947
|
title: n("protocolConfig.readable", "Readable")
|
|
1947
1948
|
}
|
|
@@ -1951,9 +1952,9 @@ function Me({
|
|
|
1951
1952
|
{
|
|
1952
1953
|
type: "checkbox",
|
|
1953
1954
|
checked: c.writable,
|
|
1954
|
-
onChange: (
|
|
1955
|
+
onChange: (t) => {
|
|
1955
1956
|
const s = [...a.registers];
|
|
1956
|
-
s[
|
|
1957
|
+
s[l] = { ...s[l], writable: t.target.checked }, r({ ...a, registers: s });
|
|
1957
1958
|
},
|
|
1958
1959
|
title: n("protocolConfig.writable", "Writable")
|
|
1959
1960
|
}
|
|
@@ -1964,19 +1965,19 @@ function Me({
|
|
|
1964
1965
|
{
|
|
1965
1966
|
"aria-label": n("protocolConfig.close", "Close"),
|
|
1966
1967
|
onClick: () => {
|
|
1967
|
-
const
|
|
1968
|
-
|
|
1968
|
+
const t = a.registers.filter((s, h) => h !== l);
|
|
1969
|
+
r({ ...a, registers: t });
|
|
1969
1970
|
},
|
|
1970
|
-
children: /* @__PURE__ */ e(
|
|
1971
|
+
children: /* @__PURE__ */ e(p, { name: "close", size: 14 })
|
|
1971
1972
|
}
|
|
1972
1973
|
) })
|
|
1973
|
-
] },
|
|
1974
|
+
] }, l)) })
|
|
1974
1975
|
] }),
|
|
1975
1976
|
/* @__PURE__ */ i(
|
|
1976
1977
|
"button",
|
|
1977
1978
|
{
|
|
1978
1979
|
onClick: () => {
|
|
1979
|
-
|
|
1980
|
+
r({
|
|
1980
1981
|
...a,
|
|
1981
1982
|
registers: [
|
|
1982
1983
|
...a.registers,
|
|
@@ -1992,7 +1993,7 @@ function Me({
|
|
|
1992
1993
|
});
|
|
1993
1994
|
},
|
|
1994
1995
|
children: [
|
|
1995
|
-
/* @__PURE__ */ e(
|
|
1996
|
+
/* @__PURE__ */ e(p, { name: "plus", size: 14 }),
|
|
1996
1997
|
" ",
|
|
1997
1998
|
n("protocolConfig.addRegister", "Add Register")
|
|
1998
1999
|
]
|
|
@@ -2000,96 +2001,96 @@ function Me({
|
|
|
2000
2001
|
)
|
|
2001
2002
|
] });
|
|
2002
2003
|
}
|
|
2003
|
-
function
|
|
2004
|
-
const { t:
|
|
2004
|
+
function Me({ config: a, onChange: o }) {
|
|
2005
|
+
const { t: r } = _();
|
|
2005
2006
|
return /* @__PURE__ */ i("div", { className: "nice-protocol-config__section", children: [
|
|
2006
|
-
/* @__PURE__ */ e("h3", { children:
|
|
2007
|
+
/* @__PURE__ */ e("h3", { children: r("protocolConfig.opcUaConfiguration", "OPC-UA Configuration") }),
|
|
2007
2008
|
/* @__PURE__ */ i("div", { className: "nice-protocol-config__grid", children: [
|
|
2008
2009
|
/* @__PURE__ */ i("div", { className: "nice-protocol-config__field nice-protocol-config__field--full", children: [
|
|
2009
|
-
/* @__PURE__ */ e("label", { children:
|
|
2010
|
+
/* @__PURE__ */ e("label", { children: r("protocolConfig.endpointUrl", "Endpoint URL") }),
|
|
2010
2011
|
/* @__PURE__ */ e(
|
|
2011
2012
|
"input",
|
|
2012
2013
|
{
|
|
2013
2014
|
type: "text",
|
|
2014
2015
|
value: a.endpointUrl,
|
|
2015
|
-
onChange: (n) =>
|
|
2016
|
-
placeholder:
|
|
2016
|
+
onChange: (n) => o({ ...a, endpointUrl: n.target.value }),
|
|
2017
|
+
placeholder: r("protocolConfig.endpointUrlPlaceholder", "opc.tcp://localhost:4840")
|
|
2017
2018
|
}
|
|
2018
2019
|
)
|
|
2019
2020
|
] }),
|
|
2020
2021
|
/* @__PURE__ */ i("div", { className: "nice-protocol-config__field", children: [
|
|
2021
|
-
/* @__PURE__ */ e("label", { children:
|
|
2022
|
+
/* @__PURE__ */ e("label", { children: r("protocolConfig.securityMode", "Security Mode") }),
|
|
2022
2023
|
/* @__PURE__ */ i(
|
|
2023
2024
|
"select",
|
|
2024
2025
|
{
|
|
2025
2026
|
value: a.securityMode,
|
|
2026
|
-
onChange: (n) =>
|
|
2027
|
+
onChange: (n) => o({
|
|
2027
2028
|
...a,
|
|
2028
2029
|
securityMode: n.target.value
|
|
2029
2030
|
}),
|
|
2030
2031
|
children: [
|
|
2031
|
-
/* @__PURE__ */ e("option", { value: "None", children:
|
|
2032
|
-
/* @__PURE__ */ e("option", { value: "Sign", children:
|
|
2033
|
-
/* @__PURE__ */ e("option", { value: "SignAndEncrypt", children:
|
|
2032
|
+
/* @__PURE__ */ e("option", { value: "None", children: r("protocolConfig.securityNone", "None") }),
|
|
2033
|
+
/* @__PURE__ */ e("option", { value: "Sign", children: r("protocolConfig.sign", "Sign") }),
|
|
2034
|
+
/* @__PURE__ */ e("option", { value: "SignAndEncrypt", children: r("protocolConfig.signAndEncrypt", "Sign and Encrypt") })
|
|
2034
2035
|
]
|
|
2035
2036
|
}
|
|
2036
2037
|
)
|
|
2037
2038
|
] }),
|
|
2038
2039
|
/* @__PURE__ */ i("div", { className: "nice-protocol-config__field", children: [
|
|
2039
|
-
/* @__PURE__ */ e("label", { children:
|
|
2040
|
+
/* @__PURE__ */ e("label", { children: r("protocolConfig.authentication", "Authentication") }),
|
|
2040
2041
|
/* @__PURE__ */ i(
|
|
2041
2042
|
"select",
|
|
2042
2043
|
{
|
|
2043
2044
|
value: a.authentication,
|
|
2044
|
-
onChange: (n) =>
|
|
2045
|
+
onChange: (n) => o({
|
|
2045
2046
|
...a,
|
|
2046
2047
|
authentication: n.target.value
|
|
2047
2048
|
}),
|
|
2048
2049
|
children: [
|
|
2049
|
-
/* @__PURE__ */ e("option", { value: "anonymous", children:
|
|
2050
|
-
/* @__PURE__ */ e("option", { value: "username", children:
|
|
2051
|
-
/* @__PURE__ */ e("option", { value: "certificate", children:
|
|
2050
|
+
/* @__PURE__ */ e("option", { value: "anonymous", children: r("protocolConfig.anonymous", "Anonymous") }),
|
|
2051
|
+
/* @__PURE__ */ e("option", { value: "username", children: r("protocolConfig.usernamePassword", "Username/Password") }),
|
|
2052
|
+
/* @__PURE__ */ e("option", { value: "certificate", children: r("protocolConfig.certificate", "Certificate") })
|
|
2052
2053
|
]
|
|
2053
2054
|
}
|
|
2054
2055
|
)
|
|
2055
2056
|
] }),
|
|
2056
|
-
a.authentication === "username" && /* @__PURE__ */ i(
|
|
2057
|
+
a.authentication === "username" && /* @__PURE__ */ i(S, { children: [
|
|
2057
2058
|
/* @__PURE__ */ i("div", { className: "nice-protocol-config__field", children: [
|
|
2058
|
-
/* @__PURE__ */ e("label", { children:
|
|
2059
|
+
/* @__PURE__ */ e("label", { children: r("protocolConfig.username", "Username") }),
|
|
2059
2060
|
/* @__PURE__ */ e(
|
|
2060
2061
|
"input",
|
|
2061
2062
|
{
|
|
2062
2063
|
type: "text",
|
|
2063
2064
|
value: a.username || "",
|
|
2064
|
-
onChange: (n) =>
|
|
2065
|
+
onChange: (n) => o({ ...a, username: n.target.value })
|
|
2065
2066
|
}
|
|
2066
2067
|
)
|
|
2067
2068
|
] }),
|
|
2068
2069
|
/* @__PURE__ */ i("div", { className: "nice-protocol-config__field", children: [
|
|
2069
|
-
/* @__PURE__ */ e("label", { children:
|
|
2070
|
+
/* @__PURE__ */ e("label", { children: r("protocolConfig.password", "Password") }),
|
|
2070
2071
|
/* @__PURE__ */ e(
|
|
2071
2072
|
"input",
|
|
2072
2073
|
{
|
|
2073
2074
|
type: "password",
|
|
2074
2075
|
value: a.password || "",
|
|
2075
|
-
onChange: (n) =>
|
|
2076
|
+
onChange: (n) => o({ ...a, password: n.target.value })
|
|
2076
2077
|
}
|
|
2077
2078
|
)
|
|
2078
2079
|
] })
|
|
2079
2080
|
] }),
|
|
2080
2081
|
/* @__PURE__ */ i("div", { className: "nice-protocol-config__field nice-protocol-config__field--full", children: [
|
|
2081
|
-
/* @__PURE__ */ e("label", { children:
|
|
2082
|
+
/* @__PURE__ */ e("label", { children: r("protocolConfig.applicationName", "Application Name") }),
|
|
2082
2083
|
/* @__PURE__ */ e(
|
|
2083
2084
|
"input",
|
|
2084
2085
|
{
|
|
2085
2086
|
type: "text",
|
|
2086
2087
|
value: a.applicationName,
|
|
2087
|
-
onChange: (n) =>
|
|
2088
|
+
onChange: (n) => o({ ...a, applicationName: n.target.value })
|
|
2088
2089
|
}
|
|
2089
2090
|
)
|
|
2090
2091
|
] })
|
|
2091
2092
|
] }),
|
|
2092
|
-
/* @__PURE__ */ e("h4", { children:
|
|
2093
|
+
/* @__PURE__ */ e("h4", { children: r("protocolConfig.nodes", "Nodes") }),
|
|
2093
2094
|
/* @__PURE__ */ i("div", { className: "nice-protocol-config__nodes", children: [
|
|
2094
2095
|
a.nodes.map((n, c) => /* @__PURE__ */ i("div", { className: "nice-protocol-config__node-row", children: [
|
|
2095
2096
|
/* @__PURE__ */ e(
|
|
@@ -2097,11 +2098,11 @@ function ge({ config: a, onChange: r }) {
|
|
|
2097
2098
|
{
|
|
2098
2099
|
type: "text",
|
|
2099
2100
|
value: n.nodeId,
|
|
2100
|
-
onChange: (
|
|
2101
|
-
const
|
|
2102
|
-
|
|
2101
|
+
onChange: (l) => {
|
|
2102
|
+
const t = [...a.nodes];
|
|
2103
|
+
t[c] = { ...t[c], nodeId: l.target.value }, o({ ...a, nodes: t });
|
|
2103
2104
|
},
|
|
2104
|
-
placeholder:
|
|
2105
|
+
placeholder: r("protocolConfig.nodeIdPlaceholder", "ns=2;s=Temperature")
|
|
2105
2106
|
}
|
|
2106
2107
|
),
|
|
2107
2108
|
/* @__PURE__ */ e(
|
|
@@ -2109,22 +2110,22 @@ function ge({ config: a, onChange: r }) {
|
|
|
2109
2110
|
{
|
|
2110
2111
|
type: "text",
|
|
2111
2112
|
value: n.displayName,
|
|
2112
|
-
onChange: (
|
|
2113
|
-
const
|
|
2114
|
-
|
|
2113
|
+
onChange: (l) => {
|
|
2114
|
+
const t = [...a.nodes];
|
|
2115
|
+
t[c] = { ...t[c], displayName: l.target.value }, o({ ...a, nodes: t });
|
|
2115
2116
|
},
|
|
2116
|
-
placeholder:
|
|
2117
|
+
placeholder: r("protocolConfig.displayNamePlaceholder", "Display Name")
|
|
2117
2118
|
}
|
|
2118
2119
|
),
|
|
2119
2120
|
/* @__PURE__ */ e(
|
|
2120
2121
|
"button",
|
|
2121
2122
|
{
|
|
2122
|
-
"aria-label":
|
|
2123
|
+
"aria-label": r("protocolConfig.close", "Close"),
|
|
2123
2124
|
onClick: () => {
|
|
2124
|
-
const
|
|
2125
|
-
|
|
2125
|
+
const l = a.nodes.filter((t, s) => s !== c);
|
|
2126
|
+
o({ ...a, nodes: l });
|
|
2126
2127
|
},
|
|
2127
|
-
children: /* @__PURE__ */ e(
|
|
2128
|
+
children: /* @__PURE__ */ e(p, { name: "close", size: 14 })
|
|
2128
2129
|
}
|
|
2129
2130
|
)
|
|
2130
2131
|
] }, c)),
|
|
@@ -2132,7 +2133,7 @@ function ge({ config: a, onChange: r }) {
|
|
|
2132
2133
|
"button",
|
|
2133
2134
|
{
|
|
2134
2135
|
onClick: () => {
|
|
2135
|
-
|
|
2136
|
+
o({
|
|
2136
2137
|
...a,
|
|
2137
2138
|
nodes: [
|
|
2138
2139
|
...a.nodes,
|
|
@@ -2141,9 +2142,9 @@ function ge({ config: a, onChange: r }) {
|
|
|
2141
2142
|
});
|
|
2142
2143
|
},
|
|
2143
2144
|
children: [
|
|
2144
|
-
/* @__PURE__ */ e(
|
|
2145
|
+
/* @__PURE__ */ e(p, { name: "plus", size: 14 }),
|
|
2145
2146
|
" ",
|
|
2146
|
-
|
|
2147
|
+
r("protocolConfig.addNode", "Add Node")
|
|
2147
2148
|
]
|
|
2148
2149
|
}
|
|
2149
2150
|
)
|