@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,132 @@
|
|
|
1
|
+
import { Check, TriangleAlert } from "lucide-react";
|
|
2
|
+
|
|
3
|
+
import { BundleIdDisplay } from "@/components/BundleIdDisplay";
|
|
4
|
+
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";
|
|
5
|
+
import { Badge } from "@/components/ui/badge";
|
|
6
|
+
import {
|
|
7
|
+
Card,
|
|
8
|
+
CardContent,
|
|
9
|
+
CardDescription,
|
|
10
|
+
CardHeader,
|
|
11
|
+
CardTitle,
|
|
12
|
+
} from "@/components/ui/card";
|
|
13
|
+
import type {
|
|
14
|
+
InstallationSearchResult,
|
|
15
|
+
InstallationSearchRow,
|
|
16
|
+
} from "@/lib/api";
|
|
17
|
+
|
|
18
|
+
import { InstallationPagination } from "./InstallationPagination";
|
|
19
|
+
|
|
20
|
+
const getLastKnownBundleId = (event: InstallationSearchRow) =>
|
|
21
|
+
event.lastKnownBundleId;
|
|
22
|
+
|
|
23
|
+
const getUserLabel = (event: InstallationSearchRow) =>
|
|
24
|
+
event.userId ?? event.username ?? "—";
|
|
25
|
+
|
|
26
|
+
export function InstallationMatchesCard({
|
|
27
|
+
error,
|
|
28
|
+
limit,
|
|
29
|
+
offset,
|
|
30
|
+
onOffsetChange,
|
|
31
|
+
onSelect,
|
|
32
|
+
results,
|
|
33
|
+
selectedInstallId,
|
|
34
|
+
}: {
|
|
35
|
+
readonly error: unknown;
|
|
36
|
+
readonly limit: number;
|
|
37
|
+
readonly offset: number;
|
|
38
|
+
readonly onOffsetChange: (offset: number) => void;
|
|
39
|
+
readonly onSelect: (installId: string) => void;
|
|
40
|
+
readonly results: InstallationSearchResult | undefined;
|
|
41
|
+
readonly selectedInstallId: string;
|
|
42
|
+
}) {
|
|
43
|
+
return (
|
|
44
|
+
<Card className="min-h-0 min-w-0">
|
|
45
|
+
<CardHeader className="p-6 pb-5">
|
|
46
|
+
<div className="flex items-start justify-between gap-4">
|
|
47
|
+
<div className="flex min-w-0 flex-col gap-1.5">
|
|
48
|
+
<CardTitle className="text-sm font-medium">
|
|
49
|
+
<h2>Matching installations</h2>
|
|
50
|
+
</CardTitle>
|
|
51
|
+
<CardDescription>
|
|
52
|
+
Select a row to review its bundle history.
|
|
53
|
+
</CardDescription>
|
|
54
|
+
</div>
|
|
55
|
+
<Badge variant="outline">{results?.pagination.total ?? 0}</Badge>
|
|
56
|
+
</div>
|
|
57
|
+
</CardHeader>
|
|
58
|
+
<CardContent className="min-h-0 p-0">
|
|
59
|
+
{results && results.data.length > 0 ? (
|
|
60
|
+
<ul aria-label="Matching installations" className="divide-y">
|
|
61
|
+
{results.data.map((event) => {
|
|
62
|
+
const currentBundleId = getLastKnownBundleId(event);
|
|
63
|
+
const isSelected = event.installId === selectedInstallId;
|
|
64
|
+
return (
|
|
65
|
+
<li key={event.installId}>
|
|
66
|
+
<button
|
|
67
|
+
aria-pressed={isSelected}
|
|
68
|
+
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"
|
|
69
|
+
onClick={() => onSelect(event.installId)}
|
|
70
|
+
type="button"
|
|
71
|
+
>
|
|
72
|
+
<span className="flex w-full min-w-0 items-center justify-between gap-3">
|
|
73
|
+
<span className="min-w-0 truncate text-sm font-medium">
|
|
74
|
+
{getUserLabel(event)}
|
|
75
|
+
</span>
|
|
76
|
+
{isSelected ? (
|
|
77
|
+
<span className="flex shrink-0 items-center gap-1 text-xs font-medium text-primary">
|
|
78
|
+
<Check aria-hidden="true" className="size-3.5" />
|
|
79
|
+
Selected
|
|
80
|
+
</span>
|
|
81
|
+
) : null}
|
|
82
|
+
</span>
|
|
83
|
+
<BundleIdDisplay
|
|
84
|
+
bundleId={event.installId}
|
|
85
|
+
className="block text-muted-foreground"
|
|
86
|
+
/>
|
|
87
|
+
<span className="min-w-0">
|
|
88
|
+
<span className="mb-1 block text-xs text-muted-foreground">
|
|
89
|
+
Last known bundle
|
|
90
|
+
</span>
|
|
91
|
+
{currentBundleId ? (
|
|
92
|
+
<BundleIdDisplay bundleId={currentBundleId} />
|
|
93
|
+
) : (
|
|
94
|
+
<span className="text-sm text-muted-foreground">—</span>
|
|
95
|
+
)}
|
|
96
|
+
</span>
|
|
97
|
+
</button>
|
|
98
|
+
</li>
|
|
99
|
+
);
|
|
100
|
+
})}
|
|
101
|
+
</ul>
|
|
102
|
+
) : error ? (
|
|
103
|
+
<div className="p-5">
|
|
104
|
+
<Alert variant="destructive">
|
|
105
|
+
<TriangleAlert aria-hidden="true" />
|
|
106
|
+
<AlertTitle>Installation search unavailable</AlertTitle>
|
|
107
|
+
<AlertDescription>
|
|
108
|
+
{error instanceof Error
|
|
109
|
+
? error.message
|
|
110
|
+
: "Failed to load installations."}
|
|
111
|
+
</AlertDescription>
|
|
112
|
+
</Alert>
|
|
113
|
+
</div>
|
|
114
|
+
) : (
|
|
115
|
+
<div className="p-5 text-sm text-muted-foreground">
|
|
116
|
+
No installations matched that query.
|
|
117
|
+
</div>
|
|
118
|
+
)}
|
|
119
|
+
{results && results.pagination.total > 0 ? (
|
|
120
|
+
<InstallationPagination
|
|
121
|
+
label="Installation results"
|
|
122
|
+
limit={limit}
|
|
123
|
+
offset={offset}
|
|
124
|
+
pageLength={results.data.length}
|
|
125
|
+
total={results.pagination.total}
|
|
126
|
+
onOffsetChange={onOffsetChange}
|
|
127
|
+
/>
|
|
128
|
+
) : null}
|
|
129
|
+
</CardContent>
|
|
130
|
+
</Card>
|
|
131
|
+
);
|
|
132
|
+
}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { Link } from "@tanstack/react-router";
|
|
2
|
+
import { ArrowLeft, Search, X } from "lucide-react";
|
|
3
|
+
|
|
4
|
+
import { Button, buttonVariants } from "@/components/ui/button";
|
|
5
|
+
import {
|
|
6
|
+
Card,
|
|
7
|
+
CardContent,
|
|
8
|
+
CardDescription,
|
|
9
|
+
CardTitle,
|
|
10
|
+
} from "@/components/ui/card";
|
|
11
|
+
import {
|
|
12
|
+
Field,
|
|
13
|
+
FieldDescription,
|
|
14
|
+
FieldGroup,
|
|
15
|
+
FieldLabel,
|
|
16
|
+
} from "@/components/ui/field";
|
|
17
|
+
import {
|
|
18
|
+
InputGroup,
|
|
19
|
+
InputGroupAddon,
|
|
20
|
+
InputGroupButton,
|
|
21
|
+
InputGroupInput,
|
|
22
|
+
} from "@/components/ui/input-group";
|
|
23
|
+
import { Separator } from "@/components/ui/separator";
|
|
24
|
+
import { SidebarTrigger } from "@/components/ui/sidebar";
|
|
25
|
+
import { Skeleton } from "@/components/ui/skeleton";
|
|
26
|
+
|
|
27
|
+
export function InstallationPageHeader() {
|
|
28
|
+
return (
|
|
29
|
+
<header 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">
|
|
30
|
+
<SidebarTrigger className="-ml-1" />
|
|
31
|
+
<Link
|
|
32
|
+
className={buttonVariants({ size: "sm", variant: "ghost" })}
|
|
33
|
+
to="/insights"
|
|
34
|
+
>
|
|
35
|
+
<ArrowLeft aria-hidden="true" data-icon="inline-start" />
|
|
36
|
+
Back to Insights
|
|
37
|
+
</Link>
|
|
38
|
+
<Separator className="mx-1 hidden h-4 sm:block" orientation="vertical" />
|
|
39
|
+
<div className="basis-full pl-9 sm:basis-auto sm:pl-0">
|
|
40
|
+
<h1 className="text-sm font-medium">Installation history</h1>
|
|
41
|
+
<p className="text-xs text-muted-foreground">
|
|
42
|
+
Review the last known bundle and recorded changes.
|
|
43
|
+
</p>
|
|
44
|
+
</div>
|
|
45
|
+
</header>
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export function InstallationSearchPanel({
|
|
50
|
+
draftQuery,
|
|
51
|
+
onDraftQueryChange,
|
|
52
|
+
onSubmit,
|
|
53
|
+
onClear,
|
|
54
|
+
hasQuery,
|
|
55
|
+
}: {
|
|
56
|
+
readonly draftQuery: string;
|
|
57
|
+
readonly onDraftQueryChange: (value: string) => void;
|
|
58
|
+
readonly onSubmit: () => void;
|
|
59
|
+
readonly onClear: () => void;
|
|
60
|
+
readonly hasQuery: boolean;
|
|
61
|
+
}) {
|
|
62
|
+
return (
|
|
63
|
+
<Card>
|
|
64
|
+
<CardContent className="grid gap-4 p-4 lg:grid-cols-[minmax(12rem,0.45fr)_minmax(0,1.55fr)] lg:items-start">
|
|
65
|
+
<div className="flex min-w-0 flex-col gap-1.5">
|
|
66
|
+
<CardTitle className="text-sm font-medium">
|
|
67
|
+
<h2>Find an installation</h2>
|
|
68
|
+
</CardTitle>
|
|
69
|
+
<CardDescription>
|
|
70
|
+
Search by either identifier to inspect its bundle history.
|
|
71
|
+
</CardDescription>
|
|
72
|
+
</div>
|
|
73
|
+
<form
|
|
74
|
+
onSubmit={(event) => {
|
|
75
|
+
event.preventDefault();
|
|
76
|
+
onSubmit();
|
|
77
|
+
}}
|
|
78
|
+
role="search"
|
|
79
|
+
>
|
|
80
|
+
<FieldGroup>
|
|
81
|
+
<Field>
|
|
82
|
+
<FieldLabel htmlFor="installation-history-search">
|
|
83
|
+
User ID or install ID
|
|
84
|
+
</FieldLabel>
|
|
85
|
+
<div className="flex flex-col gap-2 sm:flex-row">
|
|
86
|
+
<InputGroup className="h-8">
|
|
87
|
+
<InputGroupAddon>
|
|
88
|
+
<Search aria-hidden="true" />
|
|
89
|
+
</InputGroupAddon>
|
|
90
|
+
<InputGroupInput
|
|
91
|
+
id="installation-history-search"
|
|
92
|
+
onChange={(event) => onDraftQueryChange(event.target.value)}
|
|
93
|
+
placeholder="Enter a user ID or install ID"
|
|
94
|
+
type="search"
|
|
95
|
+
value={draftQuery}
|
|
96
|
+
/>
|
|
97
|
+
{draftQuery.length > 0 || hasQuery ? (
|
|
98
|
+
<InputGroupAddon align="inline-end">
|
|
99
|
+
<InputGroupButton
|
|
100
|
+
aria-label="Clear search"
|
|
101
|
+
onClick={onClear}
|
|
102
|
+
size="icon-xs"
|
|
103
|
+
>
|
|
104
|
+
<X aria-hidden="true" />
|
|
105
|
+
</InputGroupButton>
|
|
106
|
+
</InputGroupAddon>
|
|
107
|
+
) : null}
|
|
108
|
+
</InputGroup>
|
|
109
|
+
<Button
|
|
110
|
+
className="w-full sm:w-auto"
|
|
111
|
+
disabled={draftQuery.trim().length === 0}
|
|
112
|
+
size="lg"
|
|
113
|
+
type="submit"
|
|
114
|
+
>
|
|
115
|
+
<Search aria-hidden="true" data-icon="inline-start" />
|
|
116
|
+
Search history
|
|
117
|
+
</Button>
|
|
118
|
+
</div>
|
|
119
|
+
<FieldDescription>
|
|
120
|
+
A user ID may return more than one installation. An install ID
|
|
121
|
+
opens one installation directly.
|
|
122
|
+
</FieldDescription>
|
|
123
|
+
</Field>
|
|
124
|
+
</FieldGroup>
|
|
125
|
+
</form>
|
|
126
|
+
</CardContent>
|
|
127
|
+
</Card>
|
|
128
|
+
);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export function InstallationResultsSkeleton() {
|
|
132
|
+
return (
|
|
133
|
+
<div className="grid items-stretch gap-6 lg:min-h-96 lg:grid-cols-[minmax(18rem,20rem)_minmax(0,1fr)]">
|
|
134
|
+
<Skeleton className="h-64 w-full lg:h-full" />
|
|
135
|
+
<Skeleton className="h-64 w-full lg:h-full" />
|
|
136
|
+
</div>
|
|
137
|
+
);
|
|
138
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Button } from "@/components/ui/button";
|
|
2
|
+
|
|
3
|
+
export function InstallationPagination({
|
|
4
|
+
label,
|
|
5
|
+
limit,
|
|
6
|
+
offset,
|
|
7
|
+
pageLength,
|
|
8
|
+
total,
|
|
9
|
+
onOffsetChange,
|
|
10
|
+
}: {
|
|
11
|
+
readonly label: string;
|
|
12
|
+
readonly limit: number;
|
|
13
|
+
readonly offset: number;
|
|
14
|
+
readonly pageLength: number;
|
|
15
|
+
readonly total: number;
|
|
16
|
+
readonly onOffsetChange: (offset: number) => void;
|
|
17
|
+
}) {
|
|
18
|
+
return (
|
|
19
|
+
<nav
|
|
20
|
+
aria-label={`${label} pagination`}
|
|
21
|
+
className="flex items-center justify-between gap-4 border-t px-5 py-5"
|
|
22
|
+
>
|
|
23
|
+
<span className="text-xs text-muted-foreground">
|
|
24
|
+
{offset + 1}–{Math.min(offset + pageLength, total)} of {total}
|
|
25
|
+
</span>
|
|
26
|
+
<div className="flex gap-2">
|
|
27
|
+
<Button
|
|
28
|
+
disabled={offset === 0}
|
|
29
|
+
onClick={() => onOffsetChange(Math.max(0, offset - limit))}
|
|
30
|
+
size="sm"
|
|
31
|
+
type="button"
|
|
32
|
+
variant="outline"
|
|
33
|
+
>
|
|
34
|
+
Previous
|
|
35
|
+
</Button>
|
|
36
|
+
<Button
|
|
37
|
+
disabled={offset + pageLength >= total}
|
|
38
|
+
onClick={() => onOffsetChange(offset + limit)}
|
|
39
|
+
size="sm"
|
|
40
|
+
type="button"
|
|
41
|
+
variant="outline"
|
|
42
|
+
>
|
|
43
|
+
Next
|
|
44
|
+
</Button>
|
|
45
|
+
</div>
|
|
46
|
+
</nav>
|
|
47
|
+
);
|
|
48
|
+
}
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
import { Link } from "@tanstack/react-router";
|
|
2
|
+
import { Search, TriangleAlert } from "lucide-react";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
|
|
5
|
+
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";
|
|
6
|
+
import { Button } from "@/components/ui/button";
|
|
7
|
+
import {
|
|
8
|
+
Card,
|
|
9
|
+
CardContent,
|
|
10
|
+
CardDescription,
|
|
11
|
+
CardHeader,
|
|
12
|
+
CardTitle,
|
|
13
|
+
} from "@/components/ui/card";
|
|
14
|
+
import {
|
|
15
|
+
InputGroup,
|
|
16
|
+
InputGroupAddon,
|
|
17
|
+
InputGroupButton,
|
|
18
|
+
InputGroupInput,
|
|
19
|
+
} from "@/components/ui/input-group";
|
|
20
|
+
import { Skeleton } from "@/components/ui/skeleton";
|
|
21
|
+
import {
|
|
22
|
+
Table,
|
|
23
|
+
TableBody,
|
|
24
|
+
TableCell,
|
|
25
|
+
TableHead,
|
|
26
|
+
TableHeader,
|
|
27
|
+
TableRow,
|
|
28
|
+
} from "@/components/ui/table";
|
|
29
|
+
import {
|
|
30
|
+
type InstallationSearchRow,
|
|
31
|
+
useInstallationSearchQuery,
|
|
32
|
+
} from "@/lib/api";
|
|
33
|
+
import { isInsightsQueryEnabled } from "@/lib/insights-api";
|
|
34
|
+
|
|
35
|
+
import { useInsightsCapability } from "./InsightsCapabilityContext";
|
|
36
|
+
|
|
37
|
+
const SEARCH_LIMIT = 20;
|
|
38
|
+
|
|
39
|
+
const identityLabel = (row: InstallationSearchRow): string =>
|
|
40
|
+
row.userId ?? row.installId;
|
|
41
|
+
|
|
42
|
+
const platformLabel = (platform: InstallationSearchRow["platform"]): string =>
|
|
43
|
+
platform === "ios" ? "iOS" : "Android";
|
|
44
|
+
|
|
45
|
+
export function InstallationSearch({
|
|
46
|
+
initialQuery = "",
|
|
47
|
+
}: {
|
|
48
|
+
readonly initialQuery?: string;
|
|
49
|
+
}) {
|
|
50
|
+
const capability = useInsightsCapability();
|
|
51
|
+
const normalizedInitialQuery = initialQuery.trim();
|
|
52
|
+
const [draftQuery, setDraftQuery] = useState(normalizedInitialQuery);
|
|
53
|
+
const [submittedQuery, setSubmittedQuery] = useState(normalizedInitialQuery);
|
|
54
|
+
const [offset, setOffset] = useState(0);
|
|
55
|
+
const queryEnabled =
|
|
56
|
+
isInsightsQueryEnabled(capability) && submittedQuery.length > 0;
|
|
57
|
+
const { data, error, isLoading } = useInstallationSearchQuery(
|
|
58
|
+
{ query: submittedQuery, limit: SEARCH_LIMIT, offset },
|
|
59
|
+
queryEnabled,
|
|
60
|
+
);
|
|
61
|
+
|
|
62
|
+
return (
|
|
63
|
+
<Card>
|
|
64
|
+
<CardHeader>
|
|
65
|
+
<CardTitle className="text-sm font-medium">
|
|
66
|
+
<h2>Installation inspector</h2>
|
|
67
|
+
</CardTitle>
|
|
68
|
+
<CardDescription>
|
|
69
|
+
Search by user ID or install ID to inspect its last known bundle.
|
|
70
|
+
</CardDescription>
|
|
71
|
+
</CardHeader>
|
|
72
|
+
<CardContent className="flex flex-col gap-5">
|
|
73
|
+
<form
|
|
74
|
+
className="max-w-2xl"
|
|
75
|
+
onSubmit={(event) => {
|
|
76
|
+
event.preventDefault();
|
|
77
|
+
setSubmittedQuery(draftQuery.trim());
|
|
78
|
+
setOffset(0);
|
|
79
|
+
}}
|
|
80
|
+
role="search"
|
|
81
|
+
>
|
|
82
|
+
<label className="sr-only" htmlFor="insights-installation-search">
|
|
83
|
+
User ID or install ID
|
|
84
|
+
</label>
|
|
85
|
+
<InputGroup className="h-9">
|
|
86
|
+
<InputGroupAddon>
|
|
87
|
+
<Search aria-hidden="true" />
|
|
88
|
+
</InputGroupAddon>
|
|
89
|
+
<InputGroupInput
|
|
90
|
+
id="insights-installation-search"
|
|
91
|
+
aria-label="User ID or install ID"
|
|
92
|
+
disabled={isLoading}
|
|
93
|
+
onChange={(event) => setDraftQuery(event.target.value)}
|
|
94
|
+
placeholder="Enter a user ID or install ID"
|
|
95
|
+
type="search"
|
|
96
|
+
value={draftQuery}
|
|
97
|
+
/>
|
|
98
|
+
<InputGroupAddon align="inline-end">
|
|
99
|
+
<InputGroupButton
|
|
100
|
+
disabled={isLoading}
|
|
101
|
+
type="submit"
|
|
102
|
+
variant="default"
|
|
103
|
+
>
|
|
104
|
+
Search
|
|
105
|
+
</InputGroupButton>
|
|
106
|
+
</InputGroupAddon>
|
|
107
|
+
</InputGroup>
|
|
108
|
+
</form>
|
|
109
|
+
|
|
110
|
+
{!queryEnabled ? (
|
|
111
|
+
<p className="text-sm text-muted-foreground">
|
|
112
|
+
Enter a user ID or install ID to search received reports.
|
|
113
|
+
</p>
|
|
114
|
+
) : isLoading ? (
|
|
115
|
+
<div
|
|
116
|
+
aria-label="Searching installations"
|
|
117
|
+
className="flex flex-col gap-2"
|
|
118
|
+
>
|
|
119
|
+
<Skeleton className="h-10 w-full" />
|
|
120
|
+
<Skeleton className="h-10 w-full" />
|
|
121
|
+
</div>
|
|
122
|
+
) : error ? (
|
|
123
|
+
<Alert variant="destructive">
|
|
124
|
+
<TriangleAlert aria-hidden="true" />
|
|
125
|
+
<AlertTitle>Installation search unavailable</AlertTitle>
|
|
126
|
+
<AlertDescription>{error.message}</AlertDescription>
|
|
127
|
+
</Alert>
|
|
128
|
+
) : data && data.data.length > 0 ? (
|
|
129
|
+
<div className="flex flex-col gap-3">
|
|
130
|
+
<Table>
|
|
131
|
+
<TableHeader>
|
|
132
|
+
<TableRow className="hover:bg-transparent">
|
|
133
|
+
<TableHead>Installation</TableHead>
|
|
134
|
+
<TableHead>Last known bundle</TableHead>
|
|
135
|
+
<TableHead>Reported context</TableHead>
|
|
136
|
+
<TableHead className="text-right">Details</TableHead>
|
|
137
|
+
</TableRow>
|
|
138
|
+
</TableHeader>
|
|
139
|
+
<TableBody>
|
|
140
|
+
{data.data.map((row) => (
|
|
141
|
+
<InstallationResultRow
|
|
142
|
+
key={row.installId}
|
|
143
|
+
query={submittedQuery}
|
|
144
|
+
row={row}
|
|
145
|
+
/>
|
|
146
|
+
))}
|
|
147
|
+
</TableBody>
|
|
148
|
+
</Table>
|
|
149
|
+
<div className="flex items-center justify-between gap-3">
|
|
150
|
+
<p className="text-xs text-muted-foreground">
|
|
151
|
+
{offset + 1}–
|
|
152
|
+
{Math.min(offset + data.data.length, data.pagination.total)} of{" "}
|
|
153
|
+
{data.pagination.total}
|
|
154
|
+
</p>
|
|
155
|
+
<div className="flex gap-2">
|
|
156
|
+
<Button
|
|
157
|
+
disabled={offset === 0}
|
|
158
|
+
onClick={() => setOffset(Math.max(0, offset - SEARCH_LIMIT))}
|
|
159
|
+
size="sm"
|
|
160
|
+
type="button"
|
|
161
|
+
variant="outline"
|
|
162
|
+
>
|
|
163
|
+
Previous
|
|
164
|
+
</Button>
|
|
165
|
+
<Button
|
|
166
|
+
disabled={offset + data.data.length >= data.pagination.total}
|
|
167
|
+
onClick={() => setOffset(offset + SEARCH_LIMIT)}
|
|
168
|
+
size="sm"
|
|
169
|
+
type="button"
|
|
170
|
+
variant="outline"
|
|
171
|
+
>
|
|
172
|
+
Next
|
|
173
|
+
</Button>
|
|
174
|
+
</div>
|
|
175
|
+
</div>
|
|
176
|
+
</div>
|
|
177
|
+
) : (
|
|
178
|
+
<p className="text-sm text-muted-foreground">
|
|
179
|
+
No installations matched that search.
|
|
180
|
+
</p>
|
|
181
|
+
)}
|
|
182
|
+
</CardContent>
|
|
183
|
+
</Card>
|
|
184
|
+
);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
function InstallationResultRow({
|
|
188
|
+
query,
|
|
189
|
+
row,
|
|
190
|
+
}: {
|
|
191
|
+
readonly query: string;
|
|
192
|
+
readonly row: InstallationSearchRow;
|
|
193
|
+
}) {
|
|
194
|
+
return (
|
|
195
|
+
<TableRow>
|
|
196
|
+
<TableCell className="max-w-64 whitespace-normal">
|
|
197
|
+
<div className="flex flex-col gap-1">
|
|
198
|
+
<span className="font-medium">{identityLabel(row)}</span>
|
|
199
|
+
<code className="break-all text-muted-foreground">
|
|
200
|
+
{row.installId}
|
|
201
|
+
</code>
|
|
202
|
+
</div>
|
|
203
|
+
</TableCell>
|
|
204
|
+
<TableCell className="max-w-64 whitespace-normal">
|
|
205
|
+
<div className="flex flex-col gap-1">
|
|
206
|
+
<span className="text-muted-foreground">Last known bundle</span>
|
|
207
|
+
<code className="break-all">{row.lastKnownBundleId ?? "—"}</code>
|
|
208
|
+
</div>
|
|
209
|
+
</TableCell>
|
|
210
|
+
<TableCell>
|
|
211
|
+
{platformLabel(row.platform)} · {row.channel} · {row.appVersion}
|
|
212
|
+
</TableCell>
|
|
213
|
+
<TableCell className="text-right">
|
|
214
|
+
<Link
|
|
215
|
+
aria-label={`Open ${row.installId}`}
|
|
216
|
+
className="font-medium text-primary underline-offset-4 hover:underline focus-visible:rounded-sm focus-visible:outline-2"
|
|
217
|
+
search={{
|
|
218
|
+
query,
|
|
219
|
+
installId: row.installId,
|
|
220
|
+
searchOffset: 0,
|
|
221
|
+
historyOffset: 0,
|
|
222
|
+
}}
|
|
223
|
+
to="/installations"
|
|
224
|
+
>
|
|
225
|
+
Open
|
|
226
|
+
</Link>
|
|
227
|
+
</TableCell>
|
|
228
|
+
</TableRow>
|
|
229
|
+
);
|
|
230
|
+
}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import type { ActiveInstallationWindow } from "@hot-updater/server";
|
|
2
|
+
import type { ReactNode } from "react";
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
Card,
|
|
6
|
+
CardContent,
|
|
7
|
+
CardDescription,
|
|
8
|
+
CardHeader,
|
|
9
|
+
CardTitle,
|
|
10
|
+
} from "@/components/ui/card";
|
|
11
|
+
import { Skeleton } from "@/components/ui/skeleton";
|
|
12
|
+
import type { BundleEventInsights } from "@/lib/api";
|
|
13
|
+
|
|
14
|
+
import { BundleActivityChart } from "../bundles/BundleActivityChart";
|
|
15
|
+
import { InsightsErrorAlert } from "./InsightsErrorAlert";
|
|
16
|
+
|
|
17
|
+
export type UpdateOutcomeState =
|
|
18
|
+
| { readonly status: "idle" }
|
|
19
|
+
| { readonly status: "loading"; readonly bundleId: string }
|
|
20
|
+
| {
|
|
21
|
+
readonly status: "error";
|
|
22
|
+
readonly bundleId: string;
|
|
23
|
+
readonly error: Error;
|
|
24
|
+
}
|
|
25
|
+
| {
|
|
26
|
+
readonly status: "success";
|
|
27
|
+
readonly bundleId: string;
|
|
28
|
+
readonly data: BundleEventInsights;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export function UpdateOutcomes({
|
|
32
|
+
bundleSelector,
|
|
33
|
+
configuredPercentage,
|
|
34
|
+
latestBundleInstallations,
|
|
35
|
+
reportingInstallations,
|
|
36
|
+
state,
|
|
37
|
+
window,
|
|
38
|
+
}: {
|
|
39
|
+
readonly bundleSelector: ReactNode;
|
|
40
|
+
readonly configuredPercentage: number | null;
|
|
41
|
+
readonly latestBundleInstallations: number;
|
|
42
|
+
readonly reportingInstallations: number;
|
|
43
|
+
readonly state: UpdateOutcomeState;
|
|
44
|
+
readonly window: ActiveInstallationWindow;
|
|
45
|
+
}) {
|
|
46
|
+
const latestBundleShare =
|
|
47
|
+
reportingInstallations === 0
|
|
48
|
+
? 0
|
|
49
|
+
: (latestBundleInstallations / reportingInstallations) * 100;
|
|
50
|
+
|
|
51
|
+
return (
|
|
52
|
+
<Card className="min-w-0 overflow-hidden shadow-sm">
|
|
53
|
+
<CardHeader className="gap-4 space-y-0 lg:flex-row lg:items-start lg:justify-between">
|
|
54
|
+
<div className="flex min-w-0 flex-col gap-1.5">
|
|
55
|
+
<CardTitle className="text-sm font-medium">
|
|
56
|
+
<h2 id="bundle-detail-heading">Selected bundle activity</h2>
|
|
57
|
+
</CardTitle>
|
|
58
|
+
<CardDescription>
|
|
59
|
+
Select a bundle to inspect its latest presence, applies, and
|
|
60
|
+
recoveries during this period.
|
|
61
|
+
</CardDescription>
|
|
62
|
+
</div>
|
|
63
|
+
{bundleSelector}
|
|
64
|
+
</CardHeader>
|
|
65
|
+
<CardContent className="pt-10">
|
|
66
|
+
{state.status === "idle" ? (
|
|
67
|
+
<p className="text-sm text-muted-foreground">
|
|
68
|
+
No active bundle is available.
|
|
69
|
+
</p>
|
|
70
|
+
) : state.status === "loading" ? (
|
|
71
|
+
<div
|
|
72
|
+
aria-label="Loading update outcomes"
|
|
73
|
+
className="flex flex-col gap-4"
|
|
74
|
+
>
|
|
75
|
+
<div className="grid grid-cols-2 gap-4 lg:grid-cols-4">
|
|
76
|
+
<Skeleton className="h-14 w-full" />
|
|
77
|
+
<Skeleton className="h-14 w-full" />
|
|
78
|
+
<Skeleton className="h-14 w-full" />
|
|
79
|
+
<Skeleton className="h-14 w-full" />
|
|
80
|
+
</div>
|
|
81
|
+
<Skeleton className="h-32 w-full" />
|
|
82
|
+
</div>
|
|
83
|
+
) : state.status === "error" ? (
|
|
84
|
+
<InsightsErrorAlert
|
|
85
|
+
error={state.error}
|
|
86
|
+
fallbackTitle="Bundle movement unavailable"
|
|
87
|
+
/>
|
|
88
|
+
) : (
|
|
89
|
+
<div className="flex min-w-0 flex-col gap-5">
|
|
90
|
+
<dl className="grid sm:grid-cols-2 lg:grid-cols-4 lg:divide-x lg:divide-border/70">
|
|
91
|
+
<div className="border-b pb-4 sm:pr-4 lg:border-b-0">
|
|
92
|
+
<dt className="text-xs text-muted-foreground">
|
|
93
|
+
Latest bundle share
|
|
94
|
+
</dt>
|
|
95
|
+
<dd className="mt-1 text-2xl font-semibold tracking-tight tabular-nums">
|
|
96
|
+
{Math.round(latestBundleShare)}%
|
|
97
|
+
</dd>
|
|
98
|
+
<dd className="mt-1 text-xs text-muted-foreground tabular-nums">
|
|
99
|
+
{latestBundleInstallations.toLocaleString()} of{" "}
|
|
100
|
+
{reportingInstallations.toLocaleString()} reporting installs
|
|
101
|
+
</dd>
|
|
102
|
+
</div>
|
|
103
|
+
<div className="border-b py-4 sm:pl-4 lg:border-b-0 lg:py-0 lg:pr-4">
|
|
104
|
+
<dt className="text-xs text-muted-foreground">Newly applied</dt>
|
|
105
|
+
<dd className="mt-1 text-2xl font-semibold tracking-tight tabular-nums">
|
|
106
|
+
{state.data.summary.installed.toLocaleString()}
|
|
107
|
+
</dd>
|
|
108
|
+
<dd className="mt-1 text-xs text-muted-foreground">
|
|
109
|
+
Distinct installations
|
|
110
|
+
</dd>
|
|
111
|
+
</div>
|
|
112
|
+
<div className="border-b py-4 sm:pr-4 lg:border-b-0 lg:py-0 lg:pl-4">
|
|
113
|
+
<dt className="text-xs text-muted-foreground">
|
|
114
|
+
Recovered away
|
|
115
|
+
</dt>
|
|
116
|
+
<dd className="mt-1 text-2xl font-semibold tracking-tight tabular-nums">
|
|
117
|
+
{state.data.summary.recovered.toLocaleString()}
|
|
118
|
+
</dd>
|
|
119
|
+
<dd className="mt-1 text-xs text-muted-foreground">
|
|
120
|
+
Distinct installations
|
|
121
|
+
</dd>
|
|
122
|
+
</div>
|
|
123
|
+
<div className="pt-4 sm:pl-4 lg:py-0">
|
|
124
|
+
<dt className="text-xs text-muted-foreground">
|
|
125
|
+
Configured rollout
|
|
126
|
+
</dt>
|
|
127
|
+
<dd className="mt-1 text-2xl font-semibold tracking-tight tabular-nums">
|
|
128
|
+
{configuredPercentage === null
|
|
129
|
+
? "—"
|
|
130
|
+
: `${configuredPercentage}%`}
|
|
131
|
+
</dd>
|
|
132
|
+
<dd className="mt-1 text-xs text-muted-foreground">
|
|
133
|
+
Eligibility setting
|
|
134
|
+
</dd>
|
|
135
|
+
</div>
|
|
136
|
+
</dl>
|
|
137
|
+
<BundleActivityChart
|
|
138
|
+
installed={state.data.series.installed}
|
|
139
|
+
recovered={state.data.series.recovered}
|
|
140
|
+
window={window}
|
|
141
|
+
/>
|
|
142
|
+
</div>
|
|
143
|
+
)}
|
|
144
|
+
</CardContent>
|
|
145
|
+
</Card>
|
|
146
|
+
);
|
|
147
|
+
}
|