@overvis/hmi-workspace-ui 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/alarm-list-DKFio0hg.js +414 -0
- package/dist/alarm-rule-dialog-mb4_nHRW.js +417 -0
- package/dist/{alarm-rule-lists-C5v1Kf7A.js → alarm-rule-lists-CfZXTWkK.js} +123 -125
- package/dist/{alarm-rules-page-CqFzofPd.js → alarm-rules-page-DBLSkrrG.js} +15 -18
- package/dist/alert-dialog-D_iDv2lQ.js +891 -0
- package/dist/{base-revision-YCO27zR4.js → base-revision-DLF9EnGV.js} +26 -29
- package/dist/{breadcrumbs-0cjsV2cq.js → breadcrumbs-D5R6Fz74.js} +6 -7
- package/dist/{catalog-list-DjZojYLJ.js → catalog-list-BkWosvh1.js} +2 -4
- package/dist/{code-editor-BVimvjDV.js → code-editor-DCM0KdMJ.js} +9 -6
- package/dist/dashboard-bindings.js +1 -2
- package/dist/{dashboards-page-BlrJguNz.js → dashboards-page-DLc11Vzu.js} +335 -359
- package/dist/{de-14WdmJxZ.js → de-Z2er-E5v.js} +4 -2
- package/dist/diagnostic-text-CYZFPiND.js +116 -0
- package/dist/{dialogs-D_v1LeH4.js → dialogs-BX023zml.js} +2523 -2590
- package/dist/{dialogs-B6BRnf3Q.js → dialogs-DEOg9lxy.js} +219 -227
- package/dist/{display-DmOo23mi.js → display-VYGzneE0.js} +4 -6
- package/dist/{editor-language-To9MxloY.js → editor-language-CGENZxbI.js} +3 -5
- package/dist/editor-page-CaN52OQh.js +1337 -0
- package/dist/{en-BgercpT0.js → en-CKPPL6bQ.js} +4 -2
- package/dist/entity-controls-DJT47yeV.js +71 -0
- package/dist/errors-BAWoH_5w.js +25 -0
- package/dist/{footer-DC-Q0052.js → footer-CbPMP8aq.js} +2404 -2515
- package/dist/host.js +8254 -675
- package/dist/{i18n-BgzakKoC.js → i18n-ChjEbYEg.js} +77 -90
- package/dist/i18n.js +1 -2
- package/dist/index.js +5168 -5353
- package/dist/{lat-lng-B12P7QyY.js → lat-lng-Bl77AGSO.js} +1 -2
- package/dist/{list-page-CvsdZb86.js → list-page-Fa29SkaJ.js} +116 -123
- package/dist/{location-map-renderer-DO5yfdSU.js → location-map-renderer-DvXIYc1Z.js} +6 -6
- package/dist/{location-picker-renderer-CjCxg6ai.js → location-picker-renderer-B1_-n8lf.js} +3 -4
- package/dist/{model-B8gGi4OK.js → model-tpg_xpFB.js} +1 -2
- package/dist/{notice-card-DyGywFsW.js → notice-card-V_0K0lO0.js} +54 -58
- package/dist/page-B5te_1Lc.js +449 -0
- package/dist/{page-v6LCwswN.js → page-BorlLnMX.js} +92 -100
- package/dist/page-DxF7FOve.js +507 -0
- package/dist/panel-DuZD-cBP.js +949 -0
- package/dist/parameter-values.js +3 -16
- package/dist/{pl-lQ9HXV9k.js → pl-DVABrn5G.js} +4 -2
- package/dist/presence-code-DsabLTZs.js +73 -0
- package/dist/{query-gate-DVhNIkge.js → query-gate-BbIo1Xrj.js} +6 -6
- package/dist/{provider-DoEpKcQ-.js → quick-report-BcZsfkCZ.js} +9423 -5102
- package/dist/{retention-BYXNpYmR.js → retention-C7EZsq8u.js} +4 -6
- package/dist/retention-note-CmMeHV_u.js +40 -0
- package/dist/{rolldown-runtime-Dy4uBu1J.js → rolldown-runtime-CGnMp29N.js} +1 -2
- package/dist/{ru-qTKINoUj.js → ru-CBRLC_xM.js} +8 -6
- package/dist/run-text-CDdfbKbg.js +112 -0
- package/dist/{search-D4rDnE9T.js → search-C6xQ_Hvo.js} +26 -29
- package/dist/{sections-kCOyc4NR.js → sections-D_SBfVzV.js} +2 -3
- package/dist/{select-BKiOWdSr.js → select-nNLG-AMz.js} +17 -23
- package/dist/{spinner-C-HPNxOc.js → spinner-B-KLtBjp.js} +182 -201
- package/dist/src/code-editor/code-editor.d.ts +3 -0
- package/dist/src/code-editor/taskfile-language.d.ts +22 -2
- package/dist/src/i18n/catalogs/de/edge-program.d.ts +3 -0
- package/dist/src/i18n/catalogs/de.d.ts +3 -0
- package/dist/src/i18n/catalogs/en/edge-program.d.ts +3 -0
- package/dist/src/i18n/catalogs/en.d.ts +3 -0
- package/dist/src/i18n/catalogs/pl/edge-program.d.ts +3 -0
- package/dist/src/i18n/catalogs/pl.d.ts +3 -0
- package/dist/src/i18n/catalogs/ru/edge-program.d.ts +5 -2
- package/dist/src/i18n/catalogs/ru/graphics.d.ts +2 -2
- package/dist/src/i18n/catalogs/ru.d.ts +7 -4
- package/dist/src/i18n/catalogs/uk/edge-program.d.ts +5 -2
- package/dist/src/i18n/catalogs/uk/graphics.d.ts +2 -2
- package/dist/src/i18n/catalogs/uk.d.ts +7 -4
- package/dist/src/version.d.ts +1 -1
- package/dist/src/workspace/graphics/inspector/item.d.ts +6 -6
- package/dist/src/workspace/local-workspace-app.d.ts +1 -1
- package/dist/src/workspace/routes.d.ts +1 -1
- package/dist/{starter-fields-BRLX0z-v.js → starter-fields-7S3LmtGa.js} +154 -157
- package/dist/{starter-handoff-BA3ucMKL.js → starter-handoff-BaK8Ss8I.js} +1 -2
- package/dist/styles.css +1 -1
- package/dist/ui.js +334 -374
- package/dist/{uk-CwpJAxmx.js → uk-17pbVYZa.js} +8 -6
- package/dist/{wireguard-docs-AfU6NzTL.js → wireguard-docs-Clb-7xRY.js} +14 -17
- package/package.json +15 -9
- package/dist/alarm-list-BL3xQ5Lf.js +0 -423
- package/dist/alarm-rule-dialog-S1ZUg-74.js +0 -423
- package/dist/alert-B8MAoIO8.js +0 -45
- package/dist/alert-dialog-CYkuMg5D.js +0 -129
- package/dist/api-error-9rQmUN5L.js +0 -93
- package/dist/breadcrumb-DzVL1yHa.js +0 -74
- package/dist/button-6SxPBYMz.js +0 -44
- package/dist/context-u9KJQmdB.js +0 -102
- package/dist/copyable-id-DYGiAcnq.js +0 -40
- package/dist/dashboard-context-CBfG6DoT.js +0 -191
- package/dist/date-time-picker-C3FhMXk6.js +0 -266
- package/dist/diagnostic-text-BAkzW0SE.js +0 -111
- package/dist/diagnostic-text-DiKd2i1w.js +0 -76
- package/dist/dialog-BIhQXcZC.js +0 -237
- package/dist/dialog-BqyIxMD-.js +0 -54
- package/dist/dropdown-menu-DSzbBq3v.js +0 -136
- package/dist/editor-page-BiSZJz5b.js +0 -1353
- package/dist/empty-B-QJ-06w.js +0 -59
- package/dist/entity-controls-D1K4Ot3O.js +0 -76
- package/dist/errors-CcsvDHu8.js +0 -26
- package/dist/history-page-sAAhG54V.js +0 -1400
- package/dist/icon-D-pR9htW.js +0 -57
- package/dist/index-page-DMH82fZe.js +0 -214
- package/dist/item-B5SaTFQU.js +0 -120
- package/dist/mutation-form-validators-BNz5bsv1.js +0 -2408
- package/dist/mutations-THtGG6Ai.js +0 -240
- package/dist/page-2KPemaAj.js +0 -328
- package/dist/page-6rIoTg2L.js +0 -459
- package/dist/page-C6giEoEd.js +0 -1935
- package/dist/page-DCbTxKsi.js +0 -313
- package/dist/page-DWO427hT.js +0 -208
- package/dist/page-LXu_2zm3.js +0 -137
- package/dist/page-aaUiVOnk.js +0 -513
- package/dist/page-header-RB2YFWlE.js +0 -55
- package/dist/page-title-CdCbiLt8.js +0 -14
- package/dist/panel-DDy8tUNR.js +0 -338
- package/dist/presence-code-BfSXr50g.js +0 -83
- package/dist/progress-C7cxNJA1.js +0 -83
- package/dist/provider-BOeYHi0n.js +0 -134
- package/dist/quick-report-CUVJnbKP.js +0 -416
- package/dist/radio-group-CZGqVbkJ.js +0 -26
- package/dist/retention-note-CHhA6gjY.js +0 -42
- package/dist/run-text-DvaO8LDF.js +0 -113
- package/dist/select-eNgZdZ30.js +0 -521
- package/dist/skeleton-6yk8Tdh5.js +0 -19
- package/dist/slider-DorDsoF8.js +0 -37
- package/dist/status-page-DAHiKM9P.js +0 -3286
- package/dist/switch-BqD0RH_G.js +0 -18
- package/dist/table-Q2-voLuw.js +0 -65
- package/dist/tabs-CSIucYFP.js +0 -57
- package/dist/theme-provider-BkRohQFU.js +0 -61
- package/dist/toggle-group-9Bs0Mm3r.js +0 -82
- package/dist/trpc-CvJUuUXp.js +0 -153
- package/dist/utils-CX-Pz5p6.js +0 -8
- package/dist/writability-BuH-spxv.js +0 -57
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/workspace/maps/lat-lng.ts
|
|
2
2
|
function e(e) {
|
|
3
3
|
if (e == null) return null;
|
|
4
4
|
let t = typeof e.lat == "function" ? e.lat() : e.lat, n = typeof e.lng == "function" ? e.lng() : e.lng;
|
|
@@ -7,5 +7,4 @@ function e(e) {
|
|
|
7
7
|
lng: n
|
|
8
8
|
};
|
|
9
9
|
}
|
|
10
|
-
//#endregion
|
|
11
10
|
export { e as t };
|
|
@@ -1,34 +1,29 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { h as
|
|
3
|
-
import {
|
|
4
|
-
import { l as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { n as
|
|
9
|
-
import { t as
|
|
10
|
-
import { i as
|
|
11
|
-
import { r as
|
|
12
|
-
import { t as
|
|
13
|
-
import { a as w, c as T, d as E, i as D, l as O, n as k, o as A, r as j, s as M, t as ee, u as te } from "./catalog-list-DjZojYLJ.js";
|
|
14
|
-
import { t as ne } from "./run-text-DvaO8LDF.js";
|
|
15
|
-
import { i as re, n as ie, r as ae, t as oe } from "./starter-fields-BRLX0z-v.js";
|
|
16
|
-
import { r as N } from "./starter-handoff-BA3ucMKL.js";
|
|
17
|
-
import { n as P, t as F } from "./entity-controls-D1K4Ot3O.js";
|
|
1
|
+
import { Kn as e, Qn as t, Wn as n, ii as r, zn as i } from "./quick-report-BcZsfkCZ.js";
|
|
2
|
+
import { h as a, m as o, n as s } from "./i18n-ChjEbYEg.js";
|
|
3
|
+
import { B as c, H as l, K as u, R as d, U as f, V as p, jt as m, xt as h } from "./alert-dialog-D_iDv2lQ.js";
|
|
4
|
+
import { l as g } from "./spinner-B-KLtBjp.js";
|
|
5
|
+
import { a as _, b as v, i as y, n as b } from "./panel-DuZD-cBP.js";
|
|
6
|
+
import { r as x, t as S } from "./query-gate-BbIo1Xrj.js";
|
|
7
|
+
import { t as C } from "./breadcrumbs-D5R6Fz74.js";
|
|
8
|
+
import { a as w, c as T, d as E, i as D, l as O, n as k, o as A, r as j, s as M, t as ee, u as te } from "./catalog-list-BkWosvh1.js";
|
|
9
|
+
import { t as ne } from "./run-text-CDdfbKbg.js";
|
|
10
|
+
import { i as re, n as ie, r as ae, t as oe } from "./starter-fields-7S3LmtGa.js";
|
|
11
|
+
import { r as N } from "./starter-handoff-BaK8Ss8I.js";
|
|
12
|
+
import { n as P, t as F } from "./entity-controls-DJT47yeV.js";
|
|
18
13
|
import { useRef as I, useState as L } from "react";
|
|
19
14
|
import { Fragment as R, jsx as z, jsxs as B } from "react/jsx-runtime";
|
|
20
15
|
import { LayoutTemplateIcon as V, PlusIcon as H, Trash2Icon as U, WorkflowIcon as W } from "lucide-react";
|
|
21
16
|
import { formatAppDateTime as G, resolveLocalized as K } from "@overvis/hmi-shared";
|
|
22
17
|
import { useNavigate as q } from "@tanstack/react-router";
|
|
23
|
-
|
|
18
|
+
// src/workspace/setup/automations/starter-dialog.tsx
|
|
24
19
|
function J({ workspaceId: e, kind: t, onClose: n }) {
|
|
25
20
|
let [r, i] = L(null), [a, o] = L(!1);
|
|
26
|
-
return /* @__PURE__ */ z(
|
|
21
|
+
return /* @__PURE__ */ z(d, {
|
|
27
22
|
open: !0,
|
|
28
23
|
onOpenChange: (e) => {
|
|
29
24
|
!e && !a && n();
|
|
30
25
|
},
|
|
31
|
-
children: /* @__PURE__ */ z(
|
|
26
|
+
children: /* @__PURE__ */ z(c, {
|
|
32
27
|
className: "sm:max-w-xl",
|
|
33
28
|
showCloseButton: !a,
|
|
34
29
|
children: r == null ? /* @__PURE__ */ z(se, {
|
|
@@ -47,18 +42,18 @@ function J({ workspaceId: e, kind: t, onClose: n }) {
|
|
|
47
42
|
})
|
|
48
43
|
});
|
|
49
44
|
}
|
|
50
|
-
function se({ workspaceId:
|
|
51
|
-
let a =
|
|
52
|
-
workspaceId:
|
|
53
|
-
kind:
|
|
45
|
+
function se({ workspaceId: e, kind: t, onPick: i }) {
|
|
46
|
+
let a = o(), s = r.templates.automation.list.useQuery({
|
|
47
|
+
workspaceId: e,
|
|
48
|
+
kind: t
|
|
54
49
|
});
|
|
55
|
-
return /* @__PURE__ */ B(R, { children: [/* @__PURE__ */ B(f, { children: [/* @__PURE__ */ z(
|
|
56
|
-
query:
|
|
50
|
+
return /* @__PURE__ */ B(R, { children: [/* @__PURE__ */ B(f, { children: [/* @__PURE__ */ z(u, { children: a("automation_starter_title") }), /* @__PURE__ */ z(p, { children: a("automation_starter_pick_description") })] }), /* @__PURE__ */ z(x, {
|
|
51
|
+
query: s,
|
|
57
52
|
loading: /* @__PURE__ */ B("div", {
|
|
58
53
|
className: "flex flex-col gap-2",
|
|
59
54
|
children: [/* @__PURE__ */ z(h, { className: "h-14 w-full" }), /* @__PURE__ */ z(h, { className: "h-14 w-full" })]
|
|
60
55
|
}),
|
|
61
|
-
error: (e) => /* @__PURE__ */ z(S, { message:
|
|
56
|
+
error: (e) => /* @__PURE__ */ z(S, { message: n(e) }),
|
|
62
57
|
isEmpty: (e) => e.starters.length === 0,
|
|
63
58
|
empty: /* @__PURE__ */ z("p", {
|
|
64
59
|
className: "text-muted-foreground",
|
|
@@ -70,20 +65,20 @@ function se({ workspaceId: t, kind: r, onPick: i }) {
|
|
|
70
65
|
})
|
|
71
66
|
})] });
|
|
72
67
|
}
|
|
73
|
-
function ce({ workspaceId:
|
|
74
|
-
let
|
|
75
|
-
workspaceId:
|
|
76
|
-
starterId:
|
|
77
|
-
}),
|
|
78
|
-
u,
|
|
68
|
+
function ce({ workspaceId: e, starterId: t, onBack: i, onBuilt: s, onBuilding: c }) {
|
|
69
|
+
let l = o(), u = a(), d = r.templates.automation.get.useQuery({
|
|
70
|
+
workspaceId: e,
|
|
71
|
+
starterId: t
|
|
72
|
+
}), f = r.automation.validationContext.useQuery({ workspaceId: e }), p = new Set((d.data?.placeholders ?? []).flatMap((e) => e.kind === "list" ? e.fields.map((e) => e.kind) : [e.kind])), m = r.endpoint.list.useQuery({ workspaceId: e }, { enabled: p.has("endpoint") }), g = r.alarmRule.list.useQuery({ workspaceId: e }, { enabled: p.has("alarmRule") }), _ = r.automation.members.useQuery({ workspaceId: e }, { enabled: p.has("recipients") }), v = [
|
|
79
73
|
d,
|
|
80
|
-
|
|
81
|
-
...
|
|
82
|
-
...
|
|
74
|
+
f,
|
|
75
|
+
...p.has("endpoint") ? [m] : [],
|
|
76
|
+
...p.has("alarmRule") ? [g] : [],
|
|
77
|
+
...p.has("recipients") ? [_] : []
|
|
83
78
|
], y = (e) => e.map((e) => ({
|
|
84
79
|
id: e.id,
|
|
85
|
-
name: K(e.name,
|
|
86
|
-
})), b =
|
|
80
|
+
name: K(e.name, u)
|
|
81
|
+
})), b = d.data, C = f.data, w = new Map((C?.parameters ?? []).map((e) => [e.id, e])), T = b != null && C != null && v.every((e) => e.data != null);
|
|
87
82
|
return /* @__PURE__ */ z(x, {
|
|
88
83
|
query: {
|
|
89
84
|
isLoading: v.some((e) => e.isLoading),
|
|
@@ -96,8 +91,8 @@ function ce({ workspaceId: r, starterId: i, onBack: a, onBuilt: o, onBuilding: s
|
|
|
96
91
|
let n = w.get(t), r = e.valueTypes;
|
|
97
92
|
return n !== void 0 && (r === void 0 || r.includes(n.type)) && (e.writable !== !0 || n.writable);
|
|
98
93
|
},
|
|
99
|
-
endpoints: y(
|
|
100
|
-
alarmRules: y(
|
|
94
|
+
endpoints: y(m.data?.endpoints ?? []),
|
|
95
|
+
alarmRules: y(g.data?.items ?? []),
|
|
101
96
|
branches: [],
|
|
102
97
|
members: _.data?.members ?? []
|
|
103
98
|
}
|
|
@@ -107,79 +102,79 @@ function ce({ workspaceId: r, starterId: i, onBack: a, onBuilt: o, onBuilding: s
|
|
|
107
102
|
className: "flex flex-col gap-4",
|
|
108
103
|
children: [/* @__PURE__ */ z(h, { className: "h-6 w-48" }), /* @__PURE__ */ z(h, { className: "h-40 w-full" })]
|
|
109
104
|
}),
|
|
110
|
-
error: (e) => /* @__PURE__ */ z(S, { message: e == null ?
|
|
111
|
-
children: (
|
|
112
|
-
workspaceId:
|
|
113
|
-
starter:
|
|
114
|
-
data:
|
|
115
|
-
onBack:
|
|
116
|
-
onBuilt:
|
|
117
|
-
onBuilding:
|
|
105
|
+
error: (e) => /* @__PURE__ */ z(S, { message: e == null ? l("error_request_failed") : n(e) }),
|
|
106
|
+
children: (t) => /* @__PURE__ */ z(le, {
|
|
107
|
+
workspaceId: e,
|
|
108
|
+
starter: t.starter,
|
|
109
|
+
data: t.data,
|
|
110
|
+
onBack: i,
|
|
111
|
+
onBuilt: s,
|
|
112
|
+
onBuilding: c
|
|
118
113
|
})
|
|
119
114
|
});
|
|
120
115
|
}
|
|
121
|
-
function le({ workspaceId:
|
|
122
|
-
let _ =
|
|
116
|
+
function le({ workspaceId: n, starter: s, data: c, onBack: d, onBuilt: h, onBuilding: g }) {
|
|
117
|
+
let _ = o(), v = a(), y = q(), b = r.useUtils(), [x, S] = L([]), C = I(1e3), w = () => `row-${String(C.current++)}`, T = e({
|
|
123
118
|
defaultValues: { values: ae(s.placeholders) },
|
|
124
|
-
validators:
|
|
125
|
-
let t = re(s.placeholders, e.values),
|
|
119
|
+
validators: i({ submit: async (e) => {
|
|
120
|
+
let t = re(s.placeholders, e.values), r;
|
|
126
121
|
g(!0);
|
|
127
122
|
try {
|
|
128
|
-
|
|
129
|
-
workspaceId:
|
|
123
|
+
r = t.ok ? await b.client.templates.automation.instantiate.query({
|
|
124
|
+
workspaceId: n,
|
|
130
125
|
starterId: s.id,
|
|
131
126
|
values: t.values
|
|
132
127
|
}) : t;
|
|
133
128
|
} finally {
|
|
134
129
|
g(!1);
|
|
135
130
|
}
|
|
136
|
-
if (!
|
|
131
|
+
if (!r.ok) return S(r.problems), {
|
|
137
132
|
form: () => _("starter_fix_problems"),
|
|
138
133
|
fields: {}
|
|
139
134
|
};
|
|
140
135
|
S([]);
|
|
141
|
-
let i =
|
|
136
|
+
let i = r.kind === "automation" ? {
|
|
142
137
|
kind: "automation",
|
|
143
|
-
document:
|
|
138
|
+
document: r.document
|
|
144
139
|
} : {
|
|
145
140
|
kind: "alarmRule",
|
|
146
|
-
document:
|
|
141
|
+
document: r.document
|
|
147
142
|
};
|
|
148
143
|
return h(), y({
|
|
149
144
|
to: i.kind === "automation" ? "/workspace/$workspaceId/setup/automations/new" : "/workspace/$workspaceId/setup/automations/alarm-rules/new",
|
|
150
|
-
params: { workspaceId:
|
|
145
|
+
params: { workspaceId: n },
|
|
151
146
|
state: N(i)
|
|
152
147
|
}), null;
|
|
153
148
|
} }),
|
|
154
|
-
onSubmitInvalid:
|
|
149
|
+
onSubmitInvalid: t
|
|
155
150
|
}), E = (e) => {
|
|
156
151
|
S((t) => t.filter((t) => t.path !== e && !t.path.startsWith(`${e}/`)));
|
|
157
152
|
};
|
|
158
153
|
return /* @__PURE__ */ z(T.AppForm, { children: /* @__PURE__ */ B(T.FormRoot, {
|
|
159
154
|
layout: "dialog",
|
|
160
155
|
children: [
|
|
161
|
-
/* @__PURE__ */ B(f, { children: [/* @__PURE__ */ z(
|
|
156
|
+
/* @__PURE__ */ B(f, { children: [/* @__PURE__ */ z(u, { children: K(s.name, v) }), /* @__PURE__ */ z(p, { children: K(s.description, v) })] }),
|
|
162
157
|
/* @__PURE__ */ z(T.AppField, {
|
|
163
158
|
name: "values",
|
|
164
159
|
children: (e) => /* @__PURE__ */ z(ie, {
|
|
165
|
-
workspaceId:
|
|
160
|
+
workspaceId: n,
|
|
166
161
|
placeholders: s.placeholders,
|
|
167
162
|
values: e.state.value,
|
|
168
163
|
onChange: (t, n) => {
|
|
169
164
|
E(n), e.handleChange(t);
|
|
170
165
|
},
|
|
171
166
|
problems: x,
|
|
172
|
-
data:
|
|
167
|
+
data: c,
|
|
173
168
|
newKey: w
|
|
174
169
|
})
|
|
175
170
|
}),
|
|
176
171
|
/* @__PURE__ */ B(l, { children: [/* @__PURE__ */ z(T.Subscribe, {
|
|
177
172
|
selector: (e) => e.isSubmitting,
|
|
178
|
-
children: (e) => /* @__PURE__ */ z(
|
|
173
|
+
children: (e) => /* @__PURE__ */ z(m, {
|
|
179
174
|
type: "button",
|
|
180
175
|
variant: "outline",
|
|
181
176
|
disabled: e,
|
|
182
|
-
onClick:
|
|
177
|
+
onClick: d,
|
|
183
178
|
children: _("starter_back")
|
|
184
179
|
})
|
|
185
180
|
}), /* @__PURE__ */ z(T.SubmitButton, {
|
|
@@ -189,96 +184,95 @@ function le({ workspaceId: r, starter: s, data: p, onBack: m, onBuilt: h, onBuil
|
|
|
189
184
|
]
|
|
190
185
|
}) });
|
|
191
186
|
}
|
|
192
|
-
|
|
193
|
-
//#region src/workspace/setup/automations/list-page.tsx
|
|
187
|
+
// src/workspace/setup/automations/list-page.tsx
|
|
194
188
|
function Y({ workspaceId: e, active: t }) {
|
|
195
|
-
let
|
|
189
|
+
let n = o(), r = q();
|
|
196
190
|
return /* @__PURE__ */ z(b, {
|
|
197
191
|
value: t,
|
|
198
192
|
onValueChange: (t) => {
|
|
199
|
-
t === "automations" ?
|
|
193
|
+
t === "automations" ? r({
|
|
200
194
|
to: "/workspace/$workspaceId/setup/automations",
|
|
201
195
|
params: { workspaceId: e }
|
|
202
|
-
}) : t === "alarm-rules" &&
|
|
196
|
+
}) : t === "alarm-rules" && r({
|
|
203
197
|
to: "/workspace/$workspaceId/setup/automations/alarm-rules",
|
|
204
198
|
params: { workspaceId: e }
|
|
205
199
|
});
|
|
206
200
|
},
|
|
207
201
|
children: /* @__PURE__ */ B(y, {
|
|
208
202
|
variant: "line",
|
|
209
|
-
children: [/* @__PURE__ */ z(
|
|
203
|
+
children: [/* @__PURE__ */ z(_, {
|
|
210
204
|
value: "automations",
|
|
211
|
-
children:
|
|
212
|
-
}), /* @__PURE__ */ z(
|
|
205
|
+
children: n("automation_tab_automations")
|
|
206
|
+
}), /* @__PURE__ */ z(_, {
|
|
213
207
|
value: "alarm-rules",
|
|
214
|
-
children:
|
|
208
|
+
children: n("automation_tab_alarm_rules")
|
|
215
209
|
})]
|
|
216
210
|
})
|
|
217
211
|
});
|
|
218
212
|
}
|
|
219
213
|
function X({ errors: e, warnings: t }) {
|
|
220
|
-
let
|
|
221
|
-
return /* @__PURE__ */ B(R, { children: [e > 0 ? /* @__PURE__ */ z(
|
|
214
|
+
let n = o();
|
|
215
|
+
return /* @__PURE__ */ B(R, { children: [e > 0 ? /* @__PURE__ */ z(g, {
|
|
222
216
|
variant: "destructive",
|
|
223
|
-
children:
|
|
224
|
-
}) : null, t > 0 ? /* @__PURE__ */ z(
|
|
217
|
+
children: n("automation_error_count", { count: String(e) })
|
|
218
|
+
}) : null, t > 0 ? /* @__PURE__ */ z(g, {
|
|
225
219
|
variant: "warning",
|
|
226
|
-
children:
|
|
220
|
+
children: n("automation_warning_count", { count: String(t) })
|
|
227
221
|
}) : null] });
|
|
228
222
|
}
|
|
229
|
-
function Z(
|
|
230
|
-
let
|
|
223
|
+
function Z(e) {
|
|
224
|
+
let t = a(), n = r.dashboard.list.useQuery({ workspaceId: e });
|
|
231
225
|
return (e) => {
|
|
232
226
|
if (e == null) return null;
|
|
233
|
-
let
|
|
234
|
-
return
|
|
227
|
+
let r = n.data?.dashboards.find((t) => t.id === e);
|
|
228
|
+
return r == null ? null : K(r.name, t);
|
|
235
229
|
};
|
|
236
230
|
}
|
|
237
231
|
function ue({ run: e }) {
|
|
238
|
-
let t =
|
|
232
|
+
let t = o();
|
|
239
233
|
if (e === void 0) return /* @__PURE__ */ z(A, { children: t("automation_last_run_none") });
|
|
240
|
-
let
|
|
241
|
-
return e.status === "ok" ? /* @__PURE__ */ z(A, { children: t("automation_last_run_ok", { at:
|
|
234
|
+
let n = G(e.startedAt);
|
|
235
|
+
return e.status === "ok" ? /* @__PURE__ */ z(A, { children: t("automation_last_run_ok", { at: n }) }) : /* @__PURE__ */ z(A, {
|
|
242
236
|
className: "text-destructive",
|
|
243
237
|
children: t("automation_last_run_failed", {
|
|
244
|
-
at:
|
|
238
|
+
at: n,
|
|
245
239
|
error: ne(e.errorCode ?? "", e.error)
|
|
246
240
|
})
|
|
247
241
|
});
|
|
248
242
|
}
|
|
249
|
-
function Q({ workspaceId:
|
|
250
|
-
let
|
|
243
|
+
function Q({ workspaceId: e }) {
|
|
244
|
+
let t = o(), i = s(), c = a(), l = q(), u = r.automation.list.useQuery({ workspaceId: e }), d = r.automation.latestRuns.useQuery({ workspaceId: e }), f = Z(e), [p, g] = L(null), [_, y] = L(!1), b = new Map(d.data?.items.map((e) => [e.automationId, e.run]));
|
|
251
245
|
return /* @__PURE__ */ B(O, { children: [
|
|
252
|
-
/* @__PURE__ */ z(
|
|
246
|
+
/* @__PURE__ */ z(v, {
|
|
253
247
|
icon: /* @__PURE__ */ z(W, {}),
|
|
254
|
-
breadcrumbs: /* @__PURE__ */ z(C, { workspaceId:
|
|
255
|
-
title:
|
|
256
|
-
description:
|
|
248
|
+
breadcrumbs: /* @__PURE__ */ z(C, { workspaceId: e }),
|
|
249
|
+
title: t("setup_automations_title"),
|
|
250
|
+
description: t("setup_automations_description"),
|
|
257
251
|
actions: /* @__PURE__ */ B("div", {
|
|
258
252
|
className: "flex items-center gap-2",
|
|
259
|
-
children: [/* @__PURE__ */ B(
|
|
253
|
+
children: [/* @__PURE__ */ B(m, {
|
|
260
254
|
type: "button",
|
|
261
255
|
size: "sm",
|
|
262
256
|
variant: "outline",
|
|
263
257
|
onClick: () => {
|
|
264
258
|
y(!0);
|
|
265
259
|
},
|
|
266
|
-
children: [/* @__PURE__ */ z(V, { "data-icon": "inline-start" }),
|
|
267
|
-
}), /* @__PURE__ */ B(
|
|
260
|
+
children: [/* @__PURE__ */ z(V, { "data-icon": "inline-start" }), t("automation_starter_action")]
|
|
261
|
+
}), /* @__PURE__ */ B(m, {
|
|
268
262
|
type: "button",
|
|
269
263
|
size: "sm",
|
|
270
264
|
onClick: () => {
|
|
271
265
|
l({
|
|
272
266
|
to: "/workspace/$workspaceId/setup/automations/new",
|
|
273
|
-
params: { workspaceId:
|
|
267
|
+
params: { workspaceId: e }
|
|
274
268
|
});
|
|
275
269
|
},
|
|
276
|
-
children: [/* @__PURE__ */ z(H, { "data-icon": "inline-start" }),
|
|
270
|
+
children: [/* @__PURE__ */ z(H, { "data-icon": "inline-start" }), t("automation_create_action")]
|
|
277
271
|
})]
|
|
278
272
|
})
|
|
279
273
|
}),
|
|
280
274
|
/* @__PURE__ */ B(k, { children: [/* @__PURE__ */ z(Y, {
|
|
281
|
-
workspaceId:
|
|
275
|
+
workspaceId: e,
|
|
282
276
|
active: "automations"
|
|
283
277
|
}), /* @__PURE__ */ z(x, {
|
|
284
278
|
query: u,
|
|
@@ -286,56 +280,56 @@ function Q({ workspaceId: i }) {
|
|
|
286
280
|
className: "space-y-2",
|
|
287
281
|
children: [/* @__PURE__ */ z(h, { className: "h-10 w-full" }), /* @__PURE__ */ z(h, { className: "h-10 w-4/5" })]
|
|
288
282
|
}),
|
|
289
|
-
error: (e) => /* @__PURE__ */ z(S, { message:
|
|
283
|
+
error: (e) => /* @__PURE__ */ z(S, { message: n(e) }),
|
|
290
284
|
isEmpty: (e) => e.items.length === 0,
|
|
291
|
-
empty: /* @__PURE__ */ z(j, { children:
|
|
292
|
-
children: ({ items:
|
|
293
|
-
let
|
|
285
|
+
empty: /* @__PURE__ */ z(j, { children: t("setup_automations_empty") }),
|
|
286
|
+
children: ({ items: n }) => /* @__PURE__ */ z(w, { children: n.map((n) => {
|
|
287
|
+
let r = f(n.dashboardId);
|
|
294
288
|
return /* @__PURE__ */ B(te, { children: [/* @__PURE__ */ B(T, {
|
|
295
289
|
to: "/workspace/$workspaceId/setup/automations/$automationId",
|
|
296
290
|
params: {
|
|
297
|
-
workspaceId:
|
|
298
|
-
automationId:
|
|
291
|
+
workspaceId: e,
|
|
292
|
+
automationId: n.id
|
|
299
293
|
},
|
|
300
294
|
className: "sm:flex-col sm:items-start",
|
|
301
295
|
children: [
|
|
302
296
|
/* @__PURE__ */ B("div", {
|
|
303
297
|
className: "flex min-w-0 flex-wrap items-center gap-2",
|
|
304
|
-
children: [/* @__PURE__ */ z(M, { children: K(
|
|
305
|
-
errors:
|
|
306
|
-
warnings:
|
|
298
|
+
children: [/* @__PURE__ */ z(M, { children: K(n.name, c) }), /* @__PURE__ */ z(X, {
|
|
299
|
+
errors: n.errorCount,
|
|
300
|
+
warnings: n.warningCount
|
|
307
301
|
})]
|
|
308
302
|
}),
|
|
309
|
-
|
|
310
|
-
d.isSuccess ? /* @__PURE__ */ z(ue, { run: b.get(
|
|
303
|
+
r == null ? null : /* @__PURE__ */ z(A, { children: t("automation_owned_by", { owner: r }) }),
|
|
304
|
+
d.isSuccess ? /* @__PURE__ */ z(ue, { run: b.get(n.id) }) : null
|
|
311
305
|
]
|
|
312
306
|
}), /* @__PURE__ */ B(ee, { children: [/* @__PURE__ */ z(P, {
|
|
313
|
-
workspaceId:
|
|
314
|
-
entity:
|
|
307
|
+
workspaceId: e,
|
|
308
|
+
entity: n,
|
|
315
309
|
kind: "automation"
|
|
316
310
|
}), /* @__PURE__ */ z(D, { children: /* @__PURE__ */ z(E, {
|
|
317
311
|
tone: "destructive",
|
|
318
|
-
"aria-label":
|
|
312
|
+
"aria-label": t("automation_delete_action"),
|
|
319
313
|
onClick: () => {
|
|
320
|
-
|
|
314
|
+
g(n);
|
|
321
315
|
},
|
|
322
316
|
children: /* @__PURE__ */ z(U, {})
|
|
323
|
-
}) })] })] },
|
|
317
|
+
}) })] })] }, n.id);
|
|
324
318
|
}) })
|
|
325
319
|
})] }),
|
|
326
320
|
/* @__PURE__ */ z($, {
|
|
327
|
-
workspaceId:
|
|
321
|
+
workspaceId: e,
|
|
328
322
|
kind: "automation",
|
|
329
323
|
entity: p,
|
|
330
324
|
onClose: () => {
|
|
331
|
-
|
|
325
|
+
g(null);
|
|
332
326
|
},
|
|
333
327
|
onDeleted: () => {
|
|
334
|
-
|
|
328
|
+
g(null), i.success(t("automation_delete_toast"));
|
|
335
329
|
}
|
|
336
330
|
}),
|
|
337
|
-
|
|
338
|
-
workspaceId:
|
|
331
|
+
_ ? /* @__PURE__ */ z(J, {
|
|
332
|
+
workspaceId: e,
|
|
339
333
|
kind: "automation",
|
|
340
334
|
onClose: () => {
|
|
341
335
|
y(!1);
|
|
@@ -344,12 +338,12 @@ function Q({ workspaceId: i }) {
|
|
|
344
338
|
] });
|
|
345
339
|
}
|
|
346
340
|
function $({ workspaceId: e, kind: t, entity: n, onClose: r, onDeleted: i }) {
|
|
347
|
-
return /* @__PURE__ */ z(
|
|
341
|
+
return /* @__PURE__ */ z(d, {
|
|
348
342
|
open: n != null,
|
|
349
343
|
onOpenChange: (e) => {
|
|
350
344
|
e || r();
|
|
351
345
|
},
|
|
352
|
-
children: /* @__PURE__ */ z(
|
|
346
|
+
children: /* @__PURE__ */ z(c, { children: n == null ? null : /* @__PURE__ */ z(F, {
|
|
353
347
|
workspaceId: e,
|
|
354
348
|
kind: t,
|
|
355
349
|
id: n.id,
|
|
@@ -359,5 +353,4 @@ function $({ workspaceId: e, kind: t, entity: n, onClose: r, onDeleted: i }) {
|
|
|
359
353
|
}) })
|
|
360
354
|
});
|
|
361
355
|
}
|
|
362
|
-
//#endregion
|
|
363
356
|
export { Y as AutomationSectionTabs, $ as DeleteDialog, X as ProblemBadges, Q as SetupAutomationsPage, J as t, Z as useDashboardNames };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Nt as e } from "./alert-dialog-D_iDv2lQ.js";
|
|
2
2
|
import { useCallback as t, useEffect as n, useEffectEvent as r, useState as i } from "react";
|
|
3
3
|
import { Fragment as a, jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
4
4
|
import { APIProvider as c, AdvancedMarker as l, InfoWindow as u, Map as d, useMap as f } from "@vis.gl/react-google-maps";
|
|
5
5
|
import { MarkerClusterer as p } from "@googlemaps/markerclusterer";
|
|
6
|
-
|
|
6
|
+
// src/workspace/maps/location-map-renderer.tsx
|
|
7
7
|
var m = {
|
|
8
8
|
normal: 0,
|
|
9
9
|
warning: 1,
|
|
@@ -131,15 +131,15 @@ function v(e) {
|
|
|
131
131
|
return new Map(e.map(({ id: e, tone: t }) => [e, t ?? "normal"]));
|
|
132
132
|
}
|
|
133
133
|
function y({ location: e, register: n, onClick: r }) {
|
|
134
|
+
let i = t((t) => {
|
|
135
|
+
n(e.id, t);
|
|
136
|
+
}, [n, e.id]);
|
|
134
137
|
return /* @__PURE__ */ o(l, {
|
|
135
|
-
ref:
|
|
136
|
-
n(e.id, t);
|
|
137
|
-
}, [n, e.id]),
|
|
138
|
+
ref: i,
|
|
138
139
|
position: e.position,
|
|
139
140
|
title: e.title ?? e.name,
|
|
140
141
|
onClick: r,
|
|
141
142
|
children: e.marker
|
|
142
143
|
});
|
|
143
144
|
}
|
|
144
|
-
//#endregion
|
|
145
145
|
export { g as default };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { t as e } from "./lat-lng-
|
|
1
|
+
import { t as e } from "./lat-lng-Bl77AGSO.js";
|
|
2
2
|
import { useEffect as t, useState as n } from "react";
|
|
3
3
|
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
4
4
|
import { APIProvider as a, AdvancedMarker as o, Map as s, useMap as c } from "@vis.gl/react-google-maps";
|
|
5
|
-
|
|
5
|
+
// src/workspace/maps/location-picker-renderer.tsx
|
|
6
6
|
var l = {
|
|
7
7
|
lat: 20,
|
|
8
8
|
lng: 0
|
|
@@ -88,7 +88,7 @@ function f({ positions: e }) {
|
|
|
88
88
|
function p({ value: e }) {
|
|
89
89
|
let n = c(), r = e?.lat, i = e?.lng;
|
|
90
90
|
return t(() => {
|
|
91
|
-
n
|
|
91
|
+
n != null && r != null && i != null && n.getBounds()?.contains({
|
|
92
92
|
lat: r,
|
|
93
93
|
lng: i
|
|
94
94
|
}) !== !0 && n.panTo({
|
|
@@ -101,5 +101,4 @@ function p({ value: e }) {
|
|
|
101
101
|
i
|
|
102
102
|
]), null;
|
|
103
103
|
}
|
|
104
|
-
//#endregion
|
|
105
104
|
export { d as default };
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { resolveLocalized as e } from "@overvis/hmi-shared";
|
|
2
|
-
|
|
2
|
+
// src/workspace/page-state/model.ts
|
|
3
3
|
function t(t, n) {
|
|
4
4
|
if (t == null) return null;
|
|
5
5
|
let r = e(t, n);
|
|
6
6
|
return r.length > 0 ? r : null;
|
|
7
7
|
}
|
|
8
|
-
//#endregion
|
|
9
8
|
export { t };
|