From aedda06f2e38649021fc3ba1c067819fd69ae0e3 Mon Sep 17 00:00:00 2001 From: Liosha84 Date: Sat, 7 Nov 2026 03:11:42 +0100 Subject: [PATCH] =?UTF-8?q?=D0=92=D0=B5=D0=B1-=D0=BF=D0=BE=D1=87=D1=82?= =?UTF-8?q?=D0=B0:=20=D0=BF=D1=80=D0=B8=20=D1=81=D0=BE=D0=B7=D0=B4=D0=B0?= =?UTF-8?q?=D0=BD=D0=B8=D0=B8=20=D1=8F=D1=89=D0=B8=D0=BA=D0=B0=20=E2=80=94?= =?UTF-8?q?=20=D1=82=D0=BE=D0=BB=D1=8C=D0=BA=D0=BE=20=D0=B8=D0=BC=D1=8F,?= =?UTF-8?q?=20@=D0=B4=D0=BE=D0=BC=D0=B5=D0=BD=20=D0=BF=D0=BE=D0=B4=D1=81?= =?UTF-8?q?=D1=82=D0=B0=D0=B2=D0=BB=D1=8F=D0=B5=D1=82=D1=81=D1=8F=20(?= =?UTF-8?q?=D0=B2=D1=8B=D0=B1=D0=BE=D1=80,=20=D0=B5=D1=81=D0=BB=D0=B8=20?= =?UTF-8?q?=D0=B4=D0=BE=D0=BC=D0=B5=D0=BD=D0=BE=D0=B2=20=D0=BD=D0=B5=D1=81?= =?UTF-8?q?=D0=BA=D0=BE=D0=BB=D1=8C=D0=BA=D0=BE);=20=D0=B3=D0=BB=D0=B0?= =?UTF-8?q?=D0=B7=D0=BE=D0=BA=20=C2=AB=D0=BF=D0=BE=D0=BA=D0=B0=D0=B7=D0=B0?= =?UTF-8?q?=D1=82=D1=8C=20=D0=BF=D0=B0=D1=80=D0=BE=D0=BB=D1=8C=C2=BB=20?= =?UTF-8?q?=D1=83=20=D0=B2=D1=81=D0=B5=D1=85=20=D0=BF=D0=BE=D0=BB=D0=B5?= =?UTF-8?q?=D0=B9=20=D0=BF=D0=B0=D1=80=D0=BE=D0=BB=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Регистрация, смена пароля, создание ящика (вход уже был). Co-Authored-By: Claude Opus 5.5 --- frontend/src/app/pages/auth/register.page.ts | 13 +++++- .../app/pages/settings/mailboxes.section.ts | 40 +++++++++++++++---- .../src/app/pages/settings/settings.page.ts | 19 +++++++-- 3 files changed, 59 insertions(+), 13 deletions(-) diff --git a/frontend/src/app/pages/auth/register.page.ts b/frontend/src/app/pages/auth/register.page.ts index d121f9b..beebd82 100644 --- a/frontend/src/app/pages/auth/register.page.ts +++ b/frontend/src/app/pages/auth/register.page.ts @@ -49,13 +49,21 @@ const NAME = /^[a-z0-9]([a-z0-9._-]{0,62}[a-z0-9])?$/;
- +
- +
@if (error()) {
-
+
+ + @ + @if (domains().length > 1) { + + } @else { + {{ domain() }} + } +
-
+
+
@if (error()) { } @@ -74,13 +89,20 @@ export class MailboxesSection { readonly error = signal(''); readonly busy = signal(false); readonly me = computed(() => this.state.profile()?.email ?? ''); - readonly domain = computed(() => this.me().split('@')[1] ?? 'example.com'); - - email = ''; + readonly showPw = signal(false); + readonly local = signal(''); + // Домены сервера (/api/config); пока не пришли — домен своего ящика + readonly domains = signal([]); + readonly domain = signal(''); name = ''; password = ''; constructor() { + this.domain.set(this.me().split('@')[1] ?? ''); + this.api.config().subscribe({ + next: c => { this.domains.set(c.domains); if (!c.domains.includes(this.domain())) { this.domain.set(c.domains[0] ?? ''); } }, + error: () => {} + }); this.load(); } @@ -93,14 +115,16 @@ export class MailboxesSection { } create(): void { - const email = this.email.trim(); - if (!email) { this.error.set('Enter an address'); return; } + const local = this.local().replace(/@.*$/, ''); + if (!local) { this.error.set('Enter an address'); return; } + const email = local + '@' + this.domain(); this.error.set(''); this.busy.set(true); this.api.createMailbox(email, this.name.trim(), this.password).subscribe({ next: created => { this.busy.set(false); - this.email = this.name = this.password = ''; + this.local.set(''); + this.name = this.password = ''; if (created.password) { this.secret.set({ email: created.mailbox.email, password: created.password }); } this.toasts.ok('Mailbox ' + created.mailbox.email + ' created'); this.load(); diff --git a/frontend/src/app/pages/settings/settings.page.ts b/frontend/src/app/pages/settings/settings.page.ts index 4919f56..7b9dc1f 100644 --- a/frontend/src/app/pages/settings/settings.page.ts +++ b/frontend/src/app/pages/settings/settings.page.ts @@ -42,11 +42,23 @@ import { MailboxesSection } from './mailboxes.section';
-
+
+
-
+
+
-
+
+
@if (passwordError()) { }
@@ -117,6 +129,7 @@ export class SettingsPage { next = ''; again = ''; readonly passwordError = signal(''); + readonly showPw = signal(false); readonly used = computed(() => formatBytes(this.state.profile()?.usedBytes)); readonly quota = computed(() => formatBytes(this.state.profile()?.quotaBytes));