@hot-updater/console 1.0.0-rc.2 → 1.0.0-rc.4
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/.output/nitro.json +1 -1
- package/.output/public/assets/InsightsPageHeader-C-Xc2MB9.js +1 -0
- package/.output/public/assets/api-keys-C1sgC6ko.js +1 -0
- package/.output/public/assets/{api-keys-api-BHcODB7q.js → api-keys-api-LchP65vQ.js} +1 -1
- package/.output/public/assets/badge-BuMDU0Rf.js +1 -0
- package/.output/public/assets/card-BEvx_QKh.js +1 -0
- package/.output/public/assets/{chart-no-axes-combined-Dy4WJv2U.js → chart-no-axes-combined-C0G0fQ3J.js} +1 -1
- package/.output/public/assets/{composite-Bp98A0Ld.js → composite-CHTH1Xhh.js} +1 -1
- package/.output/public/assets/createServerFn-DHc2erub.js +3 -0
- package/.output/public/assets/dialog-dyZ1SphZ.js +1 -0
- package/.output/public/assets/{dist-C_NydL0e.js → dist-Bh1gaDfB.js} +1 -1
- package/.output/public/assets/field-79SVH26s.js +1 -0
- package/.output/public/assets/index-BNkxg4jz.js +10 -0
- package/.output/public/assets/input-group-BbHfaBzQ.js +1 -0
- package/.output/public/assets/insights-D_7uSKfc.js +1 -0
- package/.output/public/assets/installations-BzoHWuXw.js +1 -0
- package/.output/public/assets/{installations-CE33wgbY.js → installations-DvjbUqd1.js} +2 -2
- package/.output/public/assets/{lazyRouteComponent-Ccp3bwBY.js → lazyRouteComponent-BN0MS05o.js} +1 -1
- package/.output/public/assets/{link-CI8idAUi.js → link-BG06whwB.js} +1 -1
- package/.output/public/assets/{loader-circle-BoxLrsOu.js → loader-circle-Bbp8LGVC.js} +1 -1
- package/.output/public/assets/{refresh-cw-Bqc72UZG.js → refresh-cw-DZgiAOMk.js} +1 -1
- package/.output/public/assets/routes-BFE-oRIT.js +1 -0
- package/.output/public/assets/{routes-DGVXdzpw.js → routes-DaPMY31P.js} +2 -2
- package/.output/public/assets/{shield-check-uK3MHWJZ.js → shield-check-DoIiaaXU.js} +1 -1
- package/.output/public/assets/signing-BTRhaF5D.js +1 -0
- package/.output/public/assets/styles-C7U0oVke.css +2 -0
- package/.output/public/assets/table-BBEzJ7Xl.js +1 -0
- package/.output/public/assets/useCompositeListItem-BkPDaqyj.js +42 -0
- package/.output/server/{__23tanstack-start-server-fn-resolver-B7ioJhtE.mjs → __23tanstack-start-server-fn-resolver-Dr2ixDgQ.mjs} +40 -32
- package/.output/server/_libs/@base-ui/react+[...].mjs +1 -1
- package/.output/server/_libs/@reduxjs/toolkit+[...].mjs +1554 -0
- package/.output/server/_libs/@tanstack/react-router+[...].mjs +1 -1
- package/.output/server/_libs/@tanstack/react-router-ssr-query+[...].mjs +1 -1
- package/.output/server/_libs/d3-array.mjs +231 -0
- package/.output/server/_libs/d3-color.mjs +330 -0
- package/.output/server/_libs/d3-format.mjs +252 -0
- package/.output/server/_libs/d3-interpolate.mjs +207 -0
- package/.output/server/_libs/d3-path.mjs +77 -0
- package/.output/server/_libs/d3-scale+[...].mjs +1907 -0
- package/.output/server/_libs/d3-shape.mjs +818 -0
- package/.output/server/_libs/decimal.js-light.mjs +884 -0
- package/.output/server/_libs/es-toolkit.mjs +1159 -0
- package/.output/server/_libs/eventemitter3.mjs +236 -0
- package/.output/server/_libs/immer.mjs +532 -0
- package/.output/server/_libs/lucide-react.mjs +9 -2
- package/.output/server/_libs/next-themes.mjs +1 -1
- package/.output/server/_libs/react-redux+[...].mjs +205 -0
- package/.output/server/_libs/recharts+[...].mjs +15054 -0
- package/.output/server/_libs/sonner.mjs +1 -1
- package/.output/server/_libs/tanstack__react-query.mjs +1 -1
- package/.output/server/_runtime.mjs +10 -1
- package/.output/server/_ssr/InsightsPageHeader-C5Has8Ry.mjs +60 -0
- package/.output/server/_ssr/{api-keys-CZeTPQys.mjs → api-keys-DJml_XoK.mjs} +10 -8
- package/.output/server/_ssr/{api-keys-api-BUPQVSpk.mjs → api-keys-api-CrCZyvnl.mjs} +2 -2
- package/.output/server/_ssr/{api-keys-rpc-Cs7tS5_j.mjs → api-keys-rpc-CFaNf-q0.mjs} +3 -3
- package/.output/server/_ssr/{api-rpc-tAupfGQm.mjs → api-rpc-B61KL3Eo.mjs} +25 -25
- package/.output/server/_ssr/{auth-rpc-DUaeOWKK.mjs → auth-rpc-D_hv52-J.mjs} +4 -4
- package/.output/server/_ssr/{auth.server-DW71WzsD.mjs → auth.server-DF_shCeq.mjs} +1 -1
- package/.output/server/_ssr/badge-BgsCP9Dp.mjs +28 -0
- package/.output/server/_ssr/{bundle-signing-rpc-BhnBw0-d.mjs → bundle-signing-rpc-BBipZnFs.mjs} +2 -2
- package/.output/server/_ssr/{bundle-signing.server-C4NW5mWx.mjs → bundle-signing.server-Co_zHdJx.mjs} +1 -1
- package/.output/server/_ssr/bundleActivity-D3_fIda2.mjs +27 -0
- package/.output/server/_ssr/{card-BRiPmi0C.mjs → card-DrbxCPtG.mjs} +3 -25
- package/.output/server/_ssr/chart-qxa-_30a.mjs +162 -0
- package/.output/server/_ssr/{config.server-afDuAwaG.mjs → config.server-CBr6PDj5.mjs} +5 -5
- package/.output/server/_ssr/{createSsrRpc-DjWNJ0uc.mjs → createSsrRpc-NHF2PxuK.mjs} +4 -4
- package/.output/server/_ssr/{deleteBundle-BTGwBgzx.mjs → deleteBundle-BAq3JuGr.mjs} +1 -1
- package/.output/server/_ssr/{dialog-DS-nw-pA.mjs → dialog-DUaIgpgd.mjs} +1 -1
- package/.output/server/_ssr/{downloadBundle-CNnYxYO2.mjs → downloadBundle-B3ert-pY.mjs} +1 -1
- package/.output/server/_ssr/{table-CnZmon_Z.mjs → field-CqNUlqUq.mjs} +4 -50
- package/.output/server/_ssr/{getBundleChildren-C0vh4ZvE.mjs → getBundleChildren-COMt16m_.mjs} +1 -1
- package/.output/server/_ssr/{input-group-BpsnmvZw.mjs → input-group-Bb8ueylQ.mjs} +51 -2
- package/.output/server/_ssr/insights-B-DUbksX.mjs +502 -0
- package/.output/server/_ssr/insights-recovery-DSFM-YTL.mjs +21 -0
- package/.output/server/_ssr/insights-recovery-rpc-P71FH66n.mjs +37 -0
- package/.output/server/_ssr/{insights-rpc-38DujK0G.mjs → insights-rpc-DrIQCjpD.mjs} +2 -2
- package/.output/server/_ssr/insightsRecovery-CqcosG7B.mjs +149 -0
- package/.output/server/_ssr/{installations-CtA59MQG.mjs → installations-BQrppti7.mjs} +2 -2
- package/.output/server/_ssr/{installations-DiVKEF5T.mjs → installations-YumqpNpa.mjs} +426 -11
- package/.output/server/_ssr/{router-B9wG_9f8.mjs → router-iP95Vqi2.mjs} +14 -14
- package/.output/server/_ssr/{routes-CKrrS2q2.mjs → routes-BDabsmc7.mjs} +2 -2
- package/.output/server/_ssr/{routes-D7Yh_jfj.mjs → routes-ivsV2TDu.mjs} +224 -13
- package/.output/server/_ssr/{runtime.server-DacU1TBV.mjs → runtime.server-jmZOKIQM.mjs} +1 -1
- package/.output/server/_ssr/{server-D_C2rMzf.mjs → server-p7yrVBfD.mjs} +3 -3
- package/.output/server/_ssr/{signing-Dz1WkZOf.mjs → signing-CxCbnFCt.mjs} +5 -4
- package/.output/server/_ssr/ssr.mjs +1 -1
- package/.output/server/_ssr/table-D1mL8fJu.mjs +53 -0
- package/.output/server/_tanstack-start-manifest_v-Cwpu0C9Q.mjs +100 -0
- package/.output/server/index.mjs +154 -154
- package/package.json +3 -3
- package/src/components/features/bundles/BundleActivityChart.tsx +95 -0
- package/src/components/features/bundles/BundleInsightsSummary.tsx +121 -0
- package/src/components/features/insights/InsightsControls.tsx +1 -15
- package/src/components/features/insights/InsightsOverview.tsx +368 -179
- package/src/components/features/releases/ReleaseEditorSheet.tsx +10 -0
- package/src/components/ui/empty.tsx +101 -0
- package/src/lib/bundle-activity.ts +21 -0
- package/src/lib/insights-recovery-rpc.ts +38 -0
- package/src/lib/insights-recovery.ts +59 -0
- package/src/lib/server/bundleActivity.ts +37 -0
- package/src/lib/server/insightsHistory.ts +52 -0
- package/src/lib/server/insightsRecovery.ts +186 -0
- package/src/routes/index.tsx +33 -3
- package/src/routes/insights.tsx +1 -42
- package/.output/public/assets/HashValueDisplay-CB0Eskit.js +0 -1
- package/.output/public/assets/InsightsPageHeader-Car5LNiZ.js +0 -1
- package/.output/public/assets/api-keys-BzKocqRy.js +0 -1
- package/.output/public/assets/card-Dhr_eFYj.js +0 -1
- package/.output/public/assets/createServerFn-CA8fs7QD.js +0 -3
- package/.output/public/assets/dialog-CUTrcPlB.js +0 -1
- package/.output/public/assets/index-DdAz-CXv.js +0 -10
- package/.output/public/assets/input-group-cSOG4wh_.js +0 -1
- package/.output/public/assets/insights-C0PBSZ-n.js +0 -1
- package/.output/public/assets/installations-CStZja8x.js +0 -1
- package/.output/public/assets/routes-DTlwOr8I.js +0 -1
- package/.output/public/assets/signing-CMf4aqDO.js +0 -1
- package/.output/public/assets/styles-BCvbtKsm.css +0 -2
- package/.output/public/assets/table-2vcV89QB.js +0 -1
- package/.output/public/assets/useCompositeListItem-CHLITE_4.js +0 -1
- package/.output/public/assets/x-DCd0j8c6.js +0 -1
- package/.output/server/_ssr/HashValueDisplay-DwpGLfrl.mjs +0 -55
- package/.output/server/_ssr/InsightsPageHeader-Df4Brj8u.mjs +0 -484
- package/.output/server/_ssr/insights-BdS364Xu.mjs +0 -460
- package/.output/server/_tanstack-start-manifest_v-2MjTyxil.mjs +0 -97
- package/src/components/features/insights/InsightsBundleReports.tsx +0 -51
- /package/.output/public/assets/{preload-helper-CQ36nxok.js → preload-helper-uTix4PVD.js} +0 -0
|
@@ -1,484 +0,0 @@
|
|
|
1
|
-
import { r as __toESM } from "../_runtime.mjs";
|
|
2
|
-
import { c as createServerFn } from "./createServerFn-B2hcXoPM.mjs";
|
|
3
|
-
import { J as require_react, q as require_jsx_runtime } from "../_libs/@base-ui/react+[...].mjs";
|
|
4
|
-
import { F as ChartNoAxesCombined, I as ArrowUpRight, N as ChevronDown, P as Check, d as RefreshCw, h as PackageCheck, n as TriangleAlert, u as RotateCcw, z as Activity } from "../_libs/lucide-react.mjs";
|
|
5
|
-
import { S as buttonVariants, _ as Skeleton, g as SidebarTrigger, t as Button$1, w as createSsrRpc } from "./createSsrRpc-DjWNJ0uc.mjs";
|
|
6
|
-
import { m as Link } from "../_libs/@tanstack/react-router+[...].mjs";
|
|
7
|
-
import { n as useQuery } from "../_libs/tanstack__react-query.mjs";
|
|
8
|
-
import { a as Badge, d as CardTitle, i as AlertTitle, o as Card, r as AlertDescription, s as CardContent, t as Alert, u as CardHeader } from "./card-BRiPmi0C.mjs";
|
|
9
|
-
import { c as TableBody, d as TableHeader, f as TableRow, l as TableCell, s as Table, u as TableHead } from "./table-CnZmon_Z.mjs";
|
|
10
|
-
import { t as HashValueDisplay } from "./HashValueDisplay-DwpGLfrl.mjs";
|
|
11
|
-
//#region node_modules/.nitro/vite/services/ssr/assets/InsightsPageHeader-Df4Brj8u.js
|
|
12
|
-
var import_react = /* @__PURE__ */ __toESM(require_react());
|
|
13
|
-
var import_jsx_runtime = require_jsx_runtime();
|
|
14
|
-
var readOverview = (input) => input;
|
|
15
|
-
var readEventsPage = (input) => input;
|
|
16
|
-
var readInstallationEventsPage = (input) => input;
|
|
17
|
-
var readInstallationPage = (input) => input;
|
|
18
|
-
var readInstallId = (input) => input;
|
|
19
|
-
var getReportingInstallationsRpc = createServerFn({ method: "GET" }).validator(readOverview).handler(createSsrRpc("ff00311d412c8cdfa8ad5b0ba1eb6aa7471d0cc12170e6cc645deb91603d42dd"));
|
|
20
|
-
var listInsightsEventsRpc = createServerFn({ method: "GET" }).validator(readEventsPage).handler(createSsrRpc("d4c50f40701055145f24873dc90f3c55a5494457a6a03a743339b2ac4545eb19"));
|
|
21
|
-
var listInsightsInstallationEventsRpc = createServerFn({ method: "GET" }).validator(readInstallationEventsPage).handler(createSsrRpc("3c04bc6624be6dfdd80cf96819f9c6d0455e59a7bb4c0374b6afb0162ffd15b0"));
|
|
22
|
-
var getInsightsInstallationRpc = createServerFn({ method: "GET" }).validator(readInstallId).handler(createSsrRpc("6726f1ed9eda1f0cb4c1f1ad1023faee435ddcfd0b7c55ef08ca7f2f7f577370"));
|
|
23
|
-
var findInsightsInstallationsRpc = createServerFn({ method: "GET" }).validator(readInstallationPage).handler(createSsrRpc("735c501f6d5ea81a445ff2b6b2ea6a1b589e3c6f63a465a881822c80ae71e7d1"));
|
|
24
|
-
var STALE_TIME_MS = 3e4;
|
|
25
|
-
var queryKeys = {
|
|
26
|
-
reportingInstallations: (input) => [
|
|
27
|
-
"insights",
|
|
28
|
-
"reporting-installations",
|
|
29
|
-
input
|
|
30
|
-
],
|
|
31
|
-
events: (input) => [
|
|
32
|
-
"insights",
|
|
33
|
-
"events",
|
|
34
|
-
input
|
|
35
|
-
],
|
|
36
|
-
installations: (input) => [
|
|
37
|
-
"insights",
|
|
38
|
-
"installations",
|
|
39
|
-
input
|
|
40
|
-
],
|
|
41
|
-
installation: (installId) => [
|
|
42
|
-
"insights",
|
|
43
|
-
"installation",
|
|
44
|
-
installId
|
|
45
|
-
],
|
|
46
|
-
installationEvents: (input) => [
|
|
47
|
-
"insights",
|
|
48
|
-
"installation-events",
|
|
49
|
-
input
|
|
50
|
-
]
|
|
51
|
-
};
|
|
52
|
-
var useReportingInstallationsQuery = (input) => useQuery({
|
|
53
|
-
queryKey: queryKeys.reportingInstallations(input),
|
|
54
|
-
queryFn: () => getReportingInstallationsRpc({ data: input }),
|
|
55
|
-
refetchOnWindowFocus: true,
|
|
56
|
-
staleTime: STALE_TIME_MS
|
|
57
|
-
});
|
|
58
|
-
var useInsightsEventsQuery = (input, enabled) => useQuery({
|
|
59
|
-
queryKey: queryKeys.events(input),
|
|
60
|
-
queryFn: () => listInsightsEventsRpc({ data: input }),
|
|
61
|
-
enabled,
|
|
62
|
-
refetchOnWindowFocus: true,
|
|
63
|
-
staleTime: STALE_TIME_MS
|
|
64
|
-
});
|
|
65
|
-
var useInsightsInstallationsQuery = (input, enabled) => useQuery({
|
|
66
|
-
queryKey: queryKeys.installations(input),
|
|
67
|
-
queryFn: () => findInsightsInstallationsRpc({ data: input }),
|
|
68
|
-
enabled: enabled && input.identity.length > 0,
|
|
69
|
-
staleTime: STALE_TIME_MS
|
|
70
|
-
});
|
|
71
|
-
var useInsightsInstallationQuery = (installId, enabled) => useQuery({
|
|
72
|
-
queryKey: queryKeys.installation(installId),
|
|
73
|
-
queryFn: () => getInsightsInstallationRpc({ data: { installId } }),
|
|
74
|
-
enabled: enabled && installId.length > 0,
|
|
75
|
-
staleTime: STALE_TIME_MS
|
|
76
|
-
});
|
|
77
|
-
var useInsightsInstallationEventsQuery = (input, enabled) => useQuery({
|
|
78
|
-
queryKey: queryKeys.installationEvents(input),
|
|
79
|
-
queryFn: () => listInsightsInstallationEventsRpc({ data: input }),
|
|
80
|
-
enabled: enabled && input.installId.length > 0,
|
|
81
|
-
refetchOnWindowFocus: true,
|
|
82
|
-
staleTime: STALE_TIME_MS
|
|
83
|
-
});
|
|
84
|
-
var eventTypes = {
|
|
85
|
-
UPDATE_APPLIED: {
|
|
86
|
-
label: "Bundle applied",
|
|
87
|
-
variant: "success",
|
|
88
|
-
icon: Check
|
|
89
|
-
},
|
|
90
|
-
RECOVERED: {
|
|
91
|
-
label: "Recovered",
|
|
92
|
-
variant: "warning",
|
|
93
|
-
icon: RotateCcw
|
|
94
|
-
},
|
|
95
|
-
RELEASE_ADOPTED: {
|
|
96
|
-
label: "Bundle adopted",
|
|
97
|
-
variant: "success",
|
|
98
|
-
icon: PackageCheck
|
|
99
|
-
},
|
|
100
|
-
UNCHANGED: {
|
|
101
|
-
label: "Activity reported",
|
|
102
|
-
variant: "secondary",
|
|
103
|
-
icon: Activity
|
|
104
|
-
}
|
|
105
|
-
};
|
|
106
|
-
function useInsightsTimeFormat() {
|
|
107
|
-
const [timeZone, setTimeZone] = (0, import_react.useState)("UTC");
|
|
108
|
-
(0, import_react.useEffect)(() => {
|
|
109
|
-
setTimeZone(Intl.DateTimeFormat().resolvedOptions().timeZone);
|
|
110
|
-
}, []);
|
|
111
|
-
return new Intl.DateTimeFormat("en", {
|
|
112
|
-
timeZone,
|
|
113
|
-
timeZoneName: "shortOffset",
|
|
114
|
-
year: "numeric",
|
|
115
|
-
month: "2-digit",
|
|
116
|
-
day: "2-digit",
|
|
117
|
-
hour: "2-digit",
|
|
118
|
-
minute: "2-digit",
|
|
119
|
-
second: "2-digit",
|
|
120
|
-
hourCycle: "h23"
|
|
121
|
-
});
|
|
122
|
-
}
|
|
123
|
-
function formatInsightsTimestamp(value, formatter) {
|
|
124
|
-
const parts = Object.fromEntries(formatter.formatToParts(new Date(value)).map(({ type, value }) => [type, value]));
|
|
125
|
-
const offset = parts.timeZoneName === "GMT" ? "GMT+0" : parts.timeZoneName;
|
|
126
|
-
return `${parts.year}/${parts.month}/${parts.day} ${parts.hour}:${parts.minute}:${parts.second} ${offset}`;
|
|
127
|
-
}
|
|
128
|
-
function EventTimestamp({ value, formatter, touch = false }) {
|
|
129
|
-
const date = new Date(value);
|
|
130
|
-
const localTime = formatInsightsTimestamp(value, formatter);
|
|
131
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("details", {
|
|
132
|
-
className: "group/time",
|
|
133
|
-
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("summary", {
|
|
134
|
-
className: `cursor-pointer list-none rounded-md outline-none focus-visible:ring-2 focus-visible:ring-ring/30 [&::-webkit-details-marker]:hidden ${touch ? "flex min-h-11 items-center" : ""}`,
|
|
135
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
|
|
136
|
-
className: "flex items-center gap-1",
|
|
137
|
-
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("time", {
|
|
138
|
-
dateTime: date.toISOString(),
|
|
139
|
-
className: "whitespace-nowrap",
|
|
140
|
-
children: localTime
|
|
141
|
-
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ChevronDown, {
|
|
142
|
-
"aria-hidden": "true",
|
|
143
|
-
className: "size-3 text-muted-foreground group-open/time:rotate-180"
|
|
144
|
-
})]
|
|
145
|
-
})
|
|
146
|
-
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
|
|
147
|
-
className: "mt-2 text-muted-foreground",
|
|
148
|
-
children: date.toISOString().replace("T", " ").replace("Z", " UTC")
|
|
149
|
-
})]
|
|
150
|
-
});
|
|
151
|
-
}
|
|
152
|
-
function EventTypeBadge({ type }) {
|
|
153
|
-
const eventType = eventTypes[type];
|
|
154
|
-
const Icon = eventType.icon;
|
|
155
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Badge, {
|
|
156
|
-
variant: eventType.variant,
|
|
157
|
-
className: "gap-1 whitespace-nowrap [&_svg]:size-3",
|
|
158
|
-
title: type === "UNCHANGED" ? "App activity reported on the current bundle without a bundle transition." : type === "RELEASE_ADOPTED" ? "A different release was adopted without changing the bundle." : void 0,
|
|
159
|
-
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, { "aria-hidden": "true" }), eventType.label]
|
|
160
|
-
});
|
|
161
|
-
}
|
|
162
|
-
function EventBundleTransition({ event, touch = false }) {
|
|
163
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("dl", {
|
|
164
|
-
className: "grid grid-cols-[auto_minmax(0,1fr)] items-center gap-x-2 gap-y-2",
|
|
165
|
-
children: [
|
|
166
|
-
event.fromBundleId ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("dt", {
|
|
167
|
-
className: "text-muted-foreground",
|
|
168
|
-
children: "From"
|
|
169
|
-
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("dd", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(HashValueDisplay, {
|
|
170
|
-
value: event.fromBundleId,
|
|
171
|
-
buttonClassName: touch ? "min-h-11 px-3" : void 0
|
|
172
|
-
}) })] }) : null,
|
|
173
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("dt", {
|
|
174
|
-
className: "text-muted-foreground",
|
|
175
|
-
children: event.type === "UNCHANGED" ? "Current" : "To"
|
|
176
|
-
}),
|
|
177
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("dd", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(HashValueDisplay, {
|
|
178
|
-
value: event.toBundleId,
|
|
179
|
-
buttonClassName: touch ? "min-h-11 px-3" : void 0
|
|
180
|
-
}) })
|
|
181
|
-
]
|
|
182
|
-
});
|
|
183
|
-
}
|
|
184
|
-
function EventHistoryList({ events, formatter, renderIdentity }) {
|
|
185
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
|
|
186
|
-
className: "px-4 pb-2 text-xs text-muted-foreground sm:px-6",
|
|
187
|
-
children: "Time in your browser zone"
|
|
188
|
-
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("ol", {
|
|
189
|
-
"aria-label": "Events",
|
|
190
|
-
className: "divide-y border-y",
|
|
191
|
-
children: events.map((event) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("li", {
|
|
192
|
-
className: "flex min-w-0 flex-col gap-3 px-4 py-4 sm:px-6",
|
|
193
|
-
children: [
|
|
194
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
195
|
-
className: "flex flex-wrap items-center justify-between gap-x-4 gap-y-1",
|
|
196
|
-
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(EventTypeBadge, { type: event.type }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
197
|
-
className: "text-xs tabular-nums",
|
|
198
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(EventTimestamp, {
|
|
199
|
-
value: event.receivedAtMs,
|
|
200
|
-
formatter,
|
|
201
|
-
touch: true
|
|
202
|
-
})
|
|
203
|
-
})]
|
|
204
|
-
}),
|
|
205
|
-
renderIdentity?.(event),
|
|
206
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("dl", {
|
|
207
|
-
className: "flex flex-wrap gap-x-2 gap-y-1 text-sm",
|
|
208
|
-
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("dt", {
|
|
209
|
-
className: "sr-only",
|
|
210
|
-
children: "App"
|
|
211
|
-
}), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("dd", { children: [
|
|
212
|
-
event.platform === "ios" ? "iOS" : "Android",
|
|
213
|
-
" ",
|
|
214
|
-
event.appVersion
|
|
215
|
-
] })] }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
216
|
-
className: "min-w-0 text-muted-foreground",
|
|
217
|
-
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("dt", {
|
|
218
|
-
className: "sr-only",
|
|
219
|
-
children: "Channel"
|
|
220
|
-
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("dd", {
|
|
221
|
-
className: "wrap-anywhere",
|
|
222
|
-
children: event.channel
|
|
223
|
-
})]
|
|
224
|
-
})]
|
|
225
|
-
}),
|
|
226
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
227
|
-
className: "text-xs",
|
|
228
|
-
"aria-label": "Bundle",
|
|
229
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(EventBundleTransition, {
|
|
230
|
-
event,
|
|
231
|
-
touch: true
|
|
232
|
-
})
|
|
233
|
-
})
|
|
234
|
-
]
|
|
235
|
-
}, event.id))
|
|
236
|
-
})] });
|
|
237
|
-
}
|
|
238
|
-
function InsightsErrorAlert({ fallbackTitle }) {
|
|
239
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Alert, {
|
|
240
|
-
variant: "destructive",
|
|
241
|
-
children: [
|
|
242
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TriangleAlert, { "aria-hidden": "true" }),
|
|
243
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertTitle, { children: fallbackTitle }),
|
|
244
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertDescription, { children: "Refresh to try again. If this keeps happening, check your Insights provider connection." })
|
|
245
|
-
]
|
|
246
|
-
});
|
|
247
|
-
}
|
|
248
|
-
function InsightsPagination({ hasPrevious, label, nextCursor, onNext, onPrevious, pageLength, pageNumber }) {
|
|
249
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("nav", {
|
|
250
|
-
"aria-label": `${label} pagination`,
|
|
251
|
-
className: "flex flex-wrap items-center justify-between gap-3 border-t px-4 py-3 sm:px-6",
|
|
252
|
-
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
|
|
253
|
-
className: "text-xs text-muted-foreground tabular-nums",
|
|
254
|
-
children: [
|
|
255
|
-
"Page ",
|
|
256
|
-
pageNumber,
|
|
257
|
-
" · ",
|
|
258
|
-
pageLength.toLocaleString(),
|
|
259
|
-
" rows"
|
|
260
|
-
]
|
|
261
|
-
}), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
262
|
-
className: "flex gap-2",
|
|
263
|
-
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Button$1, {
|
|
264
|
-
className: "h-11 min-w-11 px-3 lg:h-8 lg:min-w-0 lg:px-2",
|
|
265
|
-
disabled: !hasPrevious,
|
|
266
|
-
onClick: onPrevious,
|
|
267
|
-
size: "sm",
|
|
268
|
-
type: "button",
|
|
269
|
-
variant: "outline",
|
|
270
|
-
children: "Previous"
|
|
271
|
-
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Button$1, {
|
|
272
|
-
className: "h-11 min-w-11 px-3 lg:h-8 lg:min-w-0 lg:px-2",
|
|
273
|
-
disabled: nextCursor === null,
|
|
274
|
-
onClick: onNext,
|
|
275
|
-
size: "sm",
|
|
276
|
-
type: "button",
|
|
277
|
-
variant: "outline",
|
|
278
|
-
children: "Next"
|
|
279
|
-
})]
|
|
280
|
-
})]
|
|
281
|
-
});
|
|
282
|
-
}
|
|
283
|
-
function EventIdentity({ event, eventsLocation, touch = false }) {
|
|
284
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
285
|
-
className: touch ? "flex min-w-0 flex-wrap items-center justify-between gap-2" : "flex min-w-0 flex-col items-start gap-2",
|
|
286
|
-
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Link, {
|
|
287
|
-
className: buttonVariants({
|
|
288
|
-
className: touch ? "-ml-2 h-auto min-h-11 min-w-0 flex-1 justify-start gap-2 whitespace-normal text-sm" : "-ml-2 max-w-full justify-start",
|
|
289
|
-
size: "sm",
|
|
290
|
-
variant: "ghost"
|
|
291
|
-
}),
|
|
292
|
-
to: "/installations",
|
|
293
|
-
search: {
|
|
294
|
-
...eventsLocation,
|
|
295
|
-
query: event.installId || void 0,
|
|
296
|
-
installId: event.installId
|
|
297
|
-
},
|
|
298
|
-
"aria-label": `View history for ${event.userId ?? event.username ?? "anonymous installation"} (${event.installId})`,
|
|
299
|
-
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
300
|
-
className: touch ? "min-w-0 text-left wrap-anywhere" : "truncate",
|
|
301
|
-
children: event.userId ?? event.username ?? "Anonymous installation"
|
|
302
|
-
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ArrowUpRight, {
|
|
303
|
-
"aria-hidden": "true",
|
|
304
|
-
"data-icon": "inline-end"
|
|
305
|
-
})]
|
|
306
|
-
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(HashValueDisplay, {
|
|
307
|
-
value: event.installId,
|
|
308
|
-
maxLength: 13,
|
|
309
|
-
buttonClassName: touch ? "min-h-11 px-3" : void 0
|
|
310
|
-
})]
|
|
311
|
-
});
|
|
312
|
-
}
|
|
313
|
-
function EventHistoryCard({ children, error, eventsLocation, history, isFetching, isLoading, onNext, onPrevious, onRefresh, pageNumber, title = "All events" }) {
|
|
314
|
-
const dateTimeFormat = useInsightsTimeFormat();
|
|
315
|
-
const hasPrevious = pageNumber > 1;
|
|
316
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Card, {
|
|
317
|
-
className: "@container min-w-0 shadow-sm",
|
|
318
|
-
"aria-busy": isFetching,
|
|
319
|
-
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(CardHeader, {
|
|
320
|
-
className: "gap-4 p-4 sm:p-6",
|
|
321
|
-
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
322
|
-
className: "flex flex-wrap items-center justify-between gap-3",
|
|
323
|
-
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(CardTitle, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h2", { children: title }) }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Button$1, {
|
|
324
|
-
className: "h-11 lg:h-8",
|
|
325
|
-
disabled: isFetching,
|
|
326
|
-
onClick: onRefresh,
|
|
327
|
-
size: "lg",
|
|
328
|
-
variant: "outline",
|
|
329
|
-
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(RefreshCw, {
|
|
330
|
-
"aria-hidden": "true",
|
|
331
|
-
"data-icon": "inline-start"
|
|
332
|
-
}), "Refresh"]
|
|
333
|
-
})]
|
|
334
|
-
}), children]
|
|
335
|
-
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CardContent, {
|
|
336
|
-
className: "min-w-0 p-0",
|
|
337
|
-
children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
338
|
-
className: "flex flex-col gap-4 p-6",
|
|
339
|
-
role: "status",
|
|
340
|
-
"aria-label": "Loading events",
|
|
341
|
-
children: [
|
|
342
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Skeleton, { className: "h-12 w-full" }),
|
|
343
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Skeleton, { className: "h-12 w-full" }),
|
|
344
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Skeleton, { className: "h-12 w-full" })
|
|
345
|
-
]
|
|
346
|
-
}) : error ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
347
|
-
className: "px-6 pb-6",
|
|
348
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(InsightsErrorAlert, {
|
|
349
|
-
error,
|
|
350
|
-
fallbackTitle: "Event history unavailable"
|
|
351
|
-
})
|
|
352
|
-
}) : history ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [history.data.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
353
|
-
className: "@[58rem]:hidden",
|
|
354
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(EventHistoryList, {
|
|
355
|
-
events: history.data,
|
|
356
|
-
formatter: dateTimeFormat,
|
|
357
|
-
renderIdentity: (event) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(EventIdentity, {
|
|
358
|
-
event,
|
|
359
|
-
eventsLocation,
|
|
360
|
-
touch: true
|
|
361
|
-
})
|
|
362
|
-
})
|
|
363
|
-
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
364
|
-
className: "hidden @[58rem]:block",
|
|
365
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Table, {
|
|
366
|
-
className: "min-w-4xl table-fixed",
|
|
367
|
-
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(TableRow, {
|
|
368
|
-
className: "[&>th]:px-4 sm:[&>th]:px-6",
|
|
369
|
-
children: [
|
|
370
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableHead, {
|
|
371
|
-
className: "w-64",
|
|
372
|
-
children: "Time"
|
|
373
|
-
}),
|
|
374
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableHead, {
|
|
375
|
-
className: "w-48",
|
|
376
|
-
children: "Event"
|
|
377
|
-
}),
|
|
378
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableHead, {
|
|
379
|
-
className: "w-48",
|
|
380
|
-
children: "User / installation"
|
|
381
|
-
}),
|
|
382
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableHead, {
|
|
383
|
-
className: "w-32",
|
|
384
|
-
children: "App"
|
|
385
|
-
}),
|
|
386
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableHead, {
|
|
387
|
-
className: "w-52",
|
|
388
|
-
children: "Bundle"
|
|
389
|
-
})
|
|
390
|
-
]
|
|
391
|
-
}) }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableBody, { children: history.data.map((event) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(TableRow, {
|
|
392
|
-
className: "[&>td]:px-4 [&>td]:py-4 [&>td]:align-top sm:[&>td]:px-6",
|
|
393
|
-
children: [
|
|
394
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableCell, {
|
|
395
|
-
className: "whitespace-normal text-xs tabular-nums",
|
|
396
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(EventTimestamp, {
|
|
397
|
-
value: event.receivedAtMs,
|
|
398
|
-
formatter: dateTimeFormat
|
|
399
|
-
})
|
|
400
|
-
}),
|
|
401
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableCell, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(EventTypeBadge, { type: event.type }) }),
|
|
402
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableCell, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(EventIdentity, {
|
|
403
|
-
event,
|
|
404
|
-
eventsLocation
|
|
405
|
-
}) }),
|
|
406
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableCell, {
|
|
407
|
-
className: "whitespace-normal text-xs",
|
|
408
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
409
|
-
className: "flex flex-col gap-2",
|
|
410
|
-
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { children: [
|
|
411
|
-
event.platform === "ios" ? "iOS" : "Android",
|
|
412
|
-
" ",
|
|
413
|
-
event.appVersion
|
|
414
|
-
] }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
415
|
-
className: "text-muted-foreground",
|
|
416
|
-
children: event.channel
|
|
417
|
-
})]
|
|
418
|
-
})
|
|
419
|
-
}),
|
|
420
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableCell, {
|
|
421
|
-
className: "whitespace-normal text-xs",
|
|
422
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(EventBundleTransition, { event })
|
|
423
|
-
})
|
|
424
|
-
]
|
|
425
|
-
}, event.id)) })]
|
|
426
|
-
})
|
|
427
|
-
})] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
428
|
-
className: "px-6 pb-6 text-sm text-muted-foreground",
|
|
429
|
-
children: hasPrevious || history.nextCursor ? "No events on this page" : title === "All events" ? "No events recorded yet" : "No matching reports in this period"
|
|
430
|
-
}), history.data.length > 0 || hasPrevious || history.nextCursor ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(InsightsPagination, {
|
|
431
|
-
hasPrevious,
|
|
432
|
-
label: title,
|
|
433
|
-
nextCursor: history.nextCursor,
|
|
434
|
-
onNext,
|
|
435
|
-
onPrevious,
|
|
436
|
-
pageLength: history.data.length,
|
|
437
|
-
pageNumber
|
|
438
|
-
}) : null] }) : null
|
|
439
|
-
})]
|
|
440
|
-
});
|
|
441
|
-
}
|
|
442
|
-
function InsightsPageHeader({ view }) {
|
|
443
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("header", {
|
|
444
|
-
className: "sticky top-0 z-10 flex shrink-0 flex-wrap items-center gap-3 border-b bg-background px-3 py-3 sm:bg-card/70 sm:px-4 sm:backdrop-blur-sm",
|
|
445
|
-
children: [
|
|
446
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(SidebarTrigger, { className: "-ml-1 size-11 lg:size-7" }),
|
|
447
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
448
|
-
className: "flex items-center gap-1.5",
|
|
449
|
-
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(ChartNoAxesCombined, {
|
|
450
|
-
"aria-hidden": "true",
|
|
451
|
-
className: "size-3.5 text-muted-foreground"
|
|
452
|
-
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h1", {
|
|
453
|
-
className: "text-sm font-medium",
|
|
454
|
-
children: "Insights"
|
|
455
|
-
})]
|
|
456
|
-
}),
|
|
457
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("nav", {
|
|
458
|
-
"aria-label": "Insights views",
|
|
459
|
-
className: "ml-auto flex gap-1",
|
|
460
|
-
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Link, {
|
|
461
|
-
"aria-current": view === "overview" ? "page" : void 0,
|
|
462
|
-
className: buttonVariants({
|
|
463
|
-
className: "h-11 px-3 lg:h-8 lg:px-2.5",
|
|
464
|
-
size: "lg",
|
|
465
|
-
variant: view === "overview" ? "secondary" : "ghost"
|
|
466
|
-
}),
|
|
467
|
-
to: "/insights",
|
|
468
|
-
children: "Overview"
|
|
469
|
-
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Link, {
|
|
470
|
-
"aria-current": view === "events" ? "page" : void 0,
|
|
471
|
-
className: buttonVariants({
|
|
472
|
-
className: "h-11 px-3 lg:h-8 lg:px-2.5",
|
|
473
|
-
size: "lg",
|
|
474
|
-
variant: view === "events" ? "secondary" : "ghost"
|
|
475
|
-
}),
|
|
476
|
-
to: "/installations",
|
|
477
|
-
children: "Events"
|
|
478
|
-
})]
|
|
479
|
-
})
|
|
480
|
-
]
|
|
481
|
-
});
|
|
482
|
-
}
|
|
483
|
-
//#endregion
|
|
484
|
-
export { EventTypeBadge as a, InsightsPagination as c, useInsightsInstallationQuery as d, useInsightsInstallationsQuery as f, EventTimestamp as i, useInsightsEventsQuery as l, useReportingInstallationsQuery as m, EventHistoryCard as n, InsightsErrorAlert as o, useInsightsTimeFormat as p, EventHistoryList as r, InsightsPageHeader as s, EventBundleTransition as t, useInsightsInstallationEventsQuery as u };
|