@hot-updater/console 0.36.7 → 1.0.0-rc.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/.output/nitro.json +1 -1
- package/.output/public/assets/BundleIdDisplay-D4ErdU5_.js +1 -0
- package/.output/public/assets/InsightsCapabilityContext-B42VqvP6.js +1 -0
- package/.output/public/assets/api-keys-api-DGVTTvTJ.js +1 -0
- package/.output/public/assets/api-keys-z16OZIP4.js +1 -0
- package/.output/public/assets/badge-Br_KDO0J.js +1 -0
- package/.output/public/assets/card-DzuEXvyJ.js +1 -0
- package/.output/public/assets/chart-no-axes-combined-FaYMGmQS.js +1 -0
- package/.output/public/assets/createServerFn-gM2-LFBy.js +3 -0
- package/.output/public/assets/dialog-BeAENgez.js +1 -0
- package/.output/public/assets/dist-Bssh_cv0.js +1 -0
- package/.output/public/assets/field-Buq148-A.js +1 -0
- package/.output/public/assets/index-uOpQAIC4.js +10 -0
- package/.output/public/assets/input-group-B3p5UpyW.js +1 -0
- package/.output/public/assets/insights-DJTr7Ozn.js +1 -0
- package/.output/public/assets/insights-api-DVMOoRMS.js +1 -0
- package/.output/public/assets/installations-BY64iIAK.js +2 -0
- package/.output/public/assets/installations-D5v9i3AL.js +1 -0
- package/.output/public/assets/lazyRouteComponent-DKYu5cZJ.js +1 -0
- package/.output/public/assets/preload-helper-CQ36nxok.js +1 -0
- package/.output/public/assets/refresh-cw-BkbfZ62O.js +1 -0
- package/.output/public/assets/routes-BuoI5-Cr.js +2 -0
- package/.output/public/assets/routes-C8fvgETO.js +1 -0
- package/.output/public/assets/search-qsIDvS2I.js +1 -0
- package/.output/public/assets/shield-check-DE_hVuHu.js +1 -0
- package/.output/public/assets/signing-mJD88Y4C.js +1 -0
- package/.output/public/assets/styles-BZIG7t42.css +2 -0
- package/.output/public/assets/table-RamFEclP.js +1 -0
- package/.output/public/assets/useCompositeListItem-ChzDqdpc.js +42 -0
- package/.output/public/assets/useMutation-JsGVjQMY.js +1 -0
- package/.output/public/assets/useOpenInteractionType-Dwfy-SpA.js +1 -0
- package/.output/server/__23tanstack-start-server-fn-resolver-Dftxlm2E.mjs +146 -0
- package/.output/server/_libs/@base-ui/react+[...].mjs +16124 -0
- package/.output/server/_libs/@reduxjs/toolkit+[...].mjs +1554 -0
- package/.output/server/_libs/@tanstack/react-router+[...].mjs +41 -10
- package/.output/server/_libs/@tanstack/react-router-ssr-query+[...].mjs +132 -0
- 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 +1134 -0
- package/.output/server/_libs/eventemitter3.mjs +236 -0
- package/.output/server/_libs/immer.mjs +532 -0
- package/.output/server/_libs/lucide-react.mjs +141 -13
- package/.output/server/_libs/next-themes.mjs +2 -2
- package/.output/server/_libs/react-redux+[...].mjs +205 -0
- package/.output/server/_libs/recharts+[...].mjs +14117 -0
- package/.output/server/_libs/sonner.mjs +2 -2
- package/.output/server/_libs/tanstack__query-core.mjs +114 -1
- package/.output/server/_libs/tanstack__react-query.mjs +3 -4
- package/.output/server/_runtime.mjs +10 -1
- package/.output/server/_ssr/BundleActivityChart-CWcdPuUn.mjs +288 -0
- package/.output/server/_ssr/BundleIdDisplay-BEvB3MvA.mjs +13 -0
- package/.output/server/_ssr/InsightsCapabilityContext-Cx8fjm2s.mjs +15 -0
- package/.output/server/_ssr/api-keys-CpBqHpuC.mjs +300 -0
- package/.output/server/_ssr/api-keys-api-Czkp57UV.mjs +60 -0
- package/.output/server/_ssr/api-keys-rpc-BTtMDSoR.mjs +136 -0
- package/.output/server/_ssr/api-rpc-BEX8ISai.mjs +1468 -0
- package/.output/server/_ssr/auth-BF8mbAgF.mjs +21 -0
- package/.output/server/_ssr/auth-rpc-BFMEC-TT.mjs +24 -0
- package/.output/server/_ssr/auth.server-DW71WzsD.mjs +47 -0
- package/.output/server/_ssr/badge-CpWXQwyF.mjs +26 -0
- package/.output/server/_ssr/bundle-signing-rpc-BbCFUQSu.mjs +16 -0
- package/.output/server/_ssr/bundle-signing.server-C4NW5mWx.mjs +12 -0
- package/.output/server/_ssr/card-Bsc8mRis.mjs +86 -0
- package/.output/server/_ssr/config-Dv8qLDZ0.mjs +13 -0
- package/.output/server/_ssr/config.server-DQYEr_5X.mjs +361 -0
- package/.output/server/_ssr/{createServerFn-DzU0k62V.mjs → createServerFn-B2hcXoPM.mjs} +1 -1
- package/.output/server/_ssr/createServerRpc-DB29C_5p.mjs +12 -0
- package/.output/server/_ssr/{sidebar-Cv_H0_Jv.mjs → createSsrRpc-DhfrxEjg.mjs} +68 -50
- package/.output/server/_ssr/databaseRows-QlCYLi0H.mjs +166 -0
- package/.output/server/_ssr/deleteBundle-Cu_XOMt0.mjs +66 -0
- package/.output/server/_ssr/dialog-C0vKUp8R.mjs +170 -0
- package/.output/server/_ssr/dist-BVSLTpoP.mjs +250 -0
- package/.output/server/_ssr/downloadBundle-CNnYxYO2.mjs +24 -0
- package/.output/server/_ssr/{empty-plugin-adapters-B4HCzgmM.mjs → empty-plugin-adapters-B5QvGpEl.mjs} +1 -1
- package/.output/server/_ssr/field-DASCh-5d.mjs +74 -0
- package/.output/server/_ssr/{getBundleChildren-CVtSiH5t.mjs → getBundleChildren-BcRMFoDF.mjs} +10 -18
- package/.output/server/_ssr/input-group-etIsBUqv.mjs +288 -0
- package/.output/server/_ssr/insights-api-C1F7UreR.mjs +71 -0
- package/.output/server/_ssr/insights-input-9fEJF-ZG.mjs +96 -0
- package/.output/server/_ssr/insights-rpc-C-8R6kED.mjs +155 -0
- package/.output/server/_ssr/insights-ygT_aIfo.mjs +858 -0
- package/.output/server/_ssr/installations-DqRT1QTd.mjs +535 -0
- package/.output/server/_ssr/installations-K8TCYTYh.mjs +19 -0
- package/.output/server/_ssr/router-BxBEvtF1.mjs +513 -0
- package/.output/server/_ssr/routes-BC7rn-tf.mjs +37 -0
- package/.output/server/_ssr/routes-CM5KAwpB.mjs +2285 -0
- package/.output/server/_ssr/runtime.server-la7TRAH_.mjs +527 -0
- package/.output/server/_ssr/server-CpzW--lT.mjs +7468 -0
- package/.output/server/_ssr/signing-jk4HANnl.mjs +134 -0
- package/.output/server/_ssr/ssr.mjs +4 -5740
- package/.output/server/_ssr/start-DpViQGnt.mjs +4 -0
- package/.output/server/_ssr/table-CU58HeI7.mjs +53 -0
- package/.output/server/_ssr/uuidv7-CaKuKXrV.mjs +31 -0
- package/.output/server/_tanstack-start-manifest_v-Mz9MmSlD.mjs +103 -0
- package/.output/server/index.mjs +229 -47
- package/README.md +29 -8
- package/lib/index.d.mts +35 -0
- package/lib/index.mjs +4 -0
- package/lib/vite-internal.mjs +127 -0
- package/lib/vite.d.mts +10 -0
- package/lib/vite.mjs +5 -0
- package/package.json +51 -29
- package/public/apple-touch-icon.png +0 -0
- package/public/favicon-16x16.png +0 -0
- package/public/favicon-32x32.png +0 -0
- package/public/favicon.ico +0 -0
- package/public/logo.svg +1 -0
- package/public/manifest.json +30 -0
- package/public/robots.txt +3 -0
- package/src/components/AppSidebar.tsx +159 -0
- package/src/components/BundleIdDisplay.tsx +18 -0
- package/src/components/ChannelBadge.tsx +31 -0
- package/src/components/ConsoleAccessPage.tsx +122 -0
- package/src/components/EnabledStatusIcon.tsx +54 -0
- package/src/components/HashValueDisplay.tsx +85 -0
- package/src/components/HotUpdaterLogo.tsx +30 -0
- package/src/components/NotFoundPage.tsx +33 -0
- package/src/components/PlatformIcon.tsx +39 -0
- package/src/components/RolloutPercentageBadge.tsx +28 -0
- package/src/components/ThemeProvider.tsx +116 -0
- package/src/components/TimestampDisplay.tsx +41 -0
- package/src/components/features/api-keys/ApiKeysPage.tsx +377 -0
- package/src/components/features/bundles/BundleActivityChart.tsx +193 -0
- package/src/components/features/bundles/BundleChildrenPanel.tsx +201 -0
- package/src/components/features/bundles/BundleInsightsSummary.tsx +123 -0
- package/src/components/features/bundles/BundleMetadata.tsx +136 -0
- package/src/components/features/bundles/RolloutCohortsDialog.tsx +201 -0
- package/src/components/features/channels/ChannelManagementDialog.tsx +228 -0
- package/src/components/features/insights/ActivityChart.tsx +150 -0
- package/src/components/features/insights/BundleDistribution.tsx +133 -0
- package/src/components/features/insights/BundleSelector.tsx +114 -0
- package/src/components/features/insights/InsightsCapabilityContext.tsx +24 -0
- package/src/components/features/insights/InsightsControls.tsx +115 -0
- package/src/components/features/insights/InsightsErrorAlert.tsx +21 -0
- package/src/components/features/insights/InsightsOverview.tsx +208 -0
- package/src/components/features/insights/InstallationHistoryCard.tsx +248 -0
- package/src/components/features/insights/InstallationMatchesCard.tsx +132 -0
- package/src/components/features/insights/InstallationPageHeader.tsx +138 -0
- package/src/components/features/insights/InstallationPagination.tsx +48 -0
- package/src/components/features/insights/InstallationSearch.tsx +230 -0
- package/src/components/features/insights/UpdateOutcomes.tsx +147 -0
- package/src/components/features/releases/ReleaseEditorSheet.tsx +879 -0
- package/src/components/features/releases/ReleaseStateBadge.tsx +20 -0
- package/src/components/features/signing/BundleSigningPage.tsx +139 -0
- package/src/components/ui/alert-dialog.tsx +185 -0
- package/src/components/ui/alert.tsx +76 -0
- package/src/components/ui/badge.tsx +49 -0
- package/src/components/ui/button.tsx +58 -0
- package/src/components/ui/card.tsx +89 -0
- package/src/components/ui/chart.tsx +371 -0
- package/src/components/ui/combobox.tsx +303 -0
- package/src/components/ui/dialog.tsx +156 -0
- package/src/components/ui/dropdown-menu.tsx +270 -0
- package/src/components/ui/field.tsx +235 -0
- package/src/components/ui/input-group.tsx +147 -0
- package/src/components/ui/input.tsx +19 -0
- package/src/components/ui/label.tsx +25 -0
- package/src/components/ui/progress.tsx +84 -0
- package/src/components/ui/select.tsx +205 -0
- package/src/components/ui/separator.tsx +23 -0
- package/src/components/ui/sheet.tsx +132 -0
- package/src/components/ui/sidebar.tsx +779 -0
- package/src/components/ui/skeleton.tsx +13 -0
- package/src/components/ui/slider.tsx +56 -0
- package/src/components/ui/sonner.tsx +45 -0
- package/src/components/ui/switch.tsx +25 -0
- package/src/components/ui/table.tsx +114 -0
- package/src/components/ui/textarea.tsx +18 -0
- package/src/components/ui/toggle-group.tsx +89 -0
- package/src/components/ui/toggle.tsx +43 -0
- package/src/components/ui/tooltip.tsx +66 -0
- package/src/hooks/use-mobile.ts +30 -0
- package/src/index.ts +47 -0
- package/src/lib/api-keys-api.ts +69 -0
- package/src/lib/api-keys-rpc.ts +87 -0
- package/src/lib/api-rpc.ts +478 -0
- package/src/lib/api.ts +444 -0
- package/src/lib/auth-rpc.ts +16 -0
- package/src/lib/bundle-signing-api.ts +14 -0
- package/src/lib/bundle-signing-rpc.ts +16 -0
- package/src/lib/constants.ts +1 -0
- package/src/lib/git.ts +51 -0
- package/src/lib/insights-api.ts +144 -0
- package/src/lib/insights-error.ts +19 -0
- package/src/lib/insights-input.ts +187 -0
- package/src/lib/insights-overview.ts +170 -0
- package/src/lib/insights-rpc.ts +218 -0
- package/src/lib/server/auth.server.ts +43 -0
- package/src/lib/server/bundle-signing.server.ts +23 -0
- package/src/lib/server/config.server.ts +109 -0
- package/src/lib/server/console-runtime.server.ts +61 -0
- package/src/lib/server/deleteBundle.ts +145 -0
- package/src/lib/server/downloadBundle.ts +46 -0
- package/src/lib/server/getBundleChildren.ts +130 -0
- package/src/lib/server/listReleases.ts +61 -0
- package/src/lib/server/releaseActivity.ts +27 -0
- package/src/lib/server/releaseReachability.ts +95 -0
- package/src/lib/server/runtime.server.ts +172 -0
- package/src/lib/utils.ts +9 -0
- package/src/logo.svg +1 -0
- package/src/routeTree.gen.ts +199 -0
- package/src/router.tsx +21 -0
- package/src/routes/-installations-search.ts +19 -0
- package/src/routes/-releases-search.ts +74 -0
- package/src/routes/__root.tsx +174 -0
- package/src/routes/api/auth/$.ts +19 -0
- package/src/routes/api/bundles/$bundleId/download.ts +17 -0
- package/src/routes/api-keys.tsx +37 -0
- package/src/routes/index.tsx +982 -0
- package/src/routes/insights.tsx +139 -0
- package/src/routes/installations.tsx +194 -0
- package/src/routes/signing.tsx +37 -0
- package/src/styles.css +152 -0
- package/src/virtual-modules.d.ts +21 -0
- package/src/vite-env.d.ts +1 -0
- package/src/vite-internal.ts +195 -0
- package/src/vite.ts +12 -0
- package/.output/public/assets/dist-DJX53faP.js +0 -3
- package/.output/public/assets/index-Iylis5kY.js +0 -10
- package/.output/public/assets/routes-HT21hs0C.js +0 -54
- package/.output/public/assets/styles-C0Re4quB.css +0 -2
- package/.output/server/__23tanstack-start-server-fn-resolver-CgwgZ0-i.mjs +0 -66
- package/.output/server/_libs/@floating-ui/core+[...].mjs +0 -698
- package/.output/server/_libs/@floating-ui/dom+[...].mjs +0 -644
- package/.output/server/_libs/@floating-ui/react-dom+[...].mjs +0 -839
- package/.output/server/_libs/@radix-ui/react-alert-dialog+[...].mjs +0 -2138
- package/.output/server/_libs/@radix-ui/react-popper+[...].mjs +0 -308
- package/.output/server/_libs/@radix-ui/react-select+[...].mjs +0 -1038
- package/.output/server/_libs/@tanstack/devtools-event-client+[...].mjs +0 -196
- package/.output/server/_libs/@tanstack/form-core+[...].mjs +0 -3228
- package/.output/server/_libs/@tanstack/react-form+[...].mjs +0 -430
- package/.output/server/_libs/@tanstack/react-table+[...].mjs +0 -2382
- package/.output/server/_libs/radix-ui__number.mjs +0 -6
- package/.output/server/_libs/radix-ui__primitive.mjs +0 -9
- package/.output/server/_libs/radix-ui__react-arrow.mjs +0 -23
- package/.output/server/_libs/radix-ui__react-collection.mjs +0 -78
- package/.output/server/_libs/radix-ui__react-direction.mjs +0 -13
- package/.output/server/_libs/radix-ui__react-label.mjs +0 -22
- package/.output/server/_libs/radix-ui__react-separator.mjs +0 -30
- package/.output/server/_libs/radix-ui__react-slider.mjs +0 -510
- package/.output/server/_libs/radix-ui__react-switch.mjs +0 -157
- package/.output/server/_libs/radix-ui__react-tooltip.mjs +0 -493
- package/.output/server/_ssr/api-rpc-BIbDUKSz.mjs +0 -292
- package/.output/server/_ssr/config.server-BSS366KT.mjs +0 -41
- package/.output/server/_ssr/deleteBundle-BgbZTtpW.mjs +0 -141
- package/.output/server/_ssr/dist-KboydRVk.mjs +0 -120
- package/.output/server/_ssr/router-C3hqEy3k.mjs +0 -307
- package/.output/server/_ssr/routes-B0lQvvlC.mjs +0 -3048
- package/.output/server/_ssr/start-02sLteYG.mjs +0 -4
- package/.output/server/_ssr/storageProfile-FVkjPoGb.mjs +0 -9
- package/.output/server/_tanstack-start-manifest_v-Bpx52WOU.mjs +0 -20
- package/.output/server/node_modules/tslib/modules/index.js +0 -70
- package/.output/server/node_modules/tslib/modules/package.json +0 -3
- package/.output/server/node_modules/tslib/package.json +0 -47
- package/.output/server/node_modules/tslib/tslib.js +0 -484
- package/.output/server/package.json +0 -9
|
@@ -0,0 +1,535 @@
|
|
|
1
|
+
import { i as __toESM } from "../_runtime.mjs";
|
|
2
|
+
import { at as require_react, it as require_jsx_runtime } from "../_libs/@base-ui/react+[...].mjs";
|
|
3
|
+
import { I as ArrowLeft, N as Check, l as Search, n as TriangleAlert, t as X } from "../_libs/lucide-react.mjs";
|
|
4
|
+
import { S as buttonVariants, _ as Skeleton, g as SidebarTrigger, r as Separator$1, t as Button$1 } from "./createSsrRpc-DhfrxEjg.mjs";
|
|
5
|
+
import { p as Link } from "../_libs/@tanstack/react-router+[...].mjs";
|
|
6
|
+
import { a as Card, i as AlertTitle, l as CardHeader, o as CardContent, r as AlertDescription, s as CardDescription, t as Alert, u as CardTitle } from "./card-Bsc8mRis.mjs";
|
|
7
|
+
import { t as Badge } from "./badge-CpWXQwyF.mjs";
|
|
8
|
+
import { a as FieldLabel, i as FieldGroup, n as FieldDescription, t as Field } from "./field-DASCh-5d.mjs";
|
|
9
|
+
import { a as TableHeader, i as TableHead, n as TableBody, o as TableRow, r as TableCell, t as Table } from "./table-CU58HeI7.mjs";
|
|
10
|
+
import { n as useInsightsCapability } from "./InsightsCapabilityContext-Cx8fjm2s.mjs";
|
|
11
|
+
import { r as isInsightsQueryEnabled } from "./insights-api-C1F7UreR.mjs";
|
|
12
|
+
import { _ as useInstallationSearchQuery, g as useInstallationHistoryQuery, i as InputGroupInput, n as InputGroupAddon, r as InputGroupButton, t as InputGroup } from "./input-group-etIsBUqv.mjs";
|
|
13
|
+
import { t as Route } from "./installations-K8TCYTYh.mjs";
|
|
14
|
+
import { t as BundleIdDisplay } from "./BundleIdDisplay-BEvB3MvA.mjs";
|
|
15
|
+
//#region node_modules/.nitro/vite/services/ssr/assets/installations-DqRT1QTd.js
|
|
16
|
+
var import_react = /* @__PURE__ */ __toESM(require_react());
|
|
17
|
+
var import_jsx_runtime = require_jsx_runtime();
|
|
18
|
+
function InstallationPagination({ label, limit, offset, pageLength, total, onOffsetChange }) {
|
|
19
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("nav", {
|
|
20
|
+
"aria-label": `${label} pagination`,
|
|
21
|
+
className: "flex items-center justify-between gap-4 border-t px-5 py-5",
|
|
22
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
|
|
23
|
+
className: "text-xs text-muted-foreground",
|
|
24
|
+
children: [
|
|
25
|
+
offset + 1,
|
|
26
|
+
"–",
|
|
27
|
+
Math.min(offset + pageLength, total),
|
|
28
|
+
" of ",
|
|
29
|
+
total
|
|
30
|
+
]
|
|
31
|
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
32
|
+
className: "flex gap-2",
|
|
33
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Button$1, {
|
|
34
|
+
disabled: offset === 0,
|
|
35
|
+
onClick: () => onOffsetChange(Math.max(0, offset - limit)),
|
|
36
|
+
size: "sm",
|
|
37
|
+
type: "button",
|
|
38
|
+
variant: "outline",
|
|
39
|
+
children: "Previous"
|
|
40
|
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Button$1, {
|
|
41
|
+
disabled: offset + pageLength >= total,
|
|
42
|
+
onClick: () => onOffsetChange(offset + limit),
|
|
43
|
+
size: "sm",
|
|
44
|
+
type: "button",
|
|
45
|
+
variant: "outline",
|
|
46
|
+
children: "Next"
|
|
47
|
+
})]
|
|
48
|
+
})]
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
var formatDateTime = (value) => {
|
|
52
|
+
if (!value) return "—";
|
|
53
|
+
const date = value instanceof Date ? value : new Date(value);
|
|
54
|
+
if (Number.isNaN(date.getTime())) return "—";
|
|
55
|
+
return new Intl.DateTimeFormat(void 0, {
|
|
56
|
+
year: "numeric",
|
|
57
|
+
month: "2-digit",
|
|
58
|
+
day: "2-digit",
|
|
59
|
+
hour: "2-digit",
|
|
60
|
+
minute: "2-digit",
|
|
61
|
+
second: "2-digit",
|
|
62
|
+
hour12: false,
|
|
63
|
+
timeZone: "UTC"
|
|
64
|
+
}).format(date);
|
|
65
|
+
};
|
|
66
|
+
var getUserLabel$1 = (event) => event.userId ?? event.username ?? "—";
|
|
67
|
+
var getLastKnownBundleId$1 = (event) => "lastKnownBundleId" in event ? event.lastKnownBundleId : event.toBundleId ?? event.fromBundleId;
|
|
68
|
+
function InstallationHistoryCard({ error, history, isLoading, limit, offset, onOffsetChange, selectedEvent, selectedInstallId }) {
|
|
69
|
+
const lastKnownBundleId = selectedEvent ? getLastKnownBundleId$1(selectedEvent) : void 0;
|
|
70
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Card, {
|
|
71
|
+
className: "min-h-0 min-w-0",
|
|
72
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(CardHeader, {
|
|
73
|
+
className: "p-6 pb-5",
|
|
74
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
75
|
+
className: "flex items-start justify-between gap-4",
|
|
76
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
77
|
+
className: "flex min-w-0 flex-col gap-1.5",
|
|
78
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(CardTitle, {
|
|
79
|
+
className: "text-sm font-medium",
|
|
80
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h2", { children: selectedInstallId ? "Installation history" : "Select an installation" })
|
|
81
|
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CardDescription, { children: selectedInstallId ? "Recorded bundle changes for this installation." : "Choose a match to view its recorded bundle changes." })]
|
|
82
|
+
}), history && history.pagination.total > 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Badge, {
|
|
83
|
+
variant: "outline",
|
|
84
|
+
children: [history.pagination.total, " events"]
|
|
85
|
+
}) : null]
|
|
86
|
+
})
|
|
87
|
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CardContent, {
|
|
88
|
+
className: "min-h-0 p-0",
|
|
89
|
+
children: selectedInstallId ? isLoading ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
90
|
+
className: "flex flex-col gap-3 p-5",
|
|
91
|
+
children: [
|
|
92
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Skeleton, { className: "h-10 w-full" }),
|
|
93
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Skeleton, { className: "h-10 w-full" }),
|
|
94
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Skeleton, { className: "h-10 w-full" })
|
|
95
|
+
]
|
|
96
|
+
}) : history && history.data.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
97
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", {
|
|
98
|
+
"aria-labelledby": "latest-installation-state",
|
|
99
|
+
className: "px-6 pb-6",
|
|
100
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h3", {
|
|
101
|
+
className: "text-xs font-medium",
|
|
102
|
+
id: "latest-installation-state",
|
|
103
|
+
children: "Latest reported state"
|
|
104
|
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("dl", {
|
|
105
|
+
className: "mt-4 grid gap-6 xl:grid-cols-3",
|
|
106
|
+
children: [
|
|
107
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
108
|
+
className: "min-w-0",
|
|
109
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("dt", {
|
|
110
|
+
className: "text-xs text-muted-foreground",
|
|
111
|
+
children: "Installation"
|
|
112
|
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("dd", {
|
|
113
|
+
className: "mt-1 font-mono text-xs",
|
|
114
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BundleIdDisplay, { bundleId: selectedInstallId })
|
|
115
|
+
})]
|
|
116
|
+
}),
|
|
117
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
118
|
+
className: "min-w-0",
|
|
119
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("dt", {
|
|
120
|
+
className: "text-xs text-muted-foreground",
|
|
121
|
+
children: "User ID"
|
|
122
|
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("dd", {
|
|
123
|
+
className: "mt-1 truncate text-xs font-medium",
|
|
124
|
+
children: selectedEvent ? getUserLabel$1(selectedEvent) : "—"
|
|
125
|
+
})]
|
|
126
|
+
}),
|
|
127
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
128
|
+
className: "min-w-0",
|
|
129
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("dt", {
|
|
130
|
+
className: "text-xs text-muted-foreground",
|
|
131
|
+
children: "Last known bundle"
|
|
132
|
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("dd", {
|
|
133
|
+
className: "mt-1 font-mono text-xs",
|
|
134
|
+
children: lastKnownBundleId ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BundleIdDisplay, { bundleId: lastKnownBundleId }) : "—"
|
|
135
|
+
})]
|
|
136
|
+
})
|
|
137
|
+
]
|
|
138
|
+
})]
|
|
139
|
+
}),
|
|
140
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Separator$1, {}),
|
|
141
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Table, {
|
|
142
|
+
className: "min-w-3xl table-fixed",
|
|
143
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(TableRow, {
|
|
144
|
+
className: "hover:bg-transparent [&>th]:h-12 [&>th]:px-5",
|
|
145
|
+
children: [
|
|
146
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableHead, {
|
|
147
|
+
className: "w-1/5 whitespace-normal",
|
|
148
|
+
children: "Reported (UTC)"
|
|
149
|
+
}),
|
|
150
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableHead, {
|
|
151
|
+
className: "w-1/6 whitespace-normal",
|
|
152
|
+
children: "App version"
|
|
153
|
+
}),
|
|
154
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableHead, {
|
|
155
|
+
className: "w-1/5 whitespace-normal",
|
|
156
|
+
children: "Change"
|
|
157
|
+
}),
|
|
158
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableHead, {
|
|
159
|
+
className: "whitespace-normal",
|
|
160
|
+
children: "Bundle transition"
|
|
161
|
+
})
|
|
162
|
+
]
|
|
163
|
+
}) }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableBody, { children: history.data.map((event) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(TableRow, {
|
|
164
|
+
className: "[&>td]:px-5 [&>td]:py-4",
|
|
165
|
+
children: [
|
|
166
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableCell, {
|
|
167
|
+
className: "whitespace-normal align-top text-sm text-muted-foreground",
|
|
168
|
+
children: formatDateTime(event.receivedAtMs)
|
|
169
|
+
}),
|
|
170
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableCell, {
|
|
171
|
+
className: "whitespace-normal align-top font-mono text-xs",
|
|
172
|
+
children: event.appVersion
|
|
173
|
+
}),
|
|
174
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableCell, {
|
|
175
|
+
className: "whitespace-normal align-top",
|
|
176
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Badge, {
|
|
177
|
+
variant: "secondary",
|
|
178
|
+
children: event.type === "UPDATE_APPLIED" ? "Bundle applied" : "Recovered"
|
|
179
|
+
})
|
|
180
|
+
}),
|
|
181
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableCell, {
|
|
182
|
+
className: "whitespace-normal align-top",
|
|
183
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
184
|
+
className: "grid grid-cols-[2rem_minmax(0,1fr)] gap-x-3 gap-y-3",
|
|
185
|
+
children: [
|
|
186
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
187
|
+
className: "text-muted-foreground",
|
|
188
|
+
children: "From"
|
|
189
|
+
}),
|
|
190
|
+
event.fromBundleId ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BundleIdDisplay, { bundleId: event.fromBundleId }) : "—",
|
|
191
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
192
|
+
className: "text-muted-foreground",
|
|
193
|
+
children: "To"
|
|
194
|
+
}),
|
|
195
|
+
event.toBundleId ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BundleIdDisplay, { bundleId: event.toBundleId }) : "—"
|
|
196
|
+
]
|
|
197
|
+
})
|
|
198
|
+
})
|
|
199
|
+
]
|
|
200
|
+
}, event.id)) })]
|
|
201
|
+
}),
|
|
202
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(InstallationPagination, {
|
|
203
|
+
label: "Installation history",
|
|
204
|
+
limit,
|
|
205
|
+
offset,
|
|
206
|
+
pageLength: history.data.length,
|
|
207
|
+
total: history.pagination.total,
|
|
208
|
+
onOffsetChange
|
|
209
|
+
})
|
|
210
|
+
] }) : error ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
211
|
+
className: "p-5 pt-0",
|
|
212
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Alert, {
|
|
213
|
+
variant: "destructive",
|
|
214
|
+
children: [
|
|
215
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TriangleAlert, { "aria-hidden": "true" }),
|
|
216
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertTitle, { children: "Installation history unavailable" }),
|
|
217
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertDescription, { children: error instanceof Error ? error.message : "Failed to load installation history." })
|
|
218
|
+
]
|
|
219
|
+
})
|
|
220
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
221
|
+
className: "p-5 pt-0 text-sm text-muted-foreground",
|
|
222
|
+
children: "No history is available for this installation."
|
|
223
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
224
|
+
className: "p-5 pt-0 text-sm text-muted-foreground",
|
|
225
|
+
children: "Choose an installation to inspect its update history."
|
|
226
|
+
})
|
|
227
|
+
})]
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
var getLastKnownBundleId = (event) => event.lastKnownBundleId;
|
|
231
|
+
var getUserLabel = (event) => event.userId ?? event.username ?? "—";
|
|
232
|
+
function InstallationMatchesCard({ error, limit, offset, onOffsetChange, onSelect, results, selectedInstallId }) {
|
|
233
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Card, {
|
|
234
|
+
className: "min-h-0 min-w-0",
|
|
235
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(CardHeader, {
|
|
236
|
+
className: "p-6 pb-5",
|
|
237
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
238
|
+
className: "flex items-start justify-between gap-4",
|
|
239
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
240
|
+
className: "flex min-w-0 flex-col gap-1.5",
|
|
241
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(CardTitle, {
|
|
242
|
+
className: "text-sm font-medium",
|
|
243
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h2", { children: "Matching installations" })
|
|
244
|
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CardDescription, { children: "Select a row to review its bundle history." })]
|
|
245
|
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Badge, {
|
|
246
|
+
variant: "outline",
|
|
247
|
+
children: results?.pagination.total ?? 0
|
|
248
|
+
})]
|
|
249
|
+
})
|
|
250
|
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(CardContent, {
|
|
251
|
+
className: "min-h-0 p-0",
|
|
252
|
+
children: [results && results.data.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("ul", {
|
|
253
|
+
"aria-label": "Matching installations",
|
|
254
|
+
className: "divide-y",
|
|
255
|
+
children: results.data.map((event) => {
|
|
256
|
+
const currentBundleId = getLastKnownBundleId(event);
|
|
257
|
+
const isSelected = event.installId === selectedInstallId;
|
|
258
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("button", {
|
|
259
|
+
"aria-pressed": isSelected,
|
|
260
|
+
className: "group flex w-full min-w-0 flex-col gap-4 border-l-2 border-transparent px-6 py-5 text-left outline-none transition-colors hover:bg-muted/40 focus-visible:border-ring focus-visible:bg-muted/40 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring/30 aria-pressed:border-primary aria-pressed:bg-muted/60",
|
|
261
|
+
onClick: () => onSelect(event.installId),
|
|
262
|
+
type: "button",
|
|
263
|
+
children: [
|
|
264
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
|
|
265
|
+
className: "flex w-full min-w-0 items-center justify-between gap-3",
|
|
266
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
267
|
+
className: "min-w-0 truncate text-sm font-medium",
|
|
268
|
+
children: getUserLabel(event)
|
|
269
|
+
}), isSelected ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
|
|
270
|
+
className: "flex shrink-0 items-center gap-1 text-xs font-medium text-primary",
|
|
271
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Check, {
|
|
272
|
+
"aria-hidden": "true",
|
|
273
|
+
className: "size-3.5"
|
|
274
|
+
}), "Selected"]
|
|
275
|
+
}) : null]
|
|
276
|
+
}),
|
|
277
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(BundleIdDisplay, {
|
|
278
|
+
bundleId: event.installId,
|
|
279
|
+
className: "block text-muted-foreground"
|
|
280
|
+
}),
|
|
281
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
|
|
282
|
+
className: "min-w-0",
|
|
283
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
284
|
+
className: "mb-1 block text-xs text-muted-foreground",
|
|
285
|
+
children: "Last known bundle"
|
|
286
|
+
}), currentBundleId ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BundleIdDisplay, { bundleId: currentBundleId }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
287
|
+
className: "text-sm text-muted-foreground",
|
|
288
|
+
children: "—"
|
|
289
|
+
})]
|
|
290
|
+
})
|
|
291
|
+
]
|
|
292
|
+
}) }, event.installId);
|
|
293
|
+
})
|
|
294
|
+
}) : error ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
295
|
+
className: "p-5",
|
|
296
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Alert, {
|
|
297
|
+
variant: "destructive",
|
|
298
|
+
children: [
|
|
299
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TriangleAlert, { "aria-hidden": "true" }),
|
|
300
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertTitle, { children: "Installation search unavailable" }),
|
|
301
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertDescription, { children: error instanceof Error ? error.message : "Failed to load installations." })
|
|
302
|
+
]
|
|
303
|
+
})
|
|
304
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
305
|
+
className: "p-5 text-sm text-muted-foreground",
|
|
306
|
+
children: "No installations matched that query."
|
|
307
|
+
}), results && results.pagination.total > 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(InstallationPagination, {
|
|
308
|
+
label: "Installation results",
|
|
309
|
+
limit,
|
|
310
|
+
offset,
|
|
311
|
+
pageLength: results.data.length,
|
|
312
|
+
total: results.pagination.total,
|
|
313
|
+
onOffsetChange
|
|
314
|
+
}) : null]
|
|
315
|
+
})]
|
|
316
|
+
});
|
|
317
|
+
}
|
|
318
|
+
function InstallationPageHeader() {
|
|
319
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("header", {
|
|
320
|
+
className: "sticky top-0 z-10 flex shrink-0 flex-wrap items-center gap-x-2 gap-y-1 border-b bg-background px-3 py-3 sm:min-h-12 sm:flex-nowrap sm:bg-card/70 sm:px-4 sm:backdrop-blur-sm",
|
|
321
|
+
children: [
|
|
322
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(SidebarTrigger, { className: "-ml-1" }),
|
|
323
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Link, {
|
|
324
|
+
className: buttonVariants({
|
|
325
|
+
size: "sm",
|
|
326
|
+
variant: "ghost"
|
|
327
|
+
}),
|
|
328
|
+
to: "/insights",
|
|
329
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(ArrowLeft, {
|
|
330
|
+
"aria-hidden": "true",
|
|
331
|
+
"data-icon": "inline-start"
|
|
332
|
+
}), "Back to Insights"]
|
|
333
|
+
}),
|
|
334
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Separator$1, {
|
|
335
|
+
className: "mx-1 hidden h-4 sm:block",
|
|
336
|
+
orientation: "vertical"
|
|
337
|
+
}),
|
|
338
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
339
|
+
className: "basis-full pl-9 sm:basis-auto sm:pl-0",
|
|
340
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h1", {
|
|
341
|
+
className: "text-sm font-medium",
|
|
342
|
+
children: "Installation history"
|
|
343
|
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
|
|
344
|
+
className: "text-xs text-muted-foreground",
|
|
345
|
+
children: "Review the last known bundle and recorded changes."
|
|
346
|
+
})]
|
|
347
|
+
})
|
|
348
|
+
]
|
|
349
|
+
});
|
|
350
|
+
}
|
|
351
|
+
function InstallationSearchPanel({ draftQuery, onDraftQueryChange, onSubmit, onClear, hasQuery }) {
|
|
352
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Card, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(CardContent, {
|
|
353
|
+
className: "grid gap-4 p-4 lg:grid-cols-[minmax(12rem,0.45fr)_minmax(0,1.55fr)] lg:items-start",
|
|
354
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
355
|
+
className: "flex min-w-0 flex-col gap-1.5",
|
|
356
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(CardTitle, {
|
|
357
|
+
className: "text-sm font-medium",
|
|
358
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h2", { children: "Find an installation" })
|
|
359
|
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CardDescription, { children: "Search by either identifier to inspect its bundle history." })]
|
|
360
|
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("form", {
|
|
361
|
+
onSubmit: (event) => {
|
|
362
|
+
event.preventDefault();
|
|
363
|
+
onSubmit();
|
|
364
|
+
},
|
|
365
|
+
role: "search",
|
|
366
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FieldGroup, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Field, { children: [
|
|
367
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(FieldLabel, {
|
|
368
|
+
htmlFor: "installation-history-search",
|
|
369
|
+
children: "User ID or install ID"
|
|
370
|
+
}),
|
|
371
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
372
|
+
className: "flex flex-col gap-2 sm:flex-row",
|
|
373
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(InputGroup, {
|
|
374
|
+
className: "h-8",
|
|
375
|
+
children: [
|
|
376
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(InputGroupAddon, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Search, { "aria-hidden": "true" }) }),
|
|
377
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(InputGroupInput, {
|
|
378
|
+
id: "installation-history-search",
|
|
379
|
+
onChange: (event) => onDraftQueryChange(event.target.value),
|
|
380
|
+
placeholder: "Enter a user ID or install ID",
|
|
381
|
+
type: "search",
|
|
382
|
+
value: draftQuery
|
|
383
|
+
}),
|
|
384
|
+
draftQuery.length > 0 || hasQuery ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(InputGroupAddon, {
|
|
385
|
+
align: "inline-end",
|
|
386
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(InputGroupButton, {
|
|
387
|
+
"aria-label": "Clear search",
|
|
388
|
+
onClick: onClear,
|
|
389
|
+
size: "icon-xs",
|
|
390
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(X, { "aria-hidden": "true" })
|
|
391
|
+
})
|
|
392
|
+
}) : null
|
|
393
|
+
]
|
|
394
|
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Button$1, {
|
|
395
|
+
className: "w-full sm:w-auto",
|
|
396
|
+
disabled: draftQuery.trim().length === 0,
|
|
397
|
+
size: "lg",
|
|
398
|
+
type: "submit",
|
|
399
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Search, {
|
|
400
|
+
"aria-hidden": "true",
|
|
401
|
+
"data-icon": "inline-start"
|
|
402
|
+
}), "Search history"]
|
|
403
|
+
})]
|
|
404
|
+
}),
|
|
405
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(FieldDescription, { children: "A user ID may return more than one installation. An install ID opens one installation directly." })
|
|
406
|
+
] }) })
|
|
407
|
+
})]
|
|
408
|
+
}) });
|
|
409
|
+
}
|
|
410
|
+
function InstallationResultsSkeleton() {
|
|
411
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
412
|
+
className: "grid items-stretch gap-6 lg:min-h-96 lg:grid-cols-[minmax(18rem,20rem)_minmax(0,1fr)]",
|
|
413
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Skeleton, { className: "h-64 w-full lg:h-full" }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Skeleton, { className: "h-64 w-full lg:h-full" })]
|
|
414
|
+
});
|
|
415
|
+
}
|
|
416
|
+
var SEARCH_LIMIT = 20;
|
|
417
|
+
var HISTORY_LIMIT = 50;
|
|
418
|
+
function InstallationsPage() {
|
|
419
|
+
const insightsQueriesEnabled = isInsightsQueryEnabled(useInsightsCapability());
|
|
420
|
+
const search = Route.useSearch();
|
|
421
|
+
const navigate = Route.useNavigate();
|
|
422
|
+
const [draftQuery, setDraftQuery] = (0, import_react.useState)(search.query ?? "");
|
|
423
|
+
(0, import_react.useEffect)(() => {
|
|
424
|
+
setDraftQuery(search.query ?? "");
|
|
425
|
+
}, [search.query]);
|
|
426
|
+
const query = search.query?.trim() ?? "";
|
|
427
|
+
const { data: results, error: searchError, isLoading: isSearchLoading } = useInstallationSearchQuery({
|
|
428
|
+
query,
|
|
429
|
+
limit: SEARCH_LIMIT,
|
|
430
|
+
offset: search.searchOffset
|
|
431
|
+
}, insightsQueriesEnabled);
|
|
432
|
+
const selectedInstallId = search.installId ?? "";
|
|
433
|
+
const firstMatchingInstallId = results?.data[0]?.installId;
|
|
434
|
+
(0, import_react.useEffect)(() => {
|
|
435
|
+
if (selectedInstallId || !firstMatchingInstallId) return;
|
|
436
|
+
navigate({
|
|
437
|
+
to: "/installations",
|
|
438
|
+
search: {
|
|
439
|
+
query: search.query,
|
|
440
|
+
installId: firstMatchingInstallId,
|
|
441
|
+
searchOffset: search.searchOffset,
|
|
442
|
+
historyOffset: 0
|
|
443
|
+
},
|
|
444
|
+
replace: true
|
|
445
|
+
});
|
|
446
|
+
}, [
|
|
447
|
+
firstMatchingInstallId,
|
|
448
|
+
navigate,
|
|
449
|
+
search.query,
|
|
450
|
+
search.searchOffset,
|
|
451
|
+
selectedInstallId
|
|
452
|
+
]);
|
|
453
|
+
const { data: history, error: historyError, isLoading: isHistoryLoading } = useInstallationHistoryQuery({
|
|
454
|
+
installId: selectedInstallId,
|
|
455
|
+
limit: HISTORY_LIMIT,
|
|
456
|
+
offset: search.historyOffset
|
|
457
|
+
}, insightsQueriesEnabled);
|
|
458
|
+
const selectedEvent = (0, import_react.useMemo)(() => results?.data.find((event) => event.installId === selectedInstallId) ?? null, [results?.data, selectedInstallId]) ?? history?.data[0];
|
|
459
|
+
const updateSearch = (nextSearch, replace = false) => {
|
|
460
|
+
navigate({
|
|
461
|
+
to: "/installations",
|
|
462
|
+
search: {
|
|
463
|
+
query: nextSearch.query,
|
|
464
|
+
installId: nextSearch.installId,
|
|
465
|
+
searchOffset: nextSearch.searchOffset ?? 0,
|
|
466
|
+
historyOffset: nextSearch.historyOffset ?? 0
|
|
467
|
+
},
|
|
468
|
+
replace
|
|
469
|
+
});
|
|
470
|
+
};
|
|
471
|
+
const hasQuery = query.length > 0 || selectedInstallId.length > 0;
|
|
472
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
473
|
+
className: "flex h-svh min-h-0 flex-col",
|
|
474
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(InstallationPageHeader, {}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
475
|
+
className: "min-h-0 min-w-0 flex-1 overflow-y-auto bg-muted/5 p-3 sm:p-6",
|
|
476
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
477
|
+
className: "mx-auto flex w-full max-w-7xl flex-col gap-6",
|
|
478
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(InstallationSearchPanel, {
|
|
479
|
+
draftQuery,
|
|
480
|
+
hasQuery,
|
|
481
|
+
onClear: () => {
|
|
482
|
+
setDraftQuery("");
|
|
483
|
+
updateSearch({
|
|
484
|
+
query: void 0,
|
|
485
|
+
installId: void 0
|
|
486
|
+
});
|
|
487
|
+
},
|
|
488
|
+
onDraftQueryChange: setDraftQuery,
|
|
489
|
+
onSubmit: () => {
|
|
490
|
+
updateSearch({
|
|
491
|
+
query: draftQuery.trim() || void 0,
|
|
492
|
+
installId: void 0
|
|
493
|
+
});
|
|
494
|
+
}
|
|
495
|
+
}), !hasQuery ? null : isSearchLoading ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(InstallationResultsSkeleton, {}) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
496
|
+
className: "grid min-h-0 min-w-0 items-stretch gap-6 lg:min-h-96 lg:grid-cols-[minmax(18rem,20rem)_minmax(0,1fr)]",
|
|
497
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(InstallationMatchesCard, {
|
|
498
|
+
error: searchError,
|
|
499
|
+
limit: SEARCH_LIMIT,
|
|
500
|
+
offset: search.searchOffset,
|
|
501
|
+
results,
|
|
502
|
+
selectedInstallId,
|
|
503
|
+
onOffsetChange: (searchOffset) => updateSearch({
|
|
504
|
+
query: search.query,
|
|
505
|
+
installId: void 0,
|
|
506
|
+
searchOffset,
|
|
507
|
+
historyOffset: 0
|
|
508
|
+
}),
|
|
509
|
+
onSelect: (installId) => updateSearch({
|
|
510
|
+
query: search.query,
|
|
511
|
+
installId,
|
|
512
|
+
searchOffset: search.searchOffset
|
|
513
|
+
})
|
|
514
|
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(InstallationHistoryCard, {
|
|
515
|
+
error: historyError,
|
|
516
|
+
history,
|
|
517
|
+
isLoading: isHistoryLoading,
|
|
518
|
+
limit: HISTORY_LIMIT,
|
|
519
|
+
offset: search.historyOffset,
|
|
520
|
+
selectedEvent,
|
|
521
|
+
selectedInstallId,
|
|
522
|
+
onOffsetChange: (historyOffset) => updateSearch({
|
|
523
|
+
query: search.query,
|
|
524
|
+
installId: selectedInstallId,
|
|
525
|
+
searchOffset: search.searchOffset,
|
|
526
|
+
historyOffset
|
|
527
|
+
})
|
|
528
|
+
})]
|
|
529
|
+
})]
|
|
530
|
+
})
|
|
531
|
+
})]
|
|
532
|
+
});
|
|
533
|
+
}
|
|
534
|
+
//#endregion
|
|
535
|
+
export { InstallationsPage as component };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { d as createFileRoute, u as lazyRouteComponent } from "../_libs/@tanstack/react-router+[...].mjs";
|
|
2
|
+
import { t as ensureInsightsRouteAccess } from "./insights-api-C1F7UreR.mjs";
|
|
3
|
+
//#region node_modules/.nitro/vite/services/ssr/assets/installations-K8TCYTYh.js
|
|
4
|
+
function validateInstallationsSearch(search) {
|
|
5
|
+
return {
|
|
6
|
+
query: typeof search.query === "string" ? search.query : void 0,
|
|
7
|
+
installId: typeof search.installId === "string" ? search.installId : void 0,
|
|
8
|
+
searchOffset: typeof search.searchOffset === "number" && Number.isSafeInteger(search.searchOffset) && search.searchOffset >= 0 ? search.searchOffset : 0,
|
|
9
|
+
historyOffset: typeof search.historyOffset === "number" && Number.isSafeInteger(search.historyOffset) && search.historyOffset >= 0 ? search.historyOffset : 0
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
var $$splitComponentImporter = () => import("./installations-DqRT1QTd.mjs");
|
|
13
|
+
var Route = createFileRoute("/installations")({
|
|
14
|
+
beforeLoad: ({ context }) => ensureInsightsRouteAccess(context.queryClient),
|
|
15
|
+
component: lazyRouteComponent($$splitComponentImporter, "component"),
|
|
16
|
+
validateSearch: validateInstallationsSearch
|
|
17
|
+
});
|
|
18
|
+
//#endregion
|
|
19
|
+
export { Route as t };
|