@overvis/hmi-workspace-ui 0.1.0 → 0.1.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/dist/alarm-list-sheAq-pb.js +414 -0
- package/dist/alarm-rule-dialog-D_ml7V0v.js +417 -0
- package/dist/{alarm-rule-lists-C5v1Kf7A.js → alarm-rule-lists-DaA4soF4.js} +123 -125
- package/dist/{alarm-rules-page-CqFzofPd.js → alarm-rules-page-OFjOQ-dm.js} +15 -18
- package/dist/alert-dialog-B60PF7S9.js +891 -0
- package/dist/{base-revision-YCO27zR4.js → base-revision-DYCOZS0R.js} +26 -29
- package/dist/{breadcrumbs-0cjsV2cq.js → breadcrumbs-D2u8KZQo.js} +6 -7
- package/dist/{catalog-list-DjZojYLJ.js → catalog-list-LXuRix0-.js} +2 -4
- package/dist/{code-editor-BVimvjDV.js → code-editor-BMSyzAxu.js} +5 -6
- package/dist/dashboard-bindings.js +1 -2
- package/dist/{dashboards-page-BlrJguNz.js → dashboards-page-wnmmLpVC.js} +335 -359
- package/dist/{de-14WdmJxZ.js → de-hkEr2usK.js} +1 -2
- package/dist/diagnostic-text-CsbENUNI.js +116 -0
- package/dist/{dialogs-B6BRnf3Q.js → dialogs-AtIYlNSy.js} +219 -227
- package/dist/{dialogs-D_v1LeH4.js → dialogs-DsHbKgZD.js} +2523 -2590
- package/dist/{display-DmOo23mi.js → display-DSyEwQt8.js} +4 -6
- package/dist/{editor-language-To9MxloY.js → editor-language-CTfJBXMs.js} +3 -5
- package/dist/editor-page-BWbVGJvU.js +1337 -0
- package/dist/{en-BgercpT0.js → en-UW_k-Bd6.js} +1 -2
- package/dist/entity-controls-BCuRx882.js +71 -0
- package/dist/errors-Cawve9yD.js +25 -0
- package/dist/{footer-DC-Q0052.js → footer-B9XdpVzq.js} +2404 -2515
- package/dist/host.js +8143 -675
- package/dist/{i18n-BgzakKoC.js → i18n-Dt6xbSK6.js} +77 -90
- package/dist/i18n.js +1 -2
- package/dist/index.js +5149 -5345
- package/dist/{lat-lng-B12P7QyY.js → lat-lng-Bl77AGSO.js} +1 -2
- package/dist/{list-page-CvsdZb86.js → list-page-agHupfNb.js} +116 -123
- package/dist/{location-map-renderer-DO5yfdSU.js → location-map-renderer-kxU6cgFl.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-CH28rYUt.js} +54 -58
- package/dist/{page-v6LCwswN.js → page-CZPHJUmz.js} +92 -100
- package/dist/page-DpdkOGGb.js +449 -0
- package/dist/page-HCGXXGjy.js +507 -0
- package/dist/panel-BCwBlB_h.js +949 -0
- package/dist/parameter-values.js +3 -16
- package/dist/{pl-lQ9HXV9k.js → pl-BokvsP3J.js} +1 -2
- package/dist/presence-code-cT6wxlTg.js +73 -0
- package/dist/{query-gate-DVhNIkge.js → query-gate-DqmHsZ07.js} +6 -6
- package/dist/{provider-DoEpKcQ-.js → quick-report-DEqqwQxR.js} +9423 -5102
- package/dist/{retention-BYXNpYmR.js → retention-DZ0reGGe.js} +4 -6
- package/dist/retention-note-nequESpo.js +40 -0
- package/dist/{rolldown-runtime-Dy4uBu1J.js → rolldown-runtime-CGnMp29N.js} +1 -2
- package/dist/{ru-qTKINoUj.js → ru-DZSlsRHq.js} +1 -2
- package/dist/run-text-DneX9rWh.js +112 -0
- package/dist/{search-D4rDnE9T.js → search-DP9_alSQ.js} +26 -29
- package/dist/{sections-kCOyc4NR.js → sections-BU7NKUOQ.js} +2 -3
- package/dist/{select-BKiOWdSr.js → select-Te6Qv1Zu.js} +17 -23
- package/dist/{spinner-C-HPNxOc.js → spinner-BRcNKwjH.js} +182 -201
- package/dist/src/version.d.ts +1 -1
- 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-yM4B49nd.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-CjXPq9Lk.js} +1 -2
- package/dist/{wireguard-docs-AfU6NzTL.js → wireguard-docs-CC8XKBR7.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,65 +1,63 @@
|
|
|
1
|
-
import { m as e } from "./i18n-
|
|
2
|
-
import { t } from "./
|
|
3
|
-
import { t as
|
|
4
|
-
import { n as r, t as i } from "./button-6SxPBYMz.js";
|
|
1
|
+
import { m as e } from "./i18n-Dt6xbSK6.js";
|
|
2
|
+
import { Mt as t, Nt as n, jt as r } from "./alert-dialog-B60PF7S9.js";
|
|
3
|
+
import { t as i } from "./spinner-BRcNKwjH.js";
|
|
5
4
|
import * as a from "react";
|
|
6
5
|
import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
7
6
|
import { ChevronRightIcon as l, CircleAlertIcon as u, InfoIcon as d, RefreshCwIcon as f, TriangleAlertIcon as p } from "lucide-react";
|
|
8
7
|
import { cva as m } from "class-variance-authority";
|
|
9
8
|
import { Collapsible as h } from "@base-ui/react/collapsible";
|
|
10
|
-
|
|
11
|
-
function g({ className: e, size:
|
|
9
|
+
// src/ui/card.tsx
|
|
10
|
+
function g({ className: e, size: t = "default", ...r }) {
|
|
12
11
|
return /* @__PURE__ */ s("div", {
|
|
13
12
|
"data-slot": "card",
|
|
14
|
-
"data-size":
|
|
15
|
-
className:
|
|
13
|
+
"data-size": t,
|
|
14
|
+
className: n("\n group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-xl border bg-card\n py-(--card-spacing) text-sm text-card-foreground shadow-xs [--card-spacing:--spacing(4)]\n has-data-[slot=card-footer]:pb-0\n has-[>img:first-child]:pt-0\n data-[size=sm]:[--card-spacing:--spacing(3)]\n data-[size=sm]:has-data-[slot=card-footer]:pb-0\n *:[img:first-child]:rounded-t-xl\n *:[img:last-child]:rounded-b-xl\n ", e),
|
|
16
15
|
...r
|
|
17
16
|
});
|
|
18
17
|
}
|
|
19
|
-
function _({ className: e, ...
|
|
18
|
+
function _({ className: e, ...t }) {
|
|
20
19
|
return /* @__PURE__ */ s("div", {
|
|
21
20
|
"data-slot": "card-header",
|
|
22
|
-
className:
|
|
23
|
-
...
|
|
21
|
+
className: n("\n group/card-header @container/card-header grid auto-rows-min items-start gap-1\n rounded-t-xl px-(--card-spacing)\n has-data-[slot=card-action]:grid-cols-[1fr_auto]\n has-data-[slot=card-description]:grid-rows-[auto_auto]\n [.border-b]:pb-(--card-spacing)\n ", e),
|
|
22
|
+
...t
|
|
24
23
|
});
|
|
25
24
|
}
|
|
26
|
-
function v({ className: e, ...
|
|
25
|
+
function v({ className: e, ...t }) {
|
|
27
26
|
return /* @__PURE__ */ s("div", {
|
|
28
27
|
"data-slot": "card-title",
|
|
29
|
-
className:
|
|
30
|
-
...
|
|
28
|
+
className: n("\n font-heading text-sm/snug font-semibold\n group-data-[size=sm]/card:text-[13px]\n ", e),
|
|
29
|
+
...t
|
|
31
30
|
});
|
|
32
31
|
}
|
|
33
|
-
function y({ className: e, ...
|
|
32
|
+
function y({ className: e, ...t }) {
|
|
34
33
|
return /* @__PURE__ */ s("div", {
|
|
35
34
|
"data-slot": "card-description",
|
|
36
|
-
className:
|
|
37
|
-
...
|
|
35
|
+
className: n("text-[13px] text-muted-foreground", e),
|
|
36
|
+
...t
|
|
38
37
|
});
|
|
39
38
|
}
|
|
40
|
-
function b({ className: e, ...
|
|
39
|
+
function b({ className: e, ...t }) {
|
|
41
40
|
return /* @__PURE__ */ s("div", {
|
|
42
41
|
"data-slot": "card-action",
|
|
43
|
-
className:
|
|
44
|
-
...
|
|
42
|
+
className: n("col-start-2 row-span-2 row-start-1 self-start justify-self-end", e),
|
|
43
|
+
...t
|
|
45
44
|
});
|
|
46
45
|
}
|
|
47
|
-
function x({ className: e, ...
|
|
46
|
+
function x({ className: e, ...t }) {
|
|
48
47
|
return /* @__PURE__ */ s("div", {
|
|
49
48
|
"data-slot": "card-content",
|
|
50
|
-
className:
|
|
51
|
-
...
|
|
49
|
+
className: n("px-(--card-spacing)", e),
|
|
50
|
+
...t
|
|
52
51
|
});
|
|
53
52
|
}
|
|
54
|
-
function S({ className: e, ...
|
|
53
|
+
function S({ className: e, ...t }) {
|
|
55
54
|
return /* @__PURE__ */ s("div", {
|
|
56
55
|
"data-slot": "card-footer",
|
|
57
|
-
className:
|
|
58
|
-
...
|
|
56
|
+
className: n("flex items-center rounded-b-xl border-t bg-muted/40 p-(--card-spacing)", e),
|
|
57
|
+
...t
|
|
59
58
|
});
|
|
60
59
|
}
|
|
61
|
-
|
|
62
|
-
//#region src/ui/collapsible.tsx
|
|
60
|
+
// src/ui/collapsible.tsx
|
|
63
61
|
function C({ className: e, ...t }) {
|
|
64
62
|
return /* @__PURE__ */ s(h.Root, {
|
|
65
63
|
"data-slot": "collapsible",
|
|
@@ -74,15 +72,14 @@ function w({ className: e, ...t }) {
|
|
|
74
72
|
...t
|
|
75
73
|
});
|
|
76
74
|
}
|
|
77
|
-
function T({ className: e, ...
|
|
75
|
+
function T({ className: e, ...t }) {
|
|
78
76
|
return /* @__PURE__ */ s(h.Panel, {
|
|
79
77
|
"data-slot": "collapsible-content",
|
|
80
|
-
className:
|
|
81
|
-
...
|
|
78
|
+
className: n("overflow-hidden", e),
|
|
79
|
+
...t
|
|
82
80
|
});
|
|
83
81
|
}
|
|
84
|
-
|
|
85
|
-
//#region src/ui/notice-card.tsx
|
|
82
|
+
// src/ui/notice-card.tsx
|
|
86
83
|
var E = m("\n group/notice relative isolate w-full flex-row items-start gap-3 bg-linear-to-r to-card to-40%\n p-4 text-left\n before:absolute before:inset-y-0 before:left-0 before:w-[3px]\n sm:gap-4\n ", { variants: {
|
|
87
84
|
severity: {
|
|
88
85
|
error: "\n border-destructive/25 from-destructive/6\n before:bg-destructive\n ",
|
|
@@ -112,35 +109,35 @@ function k(e) {
|
|
|
112
109
|
return typeof e == "object" && !!e && "then" in e && typeof e.then == "function";
|
|
113
110
|
}
|
|
114
111
|
function A({ action: e, variant: l, size: u }) {
|
|
115
|
-
let d =
|
|
112
|
+
let d = e.pending === !0 ? /* @__PURE__ */ s(i, {
|
|
116
113
|
"aria-hidden": "true",
|
|
117
114
|
"data-icon": "inline-start"
|
|
118
|
-
}) : e.icon, e.label] }),
|
|
115
|
+
}) : e.icon, f = /* @__PURE__ */ c(o, { children: [d, e.label] }), p = e.disabled === !0 || e.pending === !0, m = t({
|
|
119
116
|
variant: l,
|
|
120
117
|
size: u
|
|
121
118
|
});
|
|
122
|
-
if (!
|
|
123
|
-
let
|
|
124
|
-
return a.cloneElement(
|
|
125
|
-
className:
|
|
126
|
-
children:
|
|
119
|
+
if (!p && e.render != null) {
|
|
120
|
+
let t = e.render;
|
|
121
|
+
return a.cloneElement(t, {
|
|
122
|
+
className: n(m, t.props.className),
|
|
123
|
+
children: f
|
|
127
124
|
});
|
|
128
125
|
}
|
|
129
|
-
return !
|
|
126
|
+
return !p && e.href != null ? /* @__PURE__ */ s("a", {
|
|
130
127
|
href: e.href,
|
|
131
|
-
className:
|
|
132
|
-
children:
|
|
133
|
-
}) : /* @__PURE__ */ s(
|
|
128
|
+
className: m,
|
|
129
|
+
children: f
|
|
130
|
+
}) : /* @__PURE__ */ s(r, {
|
|
134
131
|
type: "button",
|
|
135
132
|
variant: l,
|
|
136
133
|
size: u,
|
|
137
|
-
disabled:
|
|
134
|
+
disabled: p,
|
|
138
135
|
"aria-busy": e.pending === !0 || void 0,
|
|
139
136
|
onClick: e.onClick,
|
|
140
|
-
children:
|
|
137
|
+
children: f
|
|
141
138
|
});
|
|
142
139
|
}
|
|
143
|
-
function j({ severity:
|
|
140
|
+
function j({ severity: t = "error", size: r = "default", icon: i, subject: o, title: u, description: d, details: p, detailsOpen: m = !1, primaryAction: h, secondaryActions: _, onRetry: v, retrying: y, retryLabel: b, actions: x, className: S, children: j, ...M }) {
|
|
144
141
|
let N = e(), [P, F] = a.useState(!1), I = r === "compact", L = y === !0 || P, R = v == null ? null : {
|
|
145
142
|
label: L ? N("ui_notice_retrying") : b ?? N("ui_notice_retry"),
|
|
146
143
|
icon: /* @__PURE__ */ s(f, { "data-icon": "inline-start" }),
|
|
@@ -157,26 +154,26 @@ function j({ severity: n = "error", size: r = "default", icon: i, subject: o, ti
|
|
|
157
154
|
}, z = h ?? R, B = I ? "sm" : "default", V = z != null || (_?.length ?? 0) > 0 || x != null;
|
|
158
155
|
return /* @__PURE__ */ c(g, {
|
|
159
156
|
"data-slot": "notice-card",
|
|
160
|
-
"data-severity":
|
|
157
|
+
"data-severity": t,
|
|
161
158
|
"data-size": r,
|
|
162
|
-
role:
|
|
163
|
-
className:
|
|
164
|
-
severity:
|
|
159
|
+
role: t === "error" ? "alert" : "status",
|
|
160
|
+
className: n(E({
|
|
161
|
+
severity: t,
|
|
165
162
|
size: r
|
|
166
163
|
}), S),
|
|
167
164
|
...M,
|
|
168
165
|
children: [/* @__PURE__ */ s("span", {
|
|
169
166
|
"aria-hidden": "true",
|
|
170
167
|
className: D({
|
|
171
|
-
severity:
|
|
168
|
+
severity: t,
|
|
172
169
|
size: r
|
|
173
170
|
}),
|
|
174
|
-
children: i ?? O[
|
|
171
|
+
children: i ?? O[t]
|
|
175
172
|
}), /* @__PURE__ */ c("div", {
|
|
176
|
-
className:
|
|
173
|
+
className: n("flex min-w-0 flex-1 flex-col", I ? "gap-2" : "gap-3"),
|
|
177
174
|
children: [
|
|
178
175
|
/* @__PURE__ */ c("div", {
|
|
179
|
-
className:
|
|
176
|
+
className: n("flex min-w-0 flex-col", I ? "gap-0.5 pt-1" : o == null ? "gap-1 pt-2" : "gap-0.5"),
|
|
180
177
|
children: [
|
|
181
178
|
o == null ? null : /* @__PURE__ */ s("div", {
|
|
182
179
|
"data-slot": "notice-card-subject",
|
|
@@ -185,12 +182,12 @@ function j({ severity: n = "error", size: r = "default", icon: i, subject: o, ti
|
|
|
185
182
|
}),
|
|
186
183
|
u == null ? null : /* @__PURE__ */ s("div", {
|
|
187
184
|
"data-slot": "notice-card-title",
|
|
188
|
-
className:
|
|
185
|
+
className: n("font-semibold tracking-tight text-pretty text-foreground", I ? "text-sm/5" : "text-[0.9375rem]/snug"),
|
|
189
186
|
children: u
|
|
190
187
|
}),
|
|
191
188
|
d == null ? null : /* @__PURE__ */ s("div", {
|
|
192
189
|
"data-slot": "notice-card-description",
|
|
193
|
-
className:
|
|
190
|
+
className: n("text-sm/relaxed text-pretty", u == null ? "text-foreground" : "text-muted-foreground", "\n [&_a]:underline [&_a]:underline-offset-3\n [&_a]:hover:text-foreground\n "),
|
|
194
191
|
children: d
|
|
195
192
|
})
|
|
196
193
|
]
|
|
@@ -242,5 +239,4 @@ function j({ severity: n = "error", size: r = "default", icon: i, subject: o, ti
|
|
|
242
239
|
})]
|
|
243
240
|
});
|
|
244
241
|
}
|
|
245
|
-
//#endregion
|
|
246
242
|
export { g as a, y as c, v as d, w as i, S as l, C as n, b as o, T as r, x as s, j as t, _ as u };
|
|
@@ -1,41 +1,35 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { f as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { n as
|
|
6
|
-
import { i as
|
|
7
|
-
import {
|
|
8
|
-
import { i as
|
|
9
|
-
import { a as g, i as _, o as v, r as y } from "./provider-BOeYHi0n.js";
|
|
10
|
-
import { n as b } from "./date-time-picker-C3FhMXk6.js";
|
|
11
|
-
import { t as x } from "./page-header-RB2YFWlE.js";
|
|
12
|
-
import { i as S, n as C, r as w, t as T } from "./tabs-CSIucYFP.js";
|
|
13
|
-
import { r as E, t as D } from "./query-gate-DVhNIkge.js";
|
|
14
|
-
import { i as O, n as k, t as A } from "./search-D4rDnE9T.js";
|
|
1
|
+
import { Nr as e, Wn as t, fn as n, hn as r, ii as i, mn as a, pn as o } from "./quick-report-DEqqwQxR.js";
|
|
2
|
+
import { f as s, h as c, m as l } from "./i18n-Dt6xbSK6.js";
|
|
3
|
+
import { jt as u, xt as d } from "./alert-dialog-B60PF7S9.js";
|
|
4
|
+
import { A as f, M as p, j as m, l as h } from "./spinner-BRcNKwjH.js";
|
|
5
|
+
import { i as g, n as _, r as v, t as y } from "./alarm-list-sheAq-pb.js";
|
|
6
|
+
import { M as b, a as x, b as S, i as C, n as w, r as T } from "./panel-BCwBlB_h.js";
|
|
7
|
+
import { r as E, t as D } from "./query-gate-DqmHsZ07.js";
|
|
8
|
+
import { i as O, n as k, t as A } from "./search-DP9_alSQ.js";
|
|
15
9
|
import { jsx as j, jsxs as M } from "react/jsx-runtime";
|
|
16
10
|
import { SirenIcon as N, XIcon as P } from "lucide-react";
|
|
17
11
|
import { formatAppDateTime as F, parseExactAppDateTime as I } from "@overvis/hmi-shared";
|
|
18
12
|
import { alarmEventKinds as L, automationSeverities as R } from "@overvis/hmi-shared/automation";
|
|
19
|
-
|
|
13
|
+
// src/workspace/alarms/history.tsx
|
|
20
14
|
function z(e) {
|
|
21
|
-
return
|
|
15
|
+
return s(e === "raised" ? "alarm_event_raised" : e === "cleared" ? "alarm_event_cleared" : e === "acknowledged" ? "alarm_event_acknowledged" : e === "shelved" ? "alarm_event_shelved" : e === "unshelved" ? "alarm_event_unshelved" : "alarm_event_removed");
|
|
22
16
|
}
|
|
23
17
|
function B(e) {
|
|
24
|
-
return
|
|
18
|
+
return s(e === "urgent" ? "automation_severity_urgent" : e === "warning" ? "automation_severity_warning" : "automation_severity_info");
|
|
25
19
|
}
|
|
26
20
|
function V(e) {
|
|
27
21
|
if (e.kind === "acknowledged" || e.kind === "shelved" || e.kind === "unshelved") {
|
|
28
|
-
let
|
|
22
|
+
let t = [
|
|
29
23
|
e.actorName,
|
|
30
|
-
e.kind === "shelved" && e.shelvedUntil != null ?
|
|
24
|
+
e.kind === "shelved" && e.shelvedUntil != null ? s("alarm_event_shelved_until", { time: F(e.shelvedUntil) }) : null,
|
|
31
25
|
e.note
|
|
32
26
|
].filter((e) => e != null && e.length > 0);
|
|
33
|
-
return
|
|
27
|
+
return t.length === 0 ? null : t.join(" · ");
|
|
34
28
|
}
|
|
35
|
-
return e.kind === "removed" ?
|
|
29
|
+
return e.kind === "removed" ? s("alarm_event_removed_detail") : null;
|
|
36
30
|
}
|
|
37
|
-
function H({ event: e, sourceName: t, timeZone:
|
|
38
|
-
let
|
|
31
|
+
function H({ event: e, sourceName: t, timeZone: n, onShowAlarm: r }) {
|
|
32
|
+
let i = l(), a = c(), { title: s } = v(e, o(e.message, a, n)), u = V(e);
|
|
39
33
|
return /* @__PURE__ */ M("li", {
|
|
40
34
|
className: "\n flex flex-col gap-1 border-b py-2.5 text-sm\n last:border-b-0\n @2xl:grid @2xl:grid-cols-[11rem_7rem_1fr] @2xl:gap-x-3\n ",
|
|
41
35
|
children: [
|
|
@@ -46,7 +40,7 @@ function H({ event: e, sourceName: t, timeZone: i, onShowAlarm: a }) {
|
|
|
46
40
|
}),
|
|
47
41
|
/* @__PURE__ */ j("div", {
|
|
48
42
|
className: "\n hidden items-start\n @2xl:flex\n ",
|
|
49
|
-
children: /* @__PURE__ */ j(
|
|
43
|
+
children: /* @__PURE__ */ j(h, {
|
|
50
44
|
variant: "secondary",
|
|
51
45
|
children: z(e.kind)
|
|
52
46
|
})
|
|
@@ -57,20 +51,20 @@ function H({ event: e, sourceName: t, timeZone: i, onShowAlarm: a }) {
|
|
|
57
51
|
/* @__PURE__ */ M("div", {
|
|
58
52
|
className: "flex flex-wrap items-center gap-2",
|
|
59
53
|
children: [
|
|
60
|
-
/* @__PURE__ */ j(
|
|
54
|
+
/* @__PURE__ */ j(h, {
|
|
61
55
|
variant: "secondary",
|
|
62
56
|
className: "@2xl:hidden",
|
|
63
57
|
children: z(e.kind)
|
|
64
58
|
}),
|
|
65
|
-
/* @__PURE__ */ j(
|
|
59
|
+
/* @__PURE__ */ j(_, { severity: e.severity }),
|
|
66
60
|
/* @__PURE__ */ j("button", {
|
|
67
61
|
type: "button",
|
|
68
62
|
className: "\n min-w-0 text-left font-medium wrap-break-word underline-offset-4\n hover:underline\n focus-visible:underline focus-visible:outline-none\n ",
|
|
69
|
-
title:
|
|
63
|
+
title: i("alarm_history_of_alarm"),
|
|
70
64
|
onClick: () => {
|
|
71
|
-
|
|
65
|
+
r(e.alarmId);
|
|
72
66
|
},
|
|
73
|
-
children:
|
|
67
|
+
children: s
|
|
74
68
|
})
|
|
75
69
|
]
|
|
76
70
|
}),
|
|
@@ -87,19 +81,19 @@ function H({ event: e, sourceName: t, timeZone: i, onShowAlarm: a }) {
|
|
|
87
81
|
]
|
|
88
82
|
});
|
|
89
83
|
}
|
|
90
|
-
function U({ workspaceId:
|
|
91
|
-
let
|
|
92
|
-
workspaceId:
|
|
93
|
-
...
|
|
94
|
-
...
|
|
95
|
-
...
|
|
96
|
-
...
|
|
84
|
+
function U({ workspaceId: n, filters: r, onFiltersChange: o }) {
|
|
85
|
+
let s = l(), c = e()?.timezone ?? "UTC", h = g(n, !0), _ = I(r.from ?? "")?.toISOString(), v = I(r.to ?? "")?.toISOString(), y = i.alarm.log.useInfiniteQuery({
|
|
86
|
+
workspaceId: n,
|
|
87
|
+
...r.severity == null ? {} : { severities: [r.severity] },
|
|
88
|
+
...r.kind == null ? {} : { kinds: [r.kind] },
|
|
89
|
+
...r.source == null ? {} : { sourceIds: [r.source] },
|
|
90
|
+
...r.alarm == null ? {} : { alarmId: r.alarm },
|
|
97
91
|
..._ == null ? {} : { from: _ },
|
|
98
92
|
...v == null ? {} : { to: v },
|
|
99
93
|
limit: 50
|
|
100
|
-
}, { getNextPageParam: (e) => e.nextCursor ?? void 0 }), x = Object.values(
|
|
101
|
-
|
|
102
|
-
...
|
|
94
|
+
}, { getNextPageParam: (e) => e.nextCursor ?? void 0 }), x = Object.values(r).some((e) => e != null && e !== ""), S = (e) => {
|
|
95
|
+
o(A(k({
|
|
96
|
+
...r,
|
|
103
97
|
...e
|
|
104
98
|
})));
|
|
105
99
|
};
|
|
@@ -108,61 +102,61 @@ function U({ workspaceId: t, filters: n, onFiltersChange: s }) {
|
|
|
108
102
|
children: [
|
|
109
103
|
/* @__PURE__ */ M("div", {
|
|
110
104
|
role: "group",
|
|
111
|
-
"aria-label":
|
|
105
|
+
"aria-label": s("alarm_history_filters"),
|
|
112
106
|
className: "\n grid grid-cols-2 items-start gap-2\n @2xl:grid-cols-6\n @4xl:grid-cols-12\n ",
|
|
113
107
|
children: [
|
|
114
|
-
/* @__PURE__ */ M(
|
|
108
|
+
/* @__PURE__ */ M(f, {
|
|
115
109
|
className: "\n w-full\n @2xl:col-span-2\n ",
|
|
116
|
-
"aria-label":
|
|
117
|
-
value:
|
|
110
|
+
"aria-label": s("alarm_history_severity"),
|
|
111
|
+
value: r.severity ?? "",
|
|
118
112
|
onChange: (e) => {
|
|
119
113
|
S({ severity: e.target.value });
|
|
120
114
|
},
|
|
121
|
-
children: [/* @__PURE__ */ j(
|
|
115
|
+
children: [/* @__PURE__ */ j(p, {
|
|
122
116
|
value: "",
|
|
123
|
-
children:
|
|
124
|
-
}), R.map((e) => /* @__PURE__ */ j(
|
|
117
|
+
children: s("alarm_history_all_severities")
|
|
118
|
+
}), R.map((e) => /* @__PURE__ */ j(p, {
|
|
125
119
|
value: e,
|
|
126
120
|
children: B(e)
|
|
127
121
|
}, e))]
|
|
128
122
|
}),
|
|
129
|
-
/* @__PURE__ */ M(
|
|
123
|
+
/* @__PURE__ */ M(f, {
|
|
130
124
|
className: "\n w-full\n @2xl:col-span-2\n ",
|
|
131
|
-
"aria-label":
|
|
132
|
-
value:
|
|
125
|
+
"aria-label": s("alarm_history_kind"),
|
|
126
|
+
value: r.kind ?? "",
|
|
133
127
|
onChange: (e) => {
|
|
134
128
|
S({ kind: e.target.value });
|
|
135
129
|
},
|
|
136
|
-
children: [/* @__PURE__ */ j(
|
|
130
|
+
children: [/* @__PURE__ */ j(p, {
|
|
137
131
|
value: "",
|
|
138
|
-
children:
|
|
139
|
-
}), L.map((e) => /* @__PURE__ */ j(
|
|
132
|
+
children: s("alarm_history_all_kinds")
|
|
133
|
+
}), L.map((e) => /* @__PURE__ */ j(p, {
|
|
140
134
|
value: e,
|
|
141
135
|
children: z(e)
|
|
142
136
|
}, e))]
|
|
143
137
|
}),
|
|
144
|
-
/* @__PURE__ */ M(
|
|
138
|
+
/* @__PURE__ */ M(f, {
|
|
145
139
|
className: "\n col-span-2 w-full\n @4xl:col-span-2\n ",
|
|
146
|
-
"aria-label":
|
|
147
|
-
value:
|
|
140
|
+
"aria-label": s("alarm_history_source"),
|
|
141
|
+
value: r.source ?? "",
|
|
148
142
|
onChange: (e) => {
|
|
149
143
|
S({ source: e.target.value });
|
|
150
144
|
},
|
|
151
145
|
children: [
|
|
152
|
-
/* @__PURE__ */ j(
|
|
146
|
+
/* @__PURE__ */ j(p, {
|
|
153
147
|
value: "",
|
|
154
|
-
children:
|
|
148
|
+
children: s("alarm_history_all_sources")
|
|
155
149
|
}),
|
|
156
|
-
h.rules.length > 0 ? /* @__PURE__ */ j(
|
|
157
|
-
label:
|
|
158
|
-
children: h.rules.map((e) => /* @__PURE__ */ j(
|
|
150
|
+
h.rules.length > 0 ? /* @__PURE__ */ j(m, {
|
|
151
|
+
label: s("alarm_history_alarm_rules"),
|
|
152
|
+
children: h.rules.map((e) => /* @__PURE__ */ j(p, {
|
|
159
153
|
value: e.id,
|
|
160
154
|
children: h.names.get(e.id)
|
|
161
155
|
}, e.id))
|
|
162
156
|
}) : null,
|
|
163
|
-
h.automations.length > 0 ? /* @__PURE__ */ j(
|
|
164
|
-
label:
|
|
165
|
-
children: h.automations.map((e) => /* @__PURE__ */ j(
|
|
157
|
+
h.automations.length > 0 ? /* @__PURE__ */ j(m, {
|
|
158
|
+
label: s("alarm_history_automations"),
|
|
159
|
+
children: h.automations.map((e) => /* @__PURE__ */ j(p, {
|
|
166
160
|
value: e.id,
|
|
167
161
|
children: h.names.get(e.id)
|
|
168
162
|
}, e.id))
|
|
@@ -171,13 +165,13 @@ function U({ workspaceId: t, filters: n, onFiltersChange: s }) {
|
|
|
171
165
|
}),
|
|
172
166
|
/* @__PURE__ */ j("div", {
|
|
173
167
|
role: "group",
|
|
174
|
-
"aria-label":
|
|
168
|
+
"aria-label": s("alarm_history_period"),
|
|
175
169
|
className: "\n col-span-2\n @2xl:col-span-6\n @4xl:col-span-6\n ",
|
|
176
170
|
children: /* @__PURE__ */ j(b, {
|
|
177
171
|
optional: !0,
|
|
178
172
|
value: {
|
|
179
|
-
from:
|
|
180
|
-
to:
|
|
173
|
+
from: r.from ?? "",
|
|
174
|
+
to: r.to ?? ""
|
|
181
175
|
},
|
|
182
176
|
onValueChange: (e) => {
|
|
183
177
|
S({
|
|
@@ -187,53 +181,53 @@ function U({ workspaceId: t, filters: n, onFiltersChange: s }) {
|
|
|
187
181
|
}
|
|
188
182
|
})
|
|
189
183
|
}),
|
|
190
|
-
|
|
184
|
+
r.alarm == null ? null : /* @__PURE__ */ M(u, {
|
|
191
185
|
variant: "outline",
|
|
192
186
|
size: "sm",
|
|
193
187
|
className: "col-span-2 justify-self-start",
|
|
194
188
|
onClick: () => {
|
|
195
189
|
S({ alarm: void 0 });
|
|
196
190
|
},
|
|
197
|
-
children: [/* @__PURE__ */ j(P, { "data-icon": "inline-start" }),
|
|
191
|
+
children: [/* @__PURE__ */ j(P, { "data-icon": "inline-start" }), s("alarm_history_one_alarm")]
|
|
198
192
|
}),
|
|
199
|
-
x ? /* @__PURE__ */ M(
|
|
193
|
+
x ? /* @__PURE__ */ M(u, {
|
|
200
194
|
variant: "ghost",
|
|
201
195
|
size: "sm",
|
|
202
196
|
className: "col-span-2 justify-self-start",
|
|
203
197
|
onClick: () => {
|
|
204
|
-
|
|
198
|
+
o({});
|
|
205
199
|
},
|
|
206
|
-
children: [/* @__PURE__ */ j(P, { "data-icon": "inline-start" }),
|
|
200
|
+
children: [/* @__PURE__ */ j(P, { "data-icon": "inline-start" }), s("alarm_history_clear_filters")]
|
|
207
201
|
}) : null
|
|
208
202
|
]
|
|
209
203
|
}),
|
|
210
204
|
/* @__PURE__ */ j("p", {
|
|
211
205
|
className: "text-xs text-muted-foreground",
|
|
212
|
-
children:
|
|
206
|
+
children: s("alarm_history_delay")
|
|
213
207
|
}),
|
|
214
208
|
/* @__PURE__ */ j(E, {
|
|
215
209
|
query: y,
|
|
216
|
-
loading: /* @__PURE__ */ j(
|
|
217
|
-
error: (e) => /* @__PURE__ */ j(D, { message:
|
|
210
|
+
loading: /* @__PURE__ */ j(d, { className: "h-52 w-full" }),
|
|
211
|
+
error: (e) => /* @__PURE__ */ j(D, { message: t(e) }),
|
|
218
212
|
isEmpty: (e) => e.pages.every((e) => e.events.length === 0),
|
|
219
213
|
empty: /* @__PURE__ */ j("p", {
|
|
220
214
|
className: "rounded-lg border py-10 text-center text-sm text-muted-foreground",
|
|
221
|
-
children:
|
|
215
|
+
children: s("alarm_history_empty")
|
|
222
216
|
}),
|
|
223
217
|
children: (e) => /* @__PURE__ */ j("ul", {
|
|
224
|
-
"aria-label":
|
|
218
|
+
"aria-label": s("alarm_history_title"),
|
|
225
219
|
className: "rounded-lg border px-3",
|
|
226
220
|
children: e.pages.flatMap((e) => e.events.map((e) => /* @__PURE__ */ j(H, {
|
|
227
221
|
event: e,
|
|
228
|
-
sourceName: h.names.get(
|
|
229
|
-
timeZone:
|
|
222
|
+
sourceName: h.names.get(a(e.source)) ?? null,
|
|
223
|
+
timeZone: c,
|
|
230
224
|
onShowAlarm: (e) => {
|
|
231
225
|
S({ alarm: e });
|
|
232
226
|
}
|
|
233
227
|
}, e.id)))
|
|
234
228
|
})
|
|
235
229
|
}),
|
|
236
|
-
y.hasNextPage ? /* @__PURE__ */ j(
|
|
230
|
+
y.hasNextPage ? /* @__PURE__ */ j(u, {
|
|
237
231
|
variant: "outline",
|
|
238
232
|
size: "sm",
|
|
239
233
|
className: "self-center",
|
|
@@ -241,54 +235,53 @@ function U({ workspaceId: t, filters: n, onFiltersChange: s }) {
|
|
|
241
235
|
onClick: () => {
|
|
242
236
|
y.fetchNextPage();
|
|
243
237
|
},
|
|
244
|
-
children:
|
|
238
|
+
children: s("alarm_history_more")
|
|
245
239
|
}) : null
|
|
246
240
|
]
|
|
247
241
|
});
|
|
248
242
|
}
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
let i = r(), { alarms: a, now: o } = y(e), s = a == null ? 0 : v(a, o), c = t.tab ?? "active";
|
|
243
|
+
// src/workspace/alarms/page.tsx
|
|
244
|
+
function W({ workspaceId: e, search: t, onSearchChange: i }) {
|
|
245
|
+
let a = l(), { alarms: o, now: s } = n(e), c = o == null ? 0 : r(o, s), u = t.tab ?? "active";
|
|
253
246
|
return /* @__PURE__ */ M("div", {
|
|
254
247
|
className: "\n @container mx-auto flex w-full max-w-5xl flex-1 flex-col gap-4 p-4\n md:p-6\n ",
|
|
255
248
|
children: [
|
|
256
|
-
/* @__PURE__ */ j(
|
|
249
|
+
/* @__PURE__ */ j(S, {
|
|
257
250
|
icon: /* @__PURE__ */ j(N, {}),
|
|
258
|
-
title:
|
|
259
|
-
description:
|
|
251
|
+
title: a("alarm_page_title"),
|
|
252
|
+
description: a("alarm_page_description"),
|
|
260
253
|
className: "p-0"
|
|
261
254
|
}),
|
|
262
255
|
/* @__PURE__ */ j(O, {}),
|
|
263
|
-
/* @__PURE__ */ M(
|
|
264
|
-
value:
|
|
256
|
+
/* @__PURE__ */ M(w, {
|
|
257
|
+
value: u,
|
|
265
258
|
onValueChange: (e) => {
|
|
266
|
-
|
|
259
|
+
i(e === "history" ? {
|
|
267
260
|
...A(t),
|
|
268
261
|
tab: "history"
|
|
269
262
|
} : {});
|
|
270
263
|
},
|
|
271
264
|
children: [
|
|
272
|
-
/* @__PURE__ */ M(
|
|
265
|
+
/* @__PURE__ */ M(C, { children: [/* @__PURE__ */ j(x, {
|
|
273
266
|
value: "active",
|
|
274
|
-
children:
|
|
275
|
-
}), /* @__PURE__ */ j(
|
|
267
|
+
children: c > 0 ? a("alarm_tab_active_count", { count: String(c) }) : a("alarm_tab_active")
|
|
268
|
+
}), /* @__PURE__ */ j(x, {
|
|
276
269
|
value: "history",
|
|
277
|
-
children:
|
|
270
|
+
children: a("alarm_tab_history")
|
|
278
271
|
})] }),
|
|
279
|
-
/* @__PURE__ */ j(
|
|
272
|
+
/* @__PURE__ */ j(T, {
|
|
280
273
|
value: "active",
|
|
281
274
|
className: "pt-2",
|
|
282
|
-
children: /* @__PURE__ */ j(
|
|
275
|
+
children: /* @__PURE__ */ j(y, { workspaceId: e })
|
|
283
276
|
}),
|
|
284
|
-
/* @__PURE__ */ j(
|
|
277
|
+
/* @__PURE__ */ j(T, {
|
|
285
278
|
value: "history",
|
|
286
279
|
className: "pt-2",
|
|
287
|
-
children:
|
|
280
|
+
children: u === "history" ? /* @__PURE__ */ j(U, {
|
|
288
281
|
workspaceId: e,
|
|
289
282
|
filters: A(t),
|
|
290
283
|
onFiltersChange: (e) => {
|
|
291
|
-
|
|
284
|
+
i({
|
|
292
285
|
...e,
|
|
293
286
|
tab: "history"
|
|
294
287
|
});
|
|
@@ -300,5 +293,4 @@ function W({ workspaceId: e, search: t, onSearchChange: n }) {
|
|
|
300
293
|
]
|
|
301
294
|
});
|
|
302
295
|
}
|
|
303
|
-
//#endregion
|
|
304
296
|
export { W as AlarmsPage };
|