@hot-updater/console 0.36.7 → 1.0.0-rc.0
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/AnalyticsCapabilityContext-BCke57-7.js +1 -0
- package/.output/public/assets/BundleActivityChart-CnsBe_1J.js +42 -0
- package/.output/public/assets/BundleIdDisplay-Dky75zLU.js +1 -0
- package/.output/public/assets/alert-C-1KvDW8.js +1 -0
- package/.output/public/assets/analytics-Bqz0c-BT.js +1 -0
- package/.output/public/assets/analytics-api-CJdrTLLO.js +1 -0
- package/.output/public/assets/api-B_Rh-uzC.js +1 -0
- package/.output/public/assets/api-keys-BurCFhzH.js +1 -0
- package/.output/public/assets/api-keys-api-BEDJdQg3.js +1 -0
- package/.output/public/assets/badge-Bf0fZ-Gx.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-BS60BRr2.js +1 -0
- package/.output/public/assets/dist-DspNKfMj.js +1 -0
- package/.output/public/assets/download-O-yNBc9H.js +1 -0
- package/.output/public/assets/field-Buq148-A.js +1 -0
- package/.output/public/assets/index-kFhd2S78.js +10 -0
- package/.output/public/assets/installations-BrQ-od41.js +2 -0
- package/.output/public/assets/installations-CGlZ3ROz.js +1 -0
- package/.output/public/assets/lazyRouteComponent-rPzgA7S-.js +1 -0
- package/.output/public/assets/loader-circle-DCYF-wJl.js +1 -0
- package/.output/public/assets/preload-helper-TKOBYGYD.js +1 -0
- package/.output/public/assets/refresh-cw-n8XYbPPj.js +1 -0
- package/.output/public/assets/routes-CrdokJ80.js +1 -0
- package/.output/public/assets/routes-DcQnVajO.js +2 -0
- package/.output/public/assets/search-DLhbWw3W.js +1 -0
- package/.output/public/assets/shield-check-DE_hVuHu.js +1 -0
- package/.output/public/assets/signing-HRexfjsH.js +1 -0
- package/.output/public/assets/styles-eB4EtvFS.css +2 -0
- package/.output/public/assets/table-D8CLieHX.js +1 -0
- package/.output/public/assets/textarea-YJLTVAoq.js +1 -0
- package/.output/public/assets/useMutation-JsGVjQMY.js +1 -0
- package/.output/public/assets/useOpenInteractionType-4cRD5xO0.js +1 -0
- package/.output/server/__23tanstack-start-server-fn-resolver-DBP9TQ7K.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/AnalyticsCapabilityContext-ui4DX8GO.mjs +15 -0
- package/.output/server/_ssr/BundleActivityChart-BiB9ZORH.mjs +288 -0
- package/.output/server/_ssr/BundleIdDisplay-Czk6iR6p.mjs +13 -0
- package/.output/server/_ssr/alert-Dim3MGY5.mjs +86 -0
- package/.output/server/_ssr/analytics-DtMTn8fn.mjs +858 -0
- package/.output/server/_ssr/analytics-api-Cg1M5v_H.mjs +71 -0
- package/.output/server/_ssr/analytics-input-fRRRn0uA.mjs +96 -0
- package/.output/server/_ssr/analytics-rpc-DY5uXvHT.mjs +155 -0
- package/.output/server/_ssr/api-BTSv1tZb.mjs +282 -0
- package/.output/server/_ssr/api-keys-BnM_o2nS.mjs +300 -0
- package/.output/server/_ssr/api-keys-api-CIywsSF5.mjs +60 -0
- package/.output/server/_ssr/api-keys-rpc-BSp1wkIV.mjs +136 -0
- package/.output/server/_ssr/api-rpc-cG5wd_tO.mjs +1468 -0
- package/.output/server/_ssr/auth-BF8mbAgF.mjs +21 -0
- package/.output/server/_ssr/auth-rpc-BrJ6obHJ.mjs +24 -0
- package/.output/server/_ssr/auth.server-DwKoZoQM.mjs +50 -0
- package/.output/server/_ssr/badge-DCxbEeof.mjs +26 -0
- package/.output/server/_ssr/bundle-signing-rpc-COoQhW8E.mjs +16 -0
- package/.output/server/_ssr/bundle-signing.server-D5u8KkMp.mjs +51 -0
- package/.output/server/_ssr/config-Dv8qLDZ0.mjs +13 -0
- package/.output/server/_ssr/config.server-DEiLhKmy.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-9P0S0lJ3.mjs} +68 -50
- package/.output/server/_ssr/databaseRows-CwbNwYSl.mjs +166 -0
- package/.output/server/_ssr/deleteBundle-Cu_XOMt0.mjs +66 -0
- package/.output/server/_ssr/dialog-CQuRMNZ4.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-DRIXKjZG.mjs +74 -0
- package/.output/server/_ssr/{getBundleChildren-CVtSiH5t.mjs → getBundleChildren-BcRMFoDF.mjs} +10 -18
- package/.output/server/_ssr/installations-B-azgAvX.mjs +19 -0
- package/.output/server/_ssr/installations-Ctvzp2JH.mjs +535 -0
- package/.output/server/_ssr/router-C-KUBfOi.mjs +513 -0
- package/.output/server/_ssr/routes-BM4ht9jb.mjs +2286 -0
- package/.output/server/_ssr/routes-Z7TwC6nC.mjs +37 -0
- package/.output/server/_ssr/runtime.server-awTLiiXW.mjs +527 -0
- package/.output/server/_ssr/server-BjzmvXnO.mjs +7468 -0
- package/.output/server/_ssr/signing-k8GxyBDF.mjs +202 -0
- package/.output/server/_ssr/ssr.mjs +4 -5740
- package/.output/server/_ssr/start-DpViQGnt.mjs +4 -0
- package/.output/server/_ssr/table-v1yCvYo7.mjs +53 -0
- package/.output/server/_ssr/textarea-DYHnskhb.mjs +14 -0
- package/.output/server/_ssr/uuidv7-BbJ-9D_I.mjs +31 -0
- package/.output/server/_tanstack-start-manifest_v-CH4StzJu.mjs +108 -0
- package/.output/server/index.mjs +256 -53
- package/README.md +29 -8
- package/lib/index.d.mts +36 -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/analytics/ActivityChart.tsx +150 -0
- package/src/components/features/analytics/AnalyticsCapabilityContext.tsx +24 -0
- package/src/components/features/analytics/AnalyticsControls.tsx +115 -0
- package/src/components/features/analytics/AnalyticsErrorAlert.tsx +21 -0
- package/src/components/features/analytics/AnalyticsOverview.tsx +208 -0
- package/src/components/features/analytics/BundleDistribution.tsx +133 -0
- package/src/components/features/analytics/BundleSelector.tsx +114 -0
- package/src/components/features/analytics/InstallationHistoryCard.tsx +248 -0
- package/src/components/features/analytics/InstallationMatchesCard.tsx +132 -0
- package/src/components/features/analytics/InstallationPageHeader.tsx +138 -0
- package/src/components/features/analytics/InstallationPagination.tsx +48 -0
- package/src/components/features/analytics/InstallationSearch.tsx +230 -0
- package/src/components/features/analytics/UpdateOutcomes.tsx +147 -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/BundleAnalyticsSummary.tsx +123 -0
- package/src/components/features/bundles/BundleChildrenPanel.tsx +201 -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/releases/ReleaseEditorSheet.tsx +879 -0
- package/src/components/features/releases/ReleaseStateBadge.tsx +20 -0
- package/src/components/features/signing/BundleSigningPage.tsx +247 -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 +48 -0
- package/src/lib/analytics-api.ts +145 -0
- package/src/lib/analytics-error.ts +19 -0
- package/src/lib/analytics-input.ts +187 -0
- package/src/lib/analytics-overview.ts +170 -0
- package/src/lib/analytics-rpc.ts +218 -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/server/auth.server.ts +43 -0
- package/src/lib/server/bundle-signing.server.ts +100 -0
- package/src/lib/server/config.server.ts +109 -0
- package/src/lib/server/console-runtime.server.ts +70 -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/analytics.tsx +139 -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/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,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 { isAnalyticsQueryEnabled } from "@/lib/analytics-api";
|
|
30
|
+
import {
|
|
31
|
+
type InstallationSearchRow,
|
|
32
|
+
useInstallationSearchQuery,
|
|
33
|
+
} from "@/lib/api";
|
|
34
|
+
|
|
35
|
+
import { useAnalyticsCapability } from "./AnalyticsCapabilityContext";
|
|
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 = useAnalyticsCapability();
|
|
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
|
+
isAnalyticsQueryEnabled(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="analytics-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="analytics-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 { BundleEventAnalytics } from "@/lib/api";
|
|
13
|
+
|
|
14
|
+
import { BundleActivityChart } from "../bundles/BundleActivityChart";
|
|
15
|
+
import { AnalyticsErrorAlert } from "./AnalyticsErrorAlert";
|
|
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: BundleEventAnalytics;
|
|
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
|
+
<AnalyticsErrorAlert
|
|
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
|
+
}
|