create-expo-updates-server 0.1.6 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/template/.dockerignore +16 -0
- package/dist/template/Dockerfile +5 -0
- package/dist/template/README.md +51 -660
- package/dist/template/app/api/admin/device-targets/route.test.ts +43 -0
- package/dist/template/app/api/admin/device-targets/route.ts +91 -0
- package/dist/template/app/api/admin/devices/route.test.ts +41 -0
- package/dist/template/app/api/admin/devices/route.ts +15 -0
- package/dist/template/app/api/admin/updates/[encodedKey]/audience/route.ts +75 -0
- package/dist/template/app/api/device-heartbeat/route.ts +2 -0
- package/dist/template/app/globals.css +114 -15
- package/dist/template/app/layout.tsx +12 -4
- package/dist/template/app/login/page.tsx +22 -18
- package/dist/template/app/updates/[encodedKey]/page.tsx +112 -88
- package/dist/template/app/updates/devices/page.tsx +264 -0
- package/dist/template/app/updates/embedded/page.tsx +102 -68
- package/dist/template/app/updates/emergency-redirects/page.tsx +144 -111
- package/dist/template/app/updates/layout.tsx +6 -1
- package/dist/template/app/updates/page.tsx +262 -212
- package/dist/template/components/admin/admin-shell.tsx +196 -0
- package/dist/template/components/admin/language-switcher.tsx +25 -0
- package/dist/template/components/admin/theme-provider.tsx +15 -0
- package/dist/template/components/ui/alert.tsx +65 -0
- package/dist/template/components/ui/badge.tsx +47 -0
- package/dist/template/components/ui/button.tsx +63 -0
- package/dist/template/components/ui/card.tsx +91 -0
- package/dist/template/components/ui/chart.tsx +373 -0
- package/dist/template/components/ui/checkbox.tsx +31 -0
- package/dist/template/components/ui/dialog.tsx +158 -0
- package/dist/template/components/ui/dropdown-menu.tsx +256 -0
- package/dist/template/components/ui/input.tsx +20 -0
- package/dist/template/components/ui/label.tsx +23 -0
- package/dist/template/components/ui/native-select.tsx +61 -0
- package/dist/template/components/ui/popover.tsx +88 -0
- package/dist/template/components/ui/scroll-area.tsx +57 -0
- package/dist/template/components/ui/select.tsx +189 -0
- package/dist/template/components/ui/separator.tsx +27 -0
- package/dist/template/components/ui/sheet.tsx +142 -0
- package/dist/template/components/ui/sidebar.tsx +736 -0
- package/dist/template/components/ui/skeleton.tsx +13 -0
- package/dist/template/components/ui/switch.tsx +34 -0
- package/dist/template/components/ui/table.tsx +115 -0
- package/dist/template/components/ui/tabs.tsx +90 -0
- package/dist/template/components/ui/textarea.tsx +17 -0
- package/dist/template/components/ui/tooltip.tsx +56 -0
- package/dist/template/components.json +22 -0
- package/dist/template/docker/minio.Dockerfile +11 -0
- package/dist/template/docker-compose.yml +7 -9
- package/dist/template/docs/admin-ui.md +35 -0
- package/dist/template/docs/device-targeting.md +129 -0
- package/dist/template/docs/doctor.md +137 -0
- package/dist/template/docs/expo-app-setup.md +174 -47
- package/dist/template/docs/getting-started.md +109 -146
- package/dist/template/docs/getting-started.ru.md +110 -193
- package/dist/template/docs/index.md +14 -33
- package/dist/template/docs/installation-telemetry.md +233 -0
- package/dist/template/docs/migrations/2026-10-16-manifest-identity.sql +89 -0
- package/dist/template/docs/migrations/2026-10-19-device-heartbeat.sql +131 -0
- package/dist/template/docs/migrations/2026-10-22-device-analytics.sql +264 -0
- package/dist/template/docs/migrations/2026-10-22-device-targeting-activation.sql +108 -0
- package/dist/template/docs/migrations/2026-10-22-device-targeting.sql +130 -0
- package/dist/template/docs/migrations/2026-10-22-device-version-metadata.sql +154 -0
- package/dist/template/docs/migrations/schema.sql +868 -6
- package/dist/template/docs/npm-installer.md +15 -30
- package/dist/template/docs/operations-guide.md +87 -0
- package/dist/template/docs/ota-client-lifecycle.md +263 -0
- package/dist/template/docs/ota-update-policy.md +36 -2
- package/dist/template/docs/supabase-setup.md +4 -0
- package/dist/template/hooks/use-mobile.ts +21 -0
- package/dist/template/lib/utils.ts +6 -0
- package/dist/template/package-lock.json +2325 -101
- package/dist/template/package.json +13 -3
- package/dist/template/scripts/configure-expo-app.mjs +11 -15
- package/dist/template/scripts/doctor.mjs +51 -0
- package/dist/template/scripts/ensure-storage-bucket.mjs +25 -0
- package/dist/template/scripts/ensure-test-bucket.mjs +21 -0
- package/dist/template/scripts/lib/device-identity.test.ts +29 -0
- package/dist/template/scripts/lib/doctor-probes.mjs +139 -0
- package/dist/template/scripts/lib/doctor.mjs +208 -0
- package/dist/template/scripts/lib/doctor.test.mjs +262 -0
- package/dist/template/scripts/lib/expo-app-configurator.mjs +14 -9
- package/dist/template/scripts/lib/expo-app-configurator.test.ts +3 -2
- package/dist/template/scripts/lib/ota-client-configurator.mjs +69 -0
- package/dist/template/scripts/lib/ota-client-configurator.test.ts +88 -0
- package/dist/template/scripts/lib/ota-client.test.ts +55 -0
- package/dist/template/scripts/lib/ota-root-hook-patcher.mjs +173 -0
- package/dist/template/scripts/lib/ota-root-hook-patcher.test.ts +123 -0
- package/dist/template/scripts/lib/ota-update-controller.test.ts +231 -0
- package/dist/template/scripts/tests/device-analytics-migrations.mjs +80 -0
- package/dist/template/scripts/tests/device-analytics.mjs +126 -0
- package/dist/template/scripts/tests/device-heartbeat.mjs +86 -0
- package/dist/template/scripts/tests/device-targeting-activation.mjs +111 -0
- package/dist/template/scripts/tests/device-targeting.mjs +39 -0
- package/dist/template/scripts/tests/device-version-metadata.mjs +31 -0
- package/dist/template/scripts/tests/manifest-identity-concurrency.mjs +106 -0
- package/dist/template/scripts/tests/manifest-identity.sql +204 -0
- package/dist/template/src/client/admin-types.ts +1 -0
- package/dist/template/src/client/devices/analytics.tsx +429 -0
- package/dist/template/src/client/devices/device-name.tsx +82 -0
- package/dist/template/src/client/devices/registry.tsx +399 -0
- package/dist/template/src/client/devices/use-devices-report.ts +108 -0
- package/dist/template/src/client/devices/version-adoption-chart.tsx +269 -0
- package/dist/template/src/client/devices/version-groups.test.ts +57 -0
- package/dist/template/src/client/devices/version-groups.ts +101 -0
- package/dist/template/src/client/distribution-control.tsx +135 -81
- package/dist/template/src/client/guard-action-combobox.tsx +13 -24
- package/dist/template/src/client/i18n/en.json +286 -0
- package/dist/template/src/client/i18n/messages.test.ts +42 -0
- package/dist/template/src/client/i18n/messages.ts +31 -0
- package/dist/template/src/client/i18n/provider.tsx +55 -0
- package/dist/template/src/client/i18n/use-formatters.ts +38 -0
- package/dist/template/src/client/logout-button.tsx +3 -1
- package/dist/template/src/client/update-audience-editor.tsx +285 -0
- package/dist/template/src/client/update-policy-editor.tsx +53 -41
- package/dist/template/src/server/controllers/manifest.test.ts +250 -7
- package/dist/template/src/server/controllers/manifest.ts +39 -31
- package/dist/template/src/server/devices/audience.test.ts +48 -0
- package/dist/template/src/server/devices/audience.ts +86 -0
- package/dist/template/src/server/devices/heartbeat.test.ts +39 -0
- package/dist/template/src/server/devices/heartbeat.ts +75 -0
- package/dist/template/src/server/devices/report-types.ts +114 -0
- package/dist/template/src/server/devices/report.test.ts +29 -0
- package/dist/template/src/server/devices/report.ts +27 -0
- package/dist/template/src/server/lib/admin-audience-activation.test.ts +94 -0
- package/dist/template/src/server/lib/admin-updates.ts +32 -168
- package/dist/template/src/server/lib/supabase.js +10 -10
- package/dist/template/src/server/lib/supabase.test.ts +11 -0
- package/dist/template/src/server/manifest/manifest-identity.test.ts +30 -0
- package/dist/template/src/server/manifest/manifest-identity.ts +24 -0
- package/dist/template/src/server/manifest/manifest-repository.ts +31 -102
- package/dist/template/src/server/manifest/manifest-response.ts +1 -1
- package/dist/template/templates/expo-app/ota-client/README.md +59 -0
- package/dist/template/templates/expo-app/ota-client/controller.js +60 -0
- package/dist/template/templates/expo-app/ota-client/device-identity.js +26 -0
- package/dist/template/templates/expo-app/ota-client/docs/update-lifecycle.md +52 -0
- package/dist/template/templates/expo-app/ota-client/index.d.ts +47 -0
- package/dist/template/templates/expo-app/ota-client/index.js +3 -0
- package/dist/template/templates/expo-app/ota-client/model/hooks/useOtaUpdates.js +48 -0
- package/dist/template/templates/expo-app/ota-client/model/update-controller.js +182 -0
- package/dist/template/templates/expo-app/ota-client/runtime.js +112 -0
- package/dist/template/templates/expo-app/ota-client/ui/ota-update-gate.js +56 -0
- package/dist/template-manifest.json +592 -77
- package/lib/cli.mjs +4 -6
- package/package.json +1 -1
|
@@ -1,10 +1,32 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { useI18n } from "@/src/client/i18n/provider";
|
|
3
|
+
|
|
4
|
+
import { NativeSelect } from "@/components/ui/native-select";
|
|
2
5
|
|
|
3
6
|
import { getUpdates } from "@/src/client/admin-api";
|
|
4
7
|
import { UpdateItem } from "@/src/client/admin-types";
|
|
5
|
-
import LogoutButton from "@/src/client/logout-button";
|
|
6
8
|
import DistributionControl from "@/src/client/distribution-control";
|
|
7
9
|
import Link from "next/link";
|
|
10
|
+
import { Button } from "@/components/ui/button";
|
|
11
|
+
import { Badge } from "@/components/ui/badge";
|
|
12
|
+
import { Card } from "@/components/ui/card";
|
|
13
|
+
import {
|
|
14
|
+
Table,
|
|
15
|
+
TableHeader,
|
|
16
|
+
TableBody,
|
|
17
|
+
TableRow,
|
|
18
|
+
TableHead,
|
|
19
|
+
TableCell,
|
|
20
|
+
} from "@/components/ui/table";
|
|
21
|
+
import {
|
|
22
|
+
ArrowDownUp,
|
|
23
|
+
ArrowRight,
|
|
24
|
+
ChevronLeft,
|
|
25
|
+
ChevronRight,
|
|
26
|
+
RefreshCw,
|
|
27
|
+
Package,
|
|
28
|
+
ShieldAlert,
|
|
29
|
+
} from "lucide-react";
|
|
8
30
|
import { useCallback, useEffect, useState } from "react";
|
|
9
31
|
|
|
10
32
|
const PAGE_SIZE = 20;
|
|
@@ -19,6 +41,7 @@ type SortBy =
|
|
|
19
41
|
| "updateId";
|
|
20
42
|
|
|
21
43
|
export default function UpdatesPage() {
|
|
44
|
+
const { t, formatLocale } = useI18n();
|
|
22
45
|
const [items, setItems] = useState<UpdateItem[]>([]);
|
|
23
46
|
const [rollbackScopes, setRollbackScopes] = useState<
|
|
24
47
|
Array<{
|
|
@@ -71,236 +94,263 @@ export default function UpdatesPage() {
|
|
|
71
94
|
}, [loadUpdates]);
|
|
72
95
|
|
|
73
96
|
return (
|
|
74
|
-
<
|
|
75
|
-
<
|
|
76
|
-
<
|
|
97
|
+
<div className="mx-auto max-w-[1600px] space-y-6 p-4 md:p-8">
|
|
98
|
+
<header className="flex flex-wrap items-start justify-between gap-4">
|
|
99
|
+
<div className="space-y-1">
|
|
100
|
+
<h1 className="text-2xl font-semibold tracking-tight">OTA Updates</h1>
|
|
101
|
+
<p className="text-sm text-muted-foreground">
|
|
102
|
+
{t("Публикации, версии и управление доставкой обновлений.")}
|
|
103
|
+
</p>
|
|
104
|
+
</div>
|
|
105
|
+
<Button
|
|
106
|
+
variant="outline"
|
|
107
|
+
onClick={() => void loadUpdates()}
|
|
108
|
+
disabled={loading}
|
|
109
|
+
>
|
|
110
|
+
<RefreshCw className={loading ? "animate-spin" : ""} />{" "}
|
|
111
|
+
{t(" Обновить")}
|
|
112
|
+
</Button>
|
|
113
|
+
</header>
|
|
114
|
+
|
|
115
|
+
<DistributionControl />
|
|
116
|
+
|
|
117
|
+
{error && (
|
|
118
|
+
<div
|
|
119
|
+
role="alert"
|
|
120
|
+
className="rounded-lg border border-destructive/25 bg-destructive/5 p-4 text-sm text-destructive"
|
|
121
|
+
>
|
|
122
|
+
{t(error)}
|
|
123
|
+
</div>
|
|
124
|
+
)}
|
|
125
|
+
{hasRollbackActive && (
|
|
126
|
+
<div className="flex gap-3 rounded-lg border border-amber-500/25 bg-amber-500/5 p-4 text-sm">
|
|
127
|
+
<ShieldAlert className="mt-0.5 size-4 shrink-0 text-amber-600" />
|
|
77
128
|
<div>
|
|
78
|
-
<
|
|
79
|
-
<p className="
|
|
80
|
-
|
|
129
|
+
<p className="font-medium">{t("Rollback активен")}</p>
|
|
130
|
+
<p className="mt-1 text-muted-foreground">
|
|
131
|
+
{t("Автодоставка новых обновлений временно отключена.")}
|
|
132
|
+
{hasIgnoredUpdates
|
|
133
|
+
? t(" Новые публикации в этих scope помечены как ignored.")
|
|
134
|
+
: ""}
|
|
81
135
|
</p>
|
|
82
136
|
</div>
|
|
137
|
+
</div>
|
|
138
|
+
)}
|
|
139
|
+
{lockedScopes.length > 0 && (
|
|
140
|
+
<p className="text-xs text-muted-foreground">
|
|
141
|
+
Rollback lock:{" "}
|
|
142
|
+
{lockedScopes
|
|
143
|
+
.map(
|
|
144
|
+
(scope) =>
|
|
145
|
+
`${scope.runtimeVersion} / ${scope.platform} / ${scope.channel}`,
|
|
146
|
+
)
|
|
147
|
+
.join("; ")}
|
|
148
|
+
</p>
|
|
149
|
+
)}
|
|
150
|
+
|
|
151
|
+
<Card className="gap-0 overflow-hidden py-0 shadow-none">
|
|
152
|
+
<div className="flex flex-wrap items-center justify-between gap-4 border-b p-4">
|
|
83
153
|
<div className="flex items-center gap-2">
|
|
84
|
-
<
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
<Link
|
|
91
|
-
href="/updates/embedded"
|
|
92
|
-
className="rounded-md border border-zinc-300 px-4 py-4 text-sm hover:bg-zinc-100 dark:border-zinc-700 dark:hover:bg-zinc-800"
|
|
93
|
-
>
|
|
94
|
-
Embedded
|
|
95
|
-
</Link>
|
|
96
|
-
<label className="text-sm">Сортировка</label>
|
|
97
|
-
<select
|
|
154
|
+
<Package className="size-4 text-muted-foreground" />
|
|
155
|
+
<h2 className="text-sm font-semibold">{t("Публикации")}</h2>
|
|
156
|
+
<Badge variant="secondary">{total}</Badge>
|
|
157
|
+
</div>
|
|
158
|
+
<div className="flex items-center gap-2">
|
|
159
|
+
<NativeSelect
|
|
98
160
|
value={sortBy}
|
|
99
161
|
onChange={(event) => {
|
|
100
162
|
setSortBy(event.target.value as SortBy);
|
|
101
163
|
setPage(1);
|
|
102
164
|
}}
|
|
103
|
-
aria-label="Сортировка списка апдейтов"
|
|
104
|
-
className="rounded-md border border-
|
|
165
|
+
aria-label={t("Сортировка списка апдейтов")}
|
|
166
|
+
className="h-9 rounded-md border border-input bg-background px-3 text-sm outline-none focus-visible:ring-2 focus-visible:ring-ring"
|
|
105
167
|
>
|
|
106
|
-
<option value="createdAt"
|
|
107
|
-
<option value="runtimeVersion">
|
|
108
|
-
<option value="platform"
|
|
109
|
-
<option value="channel"
|
|
110
|
-
<option value="stage">
|
|
111
|
-
<option value="status"
|
|
112
|
-
<option value="updateId">ID</option>
|
|
113
|
-
</
|
|
114
|
-
<
|
|
115
|
-
|
|
168
|
+
<option value="createdAt">{t("По дате")}</option>
|
|
169
|
+
<option value="runtimeVersion">{t("По runtime")}</option>
|
|
170
|
+
<option value="platform">{t("По платформе")}</option>
|
|
171
|
+
<option value="channel">{t("По каналу")}</option>
|
|
172
|
+
<option value="stage">{t("По stage")}</option>
|
|
173
|
+
<option value="status">{t("По статусу")}</option>
|
|
174
|
+
<option value="updateId">{t("По ID")}</option>
|
|
175
|
+
</NativeSelect>
|
|
176
|
+
<Button
|
|
177
|
+
variant="outline"
|
|
178
|
+
size="sm"
|
|
116
179
|
onClick={() => {
|
|
117
180
|
setOrder((current) => (current === "asc" ? "desc" : "asc"));
|
|
118
181
|
setPage(1);
|
|
119
182
|
}}
|
|
120
|
-
|
|
183
|
+
aria-label={
|
|
184
|
+
order === "asc"
|
|
185
|
+
? t("Сортировать по убыванию")
|
|
186
|
+
: t("Сортировать по возрастанию")
|
|
187
|
+
}
|
|
121
188
|
>
|
|
189
|
+
<ArrowDownUp />
|
|
122
190
|
{order === "asc" ? "ASC" : "DESC"}
|
|
123
|
-
</
|
|
124
|
-
<LogoutButton />
|
|
125
|
-
</div>
|
|
126
|
-
</header>
|
|
127
|
-
|
|
128
|
-
<DistributionControl />
|
|
129
|
-
|
|
130
|
-
{error ? (
|
|
131
|
-
<div className="rounded-md border border-red-200 bg-red-50 p-3 text-sm text-red-700 dark:border-red-900 dark:bg-red-950/40 dark:text-red-300">
|
|
132
|
-
{error}
|
|
133
|
-
</div>
|
|
134
|
-
) : null}
|
|
135
|
-
|
|
136
|
-
{hasRollbackActive ? (
|
|
137
|
-
<div className="rounded-md border border-orange-300 bg-orange-50 p-3 text-sm text-orange-900 dark:border-orange-700 dark:bg-orange-950/30 dark:text-orange-200">
|
|
138
|
-
⚠️ Rollback активен: автодоставка новых апдейтов временно отключена.
|
|
139
|
-
{hasIgnoredUpdates
|
|
140
|
-
? " Новые апдейты в этом scope помечены как ignored."
|
|
141
|
-
: ""}
|
|
142
|
-
</div>
|
|
143
|
-
) : null}
|
|
144
|
-
|
|
145
|
-
{lockedScopes.length > 0 ? (
|
|
146
|
-
<div className="rounded-md border border-zinc-300 bg-zinc-50 p-3 text-sm text-zinc-800 dark:border-zinc-700 dark:bg-zinc-900/40 dark:text-zinc-200">
|
|
147
|
-
<p className="font-medium">Rollback lock по scope:</p>
|
|
148
|
-
<p className="mt-1 text-xs">
|
|
149
|
-
{lockedScopes
|
|
150
|
-
.map(
|
|
151
|
-
(scope) =>
|
|
152
|
-
`${scope.runtimeVersion} / ${scope.platform} / ${scope.channel}`,
|
|
153
|
-
)
|
|
154
|
-
.join("; ")}
|
|
155
|
-
</p>
|
|
191
|
+
</Button>
|
|
156
192
|
</div>
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
<
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
193
|
+
</div>
|
|
194
|
+
<Table>
|
|
195
|
+
<TableHeader>
|
|
196
|
+
<TableRow className="bg-muted/40 hover:bg-muted/40">
|
|
197
|
+
<TableHead className="pl-5">{t("Обновление")}</TableHead>
|
|
198
|
+
<TableHead>Runtime / App</TableHead>
|
|
199
|
+
<TableHead>{t("Платформа / канал")}</TableHead>
|
|
200
|
+
<TableHead>{t("Состояние")}</TableHead>
|
|
201
|
+
<TableHead>{t("Доставка")}</TableHead>
|
|
202
|
+
<TableHead>Assets</TableHead>
|
|
203
|
+
<TableHead className="pr-5 text-right">{t("Создано")}</TableHead>
|
|
204
|
+
</TableRow>
|
|
205
|
+
</TableHeader>
|
|
206
|
+
<TableBody>
|
|
207
|
+
{loading && (
|
|
208
|
+
<TableRow>
|
|
209
|
+
<TableCell
|
|
210
|
+
colSpan={7}
|
|
211
|
+
className="h-36 text-center text-muted-foreground"
|
|
212
|
+
>
|
|
213
|
+
<RefreshCw className="mx-auto mb-2 size-5 animate-spin" />
|
|
214
|
+
{t("Загрузка обновлений…")}
|
|
215
|
+
</TableCell>
|
|
216
|
+
</TableRow>
|
|
217
|
+
)}
|
|
218
|
+
{!loading && items.length === 0 && (
|
|
219
|
+
<TableRow>
|
|
220
|
+
<TableCell colSpan={7} className="h-48 text-center">
|
|
221
|
+
<Package className="mx-auto mb-3 size-8 text-muted-foreground/50" />
|
|
222
|
+
<p className="font-medium">{t("Обновлений пока нет")}</p>
|
|
223
|
+
<p className="mt-1 text-sm text-muted-foreground">
|
|
224
|
+
{t("Опубликуйте OTA, чтобы управлять его доставкой здесь.")}
|
|
225
|
+
</p>
|
|
226
|
+
</TableCell>
|
|
227
|
+
</TableRow>
|
|
228
|
+
)}
|
|
229
|
+
{!loading &&
|
|
230
|
+
items.map((item) => (
|
|
231
|
+
<TableRow
|
|
232
|
+
key={item.key}
|
|
233
|
+
className={item.isRollbackActive ? "bg-amber-500/5" : ""}
|
|
234
|
+
>
|
|
235
|
+
<TableCell className="max-w-80 py-4 pl-5">
|
|
236
|
+
<Link
|
|
237
|
+
href={`/updates/${item.encodedKey}`}
|
|
238
|
+
className="group flex items-center gap-2 text-sm font-medium text-foreground hover:text-primary"
|
|
239
|
+
>
|
|
240
|
+
<span className="truncate">
|
|
241
|
+
{item.comment || t("Без комментария")}
|
|
242
|
+
</span>
|
|
243
|
+
<ArrowRight className="size-3.5 shrink-0 opacity-0 transition-opacity group-hover:opacity-100" />
|
|
244
|
+
</Link>
|
|
245
|
+
<Link
|
|
246
|
+
href={`/updates/${item.encodedKey}`}
|
|
247
|
+
className="mt-1 block max-w-60 truncate font-mono text-[11px] text-muted-foreground hover:text-primary"
|
|
248
|
+
title={item.updateId}
|
|
249
|
+
>
|
|
250
|
+
{item.updateId}
|
|
251
|
+
</Link>
|
|
252
|
+
</TableCell>
|
|
253
|
+
<TableCell>
|
|
254
|
+
<p className="font-medium">{item.runtimeVersion}</p>
|
|
255
|
+
<p className="mt-1 text-xs text-muted-foreground">
|
|
256
|
+
App {item.appVersion || "—"}
|
|
257
|
+
</p>
|
|
258
|
+
</TableCell>
|
|
259
|
+
<TableCell>
|
|
260
|
+
<span className="text-sm">
|
|
261
|
+
{item.platform === "ios" ? "iOS" : "Android"}
|
|
262
|
+
</span>
|
|
263
|
+
<p className="mt-1 text-xs text-muted-foreground">
|
|
264
|
+
{item.channel}
|
|
265
|
+
</p>
|
|
266
|
+
</TableCell>
|
|
267
|
+
<TableCell>
|
|
268
|
+
<div className="flex flex-wrap gap-1.5">
|
|
269
|
+
<Badge
|
|
270
|
+
variant={
|
|
271
|
+
item.status === "active" ? "default" : "secondary"
|
|
272
|
+
}
|
|
273
|
+
className={
|
|
274
|
+
item.status === "active"
|
|
275
|
+
? "bg-emerald-500/10 text-emerald-700 dark:text-emerald-400"
|
|
202
276
|
: ""
|
|
203
|
-
}
|
|
277
|
+
}
|
|
204
278
|
>
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
<
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
<div className="flex items-center justify-between border-t border-zinc-200 px-4 py-3 dark:border-zinc-800">
|
|
278
|
-
<p className="text-sm text-zinc-600 dark:text-zinc-400">
|
|
279
|
-
Страница {page} из {totalPages}
|
|
280
|
-
</p>
|
|
281
|
-
<div className="flex gap-2">
|
|
282
|
-
<button
|
|
283
|
-
type="button"
|
|
284
|
-
onClick={() => setPage((current) => Math.max(1, current - 1))}
|
|
285
|
-
disabled={page <= 1 || loading}
|
|
286
|
-
className="rounded-md border border-zinc-300 px-4 py-4 text-sm hover:bg-zinc-100 disabled:cursor-not-allowed disabled:opacity-60 dark:border-zinc-700 dark:hover:bg-zinc-800"
|
|
287
|
-
>
|
|
288
|
-
Назад
|
|
289
|
-
</button>
|
|
290
|
-
<button
|
|
291
|
-
type="button"
|
|
292
|
-
onClick={() =>
|
|
293
|
-
setPage((current) => Math.min(totalPages, current + 1))
|
|
294
|
-
}
|
|
295
|
-
disabled={page >= totalPages || loading}
|
|
296
|
-
className="rounded-md border border-zinc-300 px-4 py-4 text-sm hover:bg-zinc-100 disabled:cursor-not-allowed disabled:opacity-60 dark:border-zinc-700 dark:hover:bg-zinc-800"
|
|
297
|
-
>
|
|
298
|
-
Вперёд
|
|
299
|
-
</button>
|
|
300
|
-
</div>
|
|
279
|
+
{item.status}
|
|
280
|
+
</Badge>
|
|
281
|
+
{item.isLatest && <Badge variant="outline">Latest</Badge>}
|
|
282
|
+
{item.audienceMode === "devices" && (
|
|
283
|
+
<Badge variant="outline">
|
|
284
|
+
{t("Выбранные устройства")}
|
|
285
|
+
</Badge>
|
|
286
|
+
)}
|
|
287
|
+
</div>
|
|
288
|
+
<p className="mt-1.5 text-xs text-muted-foreground">
|
|
289
|
+
{item.stage}
|
|
290
|
+
</p>
|
|
291
|
+
</TableCell>
|
|
292
|
+
<TableCell>
|
|
293
|
+
<div className="flex flex-wrap gap-1.5">
|
|
294
|
+
<Badge variant="outline">
|
|
295
|
+
{item.deliveryMode === "background"
|
|
296
|
+
? "Background"
|
|
297
|
+
: "Manual"}
|
|
298
|
+
</Badge>
|
|
299
|
+
{item.hasGuard && (
|
|
300
|
+
<Badge variant="secondary">Guard</Badge>
|
|
301
|
+
)}
|
|
302
|
+
</div>
|
|
303
|
+
<p
|
|
304
|
+
className={`mt-1.5 text-xs ${item.isRollbackActive ? "text-amber-600" : "text-muted-foreground"}`}
|
|
305
|
+
>
|
|
306
|
+
{item.isRollbackActive
|
|
307
|
+
? "Rollback"
|
|
308
|
+
: item.isIgnoredByRollback
|
|
309
|
+
? "Ignored by rollback"
|
|
310
|
+
: "Scope open"}
|
|
311
|
+
</p>
|
|
312
|
+
</TableCell>
|
|
313
|
+
<TableCell className="tabular-nums text-muted-foreground">
|
|
314
|
+
{item.assetsCount}
|
|
315
|
+
</TableCell>
|
|
316
|
+
<TableCell className="pr-5 text-right text-xs tabular-nums text-muted-foreground">
|
|
317
|
+
{new Date(item.createdAt).toLocaleString(formatLocale) ||
|
|
318
|
+
item.createdAtPath}
|
|
319
|
+
</TableCell>
|
|
320
|
+
</TableRow>
|
|
321
|
+
))}
|
|
322
|
+
</TableBody>
|
|
323
|
+
</Table>
|
|
324
|
+
<div className="flex items-center justify-between gap-3 border-t px-5 py-3">
|
|
325
|
+
<p className="text-xs text-muted-foreground">
|
|
326
|
+
{t("Страница ")}
|
|
327
|
+
{page} {t(" из ")}
|
|
328
|
+
{totalPages}
|
|
329
|
+
</p>
|
|
330
|
+
<div className="flex gap-2">
|
|
331
|
+
<Button
|
|
332
|
+
variant="outline"
|
|
333
|
+
size="sm"
|
|
334
|
+
onClick={() => setPage((current) => Math.max(1, current - 1))}
|
|
335
|
+
disabled={page <= 1 || loading}
|
|
336
|
+
>
|
|
337
|
+
<ChevronLeft />
|
|
338
|
+
{t("Назад")}
|
|
339
|
+
</Button>
|
|
340
|
+
<Button
|
|
341
|
+
variant="outline"
|
|
342
|
+
size="sm"
|
|
343
|
+
onClick={() =>
|
|
344
|
+
setPage((current) => Math.min(totalPages, current + 1))
|
|
345
|
+
}
|
|
346
|
+
disabled={page >= totalPages || loading}
|
|
347
|
+
>
|
|
348
|
+
{t("Вперёд")}
|
|
349
|
+
<ChevronRight />
|
|
350
|
+
</Button>
|
|
301
351
|
</div>
|
|
302
|
-
</
|
|
303
|
-
</
|
|
304
|
-
</
|
|
352
|
+
</div>
|
|
353
|
+
</Card>
|
|
354
|
+
</div>
|
|
305
355
|
);
|
|
306
356
|
}
|