@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,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-BcZsfkCZ.js";
|
|
2
|
+
import { f as s, h as c, m as l } from "./i18n-ChjEbYEg.js";
|
|
3
|
+
import { jt as u, xt as d } from "./alert-dialog-D_iDv2lQ.js";
|
|
4
|
+
import { A as f, M as p, j as m, l as h } from "./spinner-B-KLtBjp.js";
|
|
5
|
+
import { i as g, n as _, r as v, t as y } from "./alarm-list-DKFio0hg.js";
|
|
6
|
+
import { M as b, a as x, b as S, i as C, n as w, r as T } from "./panel-DuZD-cBP.js";
|
|
7
|
+
import { r as E, t as D } from "./query-gate-BbIo1Xrj.js";
|
|
8
|
+
import { i as O, n as k, t as A } from "./search-C6xQ_Hvo.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 };
|