@davra/ui-core 1.0.1 → 1.0.3
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/ui-core.es.js +180 -180
- package/package.json +1 -1
package/dist/ui-core.es.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { getCurrentInstance as be, ref as b, watch as J, computed as
|
1
|
+
import { getCurrentInstance as be, ref as b, watch as J, computed as T, defineComponent as L, onMounted as ue, resolveComponent as p, openBlock as A, createBlock as C, withCtx as i, createVNode as d, unref as u, isRef as R, readonly as q, createTextVNode as E, toDisplayString as B, createCommentVNode as P, mergeProps as F, withDirectives as he, vShow as ge, createElementVNode as de, createElementBlock as pe, Fragment as Ae, renderList as Ee, renderSlot as z, inject as Ce, normalizeProps as Ie, guardReactiveProps as Te, useCssVars as Se, normalizeClass as Ue } from "vue";
|
2
2
|
import De from "axios";
|
3
3
|
import { defineStore as N, storeToRefs as K } from "pinia";
|
4
4
|
const ee = {
|
@@ -35,14 +35,14 @@ const ee = {
|
|
35
35
|
return [];
|
36
36
|
}
|
37
37
|
}, $e = async (e, t) => {
|
38
|
-
const
|
39
|
-
Object.entries(
|
40
|
-
t && t.includes(l) && delete
|
38
|
+
const s = { ...e };
|
39
|
+
Object.entries(s).forEach(([l, n]) => {
|
40
|
+
t && t.includes(l) && delete s[l], (!n || /[^a-zA-Z_0-9\-+]/g.test(n)) && delete s[l];
|
41
41
|
});
|
42
42
|
try {
|
43
43
|
return await f().post(
|
44
44
|
"/api/v1/tags",
|
45
|
-
|
45
|
+
s,
|
46
46
|
{
|
47
47
|
headers: {
|
48
48
|
Accept: "application/json"
|
@@ -56,11 +56,11 @@ const ee = {
|
|
56
56
|
getLabels: ke,
|
57
57
|
createLabel: $e,
|
58
58
|
getValuesByKey: Ve
|
59
|
-
}, Re = async (e = 0, t = 1e3,
|
59
|
+
}, Re = async (e = 0, t = 1e3, s, l) => {
|
60
60
|
const n = [];
|
61
|
-
n.push(`start=${e || 0}`), t && n.push(`limit=${t}`),
|
61
|
+
n.push(`start=${e || 0}`), t && n.push(`limit=${t}`), s && n.push(`sort=${s}`), l && n.push(l);
|
62
62
|
try {
|
63
|
-
const { data: r, headers:
|
63
|
+
const { data: r, headers: o } = await f().get(
|
64
64
|
`/api/v1/twins?${n.join("&")}`,
|
65
65
|
{
|
66
66
|
headers: {
|
@@ -68,13 +68,13 @@ const ee = {
|
|
68
68
|
}
|
69
69
|
}
|
70
70
|
);
|
71
|
-
return { totalRecords: parseInt(
|
71
|
+
return { totalRecords: parseInt(o["com-davra-total-results"]), records: r };
|
72
72
|
} catch {
|
73
73
|
throw new Error("Twins API Error");
|
74
74
|
}
|
75
|
-
},
|
75
|
+
}, Oe = async (e) => {
|
76
76
|
try {
|
77
|
-
const { data: t, headers:
|
77
|
+
const { data: t, headers: s } = await f().post(
|
78
78
|
"/api/v1/twins/query",
|
79
79
|
e,
|
80
80
|
{
|
@@ -83,13 +83,13 @@ const ee = {
|
|
83
83
|
}
|
84
84
|
}
|
85
85
|
);
|
86
|
-
return { totalRecords: parseInt(
|
86
|
+
return { totalRecords: parseInt(s["com-davra-total-results"]), records: t };
|
87
87
|
} catch {
|
88
88
|
throw new Error("Twins API Error");
|
89
89
|
}
|
90
|
-
},
|
90
|
+
}, je = async (e) => {
|
91
91
|
try {
|
92
|
-
const { data: t, headers:
|
92
|
+
const { data: t, headers: s } = await f().get(
|
93
93
|
`/api/v1/twins?arrayUUIDs=${e.join(",")}`,
|
94
94
|
{
|
95
95
|
headers: {
|
@@ -97,15 +97,15 @@ const ee = {
|
|
97
97
|
}
|
98
98
|
}
|
99
99
|
);
|
100
|
-
return { totalRecords: parseInt(
|
100
|
+
return { totalRecords: parseInt(s["com-davra-total-results"]), records: t };
|
101
101
|
} catch {
|
102
102
|
throw new Error("Twins API Error");
|
103
103
|
}
|
104
|
-
}, Me = async (e, t = 0,
|
105
|
-
const r = [`digitalTwinTypeName=${e}`, `limit=${
|
104
|
+
}, Me = async (e, t = 0, s = 1e3, l, n) => {
|
105
|
+
const r = [`digitalTwinTypeName=${e}`, `limit=${s}`, `start=${t}`];
|
106
106
|
l && r.push(`sort=${l}`), n && r.push(`name=~${n}`);
|
107
107
|
try {
|
108
|
-
const { data:
|
108
|
+
const { data: o, headers: a } = await f().get(
|
109
109
|
`/api/v1/twins/?${r.join("&")}`,
|
110
110
|
{
|
111
111
|
headers: {
|
@@ -113,7 +113,7 @@ const ee = {
|
|
113
113
|
}
|
114
114
|
}
|
115
115
|
);
|
116
|
-
return { totalRecords: parseInt(a["com-davra-total-results"]), records:
|
116
|
+
return { totalRecords: parseInt(a["com-davra-total-results"]), records: o };
|
117
117
|
} catch {
|
118
118
|
throw new Error("Twins API Error");
|
119
119
|
}
|
@@ -149,9 +149,9 @@ const ee = {
|
|
149
149
|
getTwins: Re,
|
150
150
|
getTwinsByTypeName: Me,
|
151
151
|
getTwinByUUID: Pe,
|
152
|
-
getTwinByUUIDs:
|
152
|
+
getTwinByUUIDs: je,
|
153
153
|
getTwinAttachements: Be,
|
154
|
-
queryTwins:
|
154
|
+
queryTwins: Oe
|
155
155
|
};
|
156
156
|
var te;
|
157
157
|
const xe = typeof window < "u", Le = (e) => typeof e < "u", Ne = (e) => typeof e == "function";
|
@@ -164,16 +164,16 @@ function ze(e) {
|
|
164
164
|
}
|
165
165
|
const ae = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, ne = "__vueuse_ssr_handlers__";
|
166
166
|
ae[ne] = ae[ne] || {};
|
167
|
-
var
|
167
|
+
var oe;
|
168
168
|
(function(e) {
|
169
169
|
e.UP = "UP", e.RIGHT = "RIGHT", e.DOWN = "DOWN", e.LEFT = "LEFT", e.NONE = "NONE";
|
170
|
-
})(
|
171
|
-
var Fe = Object.defineProperty,
|
172
|
-
for (var
|
173
|
-
Qe.call(t,
|
174
|
-
if (
|
175
|
-
for (var
|
176
|
-
We.call(t,
|
170
|
+
})(oe || (oe = {}));
|
171
|
+
var Fe = Object.defineProperty, se = Object.getOwnPropertySymbols, Qe = Object.prototype.hasOwnProperty, We = Object.prototype.propertyIsEnumerable, re = (e, t, s) => t in e ? Fe(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s, Je = (e, t) => {
|
172
|
+
for (var s in t || (t = {}))
|
173
|
+
Qe.call(t, s) && re(e, s, t[s]);
|
174
|
+
if (se)
|
175
|
+
for (var s of se(t))
|
176
|
+
We.call(t, s) && re(e, s, t[s]);
|
177
177
|
return e;
|
178
178
|
};
|
179
179
|
const Ke = {
|
@@ -205,40 +205,40 @@ const Ke = {
|
|
205
205
|
Je({
|
206
206
|
linear: qe
|
207
207
|
}, Ke);
|
208
|
-
function
|
209
|
-
var n, r,
|
208
|
+
function H(e, t, s, l = {}) {
|
209
|
+
var n, r, o;
|
210
210
|
const {
|
211
211
|
clone: a = !1,
|
212
212
|
passive: c = !1,
|
213
213
|
eventName: v,
|
214
214
|
deep: _ = !1,
|
215
215
|
defaultValue: h
|
216
|
-
} = l, w = be(), I =
|
217
|
-
let
|
218
|
-
t || (t = "modelValue"),
|
219
|
-
const
|
216
|
+
} = l, w = be(), I = s || (w == null ? void 0 : w.emit) || ((n = w == null ? void 0 : w.$emit) == null ? void 0 : n.bind(w)) || ((o = (r = w == null ? void 0 : w.proxy) == null ? void 0 : r.$emit) == null ? void 0 : o.bind(w == null ? void 0 : w.proxy));
|
217
|
+
let S = v;
|
218
|
+
t || (t = "modelValue"), S = v || S || `update:${t.toString()}`;
|
219
|
+
const O = (D) => a ? Ne(a) ? a(D) : ze(D) : D, U = () => Le(e[t]) ? O(e[t]) : h;
|
220
220
|
if (c) {
|
221
|
-
const D = U(),
|
222
|
-
return J(() => e[t], (m) =>
|
223
|
-
(m !== e[t] || _) && I(
|
224
|
-
}, { deep: _ }),
|
221
|
+
const D = U(), j = b(D);
|
222
|
+
return J(() => e[t], (m) => j.value = O(m)), J(j, (m) => {
|
223
|
+
(m !== e[t] || _) && I(S, m);
|
224
|
+
}, { deep: _ }), j;
|
225
225
|
} else
|
226
|
-
return
|
226
|
+
return T({
|
227
227
|
get() {
|
228
228
|
return U();
|
229
229
|
},
|
230
230
|
set(D) {
|
231
|
-
I(
|
231
|
+
I(S, D);
|
232
232
|
}
|
233
233
|
});
|
234
234
|
}
|
235
|
-
function
|
235
|
+
function He(e, t, s = {}) {
|
236
236
|
const l = {};
|
237
237
|
for (const n in e)
|
238
|
-
l[n] =
|
238
|
+
l[n] = H(e, n, t, s);
|
239
239
|
return l;
|
240
240
|
}
|
241
|
-
const
|
241
|
+
const Ye = /* @__PURE__ */ de("span", null, null, -1), Ge = /* @__PURE__ */ de("span", null, null, -1), ve = /* @__PURE__ */ L({
|
242
242
|
__name: "LabelInput",
|
243
243
|
props: {
|
244
244
|
labels: {},
|
@@ -249,16 +249,16 @@ const He = /* @__PURE__ */ de("span", null, null, -1), Ye = /* @__PURE__ */ de("
|
|
249
249
|
},
|
250
250
|
emits: ["update:labelkey", "update:labelvalue", "removelabel"],
|
251
251
|
setup(e, { emit: t }) {
|
252
|
-
const
|
252
|
+
const s = e, l = T(() => [
|
253
253
|
{ header: "Keys", color: "blue", icon: "mdi-label" },
|
254
|
-
...
|
254
|
+
...s.labels,
|
255
255
|
{ header: "Digital Twin Types", color: "purple", icon: "mdi-content-duplicate" },
|
256
|
-
...
|
257
|
-
]), { labelkey: n, labelvalue: r } =
|
256
|
+
...s.twintypes
|
257
|
+
]), { labelkey: n, labelvalue: r } = He(s, t), o = b(""), a = b(""), c = b([]), v = b([]), _ = b(!1), h = (m) => s.twintypes.find((g) => g === m) ? "twintypes" : "labels", w = T(() => h(n.value)), I = () => {
|
258
258
|
document.activeElement.blur();
|
259
|
-
},
|
259
|
+
}, S = (m) => {
|
260
260
|
m.key === "Enter" && I();
|
261
|
-
},
|
261
|
+
}, O = async (m) => {
|
262
262
|
const g = h(m);
|
263
263
|
if (_.value = !0, g === "twintypes")
|
264
264
|
try {
|
@@ -277,12 +277,12 @@ const He = /* @__PURE__ */ de("span", null, null, -1), Ye = /* @__PURE__ */ de("
|
|
277
277
|
_.value = !1;
|
278
278
|
};
|
279
279
|
J(n, async (m, g) => {
|
280
|
-
m !== g && (
|
280
|
+
m !== g && (O(m), g !== "" && (r.value = ""));
|
281
281
|
});
|
282
|
-
const U = b(), D =
|
282
|
+
const U = b(), D = T(() => {
|
283
283
|
var m;
|
284
284
|
return (m = U.value) == null ? void 0 : m.isFocused;
|
285
|
-
}),
|
285
|
+
}), j = {
|
286
286
|
specialNames: (m) => ![
|
287
287
|
"deviceid",
|
288
288
|
"uuid",
|
@@ -295,18 +295,18 @@ const He = /* @__PURE__ */ de("span", null, null, -1), Ye = /* @__PURE__ */ de("
|
|
295
295
|
notEmpty: (m) => !!m.trim() || "Required"
|
296
296
|
};
|
297
297
|
return ue(() => {
|
298
|
-
n.value &&
|
298
|
+
n.value && O(n.value);
|
299
299
|
}), (m, g) => {
|
300
|
-
const k = p("v-icon"), $ = p("v-chip"), V = p("v-list-item-title"), M = p("v-list-item"), X = p("v-combobox"),
|
300
|
+
const k = p("v-icon"), $ = p("v-chip"), V = p("v-list-item-title"), M = p("v-list-item"), X = p("v-combobox"), Y = p("v-col"), _e = p("v-autocomplete"), fe = p("v-btn"), we = p("v-row");
|
301
301
|
return A(), C(we, { class: "py-2" }, {
|
302
302
|
default: i(() => [
|
303
|
-
d(
|
303
|
+
d(Y, { class: "py-0 flex-grow-1 flex-shrink-0" }, {
|
304
304
|
default: i(() => [
|
305
305
|
d(X, {
|
306
306
|
modelValue: u(n),
|
307
307
|
"onUpdate:modelValue": g[0] || (g[0] = (y) => R(n) ? n.value = y : null),
|
308
|
-
search: u(
|
309
|
-
"onUpdate:search": g[1] || (g[1] = (y) => R(
|
308
|
+
search: u(o),
|
309
|
+
"onUpdate:search": g[1] || (g[1] = (y) => R(o) ? o.value = y : null),
|
310
310
|
"item-value": "value",
|
311
311
|
"data-testid": "label-key-selector",
|
312
312
|
readonly: "readonly" in m ? m.readonly : u(q),
|
@@ -318,15 +318,15 @@ const He = /* @__PURE__ */ de("span", null, null, -1), Ye = /* @__PURE__ */ de("
|
|
318
318
|
"no-data-text": "",
|
319
319
|
"hide-details": "auto",
|
320
320
|
density: "compact",
|
321
|
-
rules: [
|
321
|
+
rules: [j.alphanumericAndDash, j.specialNames],
|
322
322
|
"menu-props": { maxHeight: "400px", zIndex: 9999999 },
|
323
|
-
onKeydown:
|
323
|
+
onKeydown: S
|
324
324
|
}, {
|
325
325
|
"no-data": i(() => [
|
326
|
-
|
326
|
+
Ye
|
327
327
|
]),
|
328
328
|
"prepend-item": i(() => [
|
329
|
-
u(
|
329
|
+
u(o) && !u(l).includes(u(o)) ? (A(), C(M, {
|
330
330
|
key: 0,
|
331
331
|
class: "bg-blue-lighten-5",
|
332
332
|
onClick: I
|
@@ -345,7 +345,7 @@ const He = /* @__PURE__ */ de("span", null, null, -1), Ye = /* @__PURE__ */ de("
|
|
345
345
|
start: "",
|
346
346
|
icon: "mdi-label"
|
347
347
|
}),
|
348
|
-
E(" " + B(u(
|
348
|
+
E(" " + B(u(o)), 1)
|
349
349
|
]),
|
350
350
|
_: 1
|
351
351
|
})
|
@@ -399,7 +399,7 @@ const He = /* @__PURE__ */ de("span", null, null, -1), Ye = /* @__PURE__ */ de("
|
|
399
399
|
]),
|
400
400
|
_: 1
|
401
401
|
}),
|
402
|
-
d(
|
402
|
+
d(Y, { class: "py-0 flex-grow-1 flex-shrink-0" }, {
|
403
403
|
default: i(() => [
|
404
404
|
u(w) === "twintypes" ? (A(), C(_e, {
|
405
405
|
key: 0,
|
@@ -461,11 +461,11 @@ const He = /* @__PURE__ */ de("span", null, null, -1), Ye = /* @__PURE__ */ de("
|
|
461
461
|
"item-value": "value",
|
462
462
|
"hide-no-data": !1,
|
463
463
|
"no-data-text": "",
|
464
|
-
rules: [
|
464
|
+
rules: [j.alphanumericAndDash],
|
465
465
|
readonly: "readonly" in m ? m.readonly : u(q)
|
466
466
|
}, {
|
467
467
|
"no-data": i(() => [
|
468
|
-
|
468
|
+
Ge
|
469
469
|
]),
|
470
470
|
"prepend-item": i(() => [
|
471
471
|
u(a) && !u(c).find((y) => y === u(a)) ? (A(), C(M, {
|
@@ -519,7 +519,7 @@ const He = /* @__PURE__ */ de("span", null, null, -1), Ye = /* @__PURE__ */ de("
|
|
519
519
|
]),
|
520
520
|
_: 1
|
521
521
|
}),
|
522
|
-
d(
|
522
|
+
d(Y, {
|
523
523
|
cols: "1",
|
524
524
|
style: { "min-width": "40px" },
|
525
525
|
class: "pa-0 flex-grow-0 flex-shrink-1"
|
@@ -560,7 +560,7 @@ const He = /* @__PURE__ */ de("span", null, null, -1), Ye = /* @__PURE__ */ de("
|
|
560
560
|
}, Xe = {
|
561
561
|
getTwinTypes: Ze
|
562
562
|
}, me = N("twinTypes", () => {
|
563
|
-
const e = b([]), t =
|
563
|
+
const e = b([]), t = T(() => e.value.map((n) => n.name)), s = T(() => e.value.map((n) => ({ value: n.UUID, label: n.name }))), l = async () => {
|
564
564
|
try {
|
565
565
|
const n = await Xe.getTwinTypes();
|
566
566
|
e.value = n;
|
@@ -571,7 +571,7 @@ const He = /* @__PURE__ */ de("span", null, null, -1), Ye = /* @__PURE__ */ de("
|
|
571
571
|
twinTypes: e,
|
572
572
|
pullTwinTypes: l,
|
573
573
|
twinTypeNames: t,
|
574
|
-
twinTypeSelectArray:
|
574
|
+
twinTypeSelectArray: s
|
575
575
|
};
|
576
576
|
}), et = N("labels", () => {
|
577
577
|
const e = b([]), t = async () => {
|
@@ -580,7 +580,7 @@ const He = /* @__PURE__ */ de("span", null, null, -1), Ye = /* @__PURE__ */ de("
|
|
580
580
|
e.value = l;
|
581
581
|
} catch {
|
582
582
|
}
|
583
|
-
},
|
583
|
+
}, s = async (l) => {
|
584
584
|
const { twinTypeNames: n } = K(me());
|
585
585
|
try {
|
586
586
|
await Z.createLabel(l, n.value), await t();
|
@@ -590,7 +590,7 @@ const He = /* @__PURE__ */ de("span", null, null, -1), Ye = /* @__PURE__ */ de("
|
|
590
590
|
return t(), {
|
591
591
|
labels: e,
|
592
592
|
pullLabels: t,
|
593
|
-
updateLabels:
|
593
|
+
updateLabels: s
|
594
594
|
};
|
595
595
|
}), tt = /* @__PURE__ */ L({
|
596
596
|
__name: "LabelsSelector",
|
@@ -600,7 +600,7 @@ const He = /* @__PURE__ */ de("span", null, null, -1), Ye = /* @__PURE__ */ de("
|
|
600
600
|
},
|
601
601
|
emits: ["update:modelValue"],
|
602
602
|
setup(e, { emit: t }) {
|
603
|
-
const
|
603
|
+
const s = e, { labels: l } = K(et()), { twinTypeNames: n } = K(me()), r = b([]), o = T(() => (_) => l.value.filter((h) => !n.value.includes(h) && (_.key === h || !r.value.find(({ key: w }) => w === h)))), a = T(() => (_) => n.value.filter((h) => _.key === h || !r.value.find(({ key: w }) => w === h))), c = () => {
|
604
604
|
r.value.push({ key: "", value: "" });
|
605
605
|
}, v = (_) => {
|
606
606
|
r.value.splice(_, 1);
|
@@ -609,9 +609,9 @@ const He = /* @__PURE__ */ de("span", null, null, -1), Ye = /* @__PURE__ */ de("
|
|
609
609
|
const h = _.reduce((w, I) => (I.key && I.value && (w[I.key] = I.value), w), {});
|
610
610
|
t("update:modelValue", h);
|
611
611
|
}, { deep: !0 }), ue(() => {
|
612
|
-
|
612
|
+
s.modelValue && (r.value = Object.entries(s.modelValue).map(([_, h]) => ({ key: _, value: h })));
|
613
613
|
}), (_, h) => {
|
614
|
-
const w = p("v-spacer"), I = p("v-btn"),
|
614
|
+
const w = p("v-spacer"), I = p("v-btn"), S = p("v-row"), O = p("v-card-title"), U = p("v-list-subheader"), D = p("v-col"), j = p("v-divider"), m = ve, g = p("v-card-text"), k = p("v-sheet");
|
615
615
|
return A(), C(k, {
|
616
616
|
class: "pa-3",
|
617
617
|
variant: "tonal",
|
@@ -620,9 +620,9 @@ const He = /* @__PURE__ */ de("span", null, null, -1), Ye = /* @__PURE__ */ de("
|
|
620
620
|
color: "grey-lighten-4"
|
621
621
|
}, {
|
622
622
|
default: i(() => [
|
623
|
-
d(
|
623
|
+
d(O, { class: "text-primary" }, {
|
624
624
|
default: i(() => [
|
625
|
-
d(
|
625
|
+
d(S, { "no-gutters": "" }, {
|
626
626
|
default: i(() => [
|
627
627
|
E(" Labels "),
|
628
628
|
d(w),
|
@@ -648,7 +648,7 @@ const He = /* @__PURE__ */ de("span", null, null, -1), Ye = /* @__PURE__ */ de("
|
|
648
648
|
}),
|
649
649
|
u(r).length ? (A(), C(g, { key: 0 }, {
|
650
650
|
default: i(() => [
|
651
|
-
d(
|
651
|
+
d(S, { "no-gutters": "" }, {
|
652
652
|
default: i(() => [
|
653
653
|
d(D, null, {
|
654
654
|
default: i(() => [
|
@@ -675,7 +675,7 @@ const He = /* @__PURE__ */ de("span", null, null, -1), Ye = /* @__PURE__ */ de("
|
|
675
675
|
]),
|
676
676
|
_: 1
|
677
677
|
}),
|
678
|
-
d(
|
678
|
+
d(j, { class: "mb-3" }),
|
679
679
|
(A(!0), pe(Ae, null, Ee(u(r), ($, V) => (A(), C(m, {
|
680
680
|
key: V,
|
681
681
|
labelkey: u(r)[V].key,
|
@@ -683,7 +683,7 @@ const He = /* @__PURE__ */ de("span", null, null, -1), Ye = /* @__PURE__ */ de("
|
|
683
683
|
labelvalue: u(r)[V].value,
|
684
684
|
"onUpdate:labelvalue": (M) => u(r)[V].value = M,
|
685
685
|
readonly: "readonly" in _ ? _.readonly : u(q),
|
686
|
-
labels: u(
|
686
|
+
labels: u(o)(u(r)[V]),
|
687
687
|
twintypes: u(a)(u(r)[V]),
|
688
688
|
"data-lab-key": $.key,
|
689
689
|
onRemovelabel: (M) => v(V)
|
@@ -704,10 +704,10 @@ const He = /* @__PURE__ */ de("span", null, null, -1), Ye = /* @__PURE__ */ de("
|
|
704
704
|
},
|
705
705
|
emits: ["confirm", "update:modelValue"],
|
706
706
|
setup(e, { emit: t }) {
|
707
|
-
const
|
707
|
+
const s = e, l = s.parentActivator ? b(!1) : H(s, "modelValue", t);
|
708
708
|
return (n, r) => {
|
709
|
-
const
|
710
|
-
return A(), C(
|
709
|
+
const o = p("v-dialog");
|
710
|
+
return A(), C(o, {
|
711
711
|
modelValue: u(l),
|
712
712
|
"onUpdate:modelValue": r[0] || (r[0] = (a) => R(l) ? l.value = a : null),
|
713
713
|
activator: n.parentActivator ? "parent" : void 0
|
@@ -720,13 +720,13 @@ const He = /* @__PURE__ */ de("span", null, null, -1), Ye = /* @__PURE__ */ de("
|
|
720
720
|
};
|
721
721
|
}
|
722
722
|
}), nt = Symbol.for("vuetify:display");
|
723
|
-
function
|
723
|
+
function ot() {
|
724
724
|
const e = Ce(nt);
|
725
725
|
if (!e)
|
726
726
|
throw new Error("Could not find Vuetify display injection");
|
727
727
|
return e;
|
728
728
|
}
|
729
|
-
const
|
729
|
+
const st = /* @__PURE__ */ L({
|
730
730
|
__name: "ViewObjectModal",
|
731
731
|
props: {
|
732
732
|
title: {},
|
@@ -736,20 +736,20 @@ const ot = /* @__PURE__ */ L({
|
|
736
736
|
},
|
737
737
|
emits: ["confirm", "update:modelValue"],
|
738
738
|
setup(e, { emit: t }) {
|
739
|
-
const
|
739
|
+
const s = e, l = s.parentActivator ? b(!1) : H(s, "modelValue", t), n = () => {
|
740
740
|
t("confirm"), l.value = !1;
|
741
|
-
}, { mobile: r } =
|
742
|
-
return (
|
743
|
-
const c = p("v-toolbar-title"), v = p("v-btn"), _ = p("v-toolbar"), h = p("v-card-text"), w = p("v-spacer"), I = p("v-card-actions"),
|
744
|
-
return A(), C(
|
741
|
+
}, { mobile: r } = ot();
|
742
|
+
return (o, a) => {
|
743
|
+
const c = p("v-toolbar-title"), v = p("v-btn"), _ = p("v-toolbar"), h = p("v-card-text"), w = p("v-spacer"), I = p("v-card-actions"), S = p("v-card"), O = p("v-dialog");
|
744
|
+
return A(), C(O, {
|
745
745
|
modelValue: u(l),
|
746
746
|
"onUpdate:modelValue": a[2] || (a[2] = (U) => R(l) ? l.value = U : null),
|
747
|
-
activator:
|
747
|
+
activator: o.parentActivator ? "parent" : void 0,
|
748
748
|
"max-width": "800px",
|
749
749
|
fullscreen: u(r)
|
750
750
|
}, {
|
751
751
|
default: i(() => [
|
752
|
-
d(
|
752
|
+
d(S, null, {
|
753
753
|
default: i(() => [
|
754
754
|
d(_, { color: "white" }, {
|
755
755
|
append: i(() => [
|
@@ -763,7 +763,7 @@ const ot = /* @__PURE__ */ L({
|
|
763
763
|
default: i(() => [
|
764
764
|
d(c, null, {
|
765
765
|
default: i(() => [
|
766
|
-
E(B(
|
766
|
+
E(B(o.title), 1)
|
767
767
|
]),
|
768
768
|
_: 1
|
769
769
|
})
|
@@ -772,13 +772,13 @@ const ot = /* @__PURE__ */ L({
|
|
772
772
|
}),
|
773
773
|
d(h, null, {
|
774
774
|
default: i(() => [
|
775
|
-
z(
|
775
|
+
z(o.$slots, "default")
|
776
776
|
]),
|
777
777
|
_: 3
|
778
778
|
}),
|
779
|
-
|
779
|
+
o.hideActions ? P("", !0) : (A(), C(I, { key: 0 }, {
|
780
780
|
default: i(() => [
|
781
|
-
z(
|
781
|
+
z(o.$slots, "actions", Ie(Te({ confirm: n, dialog: u(l) })), () => [
|
782
782
|
d(w),
|
783
783
|
d(v, {
|
784
784
|
class: "delete-modal-dismiss",
|
@@ -822,14 +822,14 @@ const ot = /* @__PURE__ */ L({
|
|
822
822
|
},
|
823
823
|
emits: ["confirm", "update:modelValue"],
|
824
824
|
setup(e, { emit: t }) {
|
825
|
-
const
|
825
|
+
const s = e, l = s.parentActivator ? b(!1) : H(s, "modelValue", t), n = () => {
|
826
826
|
t("confirm"), l.value = !1;
|
827
827
|
};
|
828
|
-
return (r,
|
828
|
+
return (r, o) => {
|
829
829
|
const a = p("v-card-title"), c = p("v-card-text"), v = p("v-spacer"), _ = p("v-btn"), h = p("v-card-actions"), w = p("v-card"), I = p("v-dialog");
|
830
830
|
return A(), C(I, {
|
831
831
|
modelValue: u(l),
|
832
|
-
"onUpdate:modelValue":
|
832
|
+
"onUpdate:modelValue": o[1] || (o[1] = (S) => R(l) ? l.value = S : null),
|
833
833
|
activator: r.parentActivator ? "parent" : void 0,
|
834
834
|
"max-width": "400px"
|
835
835
|
}, {
|
@@ -854,7 +854,7 @@ const ot = /* @__PURE__ */ L({
|
|
854
854
|
d(_, {
|
855
855
|
class: "delete-modal-dismiss",
|
856
856
|
color: "grey",
|
857
|
-
onClick:
|
857
|
+
onClick: o[0] || (o[0] = (S) => l.value = !1)
|
858
858
|
}, {
|
859
859
|
default: i(() => [
|
860
860
|
E(" Dismiss ")
|
@@ -890,21 +890,21 @@ const ot = /* @__PURE__ */ L({
|
|
890
890
|
},
|
891
891
|
emits: ["confirm"],
|
892
892
|
setup(e, { emit: t }) {
|
893
|
-
const
|
894
|
-
|
893
|
+
const s = b(!1), l = () => {
|
894
|
+
s.value = !1, t("confirm");
|
895
895
|
};
|
896
896
|
return (n, r) => {
|
897
|
-
const
|
897
|
+
const o = p("v-card-title"), a = p("v-card-text"), c = p("v-spacer"), v = p("v-btn"), _ = p("v-card-actions"), h = p("v-card"), w = p("v-dialog");
|
898
898
|
return A(), C(w, {
|
899
|
-
modelValue: u(
|
900
|
-
"onUpdate:modelValue": r[1] || (r[1] = (I) => R(
|
899
|
+
modelValue: u(s),
|
900
|
+
"onUpdate:modelValue": r[1] || (r[1] = (I) => R(s) ? s.value = I : null),
|
901
901
|
activator: "parent",
|
902
902
|
"max-width": "400px"
|
903
903
|
}, {
|
904
904
|
default: i(() => [
|
905
905
|
d(h, null, {
|
906
906
|
default: i(() => [
|
907
|
-
d(
|
907
|
+
d(o, null, {
|
908
908
|
default: i(() => [
|
909
909
|
E(B(n.title), 1)
|
910
910
|
]),
|
@@ -922,7 +922,7 @@ const ot = /* @__PURE__ */ L({
|
|
922
922
|
d(v, {
|
923
923
|
class: "confirm-modal-dismiss",
|
924
924
|
color: "grey",
|
925
|
-
onClick: r[0] || (r[0] = (I) =>
|
925
|
+
onClick: r[0] || (r[0] = (I) => s.value = !1)
|
926
926
|
}, {
|
927
927
|
default: i(() => [
|
928
928
|
E(" Cancel ")
|
@@ -954,51 +954,51 @@ const ot = /* @__PURE__ */ L({
|
|
954
954
|
}), ct = /* @__PURE__ */ L({
|
955
955
|
__name: "ScrollText",
|
956
956
|
setup(e) {
|
957
|
-
|
957
|
+
Se((o) => ({
|
958
958
|
"2e2ac96b": u(n),
|
959
959
|
e0628022: u(l)
|
960
960
|
}));
|
961
|
-
const t = b(null),
|
962
|
-
var
|
963
|
-
return t.value ? ((
|
964
|
-
}), l =
|
965
|
-
var
|
966
|
-
return ((
|
961
|
+
const t = b(null), s = T(() => {
|
962
|
+
var o, a;
|
963
|
+
return t.value ? ((o = t.value) == null ? void 0 : o.scrollWidth) - ((a = t.value) == null ? void 0 : a.offsetWidth) : 0;
|
964
|
+
}), l = T(() => `${-s.value - 10}px`), n = T(() => `${s.value / 30}s`), r = T(() => {
|
965
|
+
var o, a;
|
966
|
+
return ((o = t.value) == null ? void 0 : o.scrollWidth) !== ((a = t.value) == null ? void 0 : a.offsetWidth);
|
967
967
|
});
|
968
|
-
return (
|
968
|
+
return (o, a) => (A(), pe("div", {
|
969
969
|
ref_key: "text",
|
970
970
|
ref: t,
|
971
971
|
class: Ue({ "scroll-text": u(r) })
|
972
972
|
}, [
|
973
|
-
z(
|
973
|
+
z(o.$slots, "default", {}, void 0, !0)
|
974
974
|
], 2));
|
975
975
|
}
|
976
976
|
});
|
977
977
|
const it = (e, t) => {
|
978
|
-
const
|
978
|
+
const s = e.__vccOpts || e;
|
979
979
|
for (const [l, n] of t)
|
980
|
-
|
981
|
-
return
|
980
|
+
s[l] = n;
|
981
|
+
return s;
|
982
982
|
}, ut = /* @__PURE__ */ it(ct, [["__scopeId", "data-v-4d66a865"]]), Q = N("alertMessages", () => {
|
983
|
-
const e = b(!1), t = b(""),
|
983
|
+
const e = b(!1), t = b(""), s = b(""), l = b(5e3);
|
984
984
|
return {
|
985
985
|
snackbar: e,
|
986
986
|
snackbarText: t,
|
987
|
-
snackbarSeverity:
|
987
|
+
snackbarSeverity: s,
|
988
988
|
snackbarTimeout: l,
|
989
|
-
setSnackbarMessage: (r = "",
|
990
|
-
t.value = r,
|
989
|
+
setSnackbarMessage: (r = "", o = "", a = 5e3) => {
|
990
|
+
t.value = r, s.value = o, l.value = a, e.value = !0;
|
991
991
|
}
|
992
992
|
};
|
993
993
|
}), dt = /* @__PURE__ */ L({
|
994
994
|
__name: "Snackbar",
|
995
995
|
setup(e) {
|
996
|
-
const { snackbar: t, snackbarText:
|
997
|
-
return (r,
|
996
|
+
const { snackbar: t, snackbarText: s, snackbarTimeout: l, snackbarSeverity: n } = K(Q());
|
997
|
+
return (r, o) => {
|
998
998
|
const a = p("v-btn"), c = p("v-snackbar");
|
999
999
|
return A(), C(c, {
|
1000
1000
|
modelValue: u(t),
|
1001
|
-
"onUpdate:modelValue":
|
1001
|
+
"onUpdate:modelValue": o[1] || (o[1] = (v) => R(t) ? t.value = v : null),
|
1002
1002
|
style: { "margin-bottom": "50px" },
|
1003
1003
|
"data-testid": "snackbar",
|
1004
1004
|
timeout: u(l),
|
@@ -1009,7 +1009,7 @@ const it = (e, t) => {
|
|
1009
1009
|
d(a, {
|
1010
1010
|
color: "snackbarSeverity",
|
1011
1011
|
variant: "text",
|
1012
|
-
onClick:
|
1012
|
+
onClick: o[0] || (o[0] = (v) => t.value = !1)
|
1013
1013
|
}, {
|
1014
1014
|
default: i(() => [
|
1015
1015
|
E(" Close ")
|
@@ -1018,7 +1018,7 @@ const it = (e, t) => {
|
|
1018
1018
|
})
|
1019
1019
|
]),
|
1020
1020
|
default: i(() => [
|
1021
|
-
E(B(u(
|
1021
|
+
E(B(u(s)) + " ", 1)
|
1022
1022
|
]),
|
1023
1023
|
_: 1
|
1024
1024
|
}, 8, ["modelValue", "timeout", "color"]);
|
@@ -1033,7 +1033,7 @@ const it = (e, t) => {
|
|
1033
1033
|
Modal: at,
|
1034
1034
|
ScrollText: ut,
|
1035
1035
|
Snackbar: dt,
|
1036
|
-
ViewObjectModal:
|
1036
|
+
ViewObjectModal: st
|
1037
1037
|
}, Symbol.toStringTag, { value: "Module" }));
|
1038
1038
|
const pt = 100, Pt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
1039
1039
|
__proto__: null,
|
@@ -1090,8 +1090,8 @@ const Bt = {
|
|
1090
1090
|
{ Action: "features.CREATE_FEATURE" },
|
1091
1091
|
{ Action: "oauthclients.ACCESS" },
|
1092
1092
|
{ Action: "oauthclients.CREATE" },
|
1093
|
-
{ Action: "
|
1094
|
-
{ Action: "
|
1093
|
+
{ Action: "anomalyDetection.ACCESS" },
|
1094
|
+
{ Action: "anomalyDetection.CREATE_ANOMALY_DETECTOR" },
|
1095
1095
|
{ Action: "dashboards.ACCESS" },
|
1096
1096
|
{ Action: "dashboards.CREATE_DASHBOARD" },
|
1097
1097
|
{ Action: "integrations.ACCESS" }
|
@@ -1118,7 +1118,7 @@ const Bt = {
|
|
1118
1118
|
const t = [];
|
1119
1119
|
e && t.push(e);
|
1120
1120
|
try {
|
1121
|
-
const { data:
|
1121
|
+
const { data: s } = await f().get(
|
1122
1122
|
`/api/v1/iotdata/devices/counters/metrics?${t.join("&")}`,
|
1123
1123
|
{
|
1124
1124
|
headers: {
|
@@ -1126,7 +1126,7 @@ const Bt = {
|
|
1126
1126
|
}
|
1127
1127
|
}
|
1128
1128
|
);
|
1129
|
-
return
|
1129
|
+
return s;
|
1130
1130
|
} catch {
|
1131
1131
|
throw new Error("Devices Counters API Error");
|
1132
1132
|
}
|
@@ -1238,9 +1238,9 @@ const Bt = {
|
|
1238
1238
|
}, Lt = {
|
1239
1239
|
getTwinsCountersLatestByUUID: Et,
|
1240
1240
|
getTwinsCountersByUUID: At
|
1241
|
-
}, Ct = async (e, t,
|
1241
|
+
}, Ct = async (e, t, s, l) => {
|
1242
1242
|
const n = [];
|
1243
|
-
n.push(`start=${e || 0}`), t && n.push(`limit=${t}`),
|
1243
|
+
n.push(`start=${e || 0}`), t && n.push(`limit=${t}`), s && n.push(`sort=${s}`), l && n.push(l);
|
1244
1244
|
try {
|
1245
1245
|
const { data: r } = await f().get(
|
1246
1246
|
`/api/v1/devices?${n.join("&")}`,
|
@@ -1269,7 +1269,7 @@ const Bt = {
|
|
1269
1269
|
} catch {
|
1270
1270
|
throw new Error("Devices API Error");
|
1271
1271
|
}
|
1272
|
-
},
|
1272
|
+
}, Tt = async (e) => {
|
1273
1273
|
try {
|
1274
1274
|
const { data: t } = await f().get(
|
1275
1275
|
`/api/v1/devices/${e}`,
|
@@ -1283,7 +1283,7 @@ const Bt = {
|
|
1283
1283
|
} catch {
|
1284
1284
|
throw new Error("Devices API Error");
|
1285
1285
|
}
|
1286
|
-
},
|
1286
|
+
}, St = async (e) => {
|
1287
1287
|
try {
|
1288
1288
|
const { data: t } = await f().get(
|
1289
1289
|
`/api/v1/devices?arrayUUIDs=${e.join(",")}`,
|
@@ -1311,11 +1311,11 @@ const Bt = {
|
|
1311
1311
|
} catch {
|
1312
1312
|
throw new Error("Devices API Error");
|
1313
1313
|
}
|
1314
|
-
},
|
1314
|
+
}, G = {
|
1315
1315
|
getDevices: Ct,
|
1316
1316
|
queryDevices: It,
|
1317
|
-
getDeviceByUUID:
|
1318
|
-
getDeviceByUUIDs:
|
1317
|
+
getDeviceByUUID: Tt,
|
1318
|
+
getDeviceByUUIDs: St,
|
1319
1319
|
getDeviceAttachements: Ut
|
1320
1320
|
}, Dt = async (e) => {
|
1321
1321
|
try {
|
@@ -1335,7 +1335,7 @@ const Bt = {
|
|
1335
1335
|
}, Nt = {
|
1336
1336
|
queryTimeseries: Dt
|
1337
1337
|
}, kt = async () => {
|
1338
|
-
var e, t,
|
1338
|
+
var e, t, s, l, n, r, o;
|
1339
1339
|
try {
|
1340
1340
|
const { data: a } = await f().get(
|
1341
1341
|
"/api/v1/iotdata/meta-data/metrics",
|
@@ -1347,11 +1347,11 @@ const Bt = {
|
|
1347
1347
|
);
|
1348
1348
|
return a.fields;
|
1349
1349
|
} catch (a) {
|
1350
|
-
const c = typeof ((t = (e = a == null ? void 0 : a.response) == null ? void 0 : e.data) == null ? void 0 : t.message) == "string" ? (l = (
|
1351
|
-
throw new Error(`API Error ${(
|
1350
|
+
const c = typeof ((t = (e = a == null ? void 0 : a.response) == null ? void 0 : e.data) == null ? void 0 : t.message) == "string" ? (l = (s = a == null ? void 0 : a.response) == null ? void 0 : s.data) == null ? void 0 : l.message : typeof ((n = a == null ? void 0 : a.response) == null ? void 0 : n.data) == "string" ? (r = a == null ? void 0 : a.response) == null ? void 0 : r.data : "";
|
1351
|
+
throw new Error(`API Error ${(o = a == null ? void 0 : a.response) == null ? void 0 : o.status} ${c}`);
|
1352
1352
|
}
|
1353
1353
|
}, Vt = async (e) => {
|
1354
|
-
var t,
|
1354
|
+
var t, s, l, n, r, o, a;
|
1355
1355
|
try {
|
1356
1356
|
const { data: c } = await f().post(
|
1357
1357
|
"/api/v1/iotdata/meta-data",
|
@@ -1371,24 +1371,24 @@ const Bt = {
|
|
1371
1371
|
);
|
1372
1372
|
return c;
|
1373
1373
|
} catch (c) {
|
1374
|
-
const v = typeof ((
|
1374
|
+
const v = typeof ((s = (t = c == null ? void 0 : c.response) == null ? void 0 : t.data) == null ? void 0 : s.message) == "string" ? (n = (l = c == null ? void 0 : c.response) == null ? void 0 : l.data) == null ? void 0 : n.message : typeof ((r = c == null ? void 0 : c.response) == null ? void 0 : r.data) == "string" ? (o = c == null ? void 0 : c.response) == null ? void 0 : o.data : "";
|
1375
1375
|
throw new Error(`API Error ${(a = c == null ? void 0 : c.response) == null ? void 0 : a.status} ${v}`);
|
1376
1376
|
}
|
1377
1377
|
}, ie = {
|
1378
1378
|
getMetrics: kt,
|
1379
1379
|
postMetric: Vt
|
1380
1380
|
}, qt = N("userSession", () => {
|
1381
|
-
const e = b(JSON.parse(localStorage.getItem("user") || "null")), t = b(JSON.parse(localStorage.getItem("user-permissions") || "[]")),
|
1382
|
-
var
|
1383
|
-
return ((
|
1384
|
-
}), l =
|
1381
|
+
const e = b(JSON.parse(localStorage.getItem("user") || "null")), t = b(JSON.parse(localStorage.getItem("user-permissions") || "[]")), s = T(() => {
|
1382
|
+
var o;
|
1383
|
+
return ((o = e.value) == null ? void 0 : o.name) || "no user";
|
1384
|
+
}), l = T(() => (o) => {
|
1385
1385
|
var a, c;
|
1386
|
-
return
|
1386
|
+
return o ? ((c = (a = t.value) == null ? void 0 : a.find((v) => v.Action === o)) == null ? void 0 : c.Allowed) || !1 : !0;
|
1387
1387
|
}), n = async () => {
|
1388
|
-
var
|
1388
|
+
var o, a;
|
1389
1389
|
try {
|
1390
1390
|
const c = await ce.getUser();
|
1391
|
-
if (e.value = c, (
|
1391
|
+
if (e.value = c, (o = e.value) != null && o.UUID) {
|
1392
1392
|
const v = await ce.getUserPermissions();
|
1393
1393
|
t.value = v, localStorage.setItem("user", JSON.stringify(e.value)), localStorage.setItem("user-permissions", JSON.stringify(t.value));
|
1394
1394
|
}
|
@@ -1398,19 +1398,19 @@ const Bt = {
|
|
1398
1398
|
}, r = () => {
|
1399
1399
|
e.value = null, t.value = [], localStorage.removeItem("user"), localStorage.removeItem("user-permission"), window.location.href = "/ui/logout";
|
1400
1400
|
};
|
1401
|
-
return n(), { user: e, pullUser: n, userName:
|
1401
|
+
return n(), { user: e, pullUser: n, userName: s, userPermissions: t, getPermission: l, logout: r };
|
1402
1402
|
}), zt = N("devices", () => {
|
1403
1403
|
const e = b({});
|
1404
1404
|
return {
|
1405
1405
|
pullDevicesByUUIDs: async (n, r = !1) => {
|
1406
|
-
r && n.forEach((
|
1407
|
-
delete e.value[
|
1406
|
+
r && n.forEach((o) => {
|
1407
|
+
delete e.value[o];
|
1408
1408
|
});
|
1409
1409
|
try {
|
1410
|
-
const
|
1411
|
-
return
|
1410
|
+
const o = await G.getDeviceByUUIDs(n);
|
1411
|
+
return o.records.forEach((a) => {
|
1412
1412
|
e.value[a.UUID] = a;
|
1413
|
-
}),
|
1413
|
+
}), o;
|
1414
1414
|
} catch {
|
1415
1415
|
return {
|
1416
1416
|
totalRecords: 0,
|
@@ -1418,9 +1418,9 @@ const Bt = {
|
|
1418
1418
|
};
|
1419
1419
|
}
|
1420
1420
|
},
|
1421
|
-
pullDevices: async (n, r,
|
1421
|
+
pullDevices: async (n, r, o, a) => {
|
1422
1422
|
try {
|
1423
|
-
const c = await
|
1423
|
+
const c = await G.getDevices(n, r, o, a);
|
1424
1424
|
return c.records.forEach((v) => {
|
1425
1425
|
e.value[v.UUID] = v;
|
1426
1426
|
}), c;
|
@@ -1433,13 +1433,13 @@ const Bt = {
|
|
1433
1433
|
},
|
1434
1434
|
devicesCollection: e,
|
1435
1435
|
getDeviceFromUUID: async (n, r) => {
|
1436
|
-
const
|
1437
|
-
if (
|
1438
|
-
return
|
1436
|
+
const o = e.value[n];
|
1437
|
+
if (o)
|
1438
|
+
return o;
|
1439
1439
|
if (r)
|
1440
1440
|
return null;
|
1441
1441
|
try {
|
1442
|
-
const a = await
|
1442
|
+
const a = await G.getDeviceByUUID(n);
|
1443
1443
|
if (a)
|
1444
1444
|
return e.value[a.UUID] = a, a;
|
1445
1445
|
} catch {
|
@@ -1451,14 +1451,14 @@ const Bt = {
|
|
1451
1451
|
const e = b({});
|
1452
1452
|
return {
|
1453
1453
|
pullTwinsByUUIDs: async (n, r = !1) => {
|
1454
|
-
r && n.forEach((
|
1455
|
-
delete e.value[
|
1454
|
+
r && n.forEach((o) => {
|
1455
|
+
delete e.value[o];
|
1456
1456
|
});
|
1457
1457
|
try {
|
1458
|
-
const
|
1459
|
-
return
|
1458
|
+
const o = await W.getTwinByUUIDs(n);
|
1459
|
+
return o.records.forEach((a) => {
|
1460
1460
|
e.value[a.UUID] = a;
|
1461
|
-
}),
|
1461
|
+
}), o;
|
1462
1462
|
} catch {
|
1463
1463
|
return {
|
1464
1464
|
totalRecords: 0,
|
@@ -1466,9 +1466,9 @@ const Bt = {
|
|
1466
1466
|
};
|
1467
1467
|
}
|
1468
1468
|
},
|
1469
|
-
pullTwins: async (n, r,
|
1469
|
+
pullTwins: async (n, r, o, a) => {
|
1470
1470
|
try {
|
1471
|
-
const c = await W.getTwins(n, r,
|
1471
|
+
const c = await W.getTwins(n, r, o, a);
|
1472
1472
|
return c.records.forEach((v) => {
|
1473
1473
|
e.value[v.UUID] = v;
|
1474
1474
|
}), c;
|
@@ -1481,9 +1481,9 @@ const Bt = {
|
|
1481
1481
|
},
|
1482
1482
|
twinsCollection: e,
|
1483
1483
|
getTwinFromUUID: async (n, r) => {
|
1484
|
-
const
|
1485
|
-
if (
|
1486
|
-
return
|
1484
|
+
const o = e.value[n];
|
1485
|
+
if (o)
|
1486
|
+
return o;
|
1487
1487
|
if (r)
|
1488
1488
|
return null;
|
1489
1489
|
try {
|
@@ -1512,10 +1512,10 @@ const Bt = {
|
|
1512
1512
|
}, Rt = {
|
1513
1513
|
getMetricsCounters: $t
|
1514
1514
|
}, Qt = N("metrics", () => {
|
1515
|
-
const e = b([]), t = b([]),
|
1515
|
+
const e = b([]), t = b([]), s = T(() => (a) => {
|
1516
1516
|
var c;
|
1517
1517
|
return (c = t.value) == null ? void 0 : c.find((v) => v.name === a);
|
1518
|
-
}), l =
|
1518
|
+
}), l = T(() => e.value.map((a) => ({ title: `${a.label} ${a.name}`, label: a.label, value: a.name }))), n = async (a) => {
|
1519
1519
|
if (!(a && e.value.length))
|
1520
1520
|
try {
|
1521
1521
|
const c = await ie.getMetrics();
|
@@ -1530,7 +1530,7 @@ const Bt = {
|
|
1530
1530
|
} catch (a) {
|
1531
1531
|
Q().setSnackbarMessage(a, "error");
|
1532
1532
|
}
|
1533
|
-
},
|
1533
|
+
}, o = async (a) => {
|
1534
1534
|
let c = !1;
|
1535
1535
|
try {
|
1536
1536
|
await ie.postMetric(a), c = !0, Q().setSnackbarMessage(`Metric ${a.name} successfully saved`, "success");
|
@@ -1544,8 +1544,8 @@ const Bt = {
|
|
1544
1544
|
metricsCounters: t,
|
1545
1545
|
pullMetrics: n,
|
1546
1546
|
pullMetricsCounters: r,
|
1547
|
-
getMetricCounter:
|
1548
|
-
saveMetric:
|
1547
|
+
getMetricCounter: s,
|
1548
|
+
saveMetric: o,
|
1549
1549
|
metricsArr: l
|
1550
1550
|
};
|
1551
1551
|
});
|
@@ -1559,7 +1559,7 @@ export {
|
|
1559
1559
|
ee as DavraApiConfig,
|
1560
1560
|
rt as DeleteModal,
|
1561
1561
|
xt as DevicesCountersService,
|
1562
|
-
|
1562
|
+
G as DevicesService,
|
1563
1563
|
ve as LabelInput,
|
1564
1564
|
tt as LabelsSelector,
|
1565
1565
|
Z as LabelsService,
|
@@ -1574,7 +1574,7 @@ export {
|
|
1574
1574
|
Lt as TwinsCountersService,
|
1575
1575
|
W as TwinsService,
|
1576
1576
|
ce as UserSessionService,
|
1577
|
-
|
1577
|
+
st as ViewObjectModal,
|
1578
1578
|
Wt as installCoreComponents,
|
1579
1579
|
Q as useAlertMessagesStore,
|
1580
1580
|
zt as useDevicesStore,
|
package/package.json
CHANGED