@hot-updater/console 1.0.0-rc.2 → 1.0.0-rc.21
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/ConsoleFeatureUnavailable-D0LPL1Gy.js +1 -0
- package/.output/public/assets/HashValueDisplay-BmuB4FW-.js +1 -0
- package/.output/public/assets/InsightsInfo--v4SC07c.js +1 -0
- package/.output/public/assets/InsightsPageHeader-dU83CAQY.js +1 -0
- package/.output/public/assets/NotFoundPage-B5mhGG2a.js +1 -0
- package/.output/public/assets/api-D-vOVlQ4.js +1 -0
- package/.output/public/assets/api-keys-Csh8ARKU.js +1 -0
- package/.output/public/assets/api-keys-OMPUoA_A.js +1 -0
- package/.output/public/assets/arrow-left-Bwq9X1eS.js +1 -0
- package/.output/public/assets/arrow-up-right-BkOVn4if.js +1 -0
- package/.output/public/assets/card-C_7d6O9a.js +1 -0
- package/.output/public/assets/console-features-api-C1jRZTGw.js +1 -0
- package/.output/public/assets/dialog-DE8wFN_P.js +1 -0
- package/.output/public/assets/dist-C7ENGzpS.js +1 -0
- package/.output/public/assets/empty-CVd5NlQD.js +1 -0
- package/.output/public/assets/field-C06q1iC9.js +1 -0
- package/.output/public/assets/index-BeWlQtO6.js +11 -0
- package/.output/public/assets/input-group-Bi61biIA.js +1 -0
- package/.output/public/assets/insights-BjnAtC0f.js +2 -0
- package/.output/public/assets/insights-D86m11yH.js +42 -0
- package/.output/public/assets/insights-DpYstMoY.js +1 -0
- package/.output/public/assets/insights-recovery-rpc-BIm5_ALc.js +1 -0
- package/.output/public/assets/insights-search-KIF7mRtB.js +1 -0
- package/.output/public/assets/insights-usage-rpc-VHj8vyBt.js +1 -0
- package/.output/public/assets/insights_.distribution-ADcrX48c.js +2 -0
- package/.output/public/assets/insights_.distribution-CuuJUN6Y.js +1 -0
- package/.output/public/assets/insights_.distribution-DJRjuXsO.js +1 -0
- package/.output/public/assets/installations-BSBBzqWs.js +2 -0
- package/.output/public/assets/installations-DqIE6WcO.js +1 -0
- package/.output/public/assets/installations-UsELbDvw.js +1 -0
- package/.output/public/assets/loader-circle-CnCBxzHp.js +1 -0
- package/.output/public/assets/mutation-Csp7xUNh.js +1 -0
- package/.output/public/assets/preload-helper-B-cOmpLH.js +1 -0
- package/.output/public/assets/refresh-cw-FF1NtzlQ.js +1 -0
- package/.output/public/assets/routes-CoN9XHP_.js +2 -0
- package/.output/public/assets/routes-DT1jB0Zi.js +1 -0
- package/.output/public/assets/sidebar-D8mJRF15.js +3 -0
- package/.output/public/assets/styles-Bwt7v6U5.css +2 -0
- package/.output/public/assets/table-WBgfvgXg.js +1 -0
- package/.output/public/assets/useCompositeListItem-CloBmDwn.js +1 -0
- package/.output/public/assets/useMutation-DO8cvsTx.js +1 -0
- package/.output/public/assets/useOpenInteractionType-ReGr9GzJ.js +1 -0
- package/.output/public/assets/valueToPercent-BvPAi4bP.js +1 -0
- package/.output/server/{__23tanstack-start-server-fn-resolver-B7ioJhtE.mjs → __23tanstack-start-server-fn-resolver-DMRD4e4f.mjs} +51 -47
- package/.output/server/_libs/@base-ui/react+[...].mjs +7044 -3622
- package/.output/server/_libs/@reduxjs/toolkit+[...].mjs +1554 -0
- package/.output/server/_libs/@tanstack/react-router+[...].mjs +3803 -4023
- package/.output/server/_libs/@tanstack/react-router-ssr-query+[...].mjs +141 -98
- package/.output/server/_libs/d3-array.mjs +231 -0
- package/.output/server/_libs/d3-color.mjs +330 -0
- package/.output/server/_libs/d3-format.mjs +252 -0
- package/.output/server/_libs/d3-interpolate.mjs +207 -0
- package/.output/server/_libs/d3-path.mjs +77 -0
- package/.output/server/_libs/d3-scale+[...].mjs +1907 -0
- package/.output/server/_libs/d3-shape.mjs +818 -0
- package/.output/server/_libs/decimal.js-light.mjs +884 -0
- package/.output/server/_libs/es-toolkit.mjs +1159 -0
- package/.output/server/_libs/eventemitter3.mjs +236 -0
- package/.output/server/_libs/immer.mjs +532 -0
- package/.output/server/_libs/lucide-react.mjs +46 -32
- package/.output/server/_libs/next-themes.mjs +2 -2
- package/.output/server/_libs/react-redux+[...].mjs +205 -0
- package/.output/server/_libs/recharts+[...].mjs +14350 -0
- package/.output/server/_libs/sonner.mjs +2 -2
- package/.output/server/_libs/tanstack__history.mjs +68 -41
- package/.output/server/_libs/tanstack__query-core.mjs +1618 -309
- package/.output/server/_libs/tanstack__react-query.mjs +262 -22
- package/.output/server/_libs/verkit.mjs +99 -1
- package/.output/server/_runtime.mjs +10 -1
- package/.output/server/_ssr/ConsoleFeatureUnavailable-Du7jNPNS.mjs +58 -0
- package/.output/server/_ssr/{HashValueDisplay-DwpGLfrl.mjs → HashValueDisplay-GQvFkXoi.mjs} +3 -3
- package/.output/server/_ssr/InsightsInfo-Do7QSaFR.mjs +37 -0
- package/.output/server/_ssr/InsightsPageHeader-DSUWUWRc.mjs +154 -0
- package/.output/server/_ssr/NotFoundPage-DsF4Vrhg.mjs +37 -0
- package/.output/server/_ssr/api-BEiVs0H7.mjs +203 -0
- package/.output/server/_ssr/api-keys-BrvBWGRf.mjs +5 -0
- package/.output/server/_ssr/{api-keys-CZeTPQys.mjs → api-keys-K5v32nf7.mjs} +49 -9
- package/.output/server/_ssr/api-keys-rpc-B96bBllm.mjs +52 -0
- package/.output/server/_ssr/api-rpc-DcUe280B.mjs +296 -0
- package/.output/server/_ssr/{auth-rpc-DUaeOWKK.mjs → auth-rpc-C68W56DP.mjs} +6 -6
- package/.output/server/_ssr/auth.server-DM1J6NwR.mjs +5712 -0
- package/.output/server/_ssr/bundleActivity-CpuY9CTP.mjs +19 -0
- package/.output/server/_ssr/card-CPAEKx0w.mjs +49 -0
- package/.output/server/_ssr/config-nsIcsHh8.mjs +15 -0
- package/.output/server/_ssr/config.server-DDCZk3Sq.mjs +36 -0
- package/.output/server/_ssr/console-access-Da-2Qd7q.mjs +17 -0
- package/.output/server/_ssr/console-features-Dzu2iUGD.mjs +55 -0
- package/.output/server/_ssr/console-features-api-xAsSgFa_.mjs +43 -0
- package/.output/server/_ssr/console-features-rpc-qARGpB24.mjs +19 -0
- package/.output/server/_ssr/{createServerFn-B2hcXoPM.mjs → createMiddleware-BdBf_ezN.mjs} +67 -56
- package/.output/server/_ssr/{createServerRpc-DB29C_5p.mjs → createServerRpc-B_y2lrwA.mjs} +2 -2
- package/.output/server/_ssr/{databaseJsonValue-d6I3nAS4.mjs → databaseJsonValue-Bhxciy7Z.mjs} +28 -5
- package/.output/server/_ssr/databaseRows-DwMAjaF8.mjs +74 -0
- package/.output/server/_ssr/{dialog-DS-nw-pA.mjs → dialog-q__BJ7mQ.mjs} +2 -2
- package/.output/server/_ssr/{dist-CyzPaI5v.mjs → dist-Cxo9ghYv.mjs} +140 -6
- package/.output/server/_ssr/{downloadBundle-CNnYxYO2.mjs → downloadBundle-BW9I-pMQ.mjs} +10 -10
- package/.output/server/_ssr/empty-DcBTAooP.mjs +49 -0
- package/.output/server/_ssr/{empty-plugin-adapters-B5QvGpEl.mjs → empty-plugin-adapters-CYdinE-i.mjs} +1 -1
- package/.output/server/_ssr/{table-CnZmon_Z.mjs → field-QCDBVpXA.mjs} +63 -51
- package/.output/server/_ssr/getBundleChildren-DIAGCF4a.mjs +22 -0
- package/.output/server/_ssr/{input-group-BpsnmvZw.mjs → input-group-hCk2nUoU.mjs} +2 -2
- package/.output/server/_ssr/insights-BfBO0RFr.mjs +1238 -0
- package/.output/server/_ssr/insights-DsAU3-TB.mjs +14 -0
- package/.output/server/_ssr/insights-RIfg447W.mjs +5 -0
- package/.output/server/_ssr/insights-api-CDn-QQHU.mjs +105 -0
- package/.output/server/_ssr/insights-failures-BBGMhuUr.mjs +44 -0
- package/.output/server/_ssr/insights-failures-rpc-rA2dctK2.mjs +21 -0
- package/.output/server/_ssr/insights-recovery-Dpk6Mfb9.mjs +28 -0
- package/.output/server/_ssr/insights-recovery-rpc-BCaF-xSd.mjs +46 -0
- package/.output/server/_ssr/insights-recovery-rpc-CcgYyUHk.mjs +20 -0
- package/.output/server/_ssr/{insights-rpc-38DujK0G.mjs → insights-rpc-keycmwzw.mjs} +22 -14
- package/.output/server/_ssr/insights-search-BRg5VsNe.mjs +25 -0
- package/.output/server/_ssr/insights-usage-cbw9n2Fq.mjs +29 -0
- package/.output/server/_ssr/insights-usage-rpc-BKgV1QDf.mjs +29 -0
- package/.output/server/_ssr/insights-usage-rpc-D-JYachy.mjs +41 -0
- package/.output/server/_ssr/insightsRecovery-B7oMc8d8.mjs +45 -0
- package/.output/server/_ssr/insightsUsage-Oa7kk5ek.mjs +56 -0
- package/.output/server/_ssr/insights_.distribution-BIqOqRW0.mjs +335 -0
- package/.output/server/_ssr/insights_.distribution-CuUrDa7P.mjs +5 -0
- package/.output/server/_ssr/insights_.distribution-RT_6x_ud.mjs +14 -0
- package/.output/server/_ssr/{installations-DiVKEF5T.mjs → installations-BO5CjX2z.mjs} +517 -54
- package/.output/server/_ssr/installations-BjaHiIfh.mjs +5 -0
- package/.output/server/_ssr/installations-Dt5luA-N.mjs +69 -0
- package/.output/server/_ssr/listReleases-BitHzOYB.mjs +79 -0
- package/.output/server/_ssr/releaseManagement-B3e7I8J9.mjs +11 -0
- package/.output/server/_ssr/{router-B9wG_9f8.mjs → router-DfVAixxe.mjs} +135 -139
- package/.output/server/_ssr/{routes-D7Yh_jfj.mjs → routes-C6LstNp8.mjs} +176 -455
- package/.output/server/_ssr/routes-Q3Uhmwwz.mjs +292 -0
- package/.output/server/_ssr/runtime.server-fL0o6I2b.mjs +1459 -0
- package/.output/server/_ssr/schema-BKY9SqaY.mjs +25 -0
- package/.output/server/_ssr/select-CUlInmjk.mjs +107 -0
- package/.output/server/_ssr/server-C43wq9ft.mjs +8330 -0
- package/.output/server/_ssr/{createSsrRpc-DjWNJ0uc.mjs → sidebar-DKbx2ach.mjs} +117 -63
- package/.output/server/_ssr/ssr.mjs +1 -1
- package/.output/server/_ssr/start-BXUOv_n8.mjs +4 -0
- package/.output/server/_ssr/table-NGWV8B-S.mjs +53 -0
- package/.output/server/_ssr/updateFailures-Jwe2Baab.mjs +24 -0
- package/.output/server/_ssr/{uuidv7-D0QFkPL_.mjs → uuidv7-C8bwiZr8.mjs} +2 -2
- package/.output/server/_tanstack-start-manifest_v-WQ5qGn8n.mjs +124 -0
- package/.output/server/index.mjs +267 -162
- package/LICENSE +13 -14
- package/README.md +82 -72
- package/lib/index.d.mts +23 -11
- package/lib/vite-internal.mjs +13 -3
- package/lib/vite.d.mts +2 -0
- package/package.json +14 -14
- package/src/components/AppSidebar.tsx +100 -71
- package/src/components/ConsoleAccessPage.tsx +5 -1
- package/src/components/ConsoleFeatureUnavailable.tsx +80 -0
- package/src/components/NotFoundPage.tsx +7 -7
- package/src/components/features/FeatureSlots.tsx +99 -0
- package/src/components/features/api-keys/apiKeysFeatureUi.tsx +15 -0
- package/src/components/features/bundles/BundleMetadata.tsx +8 -5
- package/src/components/features/bundles/RolloutCohortsDialog.tsx +1 -1
- package/src/components/features/channels/ChannelManagementDialog.tsx +2 -5
- package/src/components/features/insights/AppUsage.tsx +370 -0
- package/src/components/features/insights/EstimatedCount.tsx +18 -0
- package/src/components/features/insights/EventDetails.tsx +117 -37
- package/src/components/features/insights/EventHistoryCard.tsx +112 -26
- package/src/components/features/insights/EventHistoryList.tsx +2 -2
- package/src/components/features/insights/InsightsControls.tsx +265 -102
- package/src/components/features/insights/InsightsErrorAlert.tsx +14 -1
- package/src/components/features/insights/InsightsInfo.tsx +48 -0
- package/src/components/features/insights/InsightsOverview.tsx +176 -173
- package/src/components/features/insights/InsightsPageHeader.tsx +35 -20
- package/src/components/features/insights/InsightsPeriodSelector.tsx +89 -0
- package/src/components/features/insights/InstallationHistoryCard.tsx +52 -10
- package/src/components/features/insights/InstallationMatchesCard.tsx +1 -1
- package/src/components/features/insights/ReleaseActivity.tsx +188 -0
- package/src/components/features/insights/ReportingDevicesSummary.tsx +65 -0
- package/src/components/features/insights/UpdateFailures.tsx +319 -0
- package/src/components/features/insights/insightsFeatureUi.tsx +35 -0
- package/src/components/features/releases/ReleaseEditorSheet.tsx +30 -7
- package/src/components/ui/card.tsx +1 -1
- package/src/components/ui/empty.tsx +101 -0
- package/src/components/ui/scroll-area.tsx +52 -0
- package/src/components/ui/sidebar.tsx +22 -29
- package/src/components/ui/tabs.tsx +81 -0
- package/src/index.ts +26 -19
- package/src/lib/api-keys-api.ts +0 -28
- package/src/lib/api-keys-rpc.ts +27 -38
- package/src/lib/api-rpc.ts +189 -266
- package/src/lib/api.ts +19 -102
- package/src/lib/bundle-activity.ts +31 -0
- package/src/lib/console-access.ts +20 -0
- package/src/lib/console-features-api.ts +68 -0
- package/src/lib/console-features-rpc.ts +13 -0
- package/src/lib/console-features.ts +91 -0
- package/src/lib/insights-api.ts +37 -1
- package/src/lib/insights-failures-rpc.ts +21 -0
- package/src/lib/insights-failures.ts +129 -0
- package/src/lib/insights-recovery-rpc.ts +51 -0
- package/src/lib/insights-recovery.ts +68 -0
- package/src/lib/insights-retention.ts +21 -0
- package/src/lib/insights-rpc.ts +30 -12
- package/src/lib/insights-search.ts +58 -0
- package/src/lib/insights-usage-rpc.ts +29 -0
- package/src/lib/insights-usage.ts +74 -0
- package/src/lib/insights-view.ts +38 -2
- package/src/lib/scroll-restoration.ts +21 -0
- package/src/lib/server/adminInsights.ts +124 -0
- package/src/lib/server/auth.server.ts +13 -5
- package/src/lib/server/bundleActivity.ts +37 -0
- package/src/lib/server/config.server.ts +21 -74
- package/src/lib/server/console-feature-apis.ts +59 -0
- package/src/lib/server/console-runtime.server.ts +82 -38
- package/src/lib/server/downloadBundle.ts +16 -15
- package/src/lib/server/getBundleChildren.ts +31 -122
- package/src/lib/server/insightsRecovery.ts +55 -0
- package/src/lib/server/insightsUsage.ts +63 -0
- package/src/lib/server/listReleases.ts +109 -44
- package/src/lib/server/releaseReachability.ts +8 -7
- package/src/lib/server/runtime.server.ts +120 -31
- package/src/lib/server/updateFailures.ts +31 -0
- package/src/routeTree.gen.ts +44 -44
- package/src/router.tsx +3 -2
- package/src/routes/-installations-search.ts +32 -8
- package/src/routes/-releases-search.ts +76 -29
- package/src/routes/__root.tsx +10 -4
- package/src/routes/api/bundles/$bundleId/download.ts +2 -5
- package/src/routes/api-keys.tsx +5 -2
- package/src/routes/index.tsx +167 -104
- package/src/routes/insights.tsx +100 -59
- package/src/routes/insights_.distribution.tsx +398 -0
- package/src/routes/installations.tsx +98 -41
- package/src/vite-internal.ts +15 -3
- package/src/vite.ts +2 -0
- package/.output/public/assets/HashValueDisplay-CB0Eskit.js +0 -1
- package/.output/public/assets/InsightsPageHeader-Car5LNiZ.js +0 -1
- package/.output/public/assets/api-keys-BzKocqRy.js +0 -1
- package/.output/public/assets/api-keys-api-BHcODB7q.js +0 -1
- package/.output/public/assets/card-Dhr_eFYj.js +0 -1
- package/.output/public/assets/chart-no-axes-combined-Dy4WJv2U.js +0 -1
- package/.output/public/assets/composite-Bp98A0Ld.js +0 -1
- package/.output/public/assets/createServerFn-CA8fs7QD.js +0 -3
- package/.output/public/assets/dialog-CUTrcPlB.js +0 -1
- package/.output/public/assets/dist-C_NydL0e.js +0 -1
- package/.output/public/assets/index-DdAz-CXv.js +0 -10
- package/.output/public/assets/input-group-cSOG4wh_.js +0 -1
- package/.output/public/assets/insights-C0PBSZ-n.js +0 -1
- package/.output/public/assets/installations-CE33wgbY.js +0 -2
- package/.output/public/assets/installations-CStZja8x.js +0 -1
- package/.output/public/assets/lazyRouteComponent-Ccp3bwBY.js +0 -1
- package/.output/public/assets/link-CI8idAUi.js +0 -1
- package/.output/public/assets/loader-circle-BoxLrsOu.js +0 -1
- package/.output/public/assets/preload-helper-CQ36nxok.js +0 -1
- package/.output/public/assets/refresh-cw-Bqc72UZG.js +0 -1
- package/.output/public/assets/routes-DGVXdzpw.js +0 -2
- package/.output/public/assets/routes-DTlwOr8I.js +0 -1
- package/.output/public/assets/shield-check-uK3MHWJZ.js +0 -1
- package/.output/public/assets/signing-CMf4aqDO.js +0 -1
- package/.output/public/assets/styles-BCvbtKsm.css +0 -2
- package/.output/public/assets/table-2vcV89QB.js +0 -1
- package/.output/public/assets/useCompositeListItem-CHLITE_4.js +0 -1
- package/.output/public/assets/x-DCd0j8c6.js +0 -1
- package/.output/server/_ssr/InsightsPageHeader-Df4Brj8u.mjs +0 -484
- package/.output/server/_ssr/api-keys-api-BUPQVSpk.mjs +0 -60
- package/.output/server/_ssr/api-keys-rpc-Cs7tS5_j.mjs +0 -136
- package/.output/server/_ssr/api-rpc-tAupfGQm.mjs +0 -1399
- package/.output/server/_ssr/auth.server-DW71WzsD.mjs +0 -47
- package/.output/server/_ssr/bundle-signing-rpc-BhnBw0-d.mjs +0 -16
- package/.output/server/_ssr/bundle-signing.server-C4NW5mWx.mjs +0 -12
- package/.output/server/_ssr/card-BRiPmi0C.mjs +0 -108
- package/.output/server/_ssr/config-Dv8qLDZ0.mjs +0 -13
- package/.output/server/_ssr/config.server-afDuAwaG.mjs +0 -368
- package/.output/server/_ssr/databaseRows-5bCRTxm-.mjs +0 -126
- package/.output/server/_ssr/deleteBundle-BTGwBgzx.mjs +0 -66
- package/.output/server/_ssr/getBundleChildren-C0vh4ZvE.mjs +0 -50
- package/.output/server/_ssr/insights-BdS364Xu.mjs +0 -460
- package/.output/server/_ssr/insightsContract-fjJDBeEE.mjs +0 -303
- package/.output/server/_ssr/installations-CtA59MQG.mjs +0 -29
- package/.output/server/_ssr/routes-CKrrS2q2.mjs +0 -37
- package/.output/server/_ssr/runtime.server-DacU1TBV.mjs +0 -438
- package/.output/server/_ssr/server-D_C2rMzf.mjs +0 -7468
- package/.output/server/_ssr/signing-Dz1WkZOf.mjs +0 -133
- package/.output/server/_ssr/start-DpViQGnt.mjs +0 -4
- package/.output/server/_tanstack-start-manifest_v-2MjTyxil.mjs +0 -97
- package/src/components/features/insights/InsightsBundleReports.tsx +0 -51
- package/src/components/features/signing/BundleSigningPage.tsx +0 -139
- package/src/lib/bundle-signing-api.ts +0 -14
- package/src/lib/bundle-signing-rpc.ts +0 -16
- package/src/lib/server/bundle-signing.server.ts +0 -23
- package/src/lib/server/deleteBundle.ts +0 -145
- package/src/routes/signing.tsx +0 -37
|
@@ -1,121 +1,284 @@
|
|
|
1
1
|
import { useState } from "react";
|
|
2
2
|
|
|
3
|
+
import { PlatformIcon } from "@/components/PlatformIcon";
|
|
3
4
|
import { Button } from "@/components/ui/button";
|
|
5
|
+
import {
|
|
6
|
+
Card,
|
|
7
|
+
CardContent,
|
|
8
|
+
CardDescription,
|
|
9
|
+
CardHeader,
|
|
10
|
+
CardTitle,
|
|
11
|
+
} from "@/components/ui/card";
|
|
12
|
+
import {
|
|
13
|
+
Combobox,
|
|
14
|
+
ComboboxContent,
|
|
15
|
+
ComboboxEmpty,
|
|
16
|
+
ComboboxInput,
|
|
17
|
+
ComboboxItem,
|
|
18
|
+
ComboboxList,
|
|
19
|
+
} from "@/components/ui/combobox";
|
|
4
20
|
import { Field, FieldGroup, FieldLabel } from "@/components/ui/field";
|
|
5
21
|
import { Input } from "@/components/ui/input";
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
22
|
+
import {
|
|
23
|
+
Select,
|
|
24
|
+
SelectContent,
|
|
25
|
+
SelectGroup,
|
|
26
|
+
SelectItem,
|
|
27
|
+
SelectTrigger,
|
|
28
|
+
SelectValue,
|
|
29
|
+
} from "@/components/ui/select";
|
|
30
|
+
import { useChannelsQuery } from "@/lib/api";
|
|
31
|
+
import type { RecoveryInput } from "@/lib/insights-recovery";
|
|
32
|
+
import type { AppUsageScope } from "@/lib/insights-usage";
|
|
14
33
|
|
|
15
34
|
export function InsightsControls({
|
|
16
|
-
|
|
17
|
-
onScopeChange,
|
|
35
|
+
onFiltersChange,
|
|
18
36
|
scope,
|
|
19
|
-
|
|
37
|
+
releaseScope,
|
|
38
|
+
appVersions,
|
|
20
39
|
}: {
|
|
21
|
-
readonly
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
40
|
+
readonly onFiltersChange: (filters: {
|
|
41
|
+
readonly scope: AppUsageScope;
|
|
42
|
+
readonly releaseScope: Pick<
|
|
43
|
+
RecoveryInput,
|
|
44
|
+
"platform" | "channel" | "releaseId"
|
|
45
|
+
>;
|
|
46
|
+
}) => void;
|
|
47
|
+
readonly scope: AppUsageScope;
|
|
48
|
+
readonly releaseScope: Pick<
|
|
49
|
+
RecoveryInput,
|
|
50
|
+
"platform" | "channel" | "releaseId"
|
|
51
|
+
>;
|
|
52
|
+
readonly appVersions: readonly string[];
|
|
27
53
|
}) {
|
|
28
54
|
const [platform, setPlatform] = useState(scope.platform);
|
|
29
55
|
const [channel, setChannel] = useState(scope.channel);
|
|
30
|
-
const [
|
|
56
|
+
const [appVersion, setAppVersion] = useState(scope.appVersion ?? "");
|
|
57
|
+
const [releasePlatform, setReleasePlatform] = useState(releaseScope.platform);
|
|
58
|
+
const [releaseId, setReleaseId] = useState(releaseScope.releaseId ?? "");
|
|
59
|
+
const versions = [
|
|
60
|
+
...new Set([...appVersions, ...(appVersion ? [appVersion] : [])]),
|
|
61
|
+
];
|
|
62
|
+
const channelsQuery = useChannelsQuery();
|
|
63
|
+
const channels = channelsQuery.data?.map((item) => item.name) ?? [];
|
|
31
64
|
|
|
32
65
|
return (
|
|
33
|
-
<
|
|
34
|
-
<
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
</ToggleGroupItem>
|
|
59
|
-
</ToggleGroup>
|
|
60
|
-
</Field>
|
|
61
|
-
<Field>
|
|
62
|
-
<FieldLabel htmlFor="insights-channel">Channel</FieldLabel>
|
|
63
|
-
<Input
|
|
64
|
-
className="h-11 lg:h-8"
|
|
65
|
-
id="insights-channel"
|
|
66
|
-
value={channel}
|
|
67
|
-
onChange={(event) => setChannel(event.target.value)}
|
|
68
|
-
required
|
|
69
|
-
maxLength={1024}
|
|
70
|
-
/>
|
|
71
|
-
</Field>
|
|
72
|
-
<Field>
|
|
73
|
-
<FieldLabel htmlFor="insights-bundle">
|
|
74
|
-
Bundle ID (optional)
|
|
75
|
-
</FieldLabel>
|
|
76
|
-
<Input
|
|
77
|
-
className="h-11 lg:h-8"
|
|
78
|
-
id="insights-bundle"
|
|
79
|
-
placeholder="Select a bundle by ID"
|
|
80
|
-
value={bundleId}
|
|
81
|
-
onChange={(event) => setBundleId(event.target.value)}
|
|
82
|
-
maxLength={1024}
|
|
83
|
-
/>
|
|
84
|
-
</Field>
|
|
85
|
-
<Button
|
|
86
|
-
className="h-11 w-full sm:w-auto lg:h-8"
|
|
87
|
-
type="submit"
|
|
88
|
-
variant="outline"
|
|
89
|
-
>
|
|
90
|
-
Apply filters
|
|
91
|
-
</Button>
|
|
92
|
-
</FieldGroup>
|
|
93
|
-
</form>
|
|
94
|
-
<Field orientation="horizontal" className="w-full">
|
|
95
|
-
<FieldLabel className="sr-only">Reporting period</FieldLabel>
|
|
96
|
-
<ToggleGroup
|
|
97
|
-
aria-label="Reporting period"
|
|
98
|
-
className="w-full sm:w-fit"
|
|
99
|
-
onValueChange={(value) => {
|
|
100
|
-
if (value[0]) onWindowChange(value[0] as InsightsWindow);
|
|
66
|
+
<Card className="shadow-sm">
|
|
67
|
+
<CardHeader className="gap-1 border-b px-5 py-4">
|
|
68
|
+
<CardTitle>Filters</CardTitle>
|
|
69
|
+
<CardDescription>
|
|
70
|
+
Channel applies to all reports. Other filters affect the report named
|
|
71
|
+
in their label.
|
|
72
|
+
</CardDescription>
|
|
73
|
+
</CardHeader>
|
|
74
|
+
<CardContent className="px-5 py-4">
|
|
75
|
+
<form
|
|
76
|
+
aria-label="Insights filters"
|
|
77
|
+
onSubmit={(event) => {
|
|
78
|
+
event.preventDefault();
|
|
79
|
+
onFiltersChange({
|
|
80
|
+
scope: {
|
|
81
|
+
platform,
|
|
82
|
+
channel,
|
|
83
|
+
...(appVersion ? { appVersion } : {}),
|
|
84
|
+
},
|
|
85
|
+
releaseScope: {
|
|
86
|
+
platform: releasePlatform,
|
|
87
|
+
channel,
|
|
88
|
+
...(releaseId.trim() ? { releaseId: releaseId.trim() } : {}),
|
|
89
|
+
},
|
|
90
|
+
});
|
|
101
91
|
}}
|
|
102
|
-
spacing={0}
|
|
103
|
-
size="lg"
|
|
104
|
-
value={[window]}
|
|
105
|
-
variant="outline"
|
|
106
92
|
>
|
|
107
|
-
|
|
108
|
-
<
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
93
|
+
<FieldGroup className="grid grid-cols-1 items-end gap-4 sm:grid-cols-2 xl:grid-cols-[minmax(12rem,1.25fr)_9rem_minmax(10rem,1fr)_9rem_minmax(12rem,1fr)_auto]">
|
|
94
|
+
<Field className="min-w-0">
|
|
95
|
+
<FieldLabel htmlFor="insights-channel">Channel</FieldLabel>
|
|
96
|
+
<Combobox
|
|
97
|
+
items={channels}
|
|
98
|
+
value={channel}
|
|
99
|
+
onValueChange={(value) => {
|
|
100
|
+
if (value !== null) setChannel(value);
|
|
101
|
+
}}
|
|
102
|
+
>
|
|
103
|
+
<ComboboxInput
|
|
104
|
+
className="h-11 w-full sm:h-9 [&_input]:h-full"
|
|
105
|
+
id="insights-channel"
|
|
106
|
+
placeholder="Search channels…"
|
|
107
|
+
maxLength={1024}
|
|
108
|
+
/>
|
|
109
|
+
<ComboboxContent>
|
|
110
|
+
<ComboboxEmpty>
|
|
111
|
+
{channelsQuery.isPending ? (
|
|
112
|
+
"Loading channels…"
|
|
113
|
+
) : channelsQuery.isError ? (
|
|
114
|
+
<div className="flex flex-col items-center gap-2 p-2">
|
|
115
|
+
Couldn't load channels.
|
|
116
|
+
<Button
|
|
117
|
+
onClick={() => void channelsQuery.refetch()}
|
|
118
|
+
size="sm"
|
|
119
|
+
variant="outline"
|
|
120
|
+
>
|
|
121
|
+
Retry channels
|
|
122
|
+
</Button>
|
|
123
|
+
</div>
|
|
124
|
+
) : (
|
|
125
|
+
"No channels found."
|
|
126
|
+
)}
|
|
127
|
+
</ComboboxEmpty>
|
|
128
|
+
<ComboboxList>
|
|
129
|
+
{(item: string) => (
|
|
130
|
+
<ComboboxItem
|
|
131
|
+
className="min-h-11 pr-8 sm:min-h-8"
|
|
132
|
+
key={item}
|
|
133
|
+
value={item}
|
|
134
|
+
>
|
|
135
|
+
<span className="truncate">{item}</span>
|
|
136
|
+
</ComboboxItem>
|
|
137
|
+
)}
|
|
138
|
+
</ComboboxList>
|
|
139
|
+
</ComboboxContent>
|
|
140
|
+
</Combobox>
|
|
141
|
+
</Field>
|
|
142
|
+
<Field>
|
|
143
|
+
<FieldLabel htmlFor="insights-platform">
|
|
144
|
+
Usage platform
|
|
145
|
+
</FieldLabel>
|
|
146
|
+
<Select
|
|
147
|
+
items={{ all: "All platforms", ios: "iOS", android: "Android" }}
|
|
148
|
+
value={platform}
|
|
149
|
+
onValueChange={(value) => {
|
|
150
|
+
if (value === "all" || value === "ios" || value === "android")
|
|
151
|
+
setPlatform(value);
|
|
152
|
+
}}
|
|
153
|
+
>
|
|
154
|
+
<SelectTrigger
|
|
155
|
+
id="insights-platform"
|
|
156
|
+
className="min-h-11 w-full sm:min-h-9"
|
|
157
|
+
>
|
|
158
|
+
<SelectValue>
|
|
159
|
+
{platform !== "all" ? (
|
|
160
|
+
<PlatformIcon platform={platform} className="size-3.5" />
|
|
161
|
+
) : null}
|
|
162
|
+
{platform === "all"
|
|
163
|
+
? "All platforms"
|
|
164
|
+
: platform === "ios"
|
|
165
|
+
? "iOS"
|
|
166
|
+
: "Android"}
|
|
167
|
+
</SelectValue>
|
|
168
|
+
</SelectTrigger>
|
|
169
|
+
<SelectContent>
|
|
170
|
+
<SelectGroup>
|
|
171
|
+
<SelectItem value="all">All platforms</SelectItem>
|
|
172
|
+
<SelectItem value="ios">
|
|
173
|
+
<PlatformIcon platform="ios" className="size-3.5" />
|
|
174
|
+
iOS
|
|
175
|
+
</SelectItem>
|
|
176
|
+
<SelectItem value="android">
|
|
177
|
+
<PlatformIcon platform="android" className="size-3.5" />
|
|
178
|
+
Android
|
|
179
|
+
</SelectItem>
|
|
180
|
+
</SelectGroup>
|
|
181
|
+
</SelectContent>
|
|
182
|
+
</Select>
|
|
183
|
+
</Field>
|
|
184
|
+
<Field className="min-w-0">
|
|
185
|
+
<FieldLabel htmlFor="insights-app-version">
|
|
186
|
+
App version
|
|
187
|
+
</FieldLabel>
|
|
188
|
+
<Select
|
|
189
|
+
items={Object.fromEntries([
|
|
190
|
+
["all", "All versions"],
|
|
191
|
+
...versions.map((version) => [`version:${version}`, version]),
|
|
192
|
+
])}
|
|
193
|
+
value={appVersion ? `version:${appVersion}` : "all"}
|
|
194
|
+
onValueChange={(value) => {
|
|
195
|
+
if (value !== null)
|
|
196
|
+
setAppVersion(value === "all" ? "" : value.slice(8));
|
|
197
|
+
}}
|
|
198
|
+
>
|
|
199
|
+
<SelectTrigger
|
|
200
|
+
id="insights-app-version"
|
|
201
|
+
className="min-h-11 w-full sm:min-h-9"
|
|
202
|
+
>
|
|
203
|
+
<SelectValue />
|
|
204
|
+
</SelectTrigger>
|
|
205
|
+
<SelectContent>
|
|
206
|
+
<SelectGroup>
|
|
207
|
+
<SelectItem value="all">All versions</SelectItem>
|
|
208
|
+
{versions.map((version) => (
|
|
209
|
+
<SelectItem key={version} value={`version:${version}`}>
|
|
210
|
+
{version}
|
|
211
|
+
</SelectItem>
|
|
212
|
+
))}
|
|
213
|
+
</SelectGroup>
|
|
214
|
+
</SelectContent>
|
|
215
|
+
</Select>
|
|
216
|
+
</Field>
|
|
217
|
+
<Field>
|
|
218
|
+
<FieldLabel htmlFor="insights-release-platform">
|
|
219
|
+
Health platform
|
|
220
|
+
</FieldLabel>
|
|
221
|
+
<Select
|
|
222
|
+
items={{ ios: "iOS", android: "Android" }}
|
|
223
|
+
value={releasePlatform}
|
|
224
|
+
onValueChange={(value) => {
|
|
225
|
+
if (value === "ios" || value === "android")
|
|
226
|
+
setReleasePlatform(value);
|
|
227
|
+
}}
|
|
228
|
+
>
|
|
229
|
+
<SelectTrigger
|
|
230
|
+
id="insights-release-platform"
|
|
231
|
+
className="min-h-11 w-full sm:min-h-9"
|
|
232
|
+
>
|
|
233
|
+
<SelectValue>
|
|
234
|
+
<PlatformIcon
|
|
235
|
+
platform={releasePlatform}
|
|
236
|
+
className="size-3.5"
|
|
237
|
+
/>
|
|
238
|
+
{releasePlatform === "ios" ? "iOS" : "Android"}
|
|
239
|
+
</SelectValue>
|
|
240
|
+
</SelectTrigger>
|
|
241
|
+
<SelectContent>
|
|
242
|
+
<SelectGroup>
|
|
243
|
+
<SelectItem value="ios">
|
|
244
|
+
<PlatformIcon platform="ios" className="size-3.5" />
|
|
245
|
+
iOS
|
|
246
|
+
</SelectItem>
|
|
247
|
+
<SelectItem value="android">
|
|
248
|
+
<PlatformIcon platform="android" className="size-3.5" />
|
|
249
|
+
Android
|
|
250
|
+
</SelectItem>
|
|
251
|
+
</SelectGroup>
|
|
252
|
+
</SelectContent>
|
|
253
|
+
</Select>
|
|
254
|
+
</Field>
|
|
255
|
+
<Field className="min-w-0">
|
|
256
|
+
<FieldLabel htmlFor="insights-release-id">
|
|
257
|
+
Release ID{" "}
|
|
258
|
+
<span className="text-muted-foreground">(optional)</span>
|
|
259
|
+
</FieldLabel>
|
|
260
|
+
<Input
|
|
261
|
+
autoComplete="off"
|
|
262
|
+
className="h-11 sm:h-9"
|
|
263
|
+
id="insights-release-id"
|
|
264
|
+
maxLength={1024}
|
|
265
|
+
name="releaseId"
|
|
266
|
+
placeholder="All releases…"
|
|
267
|
+
value={releaseId}
|
|
268
|
+
onChange={(event) => setReleaseId(event.target.value)}
|
|
269
|
+
/>
|
|
270
|
+
</Field>
|
|
271
|
+
<Button
|
|
272
|
+
className="h-11 w-full sm:h-9"
|
|
273
|
+
size="lg"
|
|
274
|
+
type="submit"
|
|
275
|
+
variant="outline"
|
|
113
276
|
>
|
|
114
|
-
|
|
115
|
-
</
|
|
116
|
-
|
|
117
|
-
</
|
|
118
|
-
</
|
|
119
|
-
</
|
|
277
|
+
Apply filters
|
|
278
|
+
</Button>
|
|
279
|
+
</FieldGroup>
|
|
280
|
+
</form>
|
|
281
|
+
</CardContent>
|
|
282
|
+
</Card>
|
|
120
283
|
);
|
|
121
284
|
}
|
|
@@ -1,13 +1,26 @@
|
|
|
1
|
-
import { TriangleAlert } from "lucide-react";
|
|
1
|
+
import { Info, TriangleAlert } from "lucide-react";
|
|
2
2
|
|
|
3
3
|
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";
|
|
4
|
+
import { isConsoleFeatureUnavailableError } from "@/lib/console-features";
|
|
4
5
|
|
|
5
6
|
export function InsightsErrorAlert({
|
|
7
|
+
error,
|
|
6
8
|
fallbackTitle,
|
|
7
9
|
}: {
|
|
8
10
|
readonly error: Error;
|
|
9
11
|
readonly fallbackTitle: string;
|
|
10
12
|
}) {
|
|
13
|
+
// A server restarted without insights() refuses the reads of a page opened
|
|
14
|
+
// before: that is its setup, not a failure.
|
|
15
|
+
if (isConsoleFeatureUnavailableError(error)) {
|
|
16
|
+
return (
|
|
17
|
+
<Alert>
|
|
18
|
+
<Info aria-hidden="true" />
|
|
19
|
+
<AlertTitle>Insights not installed</AlertTitle>
|
|
20
|
+
<AlertDescription>{error.message}</AlertDescription>
|
|
21
|
+
</Alert>
|
|
22
|
+
);
|
|
23
|
+
}
|
|
11
24
|
return (
|
|
12
25
|
<Alert variant="destructive">
|
|
13
26
|
<TriangleAlert aria-hidden="true" />
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { InfoIcon } from "lucide-react";
|
|
2
|
+
import { useId, useState, type ReactNode } from "react";
|
|
3
|
+
|
|
4
|
+
import { Button } from "@/components/ui/button";
|
|
5
|
+
import {
|
|
6
|
+
Tooltip,
|
|
7
|
+
TooltipContent,
|
|
8
|
+
TooltipTrigger,
|
|
9
|
+
} from "@/components/ui/tooltip";
|
|
10
|
+
|
|
11
|
+
export function InsightsInfo({
|
|
12
|
+
label,
|
|
13
|
+
children,
|
|
14
|
+
}: {
|
|
15
|
+
readonly label: string;
|
|
16
|
+
readonly children: ReactNode;
|
|
17
|
+
}) {
|
|
18
|
+
const id = useId();
|
|
19
|
+
const [open, setOpen] = useState(false);
|
|
20
|
+
return (
|
|
21
|
+
<Tooltip open={open} onOpenChange={setOpen} triggerId={id}>
|
|
22
|
+
<TooltipTrigger
|
|
23
|
+
id={id}
|
|
24
|
+
aria-describedby={open ? `${id}-description` : undefined}
|
|
25
|
+
closeOnClick={false}
|
|
26
|
+
onClick={() => setOpen((value) => !value)}
|
|
27
|
+
render={
|
|
28
|
+
<Button
|
|
29
|
+
aria-label={label}
|
|
30
|
+
className="size-11 sm:size-7"
|
|
31
|
+
size="icon"
|
|
32
|
+
variant="ghost"
|
|
33
|
+
/>
|
|
34
|
+
}
|
|
35
|
+
>
|
|
36
|
+
<InfoIcon />
|
|
37
|
+
</TooltipTrigger>
|
|
38
|
+
<TooltipContent
|
|
39
|
+
id={`${id}-description`}
|
|
40
|
+
role="tooltip"
|
|
41
|
+
className="max-w-64"
|
|
42
|
+
side="bottom"
|
|
43
|
+
>
|
|
44
|
+
{children}
|
|
45
|
+
</TooltipContent>
|
|
46
|
+
</Tooltip>
|
|
47
|
+
);
|
|
48
|
+
}
|