create-expo-updates-server 0.3.0 → 0.4.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/dist/template/README.md +1 -1
- package/dist/template/app/updates/[encodedKey]/page.tsx +55 -33
- package/dist/template/app/updates/devices/page.tsx +13 -7
- package/dist/template/app/updates/embedded/page.tsx +25 -13
- package/dist/template/app/updates/emergency-redirects/page.tsx +70 -38
- package/dist/template/app/updates/page.tsx +33 -20
- package/dist/template/components/admin/admin-shell.tsx +11 -5
- package/dist/template/components/admin/language-switcher.tsx +5 -2
- package/dist/template/components/ui/dialog.tsx +13 -4
- package/dist/template/components/ui/sheet.tsx +6 -2
- package/dist/template/components/ui/sidebar.tsx +62 -17
- package/dist/template/docs/admin-ui.md +18 -24
- package/dist/template/docs/device-targeting.md +4 -5
- package/dist/template/docs/getting-started.ru.md +11 -544
- package/dist/template/docs/index.md +1 -1
- package/dist/template/docs/installation-telemetry.md +4 -4
- package/dist/template/docs/operations-guide.md +1 -1
- package/dist/template/docs/ota-emergency-recovery.md +34 -57
- package/dist/template/docs/ru/admin-ui.md +29 -0
- package/dist/template/docs/ru/device-targeting.md +59 -0
- package/dist/template/docs/ru/doctor.md +98 -0
- package/dist/template/docs/ru/expo-app-setup.md +497 -0
- package/dist/template/docs/ru/getting-started.md +391 -0
- package/dist/template/docs/ru/index.md +50 -0
- package/dist/template/docs/ru/installation-telemetry.md +125 -0
- package/dist/template/docs/ru/npm-installer.md +71 -0
- package/dist/template/docs/ru/operations-guide.md +317 -0
- package/dist/template/docs/ru/ota-client-lifecycle.md +167 -0
- package/dist/template/docs/ru/ota-emergency-recovery.md +108 -0
- package/dist/template/docs/ru/ota-update-policy.md +67 -0
- package/dist/template/docs/ru/publishing-npm-installer.md +49 -0
- package/dist/template/docs/ru/supabase-setup.md +120 -0
- package/dist/template/docs/uk/admin-ui.md +29 -0
- package/dist/template/docs/uk/device-targeting.md +59 -0
- package/dist/template/docs/uk/doctor.md +98 -0
- package/dist/template/docs/uk/expo-app-setup.md +497 -0
- package/dist/template/docs/uk/getting-started.md +391 -0
- package/dist/template/docs/uk/index.md +50 -0
- package/dist/template/docs/uk/installation-telemetry.md +125 -0
- package/dist/template/docs/uk/npm-installer.md +71 -0
- package/dist/template/docs/uk/operations-guide.md +317 -0
- package/dist/template/docs/uk/ota-client-lifecycle.md +167 -0
- package/dist/template/docs/uk/ota-emergency-recovery.md +108 -0
- package/dist/template/docs/uk/ota-update-policy.md +67 -0
- package/dist/template/docs/uk/publishing-npm-installer.md +49 -0
- package/dist/template/docs/uk/supabase-setup.md +120 -0
- package/dist/template/package.json +1 -0
- package/dist/template/src/client/devices/analytics.tsx +21 -8
- package/dist/template/src/client/devices/device-name.tsx +3 -1
- package/dist/template/src/client/devices/registry.tsx +38 -19
- package/dist/template/src/client/devices/version-adoption-chart.tsx +22 -10
- package/dist/template/src/client/distribution-control.tsx +27 -14
- package/dist/template/src/client/guard-action-combobox.test.ts +1 -1
- package/dist/template/src/client/guard-action-combobox.tsx +16 -10
- package/dist/template/src/client/i18n/en.json +203 -1
- package/dist/template/src/client/i18n/language-switching.test.tsx +224 -0
- package/dist/template/src/client/i18n/messages.test.ts +102 -19
- package/dist/template/src/client/i18n/messages.ts +31 -16
- package/dist/template/src/client/i18n/provider.tsx +6 -3
- package/dist/template/src/client/i18n/ru.json +488 -0
- package/dist/template/src/client/i18n/uk.json +488 -0
- package/dist/template/src/client/i18n/use-formatters.ts +5 -0
- package/dist/template/src/client/update-audience-editor.tsx +18 -11
- package/dist/template/src/client/update-policy-editor.tsx +64 -39
- package/dist/template-manifest.json +224 -69
- package/package.json +1 -1
|
@@ -65,7 +65,9 @@ export default function UpdatesPage() {
|
|
|
65
65
|
|
|
66
66
|
const hasRollbackActive = items.some((item) => item.isRollbackActive);
|
|
67
67
|
const hasIgnoredUpdates = items.some((item) => item.isIgnoredByRollback);
|
|
68
|
-
const lockedScopes = rollbackScopes.filter(
|
|
68
|
+
const lockedScopes = rollbackScopes.filter(
|
|
69
|
+
(scope) => scope.rollbackActive,
|
|
70
|
+
);
|
|
69
71
|
|
|
70
72
|
const loadUpdates = useCallback(async () => {
|
|
71
73
|
setLoading(true);
|
|
@@ -83,7 +85,9 @@ export default function UpdatesPage() {
|
|
|
83
85
|
setTotalPages(response.totalPages);
|
|
84
86
|
setTotal(response.total);
|
|
85
87
|
} catch (loadError: unknown) {
|
|
86
|
-
setError(
|
|
88
|
+
setError(
|
|
89
|
+
(loadError as Error).message || "Не удалось загрузить список",
|
|
90
|
+
);
|
|
87
91
|
} finally {
|
|
88
92
|
setLoading(false);
|
|
89
93
|
}
|
|
@@ -97,7 +101,9 @@ export default function UpdatesPage() {
|
|
|
97
101
|
<div className="mx-auto max-w-[1600px] space-y-6 p-4 md:p-8">
|
|
98
102
|
<header className="flex flex-wrap items-start justify-between gap-4">
|
|
99
103
|
<div className="space-y-1">
|
|
100
|
-
<h1 className="text-2xl font-semibold tracking-tight">
|
|
104
|
+
<h1 className="text-2xl font-semibold tracking-tight">
|
|
105
|
+
{t("OTA Updates")}
|
|
106
|
+
</h1>
|
|
101
107
|
<p className="text-sm text-muted-foreground">
|
|
102
108
|
{t("Публикации, версии и управление доставкой обновлений.")}
|
|
103
109
|
</p>
|
|
@@ -138,7 +144,7 @@ export default function UpdatesPage() {
|
|
|
138
144
|
)}
|
|
139
145
|
{lockedScopes.length > 0 && (
|
|
140
146
|
<p className="text-xs text-muted-foreground">
|
|
141
|
-
Rollback lock:{" "}
|
|
147
|
+
{t("Rollback lock:")}{" "}
|
|
142
148
|
{lockedScopes
|
|
143
149
|
.map(
|
|
144
150
|
(scope) =>
|
|
@@ -187,7 +193,7 @@ export default function UpdatesPage() {
|
|
|
187
193
|
}
|
|
188
194
|
>
|
|
189
195
|
<ArrowDownUp />
|
|
190
|
-
{order === "asc" ? "
|
|
196
|
+
{order === "asc" ? t("Ascending") : t("Descending")}
|
|
191
197
|
</Button>
|
|
192
198
|
</div>
|
|
193
199
|
</div>
|
|
@@ -195,12 +201,14 @@ export default function UpdatesPage() {
|
|
|
195
201
|
<TableHeader>
|
|
196
202
|
<TableRow className="bg-muted/40 hover:bg-muted/40">
|
|
197
203
|
<TableHead className="pl-5">{t("Обновление")}</TableHead>
|
|
198
|
-
<TableHead>Runtime / App</TableHead>
|
|
204
|
+
<TableHead>{t("Runtime / App")}</TableHead>
|
|
199
205
|
<TableHead>{t("Платформа / канал")}</TableHead>
|
|
200
206
|
<TableHead>{t("Состояние")}</TableHead>
|
|
201
207
|
<TableHead>{t("Доставка")}</TableHead>
|
|
202
|
-
<TableHead>Assets</TableHead>
|
|
203
|
-
<TableHead className="pr-5 text-right">
|
|
208
|
+
<TableHead>{t("Assets")}</TableHead>
|
|
209
|
+
<TableHead className="pr-5 text-right">
|
|
210
|
+
{t("Создано")}
|
|
211
|
+
</TableHead>
|
|
204
212
|
</TableRow>
|
|
205
213
|
</TableHeader>
|
|
206
214
|
<TableBody>
|
|
@@ -221,7 +229,9 @@ export default function UpdatesPage() {
|
|
|
221
229
|
<Package className="mx-auto mb-3 size-8 text-muted-foreground/50" />
|
|
222
230
|
<p className="font-medium">{t("Обновлений пока нет")}</p>
|
|
223
231
|
<p className="mt-1 text-sm text-muted-foreground">
|
|
224
|
-
{t(
|
|
232
|
+
{t(
|
|
233
|
+
"Опубликуйте OTA, чтобы управлять его доставкой здесь.",
|
|
234
|
+
)}
|
|
225
235
|
</p>
|
|
226
236
|
</TableCell>
|
|
227
237
|
</TableRow>
|
|
@@ -253,7 +263,7 @@ export default function UpdatesPage() {
|
|
|
253
263
|
<TableCell>
|
|
254
264
|
<p className="font-medium">{item.runtimeVersion}</p>
|
|
255
265
|
<p className="mt-1 text-xs text-muted-foreground">
|
|
256
|
-
App {item.appVersion || "—"}
|
|
266
|
+
{t("App")} {item.appVersion || "—"}
|
|
257
267
|
</p>
|
|
258
268
|
</TableCell>
|
|
259
269
|
<TableCell>
|
|
@@ -276,9 +286,11 @@ export default function UpdatesPage() {
|
|
|
276
286
|
: ""
|
|
277
287
|
}
|
|
278
288
|
>
|
|
279
|
-
{item.status}
|
|
289
|
+
{t(item.status)}
|
|
280
290
|
</Badge>
|
|
281
|
-
{item.isLatest &&
|
|
291
|
+
{item.isLatest && (
|
|
292
|
+
<Badge variant="outline">{t("Latest")}</Badge>
|
|
293
|
+
)}
|
|
282
294
|
{item.audienceMode === "devices" && (
|
|
283
295
|
<Badge variant="outline">
|
|
284
296
|
{t("Выбранные устройства")}
|
|
@@ -293,29 +305,30 @@ export default function UpdatesPage() {
|
|
|
293
305
|
<div className="flex flex-wrap gap-1.5">
|
|
294
306
|
<Badge variant="outline">
|
|
295
307
|
{item.deliveryMode === "background"
|
|
296
|
-
? "Background"
|
|
297
|
-
: "Manual"}
|
|
308
|
+
? t("Background")
|
|
309
|
+
: t("Manual")}
|
|
298
310
|
</Badge>
|
|
299
311
|
{item.hasGuard && (
|
|
300
|
-
<Badge variant="secondary">Guard</Badge>
|
|
312
|
+
<Badge variant="secondary">{t("Guard")}</Badge>
|
|
301
313
|
)}
|
|
302
314
|
</div>
|
|
303
315
|
<p
|
|
304
316
|
className={`mt-1.5 text-xs ${item.isRollbackActive ? "text-amber-600" : "text-muted-foreground"}`}
|
|
305
317
|
>
|
|
306
318
|
{item.isRollbackActive
|
|
307
|
-
? "Rollback"
|
|
319
|
+
? t("Rollback")
|
|
308
320
|
: item.isIgnoredByRollback
|
|
309
|
-
? "Ignored by rollback"
|
|
310
|
-
: "Scope open"}
|
|
321
|
+
? t("Ignored by rollback")
|
|
322
|
+
: t("Scope open")}
|
|
311
323
|
</p>
|
|
312
324
|
</TableCell>
|
|
313
325
|
<TableCell className="tabular-nums text-muted-foreground">
|
|
314
326
|
{item.assetsCount}
|
|
315
327
|
</TableCell>
|
|
316
328
|
<TableCell className="pr-5 text-right text-xs tabular-nums text-muted-foreground">
|
|
317
|
-
{new Date(item.createdAt).toLocaleString(
|
|
318
|
-
|
|
329
|
+
{new Date(item.createdAt).toLocaleString(
|
|
330
|
+
formatLocale,
|
|
331
|
+
) || item.createdAtPath}
|
|
319
332
|
</TableCell>
|
|
320
333
|
</TableRow>
|
|
321
334
|
))}
|
|
@@ -101,7 +101,9 @@ export function AdminShell({
|
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
103
|
return (
|
|
104
|
-
<SidebarProvider
|
|
104
|
+
<SidebarProvider
|
|
105
|
+
style={{ "--sidebar-width": "14rem" } as CSSProperties}
|
|
106
|
+
>
|
|
105
107
|
<a
|
|
106
108
|
href="#main-content"
|
|
107
109
|
className="sr-only focus:not-sr-only focus:fixed focus:left-4 focus:top-4 focus:z-50 focus:rounded focus:bg-card focus:p-3"
|
|
@@ -120,7 +122,7 @@ export function AdminShell({
|
|
|
120
122
|
<span>
|
|
121
123
|
OTA Console
|
|
122
124
|
<span className="block text-[10px] font-medium uppercase tracking-[.18em] text-muted-foreground">
|
|
123
|
-
Release workspace
|
|
125
|
+
{t("Release workspace")}
|
|
124
126
|
</span>
|
|
125
127
|
</span>
|
|
126
128
|
</Link>
|
|
@@ -142,7 +144,9 @@ export function AdminShell({
|
|
|
142
144
|
<p className="truncate text-sm font-medium text-foreground">
|
|
143
145
|
{session.username}
|
|
144
146
|
</p>
|
|
145
|
-
<p className="text-xs text-muted-foreground">
|
|
147
|
+
<p className="text-xs text-muted-foreground">
|
|
148
|
+
{t(session.role)}
|
|
149
|
+
</p>
|
|
146
150
|
</div>
|
|
147
151
|
</div>
|
|
148
152
|
{error && (
|
|
@@ -164,8 +168,10 @@ export function AdminShell({
|
|
|
164
168
|
<SidebarInset className="min-w-0 bg-background">
|
|
165
169
|
<header className="flex h-16 shrink-0 items-center justify-between gap-4 border-b bg-card/80 px-4 md:px-8">
|
|
166
170
|
<div className="flex items-center gap-3">
|
|
167
|
-
<SidebarTrigger
|
|
168
|
-
|
|
171
|
+
<SidebarTrigger
|
|
172
|
+
aria-label={t("Открыть или скрыть навигацию")}
|
|
173
|
+
/>
|
|
174
|
+
<span className="hidden text-sm text-muted-foreground sm:inline">
|
|
169
175
|
{t("Управление обновлениями")}
|
|
170
176
|
</span>
|
|
171
177
|
</div>
|
|
@@ -4,8 +4,8 @@ import { useI18n } from "@/src/client/i18n/provider";
|
|
|
4
4
|
import { resolveLocale } from "@/src/client/i18n/messages";
|
|
5
5
|
|
|
6
6
|
export function LanguageSwitcher() {
|
|
7
|
-
const { locale, setLocale } = useI18n();
|
|
8
|
-
const label =
|
|
7
|
+
const { locale, setLocale, t } = useI18n();
|
|
8
|
+
const label = t("Interface language");
|
|
9
9
|
return (
|
|
10
10
|
<select
|
|
11
11
|
aria-label={label}
|
|
@@ -20,6 +20,9 @@ export function LanguageSwitcher() {
|
|
|
20
20
|
<option value="ru" lang="ru">
|
|
21
21
|
Русский
|
|
22
22
|
</option>
|
|
23
|
+
<option value="uk" lang="uk">
|
|
24
|
+
Українська
|
|
25
|
+
</option>
|
|
23
26
|
</select>
|
|
24
27
|
);
|
|
25
28
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { useI18n } from "@/src/client/i18n/provider";
|
|
2
3
|
|
|
3
4
|
import * as React from "react";
|
|
4
5
|
import { cn } from "@/lib/utils";
|
|
@@ -55,6 +56,7 @@ function DialogContent({
|
|
|
55
56
|
}: React.ComponentProps<typeof DialogPrimitive.Content> & {
|
|
56
57
|
showCloseButton?: boolean;
|
|
57
58
|
}) {
|
|
59
|
+
const { t } = useI18n();
|
|
58
60
|
return (
|
|
59
61
|
<DialogPortal data-slot="dialog-portal">
|
|
60
62
|
<DialogOverlay />
|
|
@@ -73,7 +75,7 @@ function DialogContent({
|
|
|
73
75
|
className="absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4"
|
|
74
76
|
>
|
|
75
77
|
<XIcon />
|
|
76
|
-
<span className="sr-only">Close</span>
|
|
78
|
+
<span className="sr-only">{t("Close")}</span>
|
|
77
79
|
</DialogPrimitive.Close>
|
|
78
80
|
)}
|
|
79
81
|
</DialogPrimitive.Content>
|
|
@@ -81,11 +83,17 @@ function DialogContent({
|
|
|
81
83
|
);
|
|
82
84
|
}
|
|
83
85
|
|
|
84
|
-
function DialogHeader({
|
|
86
|
+
function DialogHeader({
|
|
87
|
+
className,
|
|
88
|
+
...props
|
|
89
|
+
}: React.ComponentProps<"div">) {
|
|
85
90
|
return (
|
|
86
91
|
<div
|
|
87
92
|
data-slot="dialog-header"
|
|
88
|
-
className={cn(
|
|
93
|
+
className={cn(
|
|
94
|
+
"flex flex-col gap-2 text-center sm:text-left",
|
|
95
|
+
className,
|
|
96
|
+
)}
|
|
89
97
|
{...props}
|
|
90
98
|
/>
|
|
91
99
|
);
|
|
@@ -99,6 +107,7 @@ function DialogFooter({
|
|
|
99
107
|
}: React.ComponentProps<"div"> & {
|
|
100
108
|
showCloseButton?: boolean;
|
|
101
109
|
}) {
|
|
110
|
+
const { t } = useI18n();
|
|
102
111
|
return (
|
|
103
112
|
<div
|
|
104
113
|
data-slot="dialog-footer"
|
|
@@ -111,7 +120,7 @@ function DialogFooter({
|
|
|
111
120
|
{children}
|
|
112
121
|
{showCloseButton && (
|
|
113
122
|
<DialogPrimitive.Close asChild>
|
|
114
|
-
<Button variant="outline">Close</Button>
|
|
123
|
+
<Button variant="outline">{t("Close")}</Button>
|
|
115
124
|
</DialogPrimitive.Close>
|
|
116
125
|
)}
|
|
117
126
|
</div>
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { useI18n } from "@/src/client/i18n/provider";
|
|
2
3
|
|
|
3
4
|
import * as React from "react";
|
|
4
5
|
import { cn } from "@/lib/utils";
|
|
5
6
|
import { XIcon } from "lucide-react";
|
|
6
7
|
import { Dialog as SheetPrimitive } from "radix-ui";
|
|
7
8
|
|
|
8
|
-
function Sheet({
|
|
9
|
+
function Sheet({
|
|
10
|
+
...props
|
|
11
|
+
}: React.ComponentProps<typeof SheetPrimitive.Root>) {
|
|
9
12
|
return <SheetPrimitive.Root data-slot="sheet" {...props} />;
|
|
10
13
|
}
|
|
11
14
|
|
|
@@ -53,6 +56,7 @@ function SheetContent({
|
|
|
53
56
|
side?: "top" | "right" | "bottom" | "left";
|
|
54
57
|
showCloseButton?: boolean;
|
|
55
58
|
}) {
|
|
59
|
+
const { t } = useI18n();
|
|
56
60
|
return (
|
|
57
61
|
<SheetPortal>
|
|
58
62
|
<SheetOverlay />
|
|
@@ -76,7 +80,7 @@ function SheetContent({
|
|
|
76
80
|
{showCloseButton && (
|
|
77
81
|
<SheetPrimitive.Close className="absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-secondary">
|
|
78
82
|
<XIcon className="size-4" />
|
|
79
|
-
<span className="sr-only">Close</span>
|
|
83
|
+
<span className="sr-only">{t("Close")}</span>
|
|
80
84
|
</SheetPrimitive.Close>
|
|
81
85
|
)}
|
|
82
86
|
</SheetPrimitive.Content>
|
|
@@ -44,7 +44,9 @@ type SidebarContextProps = {
|
|
|
44
44
|
triggerRef: React.RefObject<HTMLButtonElement | null>;
|
|
45
45
|
};
|
|
46
46
|
|
|
47
|
-
const SidebarContext = React.createContext<SidebarContextProps | null>(
|
|
47
|
+
const SidebarContext = React.createContext<SidebarContextProps | null>(
|
|
48
|
+
null,
|
|
49
|
+
);
|
|
48
50
|
|
|
49
51
|
function useSidebar() {
|
|
50
52
|
const context = React.useContext(SidebarContext);
|
|
@@ -93,7 +95,9 @@ function SidebarProvider({
|
|
|
93
95
|
|
|
94
96
|
// Helper to toggle the sidebar.
|
|
95
97
|
const toggleSidebar = React.useCallback(() => {
|
|
96
|
-
return isMobile
|
|
98
|
+
return isMobile
|
|
99
|
+
? setOpenMobile((open) => !open)
|
|
100
|
+
: setOpen((open) => !open);
|
|
97
101
|
}, [isMobile, setOpen, setOpenMobile]);
|
|
98
102
|
|
|
99
103
|
// Adds a keyboard shortcut to toggle the sidebar.
|
|
@@ -127,7 +131,15 @@ function SidebarProvider({
|
|
|
127
131
|
toggleSidebar,
|
|
128
132
|
triggerRef,
|
|
129
133
|
}),
|
|
130
|
-
[
|
|
134
|
+
[
|
|
135
|
+
state,
|
|
136
|
+
open,
|
|
137
|
+
setOpen,
|
|
138
|
+
isMobile,
|
|
139
|
+
openMobile,
|
|
140
|
+
setOpenMobile,
|
|
141
|
+
toggleSidebar,
|
|
142
|
+
],
|
|
131
143
|
);
|
|
132
144
|
|
|
133
145
|
return (
|
|
@@ -270,6 +282,7 @@ function SidebarTrigger({
|
|
|
270
282
|
onClick,
|
|
271
283
|
...props
|
|
272
284
|
}: React.ComponentProps<typeof Button>) {
|
|
285
|
+
const { t } = useI18n();
|
|
273
286
|
const { toggleSidebar, triggerRef } = useSidebar();
|
|
274
287
|
|
|
275
288
|
return (
|
|
@@ -287,22 +300,26 @@ function SidebarTrigger({
|
|
|
287
300
|
{...props}
|
|
288
301
|
>
|
|
289
302
|
<PanelLeftIcon />
|
|
290
|
-
<span className="sr-only">Toggle Sidebar</span>
|
|
303
|
+
<span className="sr-only">{t("Toggle Sidebar")}</span>
|
|
291
304
|
</Button>
|
|
292
305
|
);
|
|
293
306
|
}
|
|
294
307
|
|
|
295
|
-
function SidebarRail({
|
|
308
|
+
function SidebarRail({
|
|
309
|
+
className,
|
|
310
|
+
...props
|
|
311
|
+
}: React.ComponentProps<"button">) {
|
|
312
|
+
const { t } = useI18n();
|
|
296
313
|
const { toggleSidebar } = useSidebar();
|
|
297
314
|
|
|
298
315
|
return (
|
|
299
316
|
<button
|
|
300
317
|
data-sidebar="rail"
|
|
301
318
|
data-slot="sidebar-rail"
|
|
302
|
-
aria-label="Toggle Sidebar"
|
|
319
|
+
aria-label={t("Toggle Sidebar")}
|
|
303
320
|
tabIndex={-1}
|
|
304
321
|
onClick={toggleSidebar}
|
|
305
|
-
title="Toggle Sidebar"
|
|
322
|
+
title={t("Toggle Sidebar")}
|
|
306
323
|
className={cn(
|
|
307
324
|
"absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border sm:flex",
|
|
308
325
|
"in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize",
|
|
@@ -317,7 +334,10 @@ function SidebarRail({ className, ...props }: React.ComponentProps<"button">) {
|
|
|
317
334
|
);
|
|
318
335
|
}
|
|
319
336
|
|
|
320
|
-
function SidebarInset({
|
|
337
|
+
function SidebarInset({
|
|
338
|
+
className,
|
|
339
|
+
...props
|
|
340
|
+
}: React.ComponentProps<"main">) {
|
|
321
341
|
return (
|
|
322
342
|
<main
|
|
323
343
|
data-slot="sidebar-inset"
|
|
@@ -345,7 +365,10 @@ function SidebarInput({
|
|
|
345
365
|
);
|
|
346
366
|
}
|
|
347
367
|
|
|
348
|
-
function SidebarHeader({
|
|
368
|
+
function SidebarHeader({
|
|
369
|
+
className,
|
|
370
|
+
...props
|
|
371
|
+
}: React.ComponentProps<"div">) {
|
|
349
372
|
return (
|
|
350
373
|
<div
|
|
351
374
|
data-slot="sidebar-header"
|
|
@@ -356,7 +379,10 @@ function SidebarHeader({ className, ...props }: React.ComponentProps<"div">) {
|
|
|
356
379
|
);
|
|
357
380
|
}
|
|
358
381
|
|
|
359
|
-
function SidebarFooter({
|
|
382
|
+
function SidebarFooter({
|
|
383
|
+
className,
|
|
384
|
+
...props
|
|
385
|
+
}: React.ComponentProps<"div">) {
|
|
360
386
|
return (
|
|
361
387
|
<div
|
|
362
388
|
data-slot="sidebar-footer"
|
|
@@ -381,7 +407,10 @@ function SidebarSeparator({
|
|
|
381
407
|
);
|
|
382
408
|
}
|
|
383
409
|
|
|
384
|
-
function SidebarContent({
|
|
410
|
+
function SidebarContent({
|
|
411
|
+
className,
|
|
412
|
+
...props
|
|
413
|
+
}: React.ComponentProps<"div">) {
|
|
385
414
|
return (
|
|
386
415
|
<div
|
|
387
416
|
data-slot="sidebar-content"
|
|
@@ -395,7 +424,10 @@ function SidebarContent({ className, ...props }: React.ComponentProps<"div">) {
|
|
|
395
424
|
);
|
|
396
425
|
}
|
|
397
426
|
|
|
398
|
-
function SidebarGroup({
|
|
427
|
+
function SidebarGroup({
|
|
428
|
+
className,
|
|
429
|
+
...props
|
|
430
|
+
}: React.ComponentProps<"div">) {
|
|
399
431
|
return (
|
|
400
432
|
<div
|
|
401
433
|
data-slot="sidebar-group"
|
|
@@ -475,7 +507,10 @@ function SidebarMenu({ className, ...props }: React.ComponentProps<"ul">) {
|
|
|
475
507
|
);
|
|
476
508
|
}
|
|
477
509
|
|
|
478
|
-
function SidebarMenuItem({
|
|
510
|
+
function SidebarMenuItem({
|
|
511
|
+
className,
|
|
512
|
+
...props
|
|
513
|
+
}: React.ComponentProps<"li">) {
|
|
479
514
|
return (
|
|
480
515
|
<li
|
|
481
516
|
data-slot="sidebar-menu-item"
|
|
@@ -491,7 +526,8 @@ const sidebarMenuButtonVariants = cva(
|
|
|
491
526
|
{
|
|
492
527
|
variants: {
|
|
493
528
|
variant: {
|
|
494
|
-
default:
|
|
529
|
+
default:
|
|
530
|
+
"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
|
|
495
531
|
outline:
|
|
496
532
|
"bg-background shadow-[0_0_0_1px_var(--sidebar-border)] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_var(--sidebar-accent)]",
|
|
497
533
|
},
|
|
@@ -530,7 +566,10 @@ function SidebarMenuButton({
|
|
|
530
566
|
data-sidebar="menu-button"
|
|
531
567
|
data-size={size}
|
|
532
568
|
data-active={isActive}
|
|
533
|
-
className={cn(
|
|
569
|
+
className={cn(
|
|
570
|
+
sidebarMenuButtonVariants({ variant, size }),
|
|
571
|
+
className,
|
|
572
|
+
)}
|
|
534
573
|
{...props}
|
|
535
574
|
/>
|
|
536
575
|
);
|
|
@@ -625,7 +664,10 @@ function SidebarMenuSkeleton({
|
|
|
625
664
|
<div
|
|
626
665
|
data-slot="sidebar-menu-skeleton"
|
|
627
666
|
data-sidebar="menu-skeleton"
|
|
628
|
-
className={cn(
|
|
667
|
+
className={cn(
|
|
668
|
+
"flex h-8 items-center gap-2 rounded-md px-2",
|
|
669
|
+
className,
|
|
670
|
+
)}
|
|
629
671
|
{...props}
|
|
630
672
|
>
|
|
631
673
|
{showIcon && (
|
|
@@ -647,7 +689,10 @@ function SidebarMenuSkeleton({
|
|
|
647
689
|
);
|
|
648
690
|
}
|
|
649
691
|
|
|
650
|
-
function SidebarMenuSub({
|
|
692
|
+
function SidebarMenuSub({
|
|
693
|
+
className,
|
|
694
|
+
...props
|
|
695
|
+
}: React.ComponentProps<"ul">) {
|
|
651
696
|
return (
|
|
652
697
|
<ul
|
|
653
698
|
data-slot="sidebar-menu-sub"
|
|
@@ -1,35 +1,29 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Admin panel {#панель-управления}
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The admin panel uses a shared shadcn/ui (Radix) UI kit, Tailwind CSS 4, Lucide and Recharts. Component sources live in `components/ui`, the theme in `app/globals.css`, and the shell in `components/admin`. Light and dark themes share semantic tokens. New pages must use these components and tokens while preserving server-side session validation in `app/updates/layout.tsx`.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Navigation and data {#навигация-и-данные}
|
|
6
6
|
|
|
7
|
-
-
|
|
8
|
-
- **OTA
|
|
9
|
-
- **Embedded
|
|
7
|
+
- **Installations** (`/updates/devices`): shared server filters, KPIs, daily activity, version distribution, cohorts and registry. Search supports partial installation IDs. Select an ID for full identifiers and diagnostics.
|
|
8
|
+
- **OTA updates** (`/updates`): releases, sorting, pagination and editing. The emergency distribution stop is in the expandable Management panel.
|
|
9
|
+
- **Embedded builds** and **Emergency redirects** retain the existing role restrictions and management actions.
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
Apply filters to the entire selection with Apply. A failed request keeps the previous result with an explicit message. If the last page disappears after a refresh, the registry moves to the last available page. Analytics count installations, not unique people.
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
For daily data, cohort and retention semantics and database migration, see [installation telemetry](./installation-telemetry.md). Existing databases require `2026-10-22-device-analytics.sql`; new databases receive it from the canonical `schema.sql`.
|
|
14
14
|
|
|
15
|
-
##
|
|
15
|
+
## Interface verification {#проверка-интерфеиса}
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
When making changes, check 1440px and 390px widths, both themes, empty filter results and reset, expanding and copying IDs, keyboard dismissal of side panels with focus restoration, pagination retry after failure, and a shrinking last page. Tables may scroll within their cards; the whole page should not scroll horizontally. Never replace history before collection with zeroes or demo data.
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
Verification commands: `npm run lint`, `npx tsc --noEmit`, `npm test`, `npm run build`, `npm run installer:check`. New UI directories are included in the npm initializer template, so generated installations receive the same interface.
|
|
20
20
|
|
|
21
|
-
## Interface language
|
|
21
|
+
## Interface language {#interface-language}
|
|
22
22
|
|
|
23
|
-
The admin panel defaults to English
|
|
24
|
-
language. Select **English** or **Русский** on the sign-in screen or in the admin
|
|
25
|
-
header. The choice persists in the `ota-locale` cookie for one year and is applied
|
|
26
|
-
on the server for the next page load. Unknown locale values fall back to English.
|
|
27
|
-
Switching languages preserves filters and unsaved form data; number/date formatting
|
|
28
|
-
follows the selected locale. Analytics date boundaries remain UTC.
|
|
23
|
+
The admin panel defaults to English regardless of browser language. Select **English**, **Русский** or **Українська** on the sign-in screen or in the header. The choice persists in the `ota-locale` cookie for a year and is applied on the server on the next load. Unknown locale values fall back to English.
|
|
29
24
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
Adding a language requires an explicit supported
|
|
35
|
-
browser language detection is deliberately not used for the default.
|
|
25
|
+
Switching languages preserves filters and unsaved form data, and immediately translates existing notifications. Numbers and dates follow the selected locale. Analytics date boundaries remain UTC. All admin screens, including emergency recovery, delivery policies and the Guard catalog, use the same language.
|
|
26
|
+
|
|
27
|
+
Translations live in `src/client/i18n/`: `en.json`, `ru.json` and `uk.json` must have identical keys and interpolation slots. Existing keys are Russian or English source messages; English equivalents are also accepted for API errors and labels. Use `useI18n().t` for interface text and `useFormatters()` for analytics. Store notifications as a source key or a `TranslationMessage` with interpolation values, and translate when rendering so they follow language changes.
|
|
28
|
+
|
|
29
|
+
Translate enum display labels while preserving their API values. Do not translate IDs, JSON, device or channel names, or user-written messages. Unknown technical errors are displayed verbatim. Catalog and switching tests cover completeness, interpolation, saved preferences, forms and notifications. Adding a language requires an explicit supported value, catalog and selector option; browser language deliberately does not determine the default.
|
|
@@ -11,14 +11,13 @@ have to match. A force-update guard does not bypass the audience.
|
|
|
11
11
|
is required. Existing generated files can be refreshed with `--force` (review local edits).
|
|
12
12
|
2. Rebuild the native app after adding `expo-secure-store`; use a new runtime so older
|
|
13
13
|
binaries cannot download JavaScript importing a missing native module.
|
|
14
|
-
3. Open the app. In
|
|
15
|
-
|
|
14
|
+
3. Open the app. In **Installations → installation details**, copy its Device ID or name it
|
|
15
|
+
**My phone**. Older clients still report Installation ID and can be targeted by it.
|
|
16
16
|
4. Publish with the generated `npm run ota:publish -- --platform android --message "Smoke"`.
|
|
17
|
-
Publishing creates a draft. In its detail page select
|
|
18
|
-
выбранные устройства / установки**, choose your phone, and **save before activation**.
|
|
17
|
+
Publishing creates a draft. In its detail page select **Update audience → Selected devices / installations only**, choose your phone, and **save before activation**.
|
|
19
18
|
5. Activate the draft. Your device gets it; other compatible devices get the previous
|
|
20
19
|
eligible public update, or no update if one does not exist.
|
|
21
|
-
6. After testing, set the audience to
|
|
20
|
+
6. After testing, set the audience to **All compatible devices** and save. The same
|
|
22
21
|
artifact is now eligible for everyone. No second publish is needed.
|
|
23
22
|
|
|
24
23
|
Changing an active audience affects future checks immediately. It does not uninstall or
|