create-expo-updates-server 0.4.0 → 0.6.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/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 +303 -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 +25 -3
- package/dist/template/src/server/controllers/manifest.ts +1 -2
- 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 +2 -2
- 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 +445 -300
- 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
|
@@ -2,71 +2,66 @@
|
|
|
2
2
|
@import "tw-animate-css";
|
|
3
3
|
@custom-variant dark (&:is(.dark *));
|
|
4
4
|
:root {
|
|
5
|
-
|
|
6
|
-
--
|
|
7
|
-
--
|
|
8
|
-
--card
|
|
9
|
-
--
|
|
10
|
-
--popover
|
|
11
|
-
--
|
|
12
|
-
--primary
|
|
13
|
-
--
|
|
14
|
-
--secondary
|
|
15
|
-
--
|
|
16
|
-
--muted
|
|
17
|
-
--
|
|
18
|
-
--accent
|
|
19
|
-
--
|
|
20
|
-
--
|
|
21
|
-
--
|
|
22
|
-
--
|
|
23
|
-
--
|
|
24
|
-
--
|
|
25
|
-
--
|
|
26
|
-
--
|
|
27
|
-
--chart-
|
|
28
|
-
--chart-
|
|
29
|
-
--
|
|
30
|
-
--
|
|
31
|
-
--
|
|
32
|
-
--sidebar
|
|
33
|
-
--sidebar-
|
|
34
|
-
--sidebar-
|
|
35
|
-
--sidebar-
|
|
36
|
-
--sidebar-
|
|
5
|
+
color-scheme: light;
|
|
6
|
+
--background: #fafafa;
|
|
7
|
+
--foreground: #171717;
|
|
8
|
+
--card: #fff;
|
|
9
|
+
--card-foreground: var(--foreground);
|
|
10
|
+
--popover: #fff;
|
|
11
|
+
--popover-foreground: var(--foreground);
|
|
12
|
+
--primary: #171717;
|
|
13
|
+
--primary-foreground: #fff;
|
|
14
|
+
--secondary: #f2f2f2;
|
|
15
|
+
--secondary-foreground: #262626;
|
|
16
|
+
--muted: #f5f5f5;
|
|
17
|
+
--muted-foreground: #626262;
|
|
18
|
+
--accent: #ebebeb;
|
|
19
|
+
--accent-foreground: var(--foreground);
|
|
20
|
+
--destructive: #ae2436;
|
|
21
|
+
--destructive-button: #b42336;
|
|
22
|
+
--destructive-hover: #912034;
|
|
23
|
+
--border: #dedede;
|
|
24
|
+
--input: #c5c5c5;
|
|
25
|
+
--ring: #0070f3;
|
|
26
|
+
--radius: 0.375rem;
|
|
27
|
+
--chart-1: #1264bf;
|
|
28
|
+
--chart-2: #087966;
|
|
29
|
+
--chart-3: #946000;
|
|
30
|
+
--chart-4: #b63854;
|
|
31
|
+
--chart-5: #587528;
|
|
32
|
+
--sidebar: #fff;
|
|
33
|
+
--sidebar-foreground: var(--muted-foreground);
|
|
34
|
+
--sidebar-primary: var(--primary);
|
|
35
|
+
--sidebar-primary-foreground: var(--primary-foreground);
|
|
36
|
+
--sidebar-accent: #ededed;
|
|
37
|
+
--sidebar-accent-foreground: var(--foreground);
|
|
38
|
+
--sidebar-border: var(--border);
|
|
39
|
+
--sidebar-ring: var(--ring);
|
|
37
40
|
}
|
|
38
41
|
.dark {
|
|
39
|
-
|
|
40
|
-
--
|
|
41
|
-
--
|
|
42
|
-
--card
|
|
43
|
-
--popover: #
|
|
44
|
-
--
|
|
45
|
-
--primary: #
|
|
46
|
-
--
|
|
47
|
-
--secondary: #
|
|
48
|
-
--
|
|
49
|
-
--muted: #
|
|
50
|
-
--
|
|
51
|
-
--
|
|
52
|
-
--
|
|
53
|
-
--
|
|
54
|
-
--
|
|
55
|
-
--
|
|
56
|
-
--
|
|
57
|
-
--chart-
|
|
58
|
-
--chart-
|
|
59
|
-
--chart-
|
|
60
|
-
--
|
|
61
|
-
--
|
|
62
|
-
--sidebar: #181c24;
|
|
63
|
-
--sidebar-foreground: #98a4b5;
|
|
64
|
-
--sidebar-primary: #8673f2;
|
|
65
|
-
--sidebar-primary-foreground: #12151b;
|
|
66
|
-
--sidebar-accent: #302c4a;
|
|
67
|
-
--sidebar-accent-foreground: #c6bffa;
|
|
68
|
-
--sidebar-border: #323844;
|
|
69
|
-
--sidebar-ring: #8673f2;
|
|
42
|
+
color-scheme: dark;
|
|
43
|
+
--background: #000;
|
|
44
|
+
--foreground: #ededed;
|
|
45
|
+
--card: #080808;
|
|
46
|
+
--popover: #141414;
|
|
47
|
+
--primary: #ededed;
|
|
48
|
+
--primary-foreground: #0a0a0a;
|
|
49
|
+
--secondary: #222;
|
|
50
|
+
--secondary-foreground: #ededed;
|
|
51
|
+
--muted: #191919;
|
|
52
|
+
--muted-foreground: #a1a1a1;
|
|
53
|
+
--accent: #242424;
|
|
54
|
+
--destructive: #ff9ba7;
|
|
55
|
+
--border: #2b2b2b;
|
|
56
|
+
--input: #484848;
|
|
57
|
+
--ring: #52a8ff;
|
|
58
|
+
--chart-1: #69b2ff;
|
|
59
|
+
--chart-2: #52d5b5;
|
|
60
|
+
--chart-3: #f5b455;
|
|
61
|
+
--chart-4: #ff809e;
|
|
62
|
+
--chart-5: #bbd377;
|
|
63
|
+
--sidebar: #000;
|
|
64
|
+
--sidebar-accent: #202020;
|
|
70
65
|
}
|
|
71
66
|
@theme inline {
|
|
72
67
|
--color-background: var(--background);
|
|
@@ -84,6 +79,8 @@
|
|
|
84
79
|
--color-accent: var(--accent);
|
|
85
80
|
--color-accent-foreground: var(--accent-foreground);
|
|
86
81
|
--color-destructive: var(--destructive);
|
|
82
|
+
--color-destructive-button: var(--destructive-button);
|
|
83
|
+
--color-destructive-hover: var(--destructive-hover);
|
|
87
84
|
--color-border: var(--border);
|
|
88
85
|
--color-input: var(--input);
|
|
89
86
|
--color-ring: var(--ring);
|
|
@@ -92,10 +89,10 @@
|
|
|
92
89
|
--color-chart-3: var(--chart-3);
|
|
93
90
|
--color-chart-4: var(--chart-4);
|
|
94
91
|
--color-chart-5: var(--chart-5);
|
|
95
|
-
--radius-sm: calc(var(--radius) -
|
|
96
|
-
--radius-md: calc(var(--radius) -
|
|
92
|
+
--radius-sm: calc(var(--radius) - 2px);
|
|
93
|
+
--radius-md: calc(var(--radius) - 1px);
|
|
97
94
|
--radius-lg: var(--radius);
|
|
98
|
-
--radius-xl: calc(var(--radius) +
|
|
95
|
+
--radius-xl: calc(var(--radius) + 2px);
|
|
99
96
|
--color-sidebar: var(--sidebar);
|
|
100
97
|
--color-sidebar-foreground: var(--sidebar-foreground);
|
|
101
98
|
--color-sidebar-primary: var(--sidebar-primary);
|
|
@@ -119,7 +116,7 @@
|
|
|
119
116
|
cursor: pointer;
|
|
120
117
|
}
|
|
121
118
|
::selection {
|
|
122
|
-
background: var(--
|
|
123
|
-
color: var(--
|
|
119
|
+
background: var(--primary);
|
|
120
|
+
color: var(--primary-foreground);
|
|
124
121
|
}
|
|
125
122
|
}
|
|
@@ -2,7 +2,11 @@
|
|
|
2
2
|
import { LanguageSwitcher } from "@/components/admin/language-switcher";
|
|
3
3
|
import { useI18n } from "@/src/client/i18n/provider";
|
|
4
4
|
|
|
5
|
+
import { ArrowRight, RadioTower } from "lucide-react";
|
|
6
|
+
import { Card, CardContent, CardHeader } from "@/components/ui/card";
|
|
7
|
+
import { Alert, AlertDescription } from "@/components/ui/alert";
|
|
5
8
|
import { Button } from "@/components/ui/button";
|
|
9
|
+
import { Field, FieldLabel } from "@/components/ui/field";
|
|
6
10
|
import { Input } from "@/components/ui/input";
|
|
7
11
|
import { adminLogin } from "@/src/client/admin-api";
|
|
8
12
|
import { useRouter } from "next/navigation";
|
|
@@ -32,50 +36,70 @@ export default function LoginPage() {
|
|
|
32
36
|
};
|
|
33
37
|
|
|
34
38
|
return (
|
|
35
|
-
<main className="flex min-h-
|
|
36
|
-
<
|
|
39
|
+
<main className="flex min-h-svh flex-col bg-background">
|
|
40
|
+
<header className="flex items-center justify-between gap-4 border-b px-5 py-3 md:px-8">
|
|
41
|
+
<div className="flex items-center gap-2.5 font-semibold tracking-tight">
|
|
42
|
+
<span className="grid size-8 place-items-center rounded-lg bg-primary text-primary-foreground">
|
|
43
|
+
<RadioTower aria-hidden="true" className="size-[18px]" />
|
|
44
|
+
</span>
|
|
45
|
+
OTA Console
|
|
46
|
+
</div>
|
|
37
47
|
<LanguageSwitcher />
|
|
48
|
+
</header>
|
|
49
|
+
<div className="grid flex-1 place-items-center px-4 py-12">
|
|
50
|
+
<Card className="w-full max-w-sm gap-5">
|
|
51
|
+
<CardHeader>
|
|
52
|
+
<h1 className="text-2xl font-semibold tracking-tight">
|
|
53
|
+
{t("Войти")}
|
|
54
|
+
</h1>
|
|
55
|
+
<p className="text-sm text-muted-foreground">
|
|
56
|
+
{t("Вход в панель управления обновлениями")}
|
|
57
|
+
</p>
|
|
58
|
+
</CardHeader>
|
|
59
|
+
<CardContent>
|
|
60
|
+
<form
|
|
61
|
+
onSubmit={handleSubmit}
|
|
62
|
+
className="grid gap-4"
|
|
63
|
+
aria-busy={loading}
|
|
64
|
+
>
|
|
65
|
+
<Field>
|
|
66
|
+
<FieldLabel htmlFor="username">{t("Логин")}</FieldLabel>
|
|
67
|
+
<Input
|
|
68
|
+
value={username}
|
|
69
|
+
onChange={(event) => setUsername(event.target.value)}
|
|
70
|
+
autoComplete="username"
|
|
71
|
+
id="username"
|
|
72
|
+
name="username"
|
|
73
|
+
autoCapitalize="none"
|
|
74
|
+
spellCheck={false}
|
|
75
|
+
required
|
|
76
|
+
/>
|
|
77
|
+
</Field>
|
|
78
|
+
<Field>
|
|
79
|
+
<FieldLabel htmlFor="password">{t("Пароль")}</FieldLabel>
|
|
80
|
+
<Input
|
|
81
|
+
type="password"
|
|
82
|
+
value={password}
|
|
83
|
+
onChange={(event) => setPassword(event.target.value)}
|
|
84
|
+
autoComplete="current-password"
|
|
85
|
+
id="password"
|
|
86
|
+
name="password"
|
|
87
|
+
required
|
|
88
|
+
/>
|
|
89
|
+
</Field>
|
|
90
|
+
{error && (
|
|
91
|
+
<Alert variant="destructive">
|
|
92
|
+
<AlertDescription>{t(error)}</AlertDescription>
|
|
93
|
+
</Alert>
|
|
94
|
+
)}
|
|
95
|
+
<Button type="submit" disabled={loading} className="mt-1 w-full">
|
|
96
|
+
{loading ? t("Вход...") : t("Войти")}{" "}
|
|
97
|
+
<ArrowRight aria-hidden="true" />
|
|
98
|
+
</Button>
|
|
99
|
+
</form>
|
|
100
|
+
</CardContent>
|
|
101
|
+
</Card>
|
|
38
102
|
</div>
|
|
39
|
-
<form
|
|
40
|
-
onSubmit={handleSubmit}
|
|
41
|
-
className="w-full max-w-md rounded-xl border border-border bg-card p-6 shadow-sm"
|
|
42
|
-
>
|
|
43
|
-
<h1 className="text-2xl font-semibold">OTA Admin</h1>
|
|
44
|
-
<p className="mt-1 text-sm text-muted-foreground">
|
|
45
|
-
{t("Вход в панель управления обновлениями")}
|
|
46
|
-
</p>
|
|
47
|
-
|
|
48
|
-
<div className="mt-6 space-y-4">
|
|
49
|
-
<label className="block">
|
|
50
|
-
<span className="mb-1 block text-sm">{t("Логин")}</span>
|
|
51
|
-
<Input
|
|
52
|
-
value={username}
|
|
53
|
-
onChange={(event) => setUsername(event.target.value)}
|
|
54
|
-
|
|
55
|
-
autoComplete="username"
|
|
56
|
-
required
|
|
57
|
-
/>
|
|
58
|
-
</label>
|
|
59
|
-
|
|
60
|
-
<label className="block">
|
|
61
|
-
<span className="mb-1 block text-sm">{t("Пароль")}</span>
|
|
62
|
-
<Input
|
|
63
|
-
type="password"
|
|
64
|
-
value={password}
|
|
65
|
-
onChange={(event) => setPassword(event.target.value)}
|
|
66
|
-
|
|
67
|
-
autoComplete="current-password"
|
|
68
|
-
required
|
|
69
|
-
/>
|
|
70
|
-
</label>
|
|
71
|
-
</div>
|
|
72
|
-
|
|
73
|
-
{error ? <p className="mt-4 text-sm text-red-600">{t(error)}</p> : null}
|
|
74
|
-
|
|
75
|
-
<Button type="submit" disabled={loading} className="mt-6 w-full">
|
|
76
|
-
{loading ? t("Вход...") : t("Войти")}
|
|
77
|
-
</Button>
|
|
78
|
-
</form>
|
|
79
103
|
</main>
|
|
80
104
|
);
|
|
81
105
|
}
|