@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,139 @@
|
|
|
1
|
+
import type { ActiveInstallationWindow } from "@hot-updater/server";
|
|
2
|
+
import { createFileRoute, useNavigate } from "@tanstack/react-router";
|
|
3
|
+
import { ChartNoAxesCombined } from "lucide-react";
|
|
4
|
+
import { useState } from "react";
|
|
5
|
+
|
|
6
|
+
import { useAnalyticsCapability } from "@/components/features/analytics/AnalyticsCapabilityContext";
|
|
7
|
+
import { AnalyticsControls } from "@/components/features/analytics/AnalyticsControls";
|
|
8
|
+
import { AnalyticsOverview } from "@/components/features/analytics/AnalyticsOverview";
|
|
9
|
+
import type { UpdateOutcomeState } from "@/components/features/analytics/UpdateOutcomes";
|
|
10
|
+
import { SidebarTrigger } from "@/components/ui/sidebar";
|
|
11
|
+
import {
|
|
12
|
+
ensureAnalyticsRouteAccess,
|
|
13
|
+
useActiveInstallationQuery,
|
|
14
|
+
useAnalyticsOverviewQuery,
|
|
15
|
+
} from "@/lib/analytics-api";
|
|
16
|
+
import { useBundleEventAnalyticsQuery } from "@/lib/api";
|
|
17
|
+
|
|
18
|
+
export const Route = createFileRoute("/analytics")({
|
|
19
|
+
beforeLoad: ({ context }) => ensureAnalyticsRouteAccess(context.queryClient),
|
|
20
|
+
component: AnalyticsPage,
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
function AnalyticsPage() {
|
|
24
|
+
const capability = useAnalyticsCapability();
|
|
25
|
+
const navigate = useNavigate();
|
|
26
|
+
const [window, setWindow] = useState<ActiveInstallationWindow>("30d");
|
|
27
|
+
const [selectedBundleId, setSelectedBundleId] = useState("");
|
|
28
|
+
const catalog = useAnalyticsOverviewQuery(capability);
|
|
29
|
+
const active = useActiveInstallationQuery(capability, { window });
|
|
30
|
+
const configuredById = new Map(
|
|
31
|
+
catalog.data?.configuredRollouts.map((rollout) => [
|
|
32
|
+
rollout.bundleId,
|
|
33
|
+
rollout,
|
|
34
|
+
]) ?? [],
|
|
35
|
+
);
|
|
36
|
+
const bundleIds = new Set([
|
|
37
|
+
...(active.data?.bundles.map(({ bundleId }) => bundleId) ?? []),
|
|
38
|
+
...(catalog.data?.configuredRollouts.map(({ bundleId }) => bundleId) ?? []),
|
|
39
|
+
]);
|
|
40
|
+
const bundleOptions = [...bundleIds].map((bundleId) => {
|
|
41
|
+
const configured = configuredById.get(bundleId);
|
|
42
|
+
const appVersion = configured?.bundle.targetAppVersion ?? "all versions";
|
|
43
|
+
return {
|
|
44
|
+
bundleId,
|
|
45
|
+
description: configured
|
|
46
|
+
? `${configured.bundle.platform === "ios" ? "iOS" : "Android"} · ${configured.bundle.channel} · ${appVersion}`
|
|
47
|
+
: "Metadata unavailable",
|
|
48
|
+
};
|
|
49
|
+
});
|
|
50
|
+
const bundleId = bundleIds.has(selectedBundleId)
|
|
51
|
+
? selectedBundleId
|
|
52
|
+
: (bundleOptions[0]?.bundleId ?? "");
|
|
53
|
+
const outcomes = useBundleEventAnalyticsQuery(
|
|
54
|
+
{
|
|
55
|
+
bundleId,
|
|
56
|
+
window,
|
|
57
|
+
limit: 1,
|
|
58
|
+
offset: 0,
|
|
59
|
+
},
|
|
60
|
+
capability.status === "supported" && bundleId.length > 0,
|
|
61
|
+
);
|
|
62
|
+
const outcomeState: UpdateOutcomeState = !bundleId
|
|
63
|
+
? { status: "idle" }
|
|
64
|
+
: outcomes.isLoading
|
|
65
|
+
? { status: "loading", bundleId }
|
|
66
|
+
: outcomes.error
|
|
67
|
+
? { status: "error", bundleId, error: outcomes.error }
|
|
68
|
+
: outcomes.data
|
|
69
|
+
? {
|
|
70
|
+
status: "success",
|
|
71
|
+
bundleId,
|
|
72
|
+
data: outcomes.data,
|
|
73
|
+
}
|
|
74
|
+
: { status: "loading", bundleId };
|
|
75
|
+
const analyticsError = active.error ?? catalog.error;
|
|
76
|
+
|
|
77
|
+
return (
|
|
78
|
+
<div className="flex h-svh min-h-0 flex-col">
|
|
79
|
+
<header className="sticky top-0 z-10 flex shrink-0 flex-wrap items-center gap-x-3 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">
|
|
80
|
+
<SidebarTrigger className="-ml-1" />
|
|
81
|
+
<div className="flex items-center gap-1.5">
|
|
82
|
+
<ChartNoAxesCombined
|
|
83
|
+
aria-hidden="true"
|
|
84
|
+
className="size-3.5 text-muted-foreground"
|
|
85
|
+
/>
|
|
86
|
+
<h1 className="text-sm font-medium">Analytics</h1>
|
|
87
|
+
</div>
|
|
88
|
+
<p className="basis-full pl-9 text-xs text-muted-foreground sm:basis-auto sm:pl-0">
|
|
89
|
+
Bundle adoption and movement over time.
|
|
90
|
+
</p>
|
|
91
|
+
</header>
|
|
92
|
+
|
|
93
|
+
<div className="min-h-0 min-w-0 flex-1 overflow-y-auto bg-muted/5 p-3 sm:p-6">
|
|
94
|
+
<div className="mx-auto flex w-full max-w-6xl flex-col gap-6">
|
|
95
|
+
{capability.status === "supported" &&
|
|
96
|
+
capability.mode === "bounded" ? (
|
|
97
|
+
<p className="text-xs text-muted-foreground">
|
|
98
|
+
This database scans up to{" "}
|
|
99
|
+
{capability.maxMatchingRows.toLocaleString()} matching analytics
|
|
100
|
+
records per query.
|
|
101
|
+
</p>
|
|
102
|
+
) : null}
|
|
103
|
+
<AnalyticsControls
|
|
104
|
+
onInstallationSearch={(query) => {
|
|
105
|
+
void navigate({
|
|
106
|
+
to: "/installations",
|
|
107
|
+
search: {
|
|
108
|
+
query,
|
|
109
|
+
installId: undefined,
|
|
110
|
+
searchOffset: 0,
|
|
111
|
+
historyOffset: 0,
|
|
112
|
+
},
|
|
113
|
+
});
|
|
114
|
+
}}
|
|
115
|
+
onWindowChange={setWindow}
|
|
116
|
+
window={window}
|
|
117
|
+
/>
|
|
118
|
+
{active.isLoading || catalog.isLoading ? (
|
|
119
|
+
<AnalyticsOverview status="loading" />
|
|
120
|
+
) : analyticsError ? (
|
|
121
|
+
<AnalyticsOverview status="error" error={analyticsError} />
|
|
122
|
+
) : active.data && catalog.data ? (
|
|
123
|
+
<AnalyticsOverview
|
|
124
|
+
active={active.data}
|
|
125
|
+
bundleId={bundleId}
|
|
126
|
+
bundles={bundleOptions}
|
|
127
|
+
catalog={catalog.data}
|
|
128
|
+
onBundleChange={setSelectedBundleId}
|
|
129
|
+
outcomes={outcomeState}
|
|
130
|
+
status="success"
|
|
131
|
+
/>
|
|
132
|
+
) : (
|
|
133
|
+
<AnalyticsOverview status="loading" />
|
|
134
|
+
)}
|
|
135
|
+
</div>
|
|
136
|
+
</div>
|
|
137
|
+
</div>
|
|
138
|
+
);
|
|
139
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { createFileRoute } from "@tanstack/react-router";
|
|
2
|
+
|
|
3
|
+
const handleAuthRequest = async ({
|
|
4
|
+
request,
|
|
5
|
+
}: {
|
|
6
|
+
readonly request: Request;
|
|
7
|
+
}) => {
|
|
8
|
+
const { handleConsoleAuth } = await import("@/lib/server/auth.server");
|
|
9
|
+
return handleConsoleAuth(request);
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export const Route = createFileRoute("/api/auth/$")({
|
|
13
|
+
server: {
|
|
14
|
+
handlers: {
|
|
15
|
+
GET: handleAuthRequest,
|
|
16
|
+
POST: handleAuthRequest,
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { createFileRoute } from "@tanstack/react-router";
|
|
2
|
+
|
|
3
|
+
export const Route = createFileRoute("/api/bundles/$bundleId/download")({
|
|
4
|
+
server: {
|
|
5
|
+
handlers: {
|
|
6
|
+
GET: async ({ params, request }) => {
|
|
7
|
+
const { prepareConfig } = await import("@/lib/server/config.server");
|
|
8
|
+
const { downloadBundle } = await import("@/lib/server/downloadBundle");
|
|
9
|
+
const { databaseClient, storagePlugin } = await prepareConfig(request);
|
|
10
|
+
return downloadBundle(params.bundleId, {
|
|
11
|
+
databaseClient,
|
|
12
|
+
storagePlugin,
|
|
13
|
+
});
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
});
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { createFileRoute } from "@tanstack/react-router";
|
|
2
|
+
import { KeyRound } from "lucide-react";
|
|
3
|
+
|
|
4
|
+
import { ApiKeysPage } from "@/components/features/api-keys/ApiKeysPage";
|
|
5
|
+
import { SidebarTrigger } from "@/components/ui/sidebar";
|
|
6
|
+
import { ensureApiKeyRouteAccess } from "@/lib/api-keys-api";
|
|
7
|
+
|
|
8
|
+
export const Route = createFileRoute("/api-keys")({
|
|
9
|
+
beforeLoad: ({ context }) => ensureApiKeyRouteAccess(context.queryClient),
|
|
10
|
+
component: ApiKeysRoute,
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
function ApiKeysRoute() {
|
|
14
|
+
return (
|
|
15
|
+
<div className="flex h-svh min-h-0 flex-col">
|
|
16
|
+
<header className="sticky top-0 z-10 flex shrink-0 flex-wrap items-center gap-x-3 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">
|
|
17
|
+
<SidebarTrigger className="-ml-1" />
|
|
18
|
+
<div className="flex items-center gap-1.5">
|
|
19
|
+
<KeyRound
|
|
20
|
+
aria-hidden="true"
|
|
21
|
+
className="size-3.5 text-muted-foreground"
|
|
22
|
+
/>
|
|
23
|
+
<h1 className="text-sm font-medium">API keys</h1>
|
|
24
|
+
</div>
|
|
25
|
+
<p className="basis-full pl-9 text-xs text-muted-foreground sm:basis-auto sm:pl-0">
|
|
26
|
+
API keys can download OTA updates and submit analytics only.
|
|
27
|
+
</p>
|
|
28
|
+
</header>
|
|
29
|
+
|
|
30
|
+
<div className="min-h-0 min-w-0 flex-1 overflow-y-auto bg-muted/5 p-3 sm:p-6">
|
|
31
|
+
<div className="mx-auto w-full max-w-5xl">
|
|
32
|
+
<ApiKeysPage />
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
);
|
|
37
|
+
}
|