@davra/ui-core 1.0.0-alpha.4 → 1.0.1
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/README.md +9 -162
- package/dist/types/components/utils/index.d.ts +1 -2
- package/dist/ui-core.es.js +423 -470
- package/package.json +14 -11
- package/dist/types/components/utils/ColorInput.vue.d.ts +0 -14
- package/dist/types/components/utils/IconInput.vue.d.ts +0 -14
- package/dist/types/components/utils/colorInput.test.d.ts +0 -1
package/dist/ui-core.es.js
CHANGED
@@ -1,14 +1,14 @@
|
|
1
|
-
import { getCurrentInstance as be, ref as
|
1
|
+
import { getCurrentInstance as be, ref as b, watch as J, computed as S, 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 Se, useCssVars as Te, normalizeClass as Ue } from "vue";
|
2
2
|
import De from "axios";
|
3
|
-
import { defineStore as
|
3
|
+
import { defineStore as N, storeToRefs as K } from "pinia";
|
4
4
|
const ee = {
|
5
5
|
baseURL: ""
|
6
|
-
},
|
6
|
+
}, f = (e = "") => De.create({
|
7
7
|
...ee,
|
8
8
|
baseURL: e || ee.baseURL
|
9
9
|
}), ke = async () => {
|
10
10
|
try {
|
11
|
-
const { data: e } = await
|
11
|
+
const { data: e } = await f().get(
|
12
12
|
"/api/v1/tags/keys",
|
13
13
|
{
|
14
14
|
headers: {
|
@@ -22,7 +22,7 @@ const ee = {
|
|
22
22
|
}
|
23
23
|
}, Ve = async (e) => {
|
24
24
|
try {
|
25
|
-
const { data: t } = await
|
25
|
+
const { data: t } = await f().get(
|
26
26
|
`/api/v1/tags/values/${e}`,
|
27
27
|
{
|
28
28
|
headers: {
|
@@ -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(
|
38
|
+
const o = { ...e };
|
39
|
+
Object.entries(o).forEach(([l, n]) => {
|
40
|
+
t && t.includes(l) && delete o[l], (!n || /[^a-zA-Z_0-9\-+]/g.test(n)) && delete o[l];
|
41
41
|
});
|
42
42
|
try {
|
43
|
-
return await
|
43
|
+
return await f().post(
|
44
44
|
"/api/v1/tags",
|
45
|
-
|
45
|
+
o,
|
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, o, 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}`), o && n.push(`sort=${o}`), l && n.push(l);
|
62
62
|
try {
|
63
|
-
const { data:
|
63
|
+
const { data: r, headers: s } = 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(s["com-davra-total-results"]), records: r };
|
72
72
|
} catch {
|
73
73
|
throw new Error("Twins API Error");
|
74
74
|
}
|
75
75
|
}, je = async (e) => {
|
76
76
|
try {
|
77
|
-
const { data: t, headers:
|
77
|
+
const { data: t, headers: o } = 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(o["com-davra-total-results"]), records: t };
|
87
87
|
} catch {
|
88
88
|
throw new Error("Twins API Error");
|
89
89
|
}
|
90
90
|
}, Oe = async (e) => {
|
91
91
|
try {
|
92
|
-
const { data: t, headers:
|
92
|
+
const { data: t, headers: o } = await f().get(
|
93
93
|
`/api/v1/twins?arrayUUIDs=${e.join(",")}`,
|
94
94
|
{
|
95
95
|
headers: {
|
@@ -97,29 +97,29 @@ const ee = {
|
|
97
97
|
}
|
98
98
|
}
|
99
99
|
);
|
100
|
-
return { totalRecords: parseInt(
|
100
|
+
return { totalRecords: parseInt(o["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
|
106
|
-
|
104
|
+
}, Me = async (e, t = 0, o = 1e3, l, n) => {
|
105
|
+
const r = [`digitalTwinTypeName=${e}`, `limit=${o}`, `start=${t}`];
|
106
|
+
l && r.push(`sort=${l}`), n && r.push(`name=~${n}`);
|
107
107
|
try {
|
108
|
-
const { data:
|
109
|
-
`/api/v1/twins/?${
|
108
|
+
const { data: s, headers: a } = await f().get(
|
109
|
+
`/api/v1/twins/?${r.join("&")}`,
|
110
110
|
{
|
111
111
|
headers: {
|
112
112
|
Accept: "application/json"
|
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: s };
|
117
117
|
} catch {
|
118
118
|
throw new Error("Twins API Error");
|
119
119
|
}
|
120
120
|
}, Pe = async (e) => {
|
121
121
|
try {
|
122
|
-
const { data: t } = await
|
122
|
+
const { data: t } = await f().get(
|
123
123
|
`/api/v1/twins/${e}`,
|
124
124
|
{
|
125
125
|
headers: {
|
@@ -131,9 +131,9 @@ const ee = {
|
|
131
131
|
} catch {
|
132
132
|
throw new Error("Twins API Error");
|
133
133
|
}
|
134
|
-
},
|
134
|
+
}, Be = async (e) => {
|
135
135
|
try {
|
136
|
-
const { data: t } = await
|
136
|
+
const { data: t } = await f().get(
|
137
137
|
`/api/v1/twins/${e}/attachments`,
|
138
138
|
{
|
139
139
|
headers: {
|
@@ -145,17 +145,17 @@ const ee = {
|
|
145
145
|
} catch {
|
146
146
|
throw new Error("Twins API Error");
|
147
147
|
}
|
148
|
-
},
|
148
|
+
}, W = {
|
149
149
|
getTwins: Re,
|
150
150
|
getTwinsByTypeName: Me,
|
151
151
|
getTwinByUUID: Pe,
|
152
152
|
getTwinByUUIDs: Oe,
|
153
|
-
getTwinAttachements:
|
153
|
+
getTwinAttachements: Be,
|
154
154
|
queryTwins: je
|
155
155
|
};
|
156
156
|
var te;
|
157
|
-
const
|
158
|
-
|
157
|
+
const xe = typeof window < "u", Le = (e) => typeof e < "u", Ne = (e) => typeof e == "function";
|
158
|
+
xe && ((te = window == null ? void 0 : window.navigator) != null && te.userAgent) && /iP(ad|hone|od)/.test(window.navigator.userAgent);
|
159
159
|
function qe(e) {
|
160
160
|
return e;
|
161
161
|
}
|
@@ -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 se;
|
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
|
+
})(se || (se = {}));
|
171
|
+
var Fe = Object.defineProperty, oe = Object.getOwnPropertySymbols, Qe = Object.prototype.hasOwnProperty, We = Object.prototype.propertyIsEnumerable, re = (e, t, o) => t in e ? Fe(e, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[t] = o, Je = (e, t) => {
|
172
|
+
for (var o in t || (t = {}))
|
173
|
+
Qe.call(t, o) && re(e, o, t[o]);
|
174
|
+
if (oe)
|
175
|
+
for (var o of oe(t))
|
176
|
+
We.call(t, o) && re(e, o, t[o]);
|
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,
|
208
|
+
function G(e, t, o, l = {}) {
|
209
|
+
var n, r, s;
|
210
210
|
const {
|
211
211
|
clone: a = !1,
|
212
212
|
passive: c = !1,
|
213
213
|
eventName: v,
|
214
|
-
deep:
|
215
|
-
defaultValue:
|
216
|
-
} =
|
214
|
+
deep: _ = !1,
|
215
|
+
defaultValue: h
|
216
|
+
} = l, w = be(), I = o || (w == null ? void 0 : w.emit) || ((n = w == null ? void 0 : w.$emit) == null ? void 0 : n.bind(w)) || ((s = (r = w == null ? void 0 : w.proxy) == null ? void 0 : r.$emit) == null ? void 0 : s.bind(w == null ? void 0 : w.proxy));
|
217
217
|
let T = v;
|
218
218
|
t || (t = "modelValue"), T = v || T || `update:${t.toString()}`;
|
219
|
-
const j = (
|
219
|
+
const j = (D) => a ? Ne(a) ? a(D) : ze(D) : D, U = () => Le(e[t]) ? j(e[t]) : h;
|
220
220
|
if (c) {
|
221
|
-
const
|
222
|
-
return
|
223
|
-
(m !== e[t] ||
|
224
|
-
}, { deep:
|
221
|
+
const D = U(), O = b(D);
|
222
|
+
return J(() => e[t], (m) => O.value = j(m)), J(O, (m) => {
|
223
|
+
(m !== e[t] || _) && I(T, m);
|
224
|
+
}, { deep: _ }), O;
|
225
225
|
} else
|
226
226
|
return S({
|
227
227
|
get() {
|
228
|
-
return
|
228
|
+
return U();
|
229
229
|
},
|
230
|
-
set(
|
231
|
-
I(T,
|
230
|
+
set(D) {
|
231
|
+
I(T, D);
|
232
232
|
}
|
233
233
|
});
|
234
234
|
}
|
235
|
-
function Ge(e, t,
|
236
|
-
const
|
235
|
+
function Ge(e, t, o = {}) {
|
236
|
+
const l = {};
|
237
237
|
for (const n in e)
|
238
|
-
|
239
|
-
return
|
238
|
+
l[n] = G(e, n, t, o);
|
239
|
+
return l;
|
240
240
|
}
|
241
|
-
const He = /* @__PURE__ */ de("span", null, null, -1), Ye = /* @__PURE__ */ de("span", null, null, -1), ve = /* @__PURE__ */
|
241
|
+
const He = /* @__PURE__ */ de("span", null, null, -1), Ye = /* @__PURE__ */ de("span", null, null, -1), ve = /* @__PURE__ */ L({
|
242
242
|
__name: "LabelInput",
|
243
243
|
props: {
|
244
244
|
labels: {},
|
@@ -249,39 +249,39 @@ 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 o = e, l = S(() => [
|
253
253
|
{ header: "Keys", color: "blue", icon: "mdi-label" },
|
254
|
-
...
|
254
|
+
...o.labels,
|
255
255
|
{ header: "Digital Twin Types", color: "purple", icon: "mdi-content-duplicate" },
|
256
|
-
...
|
257
|
-
]), { labelkey: n, labelvalue:
|
256
|
+
...o.twintypes
|
257
|
+
]), { labelkey: n, labelvalue: r } = Ge(o, t), s = b(""), a = b(""), c = b([]), v = b([]), _ = b(!1), h = (m) => o.twintypes.find((g) => g === m) ? "twintypes" : "labels", w = S(() => h(n.value)), I = () => {
|
258
258
|
document.activeElement.blur();
|
259
259
|
}, T = (m) => {
|
260
260
|
m.key === "Enter" && I();
|
261
261
|
}, j = async (m) => {
|
262
|
-
const
|
263
|
-
if (
|
262
|
+
const g = h(m);
|
263
|
+
if (_.value = !0, g === "twintypes")
|
264
264
|
try {
|
265
|
-
const
|
266
|
-
v.value =
|
265
|
+
const k = await W.getTwinsByTypeName(m);
|
266
|
+
v.value = k.records.map(($) => ({ value: $.UUID, label: $.name }));
|
267
267
|
} catch {
|
268
268
|
}
|
269
|
-
else if (
|
269
|
+
else if (g === "labels")
|
270
270
|
try {
|
271
|
-
const
|
272
|
-
c.value =
|
271
|
+
const k = await Z.getValuesByKey(m);
|
272
|
+
c.value = k;
|
273
273
|
} catch {
|
274
274
|
}
|
275
275
|
else
|
276
276
|
v.value = [], c.value = [];
|
277
|
-
|
277
|
+
_.value = !1;
|
278
278
|
};
|
279
|
-
|
280
|
-
m !==
|
279
|
+
J(n, async (m, g) => {
|
280
|
+
m !== g && (j(m), g !== "" && (r.value = ""));
|
281
281
|
});
|
282
|
-
const
|
282
|
+
const U = b(), D = S(() => {
|
283
283
|
var m;
|
284
|
-
return (m =
|
284
|
+
return (m = U.value) == null ? void 0 : m.isFocused;
|
285
285
|
}), O = {
|
286
286
|
specialNames: (m) => ![
|
287
287
|
"deviceid",
|
@@ -296,24 +296,24 @@ const He = /* @__PURE__ */ de("span", null, null, -1), Ye = /* @__PURE__ */ de("
|
|
296
296
|
};
|
297
297
|
return ue(() => {
|
298
298
|
n.value && j(n.value);
|
299
|
-
}), (m,
|
300
|
-
const
|
301
|
-
return
|
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"), H = p("v-col"), _e = p("v-autocomplete"), fe = p("v-btn"), we = p("v-row");
|
301
|
+
return A(), C(we, { class: "py-2" }, {
|
302
302
|
default: i(() => [
|
303
303
|
d(H, { class: "py-0 flex-grow-1 flex-shrink-0" }, {
|
304
304
|
default: i(() => [
|
305
305
|
d(X, {
|
306
306
|
modelValue: u(n),
|
307
|
-
"onUpdate:modelValue":
|
308
|
-
search: u(
|
309
|
-
"onUpdate:search":
|
307
|
+
"onUpdate:modelValue": g[0] || (g[0] = (y) => R(n) ? n.value = y : null),
|
308
|
+
search: u(s),
|
309
|
+
"onUpdate:search": g[1] || (g[1] = (y) => R(s) ? s.value = y : null),
|
310
310
|
"item-value": "value",
|
311
311
|
"data-testid": "label-key-selector",
|
312
|
-
readonly: "readonly" in m ? m.readonly : u(
|
312
|
+
readonly: "readonly" in m ? m.readonly : u(q),
|
313
313
|
class: "label-combo-key",
|
314
314
|
variant: "outlined",
|
315
315
|
label: "Key",
|
316
|
-
items: u(
|
316
|
+
items: u(l),
|
317
317
|
"hide-no-data": !1,
|
318
318
|
"no-data-text": "",
|
319
319
|
"hide-details": "auto",
|
@@ -326,26 +326,26 @@ const He = /* @__PURE__ */ de("span", null, null, -1), Ye = /* @__PURE__ */ de("
|
|
326
326
|
He
|
327
327
|
]),
|
328
328
|
"prepend-item": i(() => [
|
329
|
-
u(
|
329
|
+
u(s) && !u(l).includes(u(s)) ? (A(), C(M, {
|
330
330
|
key: 0,
|
331
331
|
class: "bg-blue-lighten-5",
|
332
332
|
onClick: I
|
333
333
|
}, {
|
334
334
|
default: i(() => [
|
335
|
-
d(
|
335
|
+
d(V, null, {
|
336
336
|
default: i(() => [
|
337
|
-
|
338
|
-
d(
|
337
|
+
E(" Create new key "),
|
338
|
+
d($, {
|
339
339
|
class: "ma-2",
|
340
340
|
color: "blue",
|
341
341
|
label: ""
|
342
342
|
}, {
|
343
343
|
default: i(() => [
|
344
|
-
d(
|
344
|
+
d(k, {
|
345
345
|
start: "",
|
346
346
|
icon: "mdi-label"
|
347
347
|
}),
|
348
|
-
|
348
|
+
E(" " + B(u(s)), 1)
|
349
349
|
]),
|
350
350
|
_: 1
|
351
351
|
})
|
@@ -356,40 +356,40 @@ const He = /* @__PURE__ */ de("span", null, null, -1), Ye = /* @__PURE__ */ de("
|
|
356
356
|
_: 1
|
357
357
|
})) : P("", !0)
|
358
358
|
]),
|
359
|
-
item: i(({ item:
|
360
|
-
|
359
|
+
item: i(({ item: y, props: x }) => [
|
360
|
+
y.raw.header ? (A(), C(M, F({ key: 0 }, x, {
|
361
361
|
disabled: "",
|
362
|
-
class: ["opacityMax", `bg-${
|
362
|
+
class: ["opacityMax", `bg-${y.raw.color}-lighten-5`],
|
363
363
|
style: {},
|
364
364
|
title: !1,
|
365
|
-
subtitle:
|
365
|
+
subtitle: y.raw.header
|
366
366
|
}), {
|
367
367
|
prepend: i(() => [
|
368
|
-
he(d(
|
369
|
-
icon:
|
370
|
-
color:
|
368
|
+
he(d(k, {
|
369
|
+
icon: y.raw.icon,
|
370
|
+
color: y.raw.color,
|
371
371
|
size: "small"
|
372
372
|
}, null, 8, ["icon", "color"]), [
|
373
|
-
[ge,
|
373
|
+
[ge, y.raw.icon]
|
374
374
|
])
|
375
375
|
]),
|
376
376
|
_: 2
|
377
|
-
}, 1040, ["class", "subtitle"])) : (
|
378
|
-
title:
|
377
|
+
}, 1040, ["class", "subtitle"])) : (A(), C(M, F({ key: 1 }, x, {
|
378
|
+
title: y.value
|
379
379
|
}), null, 16, ["title"]))
|
380
380
|
]),
|
381
|
-
chip: i(({ item:
|
382
|
-
|
381
|
+
chip: i(({ item: y, props: x }) => [
|
382
|
+
y.value ? (A(), C($, F({
|
383
383
|
key: 0,
|
384
|
-
color:
|
384
|
+
color: h(y.value) === "twintypes" ? "purple" : "blue",
|
385
385
|
label: ""
|
386
|
-
},
|
386
|
+
}, x), {
|
387
387
|
default: i(() => [
|
388
|
-
d(
|
388
|
+
d(k, {
|
389
389
|
start: "",
|
390
|
-
icon:
|
390
|
+
icon: h(y.value) === "twintypes" ? "mdi-content-duplicate" : "mdi-label"
|
391
391
|
}, null, 8, ["icon"]),
|
392
|
-
|
392
|
+
E(" " + B(y.value), 1)
|
393
393
|
]),
|
394
394
|
_: 2
|
395
395
|
}, 1040, ["color"])) : P("", !0)
|
@@ -401,19 +401,19 @@ const He = /* @__PURE__ */ de("span", null, null, -1), Ye = /* @__PURE__ */ de("
|
|
401
401
|
}),
|
402
402
|
d(H, { class: "py-0 flex-grow-1 flex-shrink-0" }, {
|
403
403
|
default: i(() => [
|
404
|
-
u(
|
404
|
+
u(w) === "twintypes" ? (A(), C(_e, {
|
405
405
|
key: 0,
|
406
406
|
ref_key: "autocomplete",
|
407
|
-
ref:
|
408
|
-
modelValue: u(
|
409
|
-
"onUpdate:modelValue":
|
407
|
+
ref: U,
|
408
|
+
modelValue: u(r),
|
409
|
+
"onUpdate:modelValue": g[2] || (g[2] = (y) => R(r) ? r.value = y : null),
|
410
410
|
"data-testid": "label-twin-selector",
|
411
|
-
readonly: "readonly" in m ? m.readonly : u(
|
411
|
+
readonly: "readonly" in m ? m.readonly : u(q),
|
412
412
|
class: "label-auto-value",
|
413
413
|
variant: "outlined",
|
414
414
|
"hide-details": "auto",
|
415
415
|
label: "Twin",
|
416
|
-
loading: u(
|
416
|
+
loading: u(_),
|
417
417
|
density: "compact",
|
418
418
|
"item-title": "label",
|
419
419
|
"item-value": "value",
|
@@ -424,34 +424,34 @@ const He = /* @__PURE__ */ de("span", null, null, -1), Ye = /* @__PURE__ */ de("
|
|
424
424
|
"no-data-text": "",
|
425
425
|
clearable: ""
|
426
426
|
}, {
|
427
|
-
chip: i(({ item:
|
428
|
-
|
427
|
+
chip: i(({ item: y, props: x }) => [
|
428
|
+
y.value && !u(D) ? (A(), C($, F({
|
429
429
|
key: 0,
|
430
430
|
color: "purple",
|
431
431
|
label: ""
|
432
|
-
},
|
432
|
+
}, x), {
|
433
433
|
default: i(() => [
|
434
|
-
d(
|
434
|
+
d(k, {
|
435
435
|
start: "",
|
436
436
|
icon: "mdi-shape"
|
437
437
|
}),
|
438
|
-
|
438
|
+
E(" " + B(y.title), 1)
|
439
439
|
]),
|
440
440
|
_: 2
|
441
441
|
}, 1040)) : P("", !0)
|
442
442
|
]),
|
443
443
|
_: 1
|
444
|
-
}, 8, ["modelValue", "readonly", "loading", "items", "disabled"])) : (
|
444
|
+
}, 8, ["modelValue", "readonly", "loading", "items", "disabled"])) : (A(), C(X, {
|
445
445
|
key: 1,
|
446
446
|
search: u(a),
|
447
|
-
"onUpdate:search":
|
448
|
-
modelValue: u(
|
449
|
-
"onUpdate:modelValue":
|
447
|
+
"onUpdate:search": g[3] || (g[3] = (y) => R(a) ? a.value = y : null),
|
448
|
+
modelValue: u(r),
|
449
|
+
"onUpdate:modelValue": g[4] || (g[4] = (y) => R(r) ? r.value = y : null),
|
450
450
|
disabled: !u(n) || u(n) === "",
|
451
451
|
"data-testid": "label-value-selector",
|
452
452
|
class: "label-combo-value",
|
453
453
|
"menu-props": { maxHeight: "400px" },
|
454
|
-
loading: u(
|
454
|
+
loading: u(_),
|
455
455
|
"hide-details": "auto",
|
456
456
|
variant: "outlined",
|
457
457
|
label: "Value",
|
@@ -462,32 +462,32 @@ const He = /* @__PURE__ */ de("span", null, null, -1), Ye = /* @__PURE__ */ de("
|
|
462
462
|
"hide-no-data": !1,
|
463
463
|
"no-data-text": "",
|
464
464
|
rules: [O.alphanumericAndDash],
|
465
|
-
readonly: "readonly" in m ? m.readonly : u(
|
465
|
+
readonly: "readonly" in m ? m.readonly : u(q)
|
466
466
|
}, {
|
467
467
|
"no-data": i(() => [
|
468
468
|
Ye
|
469
469
|
]),
|
470
470
|
"prepend-item": i(() => [
|
471
|
-
u(a) && !u(c).find((
|
471
|
+
u(a) && !u(c).find((y) => y === u(a)) ? (A(), C(M, {
|
472
472
|
key: 0,
|
473
473
|
class: "bg-blue-lighten-5",
|
474
474
|
onClick: I
|
475
475
|
}, {
|
476
476
|
default: i(() => [
|
477
|
-
d(
|
477
|
+
d(V, null, {
|
478
478
|
default: i(() => [
|
479
|
-
|
480
|
-
d(
|
479
|
+
E(" Create new value "),
|
480
|
+
d($, {
|
481
481
|
class: "ma-2",
|
482
482
|
color: "blue",
|
483
483
|
label: ""
|
484
484
|
}, {
|
485
485
|
default: i(() => [
|
486
|
-
d(
|
486
|
+
d(k, {
|
487
487
|
start: "",
|
488
488
|
icon: "mdi-label"
|
489
489
|
}),
|
490
|
-
|
490
|
+
E(" " + B(u(a)), 1)
|
491
491
|
]),
|
492
492
|
_: 1
|
493
493
|
})
|
@@ -498,18 +498,18 @@ const He = /* @__PURE__ */ de("span", null, null, -1), Ye = /* @__PURE__ */ de("
|
|
498
498
|
_: 1
|
499
499
|
})) : P("", !0)
|
500
500
|
]),
|
501
|
-
chip: i(({ item:
|
502
|
-
|
501
|
+
chip: i(({ item: y, props: x }) => [
|
502
|
+
y.value ? (A(), C($, F({
|
503
503
|
key: 0,
|
504
504
|
color: "blue",
|
505
505
|
label: ""
|
506
|
-
},
|
506
|
+
}, x), {
|
507
507
|
default: i(() => [
|
508
|
-
d(
|
508
|
+
d(k, {
|
509
509
|
start: "",
|
510
510
|
icon: "mdi-shape"
|
511
511
|
}),
|
512
|
-
|
512
|
+
E(" " + B(y.title), 1)
|
513
513
|
]),
|
514
514
|
_: 2
|
515
515
|
}, 1040)) : P("", !0)
|
@@ -525,7 +525,7 @@ const He = /* @__PURE__ */ de("span", null, null, -1), Ye = /* @__PURE__ */ de("
|
|
525
525
|
class: "pa-0 flex-grow-0 flex-shrink-1"
|
526
526
|
}, {
|
527
527
|
default: i(() => [
|
528
|
-
("readonly" in m ? m.readonly : u(
|
528
|
+
("readonly" in m ? m.readonly : u(q)) ? P("", !0) : (A(), C(fe, {
|
529
529
|
key: 0,
|
530
530
|
class: "label-delete-btn",
|
531
531
|
variant: "text",
|
@@ -533,7 +533,7 @@ const He = /* @__PURE__ */ de("span", null, null, -1), Ye = /* @__PURE__ */ de("
|
|
533
533
|
color: "grey-darken-1",
|
534
534
|
flat: "",
|
535
535
|
size: "small",
|
536
|
-
onClick:
|
536
|
+
onClick: g[5] || (g[5] = (y) => m.$emit("removelabel"))
|
537
537
|
}))
|
538
538
|
]),
|
539
539
|
_: 1
|
@@ -545,7 +545,7 @@ const He = /* @__PURE__ */ de("span", null, null, -1), Ye = /* @__PURE__ */ de("
|
|
545
545
|
}
|
546
546
|
}), Ze = async () => {
|
547
547
|
try {
|
548
|
-
const { data: e } = await
|
548
|
+
const { data: e } = await f().get(
|
549
549
|
"/api/v1/twintypes",
|
550
550
|
{
|
551
551
|
headers: {
|
@@ -559,40 +559,40 @@ const He = /* @__PURE__ */ de("span", null, null, -1), Ye = /* @__PURE__ */ de("
|
|
559
559
|
}
|
560
560
|
}, Xe = {
|
561
561
|
getTwinTypes: Ze
|
562
|
-
}, me =
|
563
|
-
const e =
|
562
|
+
}, me = N("twinTypes", () => {
|
563
|
+
const e = b([]), t = S(() => e.value.map((n) => n.name)), o = S(() => 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;
|
567
567
|
} catch {
|
568
568
|
}
|
569
569
|
};
|
570
|
-
return
|
570
|
+
return l(), {
|
571
571
|
twinTypes: e,
|
572
|
-
pullTwinTypes:
|
572
|
+
pullTwinTypes: l,
|
573
573
|
twinTypeNames: t,
|
574
|
-
twinTypeSelectArray:
|
574
|
+
twinTypeSelectArray: o
|
575
575
|
};
|
576
|
-
}), et =
|
577
|
-
const e =
|
576
|
+
}), et = N("labels", () => {
|
577
|
+
const e = b([]), t = async () => {
|
578
578
|
try {
|
579
|
-
const
|
580
|
-
e.value =
|
579
|
+
const l = await Z.getLabels();
|
580
|
+
e.value = l;
|
581
581
|
} catch {
|
582
582
|
}
|
583
|
-
},
|
584
|
-
const { twinTypeNames: n } =
|
583
|
+
}, o = async (l) => {
|
584
|
+
const { twinTypeNames: n } = K(me());
|
585
585
|
try {
|
586
|
-
await Z.createLabel(
|
586
|
+
await Z.createLabel(l, n.value), await t();
|
587
587
|
} catch {
|
588
588
|
}
|
589
589
|
};
|
590
590
|
return t(), {
|
591
591
|
labels: e,
|
592
592
|
pullLabels: t,
|
593
|
-
updateLabels:
|
593
|
+
updateLabels: o
|
594
594
|
};
|
595
|
-
}), tt = /* @__PURE__ */
|
595
|
+
}), tt = /* @__PURE__ */ L({
|
596
596
|
__name: "LabelsSelector",
|
597
597
|
props: {
|
598
598
|
modelValue: {},
|
@@ -600,19 +600,19 @@ 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
|
604
|
-
|
605
|
-
}, v = (
|
606
|
-
|
603
|
+
const o = e, { labels: l } = K(et()), { twinTypeNames: n } = K(me()), r = b([]), s = S(() => (_) => l.value.filter((h) => !n.value.includes(h) && (_.key === h || !r.value.find(({ key: w }) => w === h)))), a = S(() => (_) => n.value.filter((h) => _.key === h || !r.value.find(({ key: w }) => w === h))), c = () => {
|
604
|
+
r.value.push({ key: "", value: "" });
|
605
|
+
}, v = (_) => {
|
606
|
+
r.value.splice(_, 1);
|
607
607
|
};
|
608
|
-
return
|
609
|
-
const
|
610
|
-
t("update:modelValue",
|
608
|
+
return J(r, (_) => {
|
609
|
+
const h = _.reduce((w, I) => (I.key && I.value && (w[I.key] = I.value), w), {});
|
610
|
+
t("update:modelValue", h);
|
611
611
|
}, { deep: !0 }), ue(() => {
|
612
|
-
|
613
|
-
}), (
|
614
|
-
const
|
615
|
-
return
|
612
|
+
o.modelValue && (r.value = Object.entries(o.modelValue).map(([_, h]) => ({ key: _, value: h })));
|
613
|
+
}), (_, h) => {
|
614
|
+
const w = p("v-spacer"), I = p("v-btn"), T = p("v-row"), j = p("v-card-title"), U = p("v-list-subheader"), D = p("v-col"), O = p("v-divider"), m = ve, g = p("v-card-text"), k = p("v-sheet");
|
615
|
+
return A(), C(k, {
|
616
616
|
class: "pa-3",
|
617
617
|
variant: "tonal",
|
618
618
|
border: "",
|
@@ -624,9 +624,9 @@ const He = /* @__PURE__ */ de("span", null, null, -1), Ye = /* @__PURE__ */ de("
|
|
624
624
|
default: i(() => [
|
625
625
|
d(T, { "no-gutters": "" }, {
|
626
626
|
default: i(() => [
|
627
|
-
|
628
|
-
d(
|
629
|
-
("readonly" in
|
627
|
+
E(" Labels "),
|
628
|
+
d(w),
|
629
|
+
("readonly" in _ ? _.readonly : u(q)) ? P("", !0) : (A(), C(I, {
|
630
630
|
key: 0,
|
631
631
|
class: "label-add-btn",
|
632
632
|
size: "small",
|
@@ -636,7 +636,7 @@ const He = /* @__PURE__ */ de("span", null, null, -1), Ye = /* @__PURE__ */ de("
|
|
636
636
|
onClick: c
|
637
637
|
}, {
|
638
638
|
default: i(() => [
|
639
|
-
|
639
|
+
E(" add a label ")
|
640
640
|
]),
|
641
641
|
_: 1
|
642
642
|
}))
|
@@ -646,26 +646,26 @@ const He = /* @__PURE__ */ de("span", null, null, -1), Ye = /* @__PURE__ */ de("
|
|
646
646
|
]),
|
647
647
|
_: 1
|
648
648
|
}),
|
649
|
-
u(
|
649
|
+
u(r).length ? (A(), C(g, { key: 0 }, {
|
650
650
|
default: i(() => [
|
651
651
|
d(T, { "no-gutters": "" }, {
|
652
652
|
default: i(() => [
|
653
|
-
d(
|
653
|
+
d(D, null, {
|
654
654
|
default: i(() => [
|
655
|
-
d(
|
655
|
+
d(U, null, {
|
656
656
|
default: i(() => [
|
657
|
-
|
657
|
+
E("Key")
|
658
658
|
]),
|
659
659
|
_: 1
|
660
660
|
})
|
661
661
|
]),
|
662
662
|
_: 1
|
663
663
|
}),
|
664
|
-
d(
|
664
|
+
d(D, null, {
|
665
665
|
default: i(() => [
|
666
|
-
d(
|
666
|
+
d(U, null, {
|
667
667
|
default: i(() => [
|
668
|
-
|
668
|
+
E("Value")
|
669
669
|
]),
|
670
670
|
_: 1
|
671
671
|
})
|
@@ -676,17 +676,17 @@ const He = /* @__PURE__ */ de("span", null, null, -1), Ye = /* @__PURE__ */ de("
|
|
676
676
|
_: 1
|
677
677
|
}),
|
678
678
|
d(O, { class: "mb-3" }),
|
679
|
-
(
|
680
|
-
key:
|
681
|
-
labelkey: u(
|
682
|
-
"onUpdate:labelkey": (M) => u(
|
683
|
-
labelvalue: u(
|
684
|
-
"onUpdate:labelvalue": (M) => u(
|
685
|
-
readonly: "readonly" in
|
686
|
-
labels: u(
|
687
|
-
twintypes: u(a)(u(
|
688
|
-
"data-lab-key":
|
689
|
-
onRemovelabel: (M) => v(
|
679
|
+
(A(!0), pe(Ae, null, Ee(u(r), ($, V) => (A(), C(m, {
|
680
|
+
key: V,
|
681
|
+
labelkey: u(r)[V].key,
|
682
|
+
"onUpdate:labelkey": (M) => u(r)[V].key = M,
|
683
|
+
labelvalue: u(r)[V].value,
|
684
|
+
"onUpdate:labelvalue": (M) => u(r)[V].value = M,
|
685
|
+
readonly: "readonly" in _ ? _.readonly : u(q),
|
686
|
+
labels: u(s)(u(r)[V]),
|
687
|
+
twintypes: u(a)(u(r)[V]),
|
688
|
+
"data-lab-key": $.key,
|
689
|
+
onRemovelabel: (M) => v(V)
|
690
690
|
}, null, 8, ["labelkey", "onUpdate:labelkey", "labelvalue", "onUpdate:labelvalue", "readonly", "labels", "twintypes", "data-lab-key", "onRemovelabel"]))), 128))
|
691
691
|
]),
|
692
692
|
_: 1
|
@@ -696,7 +696,7 @@ const He = /* @__PURE__ */ de("span", null, null, -1), Ye = /* @__PURE__ */ de("
|
|
696
696
|
});
|
697
697
|
};
|
698
698
|
}
|
699
|
-
}), at = /* @__PURE__ */
|
699
|
+
}), at = /* @__PURE__ */ L({
|
700
700
|
__name: "Modal",
|
701
701
|
props: {
|
702
702
|
modelValue: { type: Boolean },
|
@@ -704,29 +704,29 @@ 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
|
708
|
-
return (n,
|
709
|
-
const
|
710
|
-
return
|
711
|
-
modelValue: u(
|
712
|
-
"onUpdate:modelValue":
|
707
|
+
const o = e, l = o.parentActivator ? b(!1) : G(o, "modelValue", t);
|
708
|
+
return (n, r) => {
|
709
|
+
const s = p("v-dialog");
|
710
|
+
return A(), C(s, {
|
711
|
+
modelValue: u(l),
|
712
|
+
"onUpdate:modelValue": r[0] || (r[0] = (a) => R(l) ? l.value = a : null),
|
713
713
|
activator: n.parentActivator ? "parent" : void 0
|
714
714
|
}, {
|
715
715
|
default: i(() => [
|
716
|
-
|
716
|
+
z(n.$slots, "default")
|
717
717
|
]),
|
718
718
|
_: 3
|
719
719
|
}, 8, ["modelValue", "activator"]);
|
720
720
|
};
|
721
721
|
}
|
722
722
|
}), nt = Symbol.for("vuetify:display");
|
723
|
-
function
|
723
|
+
function st() {
|
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 ot = /* @__PURE__ */ L({
|
730
730
|
__name: "ViewObjectModal",
|
731
731
|
props: {
|
732
732
|
title: {},
|
@@ -736,57 +736,57 @@ const st = /* @__PURE__ */ B({
|
|
736
736
|
},
|
737
737
|
emits: ["confirm", "update:modelValue"],
|
738
738
|
setup(e, { emit: t }) {
|
739
|
-
const
|
740
|
-
t("confirm"),
|
741
|
-
}, { mobile:
|
742
|
-
return (
|
743
|
-
const c = p("v-toolbar-title"), v = p("v-btn"),
|
744
|
-
return
|
745
|
-
modelValue: u(
|
746
|
-
"onUpdate:modelValue": a[2] || (a[2] = (
|
747
|
-
activator:
|
739
|
+
const o = e, l = o.parentActivator ? b(!1) : G(o, "modelValue", t), n = () => {
|
740
|
+
t("confirm"), l.value = !1;
|
741
|
+
}, { mobile: r } = st();
|
742
|
+
return (s, 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"), T = p("v-card"), j = p("v-dialog");
|
744
|
+
return A(), C(j, {
|
745
|
+
modelValue: u(l),
|
746
|
+
"onUpdate:modelValue": a[2] || (a[2] = (U) => R(l) ? l.value = U : null),
|
747
|
+
activator: s.parentActivator ? "parent" : void 0,
|
748
748
|
"max-width": "800px",
|
749
|
-
fullscreen: u(
|
749
|
+
fullscreen: u(r)
|
750
750
|
}, {
|
751
751
|
default: i(() => [
|
752
752
|
d(T, null, {
|
753
753
|
default: i(() => [
|
754
|
-
d(
|
754
|
+
d(_, { color: "white" }, {
|
755
755
|
append: i(() => [
|
756
756
|
d(v, {
|
757
757
|
"data-testid": "close-kpi-modal",
|
758
758
|
size: "small",
|
759
759
|
icon: "mdi-close",
|
760
|
-
onClick: a[0] || (a[0] = (
|
760
|
+
onClick: a[0] || (a[0] = (U) => l.value = !1)
|
761
761
|
})
|
762
762
|
]),
|
763
763
|
default: i(() => [
|
764
764
|
d(c, null, {
|
765
765
|
default: i(() => [
|
766
|
-
|
766
|
+
E(B(s.title), 1)
|
767
767
|
]),
|
768
768
|
_: 1
|
769
769
|
})
|
770
770
|
]),
|
771
771
|
_: 1
|
772
772
|
}),
|
773
|
-
d(
|
773
|
+
d(h, null, {
|
774
774
|
default: i(() => [
|
775
|
-
|
775
|
+
z(s.$slots, "default")
|
776
776
|
]),
|
777
777
|
_: 3
|
778
778
|
}),
|
779
|
-
|
779
|
+
s.hideActions ? P("", !0) : (A(), C(I, { key: 0 }, {
|
780
780
|
default: i(() => [
|
781
|
-
|
782
|
-
d(
|
781
|
+
z(s.$slots, "actions", Ie(Se({ confirm: n, dialog: u(l) })), () => [
|
782
|
+
d(w),
|
783
783
|
d(v, {
|
784
784
|
class: "delete-modal-dismiss",
|
785
785
|
color: "grey",
|
786
|
-
onClick: a[1] || (a[1] = (
|
786
|
+
onClick: a[1] || (a[1] = (U) => l.value = !1)
|
787
787
|
}, {
|
788
788
|
default: i(() => [
|
789
|
-
|
789
|
+
E(" Dismiss ")
|
790
790
|
]),
|
791
791
|
_: 1
|
792
792
|
}),
|
@@ -797,7 +797,7 @@ const st = /* @__PURE__ */ B({
|
|
797
797
|
onClick: n
|
798
798
|
}, {
|
799
799
|
default: i(() => [
|
800
|
-
|
800
|
+
E(" Yes, I'm sure ")
|
801
801
|
]),
|
802
802
|
_: 1
|
803
803
|
})
|
@@ -813,7 +813,7 @@ const st = /* @__PURE__ */ B({
|
|
813
813
|
}, 8, ["modelValue", "activator", "fullscreen"]);
|
814
814
|
};
|
815
815
|
}
|
816
|
-
}), rt = /* @__PURE__ */
|
816
|
+
}), rt = /* @__PURE__ */ L({
|
817
817
|
__name: "DeleteModal",
|
818
818
|
props: {
|
819
819
|
title: {},
|
@@ -822,53 +822,53 @@ const st = /* @__PURE__ */ B({
|
|
822
822
|
},
|
823
823
|
emits: ["confirm", "update:modelValue"],
|
824
824
|
setup(e, { emit: t }) {
|
825
|
-
const
|
826
|
-
t("confirm"),
|
825
|
+
const o = e, l = o.parentActivator ? b(!1) : G(o, "modelValue", t), n = () => {
|
826
|
+
t("confirm"), l.value = !1;
|
827
827
|
};
|
828
|
-
return (
|
829
|
-
const a = p("v-card-title"), c = p("v-card-text"), v = p("v-spacer"),
|
830
|
-
return
|
831
|
-
modelValue: u(
|
832
|
-
"onUpdate:modelValue":
|
833
|
-
activator:
|
828
|
+
return (r, s) => {
|
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
|
+
return A(), C(I, {
|
831
|
+
modelValue: u(l),
|
832
|
+
"onUpdate:modelValue": s[1] || (s[1] = (T) => R(l) ? l.value = T : null),
|
833
|
+
activator: r.parentActivator ? "parent" : void 0,
|
834
834
|
"max-width": "400px"
|
835
835
|
}, {
|
836
836
|
default: i(() => [
|
837
|
-
d(
|
837
|
+
d(w, null, {
|
838
838
|
default: i(() => [
|
839
839
|
d(a, null, {
|
840
840
|
default: i(() => [
|
841
|
-
|
841
|
+
E(B(r.title), 1)
|
842
842
|
]),
|
843
843
|
_: 1
|
844
844
|
}),
|
845
845
|
d(c, null, {
|
846
846
|
default: i(() => [
|
847
|
-
|
847
|
+
z(r.$slots, "default")
|
848
848
|
]),
|
849
849
|
_: 3
|
850
850
|
}),
|
851
|
-
d(
|
851
|
+
d(h, null, {
|
852
852
|
default: i(() => [
|
853
853
|
d(v),
|
854
|
-
d(
|
854
|
+
d(_, {
|
855
855
|
class: "delete-modal-dismiss",
|
856
856
|
color: "grey",
|
857
|
-
onClick:
|
857
|
+
onClick: s[0] || (s[0] = (T) => l.value = !1)
|
858
858
|
}, {
|
859
859
|
default: i(() => [
|
860
|
-
|
860
|
+
E(" Dismiss ")
|
861
861
|
]),
|
862
862
|
_: 1
|
863
863
|
}),
|
864
|
-
d(
|
864
|
+
d(_, {
|
865
865
|
class: "delete-modal-confirm",
|
866
866
|
color: "red",
|
867
867
|
variant: "elevated",
|
868
868
|
onClick: n
|
869
869
|
}, {
|
870
870
|
default: i(() => [
|
871
|
-
|
871
|
+
E(" Yes, I'm sure ")
|
872
872
|
]),
|
873
873
|
_: 1
|
874
874
|
})
|
@@ -883,49 +883,49 @@ const st = /* @__PURE__ */ B({
|
|
883
883
|
}, 8, ["modelValue", "activator"]);
|
884
884
|
};
|
885
885
|
}
|
886
|
-
}), lt = /* @__PURE__ */
|
886
|
+
}), lt = /* @__PURE__ */ L({
|
887
887
|
__name: "ConfirmModal",
|
888
888
|
props: {
|
889
889
|
title: {}
|
890
890
|
},
|
891
891
|
emits: ["confirm"],
|
892
892
|
setup(e, { emit: t }) {
|
893
|
-
const
|
894
|
-
|
893
|
+
const o = b(!1), l = () => {
|
894
|
+
o.value = !1, t("confirm");
|
895
895
|
};
|
896
|
-
return (n,
|
897
|
-
const
|
898
|
-
return
|
899
|
-
modelValue: u(
|
900
|
-
"onUpdate:modelValue":
|
896
|
+
return (n, r) => {
|
897
|
+
const s = 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
|
+
return A(), C(w, {
|
899
|
+
modelValue: u(o),
|
900
|
+
"onUpdate:modelValue": r[1] || (r[1] = (I) => R(o) ? o.value = I : null),
|
901
901
|
activator: "parent",
|
902
902
|
"max-width": "400px"
|
903
903
|
}, {
|
904
904
|
default: i(() => [
|
905
|
-
d(
|
905
|
+
d(h, null, {
|
906
906
|
default: i(() => [
|
907
|
-
d(
|
907
|
+
d(s, null, {
|
908
908
|
default: i(() => [
|
909
|
-
|
909
|
+
E(B(n.title), 1)
|
910
910
|
]),
|
911
911
|
_: 1
|
912
912
|
}),
|
913
913
|
d(a, null, {
|
914
914
|
default: i(() => [
|
915
|
-
|
915
|
+
z(n.$slots, "default")
|
916
916
|
]),
|
917
917
|
_: 3
|
918
918
|
}),
|
919
|
-
d(
|
919
|
+
d(_, null, {
|
920
920
|
default: i(() => [
|
921
921
|
d(c),
|
922
922
|
d(v, {
|
923
923
|
class: "confirm-modal-dismiss",
|
924
924
|
color: "grey",
|
925
|
-
onClick:
|
925
|
+
onClick: r[0] || (r[0] = (I) => o.value = !1)
|
926
926
|
}, {
|
927
927
|
default: i(() => [
|
928
|
-
|
928
|
+
E(" Cancel ")
|
929
929
|
]),
|
930
930
|
_: 1
|
931
931
|
}),
|
@@ -933,10 +933,10 @@ const st = /* @__PURE__ */ B({
|
|
933
933
|
class: "confirm-modal-confirm",
|
934
934
|
color: "primary",
|
935
935
|
variant: "elevated",
|
936
|
-
onClick:
|
936
|
+
onClick: l
|
937
937
|
}, {
|
938
938
|
default: i(() => [
|
939
|
-
|
939
|
+
E(" Yes, I'm sure ")
|
940
940
|
]),
|
941
941
|
_: 1
|
942
942
|
})
|
@@ -951,102 +951,57 @@ const st = /* @__PURE__ */ B({
|
|
951
951
|
}, 8, ["modelValue"]);
|
952
952
|
};
|
953
953
|
}
|
954
|
-
}), ct = /* @__PURE__ */
|
955
|
-
__name: "ColorInput",
|
956
|
-
props: {
|
957
|
-
modelValue: {}
|
958
|
-
},
|
959
|
-
emits: ["update:modelValue"],
|
960
|
-
setup(e, { emit: t }) {
|
961
|
-
const r = W(e, "modelValue", t), n = h(!1);
|
962
|
-
return (l, o) => {
|
963
|
-
const a = p("v-btn"), c = p("v-text-field"), v = p("v-color-picker"), y = p("v-menu");
|
964
|
-
return g(), E(y, {
|
965
|
-
modelValue: u(n),
|
966
|
-
"onUpdate:modelValue": o[2] || (o[2] = (_) => U(n) ? n.value = _ : null),
|
967
|
-
"close-on-content-click": !1,
|
968
|
-
location: "end"
|
969
|
-
}, {
|
970
|
-
activator: i(({ props: _ }) => [
|
971
|
-
d(a, N({
|
972
|
-
icon: "",
|
973
|
-
size: "small",
|
974
|
-
color: u(r)
|
975
|
-
}, _, { class: "mr-2" }), null, 16, ["color"]),
|
976
|
-
d(c, N({
|
977
|
-
modelValue: u(r),
|
978
|
-
"onUpdate:modelValue": o[0] || (o[0] = (b) => U(r) ? r.value = b : null),
|
979
|
-
"data-testid": "color-input",
|
980
|
-
"hide-details": "",
|
981
|
-
variant: "outlined",
|
982
|
-
density: "compact"
|
983
|
-
}, _, { style: { "max-width": "200px" } }), null, 16, ["modelValue"])
|
984
|
-
]),
|
985
|
-
default: i(() => [
|
986
|
-
d(v, {
|
987
|
-
modelValue: u(r),
|
988
|
-
"onUpdate:modelValue": o[1] || (o[1] = (_) => U(r) ? r.value = _ : null),
|
989
|
-
"show-swatches": "",
|
990
|
-
mode: "hex",
|
991
|
-
modes: ["hex"],
|
992
|
-
"data-testid": "color-picker"
|
993
|
-
}, null, 8, ["modelValue"])
|
994
|
-
]),
|
995
|
-
_: 1
|
996
|
-
}, 8, ["modelValue"]);
|
997
|
-
};
|
998
|
-
}
|
999
|
-
}), it = /* @__PURE__ */ B({
|
954
|
+
}), ct = /* @__PURE__ */ L({
|
1000
955
|
__name: "ScrollText",
|
1001
956
|
setup(e) {
|
1002
|
-
Te((
|
957
|
+
Te((s) => ({
|
1003
958
|
"2e2ac96b": u(n),
|
1004
|
-
e0628022: u(
|
959
|
+
e0628022: u(l)
|
1005
960
|
}));
|
1006
|
-
const t =
|
1007
|
-
var
|
1008
|
-
return t.value ? ((
|
1009
|
-
}),
|
1010
|
-
var
|
1011
|
-
return ((
|
961
|
+
const t = b(null), o = S(() => {
|
962
|
+
var s, a;
|
963
|
+
return t.value ? ((s = t.value) == null ? void 0 : s.scrollWidth) - ((a = t.value) == null ? void 0 : a.offsetWidth) : 0;
|
964
|
+
}), l = S(() => `${-o.value - 10}px`), n = S(() => `${o.value / 30}s`), r = S(() => {
|
965
|
+
var s, a;
|
966
|
+
return ((s = t.value) == null ? void 0 : s.scrollWidth) !== ((a = t.value) == null ? void 0 : a.offsetWidth);
|
1012
967
|
});
|
1013
|
-
return (
|
968
|
+
return (s, a) => (A(), pe("div", {
|
1014
969
|
ref_key: "text",
|
1015
970
|
ref: t,
|
1016
|
-
class: Ue({ "scroll-text": u(
|
971
|
+
class: Ue({ "scroll-text": u(r) })
|
1017
972
|
}, [
|
1018
|
-
|
973
|
+
z(s.$slots, "default", {}, void 0, !0)
|
1019
974
|
], 2));
|
1020
975
|
}
|
1021
976
|
});
|
1022
|
-
const
|
1023
|
-
const
|
1024
|
-
for (const [
|
1025
|
-
|
1026
|
-
return
|
1027
|
-
},
|
1028
|
-
const e =
|
977
|
+
const it = (e, t) => {
|
978
|
+
const o = e.__vccOpts || e;
|
979
|
+
for (const [l, n] of t)
|
980
|
+
o[l] = n;
|
981
|
+
return o;
|
982
|
+
}, ut = /* @__PURE__ */ it(ct, [["__scopeId", "data-v-4d66a865"]]), Q = N("alertMessages", () => {
|
983
|
+
const e = b(!1), t = b(""), o = b(""), l = b(5e3);
|
1029
984
|
return {
|
1030
985
|
snackbar: e,
|
1031
986
|
snackbarText: t,
|
1032
|
-
snackbarSeverity:
|
1033
|
-
snackbarTimeout:
|
1034
|
-
setSnackbarMessage: (
|
1035
|
-
t.value =
|
987
|
+
snackbarSeverity: o,
|
988
|
+
snackbarTimeout: l,
|
989
|
+
setSnackbarMessage: (r = "", s = "", a = 5e3) => {
|
990
|
+
t.value = r, o.value = s, l.value = a, e.value = !0;
|
1036
991
|
}
|
1037
992
|
};
|
1038
|
-
}),
|
993
|
+
}), dt = /* @__PURE__ */ L({
|
1039
994
|
__name: "Snackbar",
|
1040
995
|
setup(e) {
|
1041
|
-
const { snackbar: t, snackbarText:
|
1042
|
-
return (
|
996
|
+
const { snackbar: t, snackbarText: o, snackbarTimeout: l, snackbarSeverity: n } = K(Q());
|
997
|
+
return (r, s) => {
|
1043
998
|
const a = p("v-btn"), c = p("v-snackbar");
|
1044
|
-
return
|
999
|
+
return A(), C(c, {
|
1045
1000
|
modelValue: u(t),
|
1046
|
-
"onUpdate:modelValue":
|
1001
|
+
"onUpdate:modelValue": s[1] || (s[1] = (v) => R(t) ? t.value = v : null),
|
1047
1002
|
style: { "margin-bottom": "50px" },
|
1048
1003
|
"data-testid": "snackbar",
|
1049
|
-
timeout: u(
|
1004
|
+
timeout: u(l),
|
1050
1005
|
variant: "tonal",
|
1051
1006
|
color: u(n)
|
1052
1007
|
}, {
|
@@ -1054,16 +1009,16 @@ const ut = (e, t) => {
|
|
1054
1009
|
d(a, {
|
1055
1010
|
color: "snackbarSeverity",
|
1056
1011
|
variant: "text",
|
1057
|
-
onClick:
|
1012
|
+
onClick: s[0] || (s[0] = (v) => t.value = !1)
|
1058
1013
|
}, {
|
1059
1014
|
default: i(() => [
|
1060
|
-
|
1015
|
+
E(" Close ")
|
1061
1016
|
]),
|
1062
1017
|
_: 1
|
1063
1018
|
})
|
1064
1019
|
]),
|
1065
1020
|
default: i(() => [
|
1066
|
-
|
1021
|
+
E(B(u(o)) + " ", 1)
|
1067
1022
|
]),
|
1068
1023
|
_: 1
|
1069
1024
|
}, 8, ["modelValue", "timeout", "color"]);
|
@@ -1071,28 +1026,27 @@ const ut = (e, t) => {
|
|
1071
1026
|
}
|
1072
1027
|
}), le = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
1073
1028
|
__proto__: null,
|
1074
|
-
ColorInput: ct,
|
1075
1029
|
ConfirmModal: lt,
|
1076
1030
|
DeleteModal: rt,
|
1077
1031
|
LabelInput: ve,
|
1078
1032
|
LabelsSelector: tt,
|
1079
1033
|
Modal: at,
|
1080
|
-
ScrollText:
|
1081
|
-
Snackbar:
|
1082
|
-
ViewObjectModal:
|
1034
|
+
ScrollText: ut,
|
1035
|
+
Snackbar: dt,
|
1036
|
+
ViewObjectModal: ot
|
1083
1037
|
}, Symbol.toStringTag, { value: "Module" }));
|
1084
|
-
const
|
1038
|
+
const pt = 100, Pt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
1085
1039
|
__proto__: null,
|
1086
|
-
MAGIC_NUM:
|
1040
|
+
MAGIC_NUM: pt
|
1087
1041
|
}, Symbol.toStringTag, { value: "Module" }));
|
1088
|
-
function
|
1042
|
+
function vt(e, t) {
|
1089
1043
|
return e + t;
|
1090
1044
|
}
|
1091
1045
|
const Bt = {
|
1092
|
-
add:
|
1093
|
-
},
|
1046
|
+
add: vt
|
1047
|
+
}, mt = async () => {
|
1094
1048
|
try {
|
1095
|
-
const { data: e } = await
|
1049
|
+
const { data: e } = await f().get(
|
1096
1050
|
"/user",
|
1097
1051
|
{
|
1098
1052
|
headers: {
|
@@ -1141,9 +1095,9 @@ const Bt = {
|
|
1141
1095
|
{ Action: "dashboards.ACCESS" },
|
1142
1096
|
{ Action: "dashboards.CREATE_DASHBOARD" },
|
1143
1097
|
{ Action: "integrations.ACCESS" }
|
1144
|
-
],
|
1098
|
+
], yt = async (e = []) => {
|
1145
1099
|
try {
|
1146
|
-
const { data: t } = await
|
1100
|
+
const { data: t } = await f().post(
|
1147
1101
|
"/api/v1/authorization/policy/check",
|
1148
1102
|
e.length ? e : ye,
|
1149
1103
|
{
|
@@ -1157,14 +1111,14 @@ const Bt = {
|
|
1157
1111
|
return [];
|
1158
1112
|
}
|
1159
1113
|
}, ce = {
|
1160
|
-
getUser:
|
1161
|
-
getUserPermissions:
|
1114
|
+
getUser: mt,
|
1115
|
+
getUserPermissions: yt,
|
1162
1116
|
permissionList: ye
|
1163
|
-
},
|
1117
|
+
}, _t = async (e) => {
|
1164
1118
|
const t = [];
|
1165
1119
|
e && t.push(e);
|
1166
1120
|
try {
|
1167
|
-
const { data:
|
1121
|
+
const { data: o } = await f().get(
|
1168
1122
|
`/api/v1/iotdata/devices/counters/metrics?${t.join("&")}`,
|
1169
1123
|
{
|
1170
1124
|
headers: {
|
@@ -1172,13 +1126,13 @@ const Bt = {
|
|
1172
1126
|
}
|
1173
1127
|
}
|
1174
1128
|
);
|
1175
|
-
return
|
1129
|
+
return o;
|
1176
1130
|
} catch {
|
1177
1131
|
throw new Error("Devices Counters API Error");
|
1178
1132
|
}
|
1179
|
-
},
|
1133
|
+
}, ft = async (e) => {
|
1180
1134
|
try {
|
1181
|
-
const { data: t } = await
|
1135
|
+
const { data: t } = await f().get(
|
1182
1136
|
`/api/v1/iotdata/devices/counters/metrics?arrayUUIDs=${e.join(",")}`,
|
1183
1137
|
{
|
1184
1138
|
headers: {
|
@@ -1190,9 +1144,9 @@ const Bt = {
|
|
1190
1144
|
} catch {
|
1191
1145
|
throw new Error("Devices Counters API Error");
|
1192
1146
|
}
|
1193
|
-
},
|
1147
|
+
}, wt = async (e) => {
|
1194
1148
|
try {
|
1195
|
-
const { data: t } = await
|
1149
|
+
const { data: t } = await f().get(
|
1196
1150
|
`/api/v1/iotdata/devices/counters/metrics/${e}`,
|
1197
1151
|
{
|
1198
1152
|
headers: {
|
@@ -1204,9 +1158,9 @@ const Bt = {
|
|
1204
1158
|
} catch {
|
1205
1159
|
throw new Error("Devices Counters API Error");
|
1206
1160
|
}
|
1207
|
-
},
|
1161
|
+
}, bt = async (e) => {
|
1208
1162
|
try {
|
1209
|
-
const { data: t } = await
|
1163
|
+
const { data: t } = await f().get(
|
1210
1164
|
`/api/v1/iotdata/devices/counters/${e}`,
|
1211
1165
|
{
|
1212
1166
|
headers: {
|
@@ -1218,9 +1172,9 @@ const Bt = {
|
|
1218
1172
|
} catch {
|
1219
1173
|
throw new Error("Devices Counters API Error");
|
1220
1174
|
}
|
1221
|
-
},
|
1175
|
+
}, ht = async (e) => {
|
1222
1176
|
try {
|
1223
|
-
const { data: t } = await
|
1177
|
+
const { data: t } = await f().get(
|
1224
1178
|
`/api/v1/iotdata/devices/counters/latest/${e}`,
|
1225
1179
|
{
|
1226
1180
|
headers: {
|
@@ -1232,9 +1186,9 @@ const Bt = {
|
|
1232
1186
|
} catch {
|
1233
1187
|
throw new Error("Devices Counters API Error");
|
1234
1188
|
}
|
1235
|
-
},
|
1189
|
+
}, gt = async (e) => {
|
1236
1190
|
try {
|
1237
|
-
const { data: t } = await
|
1191
|
+
const { data: t } = await f().get(
|
1238
1192
|
`/api/v1/iotdata/devices/counters/latest?arrayUUIDs=${e.join(",")}`,
|
1239
1193
|
{
|
1240
1194
|
headers: {
|
@@ -1246,16 +1200,16 @@ const Bt = {
|
|
1246
1200
|
} catch {
|
1247
1201
|
throw new Error("Devices Counters API Error");
|
1248
1202
|
}
|
1249
|
-
},
|
1250
|
-
getDevicesCountersMetric:
|
1251
|
-
getDevicesCountersMetricByUUID:
|
1252
|
-
getDevicesCountersMetricByUUIDs:
|
1253
|
-
getDevicesCountersByUUID:
|
1254
|
-
getDevicesCountersLatestByUUID:
|
1255
|
-
getDevicesCountersLatestByUUIDs:
|
1256
|
-
},
|
1203
|
+
}, xt = {
|
1204
|
+
getDevicesCountersMetric: _t,
|
1205
|
+
getDevicesCountersMetricByUUID: wt,
|
1206
|
+
getDevicesCountersMetricByUUIDs: ft,
|
1207
|
+
getDevicesCountersByUUID: bt,
|
1208
|
+
getDevicesCountersLatestByUUID: ht,
|
1209
|
+
getDevicesCountersLatestByUUIDs: gt
|
1210
|
+
}, At = async (e) => {
|
1257
1211
|
try {
|
1258
|
-
const { data: t } = await
|
1212
|
+
const { data: t } = await f().get(
|
1259
1213
|
`/api/v1/iotdata/twins/counters/${e}`,
|
1260
1214
|
{
|
1261
1215
|
headers: {
|
@@ -1267,9 +1221,9 @@ const Bt = {
|
|
1267
1221
|
} catch {
|
1268
1222
|
throw new Error("Twins Counters API Error");
|
1269
1223
|
}
|
1270
|
-
},
|
1224
|
+
}, Et = async (e) => {
|
1271
1225
|
try {
|
1272
|
-
const { data: t } = await
|
1226
|
+
const { data: t } = await f().get(
|
1273
1227
|
`/api/v1/iotdata/twins/counters/latest/${e}`,
|
1274
1228
|
{
|
1275
1229
|
headers: {
|
@@ -1281,14 +1235,14 @@ const Bt = {
|
|
1281
1235
|
} catch {
|
1282
1236
|
throw new Error("Twins Counters API Error");
|
1283
1237
|
}
|
1284
|
-
},
|
1285
|
-
getTwinsCountersLatestByUUID:
|
1286
|
-
getTwinsCountersByUUID:
|
1287
|
-
},
|
1238
|
+
}, Lt = {
|
1239
|
+
getTwinsCountersLatestByUUID: Et,
|
1240
|
+
getTwinsCountersByUUID: At
|
1241
|
+
}, Ct = async (e, t, o, l) => {
|
1288
1242
|
const n = [];
|
1289
|
-
n.push(`start=${e || 0}`), t && n.push(`limit=${t}`),
|
1243
|
+
n.push(`start=${e || 0}`), t && n.push(`limit=${t}`), o && n.push(`sort=${o}`), l && n.push(l);
|
1290
1244
|
try {
|
1291
|
-
const { data:
|
1245
|
+
const { data: r } = await f().get(
|
1292
1246
|
`/api/v1/devices?${n.join("&")}`,
|
1293
1247
|
{
|
1294
1248
|
headers: {
|
@@ -1296,13 +1250,13 @@ const Bt = {
|
|
1296
1250
|
}
|
1297
1251
|
}
|
1298
1252
|
);
|
1299
|
-
return
|
1253
|
+
return r;
|
1300
1254
|
} catch {
|
1301
1255
|
throw new Error("Devices API Error");
|
1302
1256
|
}
|
1303
|
-
},
|
1257
|
+
}, It = async (e) => {
|
1304
1258
|
try {
|
1305
|
-
const { data: t } = await
|
1259
|
+
const { data: t } = await f().post(
|
1306
1260
|
"/api/v1/devices/query",
|
1307
1261
|
e,
|
1308
1262
|
{
|
@@ -1315,9 +1269,9 @@ const Bt = {
|
|
1315
1269
|
} catch {
|
1316
1270
|
throw new Error("Devices API Error");
|
1317
1271
|
}
|
1318
|
-
},
|
1272
|
+
}, St = async (e) => {
|
1319
1273
|
try {
|
1320
|
-
const { data: t } = await
|
1274
|
+
const { data: t } = await f().get(
|
1321
1275
|
`/api/v1/devices/${e}`,
|
1322
1276
|
{
|
1323
1277
|
headers: {
|
@@ -1329,9 +1283,9 @@ const Bt = {
|
|
1329
1283
|
} catch {
|
1330
1284
|
throw new Error("Devices API Error");
|
1331
1285
|
}
|
1332
|
-
},
|
1286
|
+
}, Tt = async (e) => {
|
1333
1287
|
try {
|
1334
|
-
const { data: t } = await
|
1288
|
+
const { data: t } = await f().get(
|
1335
1289
|
`/api/v1/devices?arrayUUIDs=${e.join(",")}`,
|
1336
1290
|
{
|
1337
1291
|
headers: {
|
@@ -1343,9 +1297,9 @@ const Bt = {
|
|
1343
1297
|
} catch {
|
1344
1298
|
throw new Error("Devices API Error");
|
1345
1299
|
}
|
1346
|
-
},
|
1300
|
+
}, Ut = async (e) => {
|
1347
1301
|
try {
|
1348
|
-
const { data: t } = await
|
1302
|
+
const { data: t } = await f().get(
|
1349
1303
|
`/api/v1/devices/attachments/${e}`,
|
1350
1304
|
{
|
1351
1305
|
headers: {
|
@@ -1358,14 +1312,14 @@ const Bt = {
|
|
1358
1312
|
throw new Error("Devices API Error");
|
1359
1313
|
}
|
1360
1314
|
}, Y = {
|
1361
|
-
getDevices:
|
1362
|
-
queryDevices:
|
1363
|
-
getDeviceByUUID:
|
1364
|
-
getDeviceByUUIDs:
|
1365
|
-
getDeviceAttachements:
|
1366
|
-
},
|
1315
|
+
getDevices: Ct,
|
1316
|
+
queryDevices: It,
|
1317
|
+
getDeviceByUUID: St,
|
1318
|
+
getDeviceByUUIDs: Tt,
|
1319
|
+
getDeviceAttachements: Ut
|
1320
|
+
}, Dt = async (e) => {
|
1367
1321
|
try {
|
1368
|
-
const { data: t } = await
|
1322
|
+
const { data: t } = await f().post(
|
1369
1323
|
"/api/v2/timeseriesdata",
|
1370
1324
|
e,
|
1371
1325
|
{
|
@@ -1378,12 +1332,12 @@ const Bt = {
|
|
1378
1332
|
} catch {
|
1379
1333
|
throw new Error("Timeseries Error");
|
1380
1334
|
}
|
1381
|
-
},
|
1382
|
-
queryTimeseries:
|
1383
|
-
},
|
1384
|
-
var e, t,
|
1335
|
+
}, Nt = {
|
1336
|
+
queryTimeseries: Dt
|
1337
|
+
}, kt = async () => {
|
1338
|
+
var e, t, o, l, n, r, s;
|
1385
1339
|
try {
|
1386
|
-
const { data: a } = await
|
1340
|
+
const { data: a } = await f().get(
|
1387
1341
|
"/api/v1/iotdata/meta-data/metrics",
|
1388
1342
|
{
|
1389
1343
|
headers: {
|
@@ -1393,13 +1347,13 @@ const Bt = {
|
|
1393
1347
|
);
|
1394
1348
|
return a.fields;
|
1395
1349
|
} catch (a) {
|
1396
|
-
const c = typeof ((t = (e = a == null ? void 0 : a.response) == null ? void 0 : e.data) == null ? void 0 : t.message) == "string" ? (
|
1397
|
-
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 = (o = a == null ? void 0 : a.response) == null ? void 0 : o.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 ${(s = a == null ? void 0 : a.response) == null ? void 0 : s.status} ${c}`);
|
1398
1352
|
}
|
1399
|
-
},
|
1400
|
-
var t,
|
1353
|
+
}, Vt = async (e) => {
|
1354
|
+
var t, o, l, n, r, s, a;
|
1401
1355
|
try {
|
1402
|
-
const { data: c } = await
|
1356
|
+
const { data: c } = await f().post(
|
1403
1357
|
"/api/v1/iotdata/meta-data",
|
1404
1358
|
{
|
1405
1359
|
name: e.name,
|
@@ -1417,46 +1371,46 @@ const Bt = {
|
|
1417
1371
|
);
|
1418
1372
|
return c;
|
1419
1373
|
} catch (c) {
|
1420
|
-
const v = typeof ((
|
1374
|
+
const v = typeof ((o = (t = c == null ? void 0 : c.response) == null ? void 0 : t.data) == null ? void 0 : o.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" ? (s = c == null ? void 0 : c.response) == null ? void 0 : s.data : "";
|
1421
1375
|
throw new Error(`API Error ${(a = c == null ? void 0 : c.response) == null ? void 0 : a.status} ${v}`);
|
1422
1376
|
}
|
1423
1377
|
}, ie = {
|
1424
|
-
getMetrics:
|
1425
|
-
postMetric:
|
1426
|
-
},
|
1427
|
-
const e =
|
1428
|
-
var
|
1429
|
-
return ((
|
1430
|
-
}),
|
1378
|
+
getMetrics: kt,
|
1379
|
+
postMetric: Vt
|
1380
|
+
}, qt = N("userSession", () => {
|
1381
|
+
const e = b(JSON.parse(localStorage.getItem("user") || "null")), t = b(JSON.parse(localStorage.getItem("user-permissions") || "[]")), o = S(() => {
|
1382
|
+
var s;
|
1383
|
+
return ((s = e.value) == null ? void 0 : s.name) || "no user";
|
1384
|
+
}), l = S(() => (s) => {
|
1431
1385
|
var a, c;
|
1432
|
-
return
|
1386
|
+
return s ? ((c = (a = t.value) == null ? void 0 : a.find((v) => v.Action === s)) == null ? void 0 : c.Allowed) || !1 : !0;
|
1433
1387
|
}), n = async () => {
|
1434
|
-
var
|
1388
|
+
var s, a;
|
1435
1389
|
try {
|
1436
1390
|
const c = await ce.getUser();
|
1437
|
-
if (e.value = c, (
|
1391
|
+
if (e.value = c, (s = e.value) != null && s.UUID) {
|
1438
1392
|
const v = await ce.getUserPermissions();
|
1439
1393
|
t.value = v, localStorage.setItem("user", JSON.stringify(e.value)), localStorage.setItem("user-permissions", JSON.stringify(t.value));
|
1440
1394
|
}
|
1441
1395
|
} catch (c) {
|
1442
1396
|
((a = c.response) == null ? void 0 : a.status) === 401 && (window.location.href = "/ui/login.html");
|
1443
1397
|
}
|
1444
|
-
},
|
1398
|
+
}, r = () => {
|
1445
1399
|
e.value = null, t.value = [], localStorage.removeItem("user"), localStorage.removeItem("user-permission"), window.location.href = "/ui/logout";
|
1446
1400
|
};
|
1447
|
-
return n(), { user: e, pullUser: n, userName:
|
1448
|
-
}),
|
1449
|
-
const e =
|
1401
|
+
return n(), { user: e, pullUser: n, userName: o, userPermissions: t, getPermission: l, logout: r };
|
1402
|
+
}), zt = N("devices", () => {
|
1403
|
+
const e = b({});
|
1450
1404
|
return {
|
1451
|
-
pullDevicesByUUIDs: async (n,
|
1452
|
-
|
1453
|
-
delete e.value[
|
1405
|
+
pullDevicesByUUIDs: async (n, r = !1) => {
|
1406
|
+
r && n.forEach((s) => {
|
1407
|
+
delete e.value[s];
|
1454
1408
|
});
|
1455
1409
|
try {
|
1456
|
-
const
|
1457
|
-
return
|
1410
|
+
const s = await Y.getDeviceByUUIDs(n);
|
1411
|
+
return s.records.forEach((a) => {
|
1458
1412
|
e.value[a.UUID] = a;
|
1459
|
-
}),
|
1413
|
+
}), s;
|
1460
1414
|
} catch {
|
1461
1415
|
return {
|
1462
1416
|
totalRecords: 0,
|
@@ -1464,9 +1418,9 @@ const Bt = {
|
|
1464
1418
|
};
|
1465
1419
|
}
|
1466
1420
|
},
|
1467
|
-
pullDevices: async (n,
|
1421
|
+
pullDevices: async (n, r, s, a) => {
|
1468
1422
|
try {
|
1469
|
-
const c = await Y.getDevices(n,
|
1423
|
+
const c = await Y.getDevices(n, r, s, a);
|
1470
1424
|
return c.records.forEach((v) => {
|
1471
1425
|
e.value[v.UUID] = v;
|
1472
1426
|
}), c;
|
@@ -1478,11 +1432,11 @@ const Bt = {
|
|
1478
1432
|
}
|
1479
1433
|
},
|
1480
1434
|
devicesCollection: e,
|
1481
|
-
getDeviceFromUUID: async (n,
|
1482
|
-
const
|
1483
|
-
if (
|
1484
|
-
return
|
1485
|
-
if (
|
1435
|
+
getDeviceFromUUID: async (n, r) => {
|
1436
|
+
const s = e.value[n];
|
1437
|
+
if (s)
|
1438
|
+
return s;
|
1439
|
+
if (r)
|
1486
1440
|
return null;
|
1487
1441
|
try {
|
1488
1442
|
const a = await Y.getDeviceByUUID(n);
|
@@ -1493,18 +1447,18 @@ const Bt = {
|
|
1493
1447
|
}
|
1494
1448
|
}
|
1495
1449
|
};
|
1496
|
-
}),
|
1497
|
-
const e =
|
1450
|
+
}), Ft = N("twins", () => {
|
1451
|
+
const e = b({});
|
1498
1452
|
return {
|
1499
|
-
pullTwinsByUUIDs: async (n,
|
1500
|
-
|
1501
|
-
delete e.value[
|
1453
|
+
pullTwinsByUUIDs: async (n, r = !1) => {
|
1454
|
+
r && n.forEach((s) => {
|
1455
|
+
delete e.value[s];
|
1502
1456
|
});
|
1503
1457
|
try {
|
1504
|
-
const
|
1505
|
-
return
|
1458
|
+
const s = await W.getTwinByUUIDs(n);
|
1459
|
+
return s.records.forEach((a) => {
|
1506
1460
|
e.value[a.UUID] = a;
|
1507
|
-
}),
|
1461
|
+
}), s;
|
1508
1462
|
} catch {
|
1509
1463
|
return {
|
1510
1464
|
totalRecords: 0,
|
@@ -1512,9 +1466,9 @@ const Bt = {
|
|
1512
1466
|
};
|
1513
1467
|
}
|
1514
1468
|
},
|
1515
|
-
pullTwins: async (n,
|
1469
|
+
pullTwins: async (n, r, s, a) => {
|
1516
1470
|
try {
|
1517
|
-
const c = await
|
1471
|
+
const c = await W.getTwins(n, r, s, a);
|
1518
1472
|
return c.records.forEach((v) => {
|
1519
1473
|
e.value[v.UUID] = v;
|
1520
1474
|
}), c;
|
@@ -1526,14 +1480,14 @@ const Bt = {
|
|
1526
1480
|
}
|
1527
1481
|
},
|
1528
1482
|
twinsCollection: e,
|
1529
|
-
getTwinFromUUID: async (n,
|
1530
|
-
const
|
1531
|
-
if (
|
1532
|
-
return
|
1533
|
-
if (
|
1483
|
+
getTwinFromUUID: async (n, r) => {
|
1484
|
+
const s = e.value[n];
|
1485
|
+
if (s)
|
1486
|
+
return s;
|
1487
|
+
if (r)
|
1534
1488
|
return null;
|
1535
1489
|
try {
|
1536
|
-
const a = await
|
1490
|
+
const a = await W.getTwinByUUID(n);
|
1537
1491
|
if (a)
|
1538
1492
|
return e.value[a.UUID] = a, a;
|
1539
1493
|
} catch {
|
@@ -1541,9 +1495,9 @@ const Bt = {
|
|
1541
1495
|
}
|
1542
1496
|
}
|
1543
1497
|
};
|
1544
|
-
}),
|
1498
|
+
}), $t = async () => {
|
1545
1499
|
try {
|
1546
|
-
const { data: e } = await
|
1500
|
+
const { data: e } = await f().get(
|
1547
1501
|
"/api/v1/iotdata/metrics/counters",
|
1548
1502
|
{
|
1549
1503
|
headers: {
|
@@ -1555,13 +1509,13 @@ const Bt = {
|
|
1555
1509
|
} catch {
|
1556
1510
|
throw new Error("Metric Counter API Error");
|
1557
1511
|
}
|
1558
|
-
},
|
1559
|
-
getMetricsCounters:
|
1560
|
-
},
|
1561
|
-
const e =
|
1512
|
+
}, Rt = {
|
1513
|
+
getMetricsCounters: $t
|
1514
|
+
}, Qt = N("metrics", () => {
|
1515
|
+
const e = b([]), t = b([]), o = S(() => (a) => {
|
1562
1516
|
var c;
|
1563
1517
|
return (c = t.value) == null ? void 0 : c.find((v) => v.name === a);
|
1564
|
-
}),
|
1518
|
+
}), l = S(() => e.value.map((a) => ({ title: `${a.label} ${a.name}`, label: a.label, value: a.name }))), n = async (a) => {
|
1565
1519
|
if (!(a && e.value.length))
|
1566
1520
|
try {
|
1567
1521
|
const c = await ie.getMetrics();
|
@@ -1569,65 +1523,64 @@ const Bt = {
|
|
1569
1523
|
} catch (c) {
|
1570
1524
|
Q().setSnackbarMessage(c, "error");
|
1571
1525
|
}
|
1572
|
-
},
|
1526
|
+
}, r = async () => {
|
1573
1527
|
try {
|
1574
|
-
const a = await
|
1528
|
+
const a = await Rt.getMetricsCounters();
|
1575
1529
|
t.value = a;
|
1576
1530
|
} catch (a) {
|
1577
1531
|
Q().setSnackbarMessage(a, "error");
|
1578
1532
|
}
|
1579
|
-
},
|
1533
|
+
}, s = async (a) => {
|
1580
1534
|
let c = !1;
|
1581
1535
|
try {
|
1582
1536
|
await ie.postMetric(a), c = !0, Q().setSnackbarMessage(`Metric ${a.name} successfully saved`, "success");
|
1583
1537
|
} catch (v) {
|
1584
1538
|
Q().setSnackbarMessage(v, "error");
|
1585
1539
|
}
|
1586
|
-
return await n(), await
|
1540
|
+
return await n(), await r(), c;
|
1587
1541
|
};
|
1588
1542
|
return n(), {
|
1589
1543
|
metrics: e,
|
1590
1544
|
metricsCounters: t,
|
1591
1545
|
pullMetrics: n,
|
1592
|
-
pullMetricsCounters:
|
1593
|
-
getMetricCounter:
|
1594
|
-
saveMetric:
|
1595
|
-
metricsArr:
|
1546
|
+
pullMetricsCounters: r,
|
1547
|
+
getMetricCounter: o,
|
1548
|
+
saveMetric: s,
|
1549
|
+
metricsArr: l
|
1596
1550
|
};
|
1597
1551
|
});
|
1598
|
-
function
|
1552
|
+
function Wt(e) {
|
1599
1553
|
for (const t in le)
|
1600
1554
|
e.component(t, le[t]);
|
1601
1555
|
}
|
1602
1556
|
export {
|
1603
|
-
ct as ColorInput,
|
1604
1557
|
lt as ConfirmModal,
|
1605
|
-
|
1558
|
+
f as DavraApiClient,
|
1606
1559
|
ee as DavraApiConfig,
|
1607
1560
|
rt as DeleteModal,
|
1608
|
-
|
1561
|
+
xt as DevicesCountersService,
|
1609
1562
|
Y as DevicesService,
|
1610
1563
|
ve as LabelInput,
|
1611
1564
|
tt as LabelsSelector,
|
1612
1565
|
Z as LabelsService,
|
1613
1566
|
ie as MetricsService,
|
1614
1567
|
at as Modal,
|
1615
|
-
|
1568
|
+
Pt as MyConstants,
|
1616
1569
|
Bt as MyUtil,
|
1617
|
-
|
1618
|
-
|
1619
|
-
|
1570
|
+
ut as ScrollText,
|
1571
|
+
dt as Snackbar,
|
1572
|
+
Nt as TimeseriesService,
|
1620
1573
|
Xe as TwinTypesService,
|
1621
|
-
|
1622
|
-
|
1574
|
+
Lt as TwinsCountersService,
|
1575
|
+
W as TwinsService,
|
1623
1576
|
ce as UserSessionService,
|
1624
|
-
|
1625
|
-
|
1577
|
+
ot as ViewObjectModal,
|
1578
|
+
Wt as installCoreComponents,
|
1626
1579
|
Q as useAlertMessagesStore,
|
1627
|
-
|
1580
|
+
zt as useDevicesStore,
|
1628
1581
|
et as useLabelsStore,
|
1629
|
-
|
1582
|
+
Qt as useMetricsStore,
|
1630
1583
|
me as useTwinTypesStore,
|
1631
|
-
|
1632
|
-
|
1584
|
+
Ft as useTwinsStore,
|
1585
|
+
qt as useUserSessionStore
|
1633
1586
|
};
|