@nivaro/react 0.3.87 → 0.3.88
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/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +18 -0
- package/dist/index.js +518 -516
- package/dist/shared/components/ops-report/CompareTab.js +110 -0
- package/dist/shared/components/ops-report/DigestSections.js +1134 -0
- package/dist/shared/components/ops-report/OpsReportView.js +88 -0
- package/dist/shared/components/ops-report/ReportTab.js +527 -0
- package/dist/shared/components/ops-report/SettingsPanel.js +247 -0
- package/dist/shared/components/ops-report/TrendsTab.js +191 -0
- package/dist/shared/components/ops-report/chip.js +17 -0
- package/dist/shared/components/ops-report/drill.js +328 -0
- package/dist/shared/components/ops-report/format.js +163 -0
- package/dist/shared/components/ops-report/ui.js +208 -0
- package/dist/shared/lib/ops-report-types.js +141 -0
- package/package.json +1 -1
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import { jsxs as l, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { ChevronsUpDown as x, Check as h, ChevronDown as b, ChevronRight as f } from "lucide-react";
|
|
3
|
+
import { useState as p } from "react";
|
|
4
|
+
import { cn as m } from "../../lib/utils.js";
|
|
5
|
+
import { Button as g } from "../ui/button.js";
|
|
6
|
+
import { Command as v, CommandInput as k, CommandList as N, CommandEmpty as w, CommandItem as y } from "../ui/command.js";
|
|
7
|
+
import { Popover as C, PopoverTrigger as S, PopoverContent as D } from "../ui/popover.js";
|
|
8
|
+
import { useDrill as P, Drillable as j } from "./drill.js";
|
|
9
|
+
function q({
|
|
10
|
+
id: a,
|
|
11
|
+
title: r,
|
|
12
|
+
gist: n,
|
|
13
|
+
empty: t,
|
|
14
|
+
defaultOpen: s,
|
|
15
|
+
children: u
|
|
16
|
+
}) {
|
|
17
|
+
const [i, o] = p(!!s && !t);
|
|
18
|
+
return /* @__PURE__ */ l(
|
|
19
|
+
"section",
|
|
20
|
+
{
|
|
21
|
+
"data-ops-section": a,
|
|
22
|
+
className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card",
|
|
23
|
+
children: [
|
|
24
|
+
/* @__PURE__ */ l(
|
|
25
|
+
"button",
|
|
26
|
+
{
|
|
27
|
+
type: "button",
|
|
28
|
+
disabled: t,
|
|
29
|
+
"aria-expanded": t ? void 0 : i,
|
|
30
|
+
onClick: () => o((c) => !c),
|
|
31
|
+
className: "flex w-full items-center gap-2 rounded-lg px-3 py-2 text-left enabled:hover:bg-muted/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/50",
|
|
32
|
+
children: [
|
|
33
|
+
t ? /* @__PURE__ */ e("span", { className: "w-3.5" }) : i ? /* @__PURE__ */ e(b, { className: "h-3.5 w-3.5 shrink-0 text-slate-400", "aria-hidden": !0 }) : /* @__PURE__ */ e(f, { className: "h-3.5 w-3.5 shrink-0 text-slate-400", "aria-hidden": !0 }),
|
|
34
|
+
/* @__PURE__ */ e(
|
|
35
|
+
"span",
|
|
36
|
+
{
|
|
37
|
+
className: m(
|
|
38
|
+
"text-[12.5px] font-semibold",
|
|
39
|
+
t ? "text-slate-400 dark:text-muted-foreground" : "text-slate-800 dark:text-foreground"
|
|
40
|
+
),
|
|
41
|
+
children: r
|
|
42
|
+
}
|
|
43
|
+
),
|
|
44
|
+
/* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate text-right text-[11.5px] tabular-nums text-slate-500 dark:text-muted-foreground", children: t ? "Nothing recorded" : n })
|
|
45
|
+
]
|
|
46
|
+
}
|
|
47
|
+
),
|
|
48
|
+
i && !t && /* @__PURE__ */ e("div", { className: "space-y-3 border-t border-slate-100 px-3 py-3 dark:border-border", children: u })
|
|
49
|
+
]
|
|
50
|
+
}
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
function I({ children: a }) {
|
|
54
|
+
return /* @__PURE__ */ e("h4", { className: "mb-1 text-[10.5px] font-semibold uppercase tracking-wide text-slate-500 dark:text-muted-foreground", children: a });
|
|
55
|
+
}
|
|
56
|
+
function z({
|
|
57
|
+
title: a,
|
|
58
|
+
rows: r,
|
|
59
|
+
cols: n,
|
|
60
|
+
limit: t = 15,
|
|
61
|
+
drill: s
|
|
62
|
+
}) {
|
|
63
|
+
const u = P();
|
|
64
|
+
if (!r.length) return null;
|
|
65
|
+
const i = r.slice(0, t);
|
|
66
|
+
return /* @__PURE__ */ l("div", { children: [
|
|
67
|
+
a && /* @__PURE__ */ e(I, { children: a }),
|
|
68
|
+
/* @__PURE__ */ e("div", { className: "overflow-x-auto", children: /* @__PURE__ */ l("table", { className: "w-full text-[12px]", children: [
|
|
69
|
+
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ e("tr", { className: "border-b border-slate-200 text-left text-[10.5px] uppercase tracking-wide text-slate-500 dark:border-border dark:text-muted-foreground", children: n.map((o) => /* @__PURE__ */ e(
|
|
70
|
+
"th",
|
|
71
|
+
{
|
|
72
|
+
className: m("py-1 pr-3 font-medium last:pr-0", o.num && "text-right"),
|
|
73
|
+
children: o.h
|
|
74
|
+
},
|
|
75
|
+
o.h
|
|
76
|
+
)) }) }),
|
|
77
|
+
/* @__PURE__ */ e("tbody", { children: i.map((o, c) => /* @__PURE__ */ e(
|
|
78
|
+
"tr",
|
|
79
|
+
{
|
|
80
|
+
...O(u, (s == null ? void 0 : s(o)) ?? null),
|
|
81
|
+
className: m(
|
|
82
|
+
"border-b border-slate-100 last:border-0 dark:border-border/60",
|
|
83
|
+
u && (s == null ? void 0 : s(o)) && "cursor-pointer hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-nvr-cyan/50"
|
|
84
|
+
),
|
|
85
|
+
children: n.map((d) => /* @__PURE__ */ e(
|
|
86
|
+
"td",
|
|
87
|
+
{
|
|
88
|
+
className: m(
|
|
89
|
+
"py-1 pr-3 align-top text-slate-700 last:pr-0 dark:text-foreground",
|
|
90
|
+
d.num && "text-right tabular-nums",
|
|
91
|
+
d.className
|
|
92
|
+
),
|
|
93
|
+
children: d.cell(o)
|
|
94
|
+
},
|
|
95
|
+
d.h
|
|
96
|
+
))
|
|
97
|
+
},
|
|
98
|
+
c
|
|
99
|
+
)) })
|
|
100
|
+
] }) }),
|
|
101
|
+
r.length > t && /* @__PURE__ */ l("p", { className: "mt-1 text-[11px] text-slate-500 dark:text-muted-foreground", children: [
|
|
102
|
+
"and ",
|
|
103
|
+
r.length - t,
|
|
104
|
+
" more"
|
|
105
|
+
] })
|
|
106
|
+
] });
|
|
107
|
+
}
|
|
108
|
+
function O(a, r) {
|
|
109
|
+
if (!a || !r) return {};
|
|
110
|
+
const n = () => a.open({ metric: r.metric, key: r.key, label: r.label });
|
|
111
|
+
return {
|
|
112
|
+
tabIndex: 0,
|
|
113
|
+
"data-ops-drill": r.metric,
|
|
114
|
+
onClick: n,
|
|
115
|
+
onKeyDown: (t) => {
|
|
116
|
+
(t.key === "Enter" || t.key === " ") && (t.preventDefault(), n());
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
function A({
|
|
121
|
+
label: a,
|
|
122
|
+
value: r,
|
|
123
|
+
tone: n,
|
|
124
|
+
drill: t
|
|
125
|
+
}) {
|
|
126
|
+
return /* @__PURE__ */ e(
|
|
127
|
+
j,
|
|
128
|
+
{
|
|
129
|
+
target: t ?? null,
|
|
130
|
+
className: "min-w-[84px] rounded-md px-1 py-0.5 -mx-1 -my-0.5 hover:bg-muted",
|
|
131
|
+
children: /* @__PURE__ */ l("div", { children: [
|
|
132
|
+
/* @__PURE__ */ e(
|
|
133
|
+
"div",
|
|
134
|
+
{
|
|
135
|
+
className: m(
|
|
136
|
+
"text-[15px] font-semibold tabular-nums",
|
|
137
|
+
n === "bad" ? "text-red-600 dark:text-red-400" : "text-slate-900 dark:text-foreground"
|
|
138
|
+
),
|
|
139
|
+
children: r
|
|
140
|
+
}
|
|
141
|
+
),
|
|
142
|
+
/* @__PURE__ */ e("div", { className: "text-[11px] text-slate-500 dark:text-muted-foreground", children: a })
|
|
143
|
+
] })
|
|
144
|
+
}
|
|
145
|
+
);
|
|
146
|
+
}
|
|
147
|
+
function F({
|
|
148
|
+
value: a,
|
|
149
|
+
onChange: r,
|
|
150
|
+
options: n,
|
|
151
|
+
ariaLabel: t,
|
|
152
|
+
placeholder: s,
|
|
153
|
+
className: u
|
|
154
|
+
}) {
|
|
155
|
+
const [i, o] = p(!1), c = n.find((d) => d.value === a);
|
|
156
|
+
return /* @__PURE__ */ l(C, { open: i, onOpenChange: o, children: [
|
|
157
|
+
/* @__PURE__ */ e(S, { asChild: !0, children: /* @__PURE__ */ l(
|
|
158
|
+
g,
|
|
159
|
+
{
|
|
160
|
+
variant: "outline",
|
|
161
|
+
role: "combobox",
|
|
162
|
+
"aria-expanded": i,
|
|
163
|
+
"aria-label": t,
|
|
164
|
+
className: m(
|
|
165
|
+
"h-8 justify-between gap-2 rounded-md border-slate-200 bg-white px-2.5 text-[12.5px] font-normal dark:border-border dark:bg-background",
|
|
166
|
+
u
|
|
167
|
+
),
|
|
168
|
+
children: [
|
|
169
|
+
/* @__PURE__ */ e("span", { className: m("truncate", !c && "text-muted-foreground"), children: (c == null ? void 0 : c.label) ?? s ?? "Select…" }),
|
|
170
|
+
/* @__PURE__ */ e(x, { className: "h-3 w-3 shrink-0 opacity-50", "aria-hidden": !0 })
|
|
171
|
+
]
|
|
172
|
+
}
|
|
173
|
+
) }),
|
|
174
|
+
/* @__PURE__ */ e(D, { className: "w-[260px] p-0", align: "start", children: /* @__PURE__ */ l(v, { children: [
|
|
175
|
+
/* @__PURE__ */ e(k, { placeholder: "Search…", className: "h-8 text-[12px]" }),
|
|
176
|
+
/* @__PURE__ */ l(N, { children: [
|
|
177
|
+
/* @__PURE__ */ e(w, { className: "py-3 text-center text-[12px] text-muted-foreground", children: "No results" }),
|
|
178
|
+
n.map((d) => /* @__PURE__ */ l(
|
|
179
|
+
y,
|
|
180
|
+
{
|
|
181
|
+
value: d.label,
|
|
182
|
+
onSelect: () => {
|
|
183
|
+
r(d.value), o(!1);
|
|
184
|
+
},
|
|
185
|
+
className: "text-[12px]",
|
|
186
|
+
children: [
|
|
187
|
+
/* @__PURE__ */ e(
|
|
188
|
+
h,
|
|
189
|
+
{
|
|
190
|
+
className: m("mr-2 h-3 w-3", d.value === a ? "opacity-100" : "opacity-0")
|
|
191
|
+
}
|
|
192
|
+
),
|
|
193
|
+
d.label
|
|
194
|
+
]
|
|
195
|
+
},
|
|
196
|
+
d.value
|
|
197
|
+
))
|
|
198
|
+
] })
|
|
199
|
+
] }) })
|
|
200
|
+
] });
|
|
201
|
+
}
|
|
202
|
+
export {
|
|
203
|
+
z as MiniTable,
|
|
204
|
+
F as Pick,
|
|
205
|
+
q as Section,
|
|
206
|
+
A as Stat,
|
|
207
|
+
I as SubTitle
|
|
208
|
+
};
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
const e = [
|
|
2
|
+
{ key: "active_people", label: "Active people", unit: "count", better: null, group: "people" },
|
|
3
|
+
{
|
|
4
|
+
key: "signed_in_today",
|
|
5
|
+
label: "Signed in today (Microsoft)",
|
|
6
|
+
unit: "count",
|
|
7
|
+
better: null,
|
|
8
|
+
group: "people"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
key: "carried_sessions",
|
|
12
|
+
label: "Still signed in from earlier",
|
|
13
|
+
unit: "count",
|
|
14
|
+
better: null,
|
|
15
|
+
group: "people"
|
|
16
|
+
},
|
|
17
|
+
{ key: "new_accounts", label: "New accounts", unit: "count", better: null, group: "people" },
|
|
18
|
+
{
|
|
19
|
+
key: "trouble_people",
|
|
20
|
+
label: "People who hit trouble",
|
|
21
|
+
unit: "count",
|
|
22
|
+
better: "down",
|
|
23
|
+
group: "people"
|
|
24
|
+
},
|
|
25
|
+
{ key: "requests", label: "Requests", unit: "count", better: null, group: "traffic" },
|
|
26
|
+
{ key: "page_views", label: "Page views", unit: "count", better: null, group: "traffic" },
|
|
27
|
+
{ key: "p95_ms", label: "p95 response", unit: "ms", better: "down", group: "speed" },
|
|
28
|
+
{ key: "p99_ms", label: "p99 response", unit: "ms", better: "down", group: "speed" },
|
|
29
|
+
{ key: "over5s", label: "Requests over 5 s", unit: "count", better: "down", group: "speed" },
|
|
30
|
+
{
|
|
31
|
+
key: "server_errors",
|
|
32
|
+
label: "Server errors (500s)",
|
|
33
|
+
unit: "count",
|
|
34
|
+
better: "down",
|
|
35
|
+
group: "errors"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
key: "client_errors",
|
|
39
|
+
label: "Refused requests (4xx)",
|
|
40
|
+
unit: "count",
|
|
41
|
+
better: "down",
|
|
42
|
+
group: "errors"
|
|
43
|
+
},
|
|
44
|
+
{ key: "deadlocks", label: "Database deadlocks", unit: "count", better: "down", group: "errors" },
|
|
45
|
+
{ key: "job_failures", label: "Failed jobs", unit: "count", better: "down", group: "errors" },
|
|
46
|
+
{ key: "deploys", label: "Deploys", unit: "count", better: null, group: "traffic" },
|
|
47
|
+
{
|
|
48
|
+
key: "integration_failures",
|
|
49
|
+
label: "Partner sends failed",
|
|
50
|
+
unit: "count",
|
|
51
|
+
better: "down",
|
|
52
|
+
group: "integrations"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
key: "integration_calls_failed",
|
|
56
|
+
label: "Partner calls failed",
|
|
57
|
+
unit: "count",
|
|
58
|
+
better: "down",
|
|
59
|
+
group: "integrations"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
key: "open_alarms",
|
|
63
|
+
label: "Open integration alarms",
|
|
64
|
+
unit: "count",
|
|
65
|
+
better: "down",
|
|
66
|
+
group: "integrations"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
key: "mail_failed",
|
|
70
|
+
label: "Mail failed",
|
|
71
|
+
unit: "count",
|
|
72
|
+
better: "down",
|
|
73
|
+
group: "integrations"
|
|
74
|
+
},
|
|
75
|
+
{ key: "moves", label: "Workflow moves", unit: "count", better: "up", group: "work" },
|
|
76
|
+
{ key: "creates", label: "Records created", unit: "count", better: "up", group: "work" },
|
|
77
|
+
{ key: "backlog_waiting", label: "Items waiting", unit: "count", better: "down", group: "work" },
|
|
78
|
+
{
|
|
79
|
+
key: "search_zero",
|
|
80
|
+
label: "Searches with no result",
|
|
81
|
+
unit: "count",
|
|
82
|
+
better: "down",
|
|
83
|
+
group: "work"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
key: "new_places",
|
|
87
|
+
label: "Sign-ins from new places",
|
|
88
|
+
unit: "count",
|
|
89
|
+
better: null,
|
|
90
|
+
group: "security"
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
key: "failed_sign_ins",
|
|
94
|
+
label: "Failed sign-ins",
|
|
95
|
+
unit: "count",
|
|
96
|
+
better: "down",
|
|
97
|
+
group: "security"
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
key: "open_bugs",
|
|
101
|
+
label: "Open bugs (tracker)",
|
|
102
|
+
unit: "count",
|
|
103
|
+
better: "down",
|
|
104
|
+
group: "errors"
|
|
105
|
+
},
|
|
106
|
+
{ key: "health_score", label: "Health score", unit: "count", better: "up", group: "errors" },
|
|
107
|
+
{ key: "pages_viewed", label: "Pages viewed", unit: "count", better: null, group: "traffic" },
|
|
108
|
+
{
|
|
109
|
+
key: "browser_errors",
|
|
110
|
+
label: "Browser errors",
|
|
111
|
+
unit: "count",
|
|
112
|
+
better: "down",
|
|
113
|
+
group: "errors"
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
key: "support_opened",
|
|
117
|
+
label: "Support tickets opened",
|
|
118
|
+
unit: "count",
|
|
119
|
+
better: "down",
|
|
120
|
+
group: "work"
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
key: "support_open",
|
|
124
|
+
label: "Support tickets open",
|
|
125
|
+
unit: "count",
|
|
126
|
+
better: "down",
|
|
127
|
+
group: "work"
|
|
128
|
+
},
|
|
129
|
+
{ key: "ai_calls", label: "AI calls", unit: "count", better: null, group: "traffic" },
|
|
130
|
+
{ key: "ai_cost_usd", label: "AI spend", unit: "usd", better: "down", group: "traffic" },
|
|
131
|
+
{
|
|
132
|
+
key: "data_violations",
|
|
133
|
+
label: "Data-quality problems",
|
|
134
|
+
unit: "count",
|
|
135
|
+
better: "down",
|
|
136
|
+
group: "work"
|
|
137
|
+
}
|
|
138
|
+
];
|
|
139
|
+
export {
|
|
140
|
+
e as OPS_KPI_META
|
|
141
|
+
};
|