create-expo-updates-server 0.4.0 → 0.6.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/README.md +4 -2
- package/dist/template/Dockerfile +4 -6
- package/dist/template/README.md +4 -9
- package/dist/template/app/api/admin/device-favorites/route.test.ts +125 -0
- package/dist/template/app/api/admin/device-favorites/route.ts +91 -0
- package/dist/template/app/api/admin/distribution-history/restore/route.ts +39 -0
- package/dist/template/app/api/admin/distribution-history/route.test.ts +55 -0
- package/dist/template/app/api/admin/distribution-history/route.ts +24 -0
- package/dist/template/app/api/admin/updates/[encodedKey]/deactivate/route.ts +2 -1
- package/dist/template/app/api/admin/updates/[encodedKey]/promote/route.ts +2 -1
- package/dist/template/app/api/admin/updates/[encodedKey]/rollback/route.ts +2 -1
- package/dist/template/app/api/admin/updates/[encodedKey]/route.ts +2 -1
- package/dist/template/app/api/admin/updates/route.test.ts +21 -0
- package/dist/template/app/api/admin/updates/route.ts +12 -1
- package/dist/template/app/globals.css +65 -68
- package/dist/template/app/login/page.tsx +66 -42
- package/dist/template/app/updates/[encodedKey]/page.tsx +375 -263
- package/dist/template/app/updates/devices/page.tsx +188 -152
- package/dist/template/app/updates/embedded/page.tsx +63 -29
- package/dist/template/app/updates/emergency-redirects/page.tsx +93 -58
- package/dist/template/app/updates/layout.tsx +2 -1
- package/dist/template/app/updates/page.tsx +381 -283
- package/dist/template/app/updates/releases.test.tsx +156 -0
- package/dist/template/components/admin/admin-role.ts +5 -0
- package/dist/template/components/admin/admin-shell.tsx +166 -101
- package/dist/template/components/admin/confirm-action.tsx +123 -0
- package/dist/template/components/admin/language-switcher.tsx +25 -17
- package/dist/template/components/admin/release-badges.test.tsx +50 -0
- package/dist/template/components/admin/release-badges.tsx +101 -0
- package/dist/template/components/ui/alert.tsx +10 -3
- package/dist/template/components/ui/avatar.tsx +108 -0
- package/dist/template/components/ui/badge.tsx +2 -2
- package/dist/template/components/ui/breadcrumb.tsx +108 -0
- package/dist/template/components/ui/button.tsx +5 -5
- package/dist/template/components/ui/card.tsx +2 -2
- package/dist/template/components/ui/chart.tsx +1 -1
- package/dist/template/components/ui/collapsible.tsx +7 -0
- package/dist/template/components/ui/empty.tsx +103 -0
- package/dist/template/components/ui/field.tsx +248 -0
- package/dist/template/components/ui/input-group.tsx +170 -0
- package/dist/template/components/ui/input.tsx +1 -1
- package/dist/template/components/ui/native-select.tsx +1 -1
- package/dist/template/components/ui/radio-group.tsx +41 -0
- package/dist/template/components/ui/status-tones.ts +15 -0
- package/dist/template/components/ui/table.tsx +1 -1
- package/dist/template/components/ui/textarea.tsx +1 -1
- package/dist/template/docs/admin-ui.md +7 -3
- package/dist/template/docs/device-targeting.md +2 -7
- package/dist/template/docs/doctor.md +2 -2
- package/dist/template/docs/expo-app-setup.md +9 -27
- package/dist/template/docs/getting-started.md +3 -4
- package/dist/template/docs/installation-telemetry.md +2 -8
- package/dist/template/docs/migrations/2026-10-16-manifest-identity.sql +5 -0
- package/dist/template/docs/migrations/2026-11-25-device-favorites.sql +53 -0
- package/dist/template/docs/migrations/2026-11-25-download-on-postpone.sql +5 -0
- package/dist/template/docs/migrations/2026-11-25-public-distribution-history.sql +283 -0
- package/dist/template/docs/migrations/schema.sql +349 -0
- package/dist/template/docs/npm-installer.md +3 -3
- package/dist/template/docs/operations-guide.md +8 -6
- package/dist/template/docs/ota-client-lifecycle.md +30 -68
- package/dist/template/docs/ota-update-policy.md +9 -20
- package/dist/template/docs/ru/admin-ui.md +7 -3
- package/dist/template/docs/ru/device-targeting.md +2 -2
- package/dist/template/docs/ru/doctor.md +2 -2
- package/dist/template/docs/ru/expo-app-setup.md +9 -9
- package/dist/template/docs/ru/getting-started.md +3 -3
- package/dist/template/docs/ru/installation-telemetry.md +2 -2
- package/dist/template/docs/ru/npm-installer.md +3 -3
- package/dist/template/docs/ru/operations-guide.md +8 -3
- package/dist/template/docs/ru/ota-client-lifecycle.md +30 -35
- package/dist/template/docs/ru/ota-update-policy.md +9 -7
- package/dist/template/docs/ru/publishing-npm-installer.md +2 -2
- package/dist/template/docs/uk/admin-ui.md +7 -3
- package/dist/template/docs/uk/device-targeting.md +2 -2
- package/dist/template/docs/uk/doctor.md +2 -2
- package/dist/template/docs/uk/expo-app-setup.md +9 -9
- package/dist/template/docs/uk/getting-started.md +3 -3
- package/dist/template/docs/uk/installation-telemetry.md +2 -2
- package/dist/template/docs/uk/npm-installer.md +3 -3
- package/dist/template/docs/uk/operations-guide.md +8 -3
- package/dist/template/docs/uk/ota-client-lifecycle.md +30 -35
- package/dist/template/docs/uk/ota-update-policy.md +9 -7
- package/dist/template/docs/uk/publishing-npm-installer.md +2 -2
- package/dist/template/lib/audience-ids.ts +4 -0
- package/dist/template/package-lock.json +46 -0
- package/dist/template/package.json +3 -1
- package/dist/template/scripts/configure-expo-app.mjs +3 -3
- package/dist/template/scripts/create-access-token.mjs +1 -1
- package/dist/template/scripts/lib/doctor.mjs +10 -7
- package/dist/template/scripts/lib/doctor.test.mjs +7 -5
- package/dist/template/scripts/lib/embedded-update-registrar.test.ts +22 -7
- package/dist/template/scripts/lib/expo-app-configurator.mjs +25 -22
- package/dist/template/scripts/lib/expo-app-configurator.test.ts +37 -2
- package/dist/template/scripts/lib/ota-client-configurator.mjs +152 -55
- package/dist/template/scripts/lib/ota-client-configurator.test.ts +60 -20
- package/dist/template/scripts/lib/ota-client-package.mjs +25 -0
- package/dist/template/scripts/lib/ota-root-hook-patcher.mjs +90 -32
- package/dist/template/scripts/lib/ota-root-hook-patcher.test.ts +49 -6
- package/dist/template/scripts/tests/device-analytics-migrations.mjs +12 -1
- package/dist/template/scripts/tests/device-targeting-activation.mjs +2 -3
- package/dist/template/scripts/tests/e2e/client-lifecycle.mjs +161 -0
- package/dist/template/scripts/tests/e2e/client-lifecycle.scenario.jsx +465 -0
- package/dist/template/scripts/tests/e2e/client-vitest.mts +18 -0
- package/dist/template/scripts/tests/e2e/console.mjs +86 -0
- package/dist/template/scripts/tests/e2e/delivery.mjs +296 -0
- package/dist/template/scripts/tests/e2e/device-favorites.mjs +309 -0
- package/dist/template/scripts/tests/e2e/installations.mjs +132 -0
- package/dist/template/scripts/tests/e2e/policy.mjs +253 -0
- package/dist/template/scripts/tests/e2e/registrar-token.mjs +59 -0
- package/dist/template/scripts/tests/e2e/release-matrix.mjs +307 -0
- package/dist/template/scripts/tests/e2e/releases.mjs +162 -0
- package/dist/template/scripts/tests/e2e/run.mjs +224 -0
- package/dist/template/scripts/tests/manifest-identity.sql +7 -5
- package/dist/template/scripts/tests/public-distribution-history.mjs +102 -0
- package/dist/template/src/client/admin-api.ts +45 -10
- package/dist/template/src/client/admin-types.ts +35 -1
- package/dist/template/src/client/devices/analytics.tsx +168 -231
- package/dist/template/src/client/devices/cohorts.tsx +181 -0
- package/dist/template/src/client/devices/device-name.tsx +37 -23
- package/dist/template/src/client/devices/favorite-targets.tsx +381 -0
- package/dist/template/src/client/devices/registry.tsx +258 -245
- package/dist/template/src/client/devices/use-devices-report.test.tsx +98 -0
- package/dist/template/src/client/devices/use-devices-report.ts +53 -82
- package/dist/template/src/client/devices/version-adoption-chart.tsx +47 -49
- package/dist/template/src/client/distribution-control.tsx +89 -57
- package/dist/template/src/client/distribution-history.tsx +353 -0
- package/dist/template/src/client/guard-action-catalog.tsx +183 -0
- package/dist/template/src/client/guard-action-combobox.test.ts +16 -22
- package/dist/template/src/client/guard-action-combobox.tsx +133 -239
- package/dist/template/src/client/guard-action-options.ts +4 -6
- package/dist/template/src/client/i18n/en.json +133 -2
- package/dist/template/src/client/i18n/language-switching.test.tsx +12 -3
- package/dist/template/src/client/i18n/ru.json +133 -2
- package/dist/template/src/client/i18n/uk.json +133 -2
- package/dist/template/src/client/logout-button.tsx +3 -3
- package/dist/template/src/client/policy-draft.ts +138 -0
- package/dist/template/src/client/update-audience-editor.tsx +597 -206
- package/dist/template/src/client/update-policy-editor.test.ts +101 -29
- package/dist/template/src/client/update-policy-editor.tsx +454 -320
- package/dist/template/src/client/use-filtered-results.ts +55 -0
- package/dist/template/src/server/controllers/manifest.test.ts +23 -3
- package/dist/template/src/server/controllers/manifest.ts +15 -1
- package/dist/template/src/server/devices/audience.ts +9 -5
- package/dist/template/src/server/lib/admin-audience-activation.test.ts +37 -90
- package/dist/template/src/server/lib/admin-release-history.test.ts +138 -0
- package/dist/template/src/server/lib/admin-updates.ts +160 -534
- package/dist/template/src/server/lib/distribution-history.ts +97 -0
- package/dist/template/src/server/lib/supabase.js +24 -0
- package/dist/template/src/server/lib/supabase.test.ts +38 -1
- package/dist/template/src/server/lib/update-policy.test.ts +20 -0
- package/dist/template/src/server/lib/update-policy.ts +23 -10
- package/dist/template/src/server/manifest/manifest-repository.ts +11 -3
- package/dist/template/src/server/manifest/manifest-values.test.ts +2 -0
- package/dist/template/src/server/manifest/manifest-values.ts +21 -13
- package/dist/template/templates/expo-app/scripts/ota-publish/api/database-client.mjs +7 -30
- package/dist/template/templates/expo-app/scripts/ota-register-embedded/index.mjs +2 -1
- package/dist/template/tsconfig.json +2 -2
- package/dist/template-manifest.json +446 -301
- package/package.json +1 -1
- package/dist/template/scripts/lib/device-identity.test.ts +0 -29
- package/dist/template/scripts/lib/ota-client.test.ts +0 -55
- package/dist/template/scripts/lib/ota-update-controller.test.ts +0 -232
- package/dist/template/scripts/lib/ota-updates-ui.test.tsx +0 -154
- package/dist/template/scripts/tests/ota-client-types.mjs +0 -69
- package/dist/template/templates/expo-app/ota-client/README.md +0 -73
- package/dist/template/templates/expo-app/ota-client/controller.ts +0 -107
- package/dist/template/templates/expo-app/ota-client/device-identity.ts +0 -48
- package/dist/template/templates/expo-app/ota-client/docs/update-lifecycle.md +0 -61
- package/dist/template/templates/expo-app/ota-client/index.ts +0 -16
- package/dist/template/templates/expo-app/ota-client/model/hooks/useOtaUpdates.ts +0 -97
- package/dist/template/templates/expo-app/ota-client/model/update-controller.ts +0 -293
- package/dist/template/templates/expo-app/ota-client/runtime.ts +0 -153
- package/dist/template/templates/expo-app/ota-client/types.ts +0 -85
- package/dist/template/templates/expo-app/ota-client/ui/ota-update-gate.tsx +0 -25
- package/dist/template/templates/expo-app/ota-client/ui/ota-updates.tsx +0 -196
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { Siren, Trash2 } from "lucide-react";
|
|
3
|
+
import { ChannelBadge, PlatformBadge } from "@/components/admin/release-badges";
|
|
4
|
+
import { statusTones } from "@/components/ui/status-tones";
|
|
5
|
+
import { Alert, AlertDescription } from "@/components/ui/alert";
|
|
6
|
+
import { Switch } from "@/components/ui/switch";
|
|
7
|
+
import { useConfirmAction } from "@/components/admin/confirm-action";
|
|
2
8
|
import type { TranslationMessage } from "@/src/client/i18n/messages";
|
|
3
9
|
import { useI18n } from "@/src/client/i18n/provider";
|
|
4
10
|
|
|
@@ -43,9 +49,11 @@ const EMPTY_FORM: EmergencyRedirectInput = {
|
|
|
43
49
|
};
|
|
44
50
|
|
|
45
51
|
export default function EmergencyRedirectsPage() {
|
|
52
|
+
const confirmAction = useConfirmAction();
|
|
46
53
|
const { t } = useI18n();
|
|
47
54
|
const [items, setItems] = useState<EmergencyRedirectItem[]>([]);
|
|
48
55
|
const [form, setForm] = useState<EmergencyRedirectInput>(EMPTY_FORM);
|
|
56
|
+
const [showEditor, setShowEditor] = useState(false);
|
|
49
57
|
const [editingId, setEditingId] = useState<string | null>(null);
|
|
50
58
|
const [canWrite, setCanWrite] = useState(false);
|
|
51
59
|
const [loading, setLoading] = useState(true);
|
|
@@ -80,6 +88,7 @@ export default function EmergencyRedirectsPage() {
|
|
|
80
88
|
const resetForm = () => {
|
|
81
89
|
setEditingId(null);
|
|
82
90
|
setForm(EMPTY_FORM);
|
|
91
|
+
setShowEditor(false);
|
|
83
92
|
};
|
|
84
93
|
|
|
85
94
|
const handleSubmit = async (event: FormEvent) => {
|
|
@@ -116,6 +125,7 @@ export default function EmergencyRedirectsPage() {
|
|
|
116
125
|
|
|
117
126
|
const edit = (item: EmergencyRedirectItem) => {
|
|
118
127
|
setEditingId(item.id);
|
|
128
|
+
setShowEditor(true);
|
|
119
129
|
setForm({
|
|
120
130
|
name: item.name,
|
|
121
131
|
enabled: item.enabled,
|
|
@@ -138,15 +148,17 @@ export default function EmergencyRedirectsPage() {
|
|
|
138
148
|
setSuccess(item.enabled ? "Redirect отключён" : "Redirect включён");
|
|
139
149
|
await load();
|
|
140
150
|
} catch (toggleError: unknown) {
|
|
141
|
-
setError(
|
|
142
|
-
(toggleError as Error).message || "Не удалось изменить статус",
|
|
143
|
-
);
|
|
151
|
+
setError((toggleError as Error).message || "Не удалось изменить статус");
|
|
144
152
|
}
|
|
145
153
|
};
|
|
146
154
|
|
|
147
155
|
const remove = async (item: EmergencyRedirectItem) => {
|
|
148
156
|
if (
|
|
149
|
-
!
|
|
157
|
+
!(await confirmAction(
|
|
158
|
+
t("Удалить"),
|
|
159
|
+
t('Удалить emergency redirect "{0}"?', [item.name]),
|
|
160
|
+
true,
|
|
161
|
+
))
|
|
150
162
|
) {
|
|
151
163
|
return;
|
|
152
164
|
}
|
|
@@ -161,9 +173,7 @@ export default function EmergencyRedirectsPage() {
|
|
|
161
173
|
}
|
|
162
174
|
await load();
|
|
163
175
|
} catch (deleteError: unknown) {
|
|
164
|
-
setError(
|
|
165
|
-
(deleteError as Error).message || "Не удалось удалить redirect",
|
|
166
|
-
);
|
|
176
|
+
setError((deleteError as Error).message || "Не удалось удалить redirect");
|
|
167
177
|
}
|
|
168
178
|
};
|
|
169
179
|
|
|
@@ -172,7 +182,12 @@ export default function EmergencyRedirectsPage() {
|
|
|
172
182
|
<div className="space-y-6">
|
|
173
183
|
<header className="flex flex-wrap items-start justify-between gap-4">
|
|
174
184
|
<div className="space-y-1">
|
|
175
|
-
<h1 className="text-2xl font-semibold tracking-tight">
|
|
185
|
+
<h1 className="flex items-center gap-2 text-2xl font-semibold tracking-tight">
|
|
186
|
+
<span
|
|
187
|
+
className={`inline-flex rounded-md border p-1.5 ${statusTones.destructive}`}
|
|
188
|
+
>
|
|
189
|
+
<Siren aria-hidden="true" className="size-5" />
|
|
190
|
+
</span>
|
|
176
191
|
{t("Emergency redirects")}
|
|
177
192
|
</h1>
|
|
178
193
|
<p className="text-sm text-muted-foreground">
|
|
@@ -181,46 +196,58 @@ export default function EmergencyRedirectsPage() {
|
|
|
181
196
|
)}
|
|
182
197
|
</p>
|
|
183
198
|
</div>
|
|
184
|
-
<
|
|
185
|
-
{
|
|
186
|
-
|
|
199
|
+
<div className="flex items-center gap-3">
|
|
200
|
+
{canWrite && !showEditor && (
|
|
201
|
+
<Button
|
|
202
|
+
size="sm"
|
|
203
|
+
onClick={() => {
|
|
204
|
+
setError("");
|
|
205
|
+
setShowEditor(true);
|
|
206
|
+
}}
|
|
207
|
+
>
|
|
208
|
+
{t("Новое правило")}
|
|
209
|
+
</Button>
|
|
210
|
+
)}
|
|
211
|
+
<Badge variant="info" className="px-3 py-1">
|
|
212
|
+
{t("Rules: {0}", [items.length])}
|
|
213
|
+
</Badge>
|
|
214
|
+
</div>
|
|
187
215
|
</header>
|
|
188
216
|
|
|
189
217
|
{error ? (
|
|
190
|
-
<
|
|
191
|
-
{t(error)}
|
|
192
|
-
</
|
|
218
|
+
<Alert variant="destructive">
|
|
219
|
+
<AlertDescription>{t(error)}</AlertDescription>
|
|
220
|
+
</Alert>
|
|
193
221
|
) : null}
|
|
194
222
|
{success ? (
|
|
195
|
-
<
|
|
196
|
-
{t(success)}
|
|
197
|
-
</
|
|
223
|
+
<Alert role="status">
|
|
224
|
+
<AlertDescription>{t(success)}</AlertDescription>
|
|
225
|
+
</Alert>
|
|
198
226
|
) : null}
|
|
199
227
|
|
|
200
|
-
{canWrite ? (
|
|
228
|
+
{canWrite && showEditor ? (
|
|
201
229
|
<form
|
|
202
230
|
onSubmit={handleSubmit}
|
|
203
231
|
className="space-y-4 rounded-xl border border-border bg-card p-5 "
|
|
204
232
|
>
|
|
205
233
|
<div className="flex items-center justify-between">
|
|
206
234
|
<h2 className="font-semibold">
|
|
207
|
-
{editingId
|
|
208
|
-
? t("Редактирование правила")
|
|
209
|
-
: t("Новое правило")}
|
|
235
|
+
{editingId ? t("Редактирование правила") : t("Новое правило")}
|
|
210
236
|
</h2>
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
</Button>
|
|
220
|
-
) : null}
|
|
237
|
+
<Button
|
|
238
|
+
variant="outline"
|
|
239
|
+
size="sm"
|
|
240
|
+
type="button"
|
|
241
|
+
onClick={resetForm}
|
|
242
|
+
>
|
|
243
|
+
{t("Отменить")}
|
|
244
|
+
</Button>
|
|
221
245
|
</div>
|
|
222
246
|
|
|
223
|
-
<
|
|
247
|
+
<fieldset className="grid gap-3 md:grid-cols-2 lg:grid-cols-3">
|
|
248
|
+
<legend className="mb-3 text-sm font-medium">
|
|
249
|
+
{t("Matching build")}
|
|
250
|
+
</legend>
|
|
224
251
|
<Input
|
|
225
252
|
label={t("Название")}
|
|
226
253
|
value={form.name}
|
|
@@ -259,10 +286,13 @@ export default function EmergencyRedirectsPage() {
|
|
|
259
286
|
<Input
|
|
260
287
|
label={t("From channel")}
|
|
261
288
|
value={form.fromChannel}
|
|
262
|
-
onChange={(value) =>
|
|
263
|
-
setForm({ ...form, fromChannel: value })
|
|
264
|
-
}
|
|
289
|
+
onChange={(value) => setForm({ ...form, fromChannel: value })}
|
|
265
290
|
/>
|
|
291
|
+
</fieldset>
|
|
292
|
+
<fieldset className="grid gap-3 border-t pt-3 md:grid-cols-3">
|
|
293
|
+
<legend className="pr-2 text-sm font-medium">
|
|
294
|
+
{t("Destination release")}
|
|
295
|
+
</legend>
|
|
266
296
|
<Input
|
|
267
297
|
label={t("To channel")}
|
|
268
298
|
value={form.toChannel}
|
|
@@ -296,22 +326,22 @@ export default function EmergencyRedirectsPage() {
|
|
|
296
326
|
setForm({ ...form, expectedUpdateId: value || null })
|
|
297
327
|
}
|
|
298
328
|
/>
|
|
299
|
-
</
|
|
329
|
+
</fieldset>
|
|
300
330
|
|
|
301
|
-
<label
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
331
|
+
<label
|
|
332
|
+
className={`flex items-center gap-3 rounded-md border p-3 text-sm ${form.enabled ? statusTones.warning : "bg-muted/25"}`}
|
|
333
|
+
>
|
|
334
|
+
<Switch
|
|
305
335
|
checked={form.enabled}
|
|
306
|
-
|
|
307
|
-
setForm({ ...form, enabled:
|
|
336
|
+
onCheckedChange={(checked) =>
|
|
337
|
+
setForm({ ...form, enabled: checked })
|
|
308
338
|
}
|
|
309
339
|
/>
|
|
310
340
|
{t("Включить правило сразу после сохранения")}
|
|
311
341
|
</label>
|
|
312
342
|
|
|
313
343
|
<Button
|
|
314
|
-
variant="default"
|
|
344
|
+
variant={form.enabled ? "destructive" : "default"}
|
|
315
345
|
size="sm"
|
|
316
346
|
type="submit"
|
|
317
347
|
disabled={saving}
|
|
@@ -381,28 +411,30 @@ export default function EmergencyRedirectsPage() {
|
|
|
381
411
|
className="border-t border-border "
|
|
382
412
|
>
|
|
383
413
|
<TableCell className="px-4 py-3">
|
|
384
|
-
<Badge
|
|
385
|
-
variant="secondary"
|
|
386
|
-
className={
|
|
387
|
-
item.enabled
|
|
388
|
-
? "bg-emerald-500/10 text-emerald-700 dark:text-emerald-400"
|
|
389
|
-
: ""
|
|
390
|
-
}
|
|
391
|
-
>
|
|
414
|
+
<Badge variant={item.enabled ? "warning" : "neutral"}>
|
|
392
415
|
{item.enabled ? t("Enabled") : t("Disabled")}
|
|
393
416
|
</Badge>
|
|
394
417
|
</TableCell>
|
|
418
|
+
<TableCell className="px-4 py-3">{item.name}</TableCell>
|
|
395
419
|
<TableCell className="px-4 py-3">
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
420
|
+
<div className="flex flex-wrap items-center gap-1.5">
|
|
421
|
+
<PlatformBadge platform={item.platform} />
|
|
422
|
+
<span>{item.runtimeVersion}</span>
|
|
423
|
+
</div>
|
|
400
424
|
</TableCell>
|
|
401
425
|
<TableCell className="px-4 py-3">
|
|
402
|
-
|
|
426
|
+
<div className="flex max-w-72 flex-wrap items-center gap-1">
|
|
427
|
+
<ChannelBadge channel={item.fromChannel} />
|
|
428
|
+
<span>→</span>
|
|
429
|
+
<ChannelBadge channel={item.toChannel} />
|
|
430
|
+
</div>
|
|
403
431
|
</TableCell>
|
|
404
432
|
<TableCell className="px-4 py-3">
|
|
405
|
-
<Badge
|
|
433
|
+
<Badge
|
|
434
|
+
variant={
|
|
435
|
+
item.targetMode === "pinned" ? "violet" : "info"
|
|
436
|
+
}
|
|
437
|
+
>
|
|
406
438
|
{item.targetMode === "pinned"
|
|
407
439
|
? t("Pinned update")
|
|
408
440
|
: t("Follow channel")}
|
|
@@ -436,7 +468,9 @@ export default function EmergencyRedirectsPage() {
|
|
|
436
468
|
{t("Edit")}
|
|
437
469
|
</Button>
|
|
438
470
|
<Button
|
|
439
|
-
variant=
|
|
471
|
+
variant={
|
|
472
|
+
item.enabled ? "outline" : "destructive"
|
|
473
|
+
}
|
|
440
474
|
size="sm"
|
|
441
475
|
type="button"
|
|
442
476
|
onClick={() => void toggle(item)}
|
|
@@ -449,6 +483,7 @@ export default function EmergencyRedirectsPage() {
|
|
|
449
483
|
type="button"
|
|
450
484
|
onClick={() => void remove(item)}
|
|
451
485
|
>
|
|
486
|
+
<Trash2 aria-hidden="true" />
|
|
452
487
|
{t("Delete")}
|
|
453
488
|
</Button>
|
|
454
489
|
</div>
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ConfirmActionProvider } from "@/components/admin/confirm-action";
|
|
1
2
|
import { getAdminSessionFromServerCookies } from "@/src/server/lib/admin-auth";
|
|
2
3
|
import { AdminShell } from "@/components/admin/admin-shell";
|
|
3
4
|
import { redirect } from "next/navigation";
|
|
@@ -13,7 +14,7 @@ export default async function UpdatesLayout({
|
|
|
13
14
|
|
|
14
15
|
return (
|
|
15
16
|
<AdminShell session={{ username: session.username, role: session.role }}>
|
|
16
|
-
{children}
|
|
17
|
+
<ConfirmActionProvider>{children}</ConfirmActionProvider>
|
|
17
18
|
</AdminShell>
|
|
18
19
|
);
|
|
19
20
|
}
|