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()) {
@@ -79,6 +87,7 @@ export class RegisterPage {
readonly loaded = signal(false);
readonly enabled = signal(false);
+ readonly show = signal(false);
readonly domains = signal([]);
readonly domain = signal('');
readonly local = signal('');
diff --git a/frontend/src/app/pages/settings/mailboxes.section.ts b/frontend/src/app/pages/settings/mailboxes.section.ts
index 848fbf3..cbf8fe5 100644
--- a/frontend/src/app/pages/settings/mailboxes.section.ts
+++ b/frontend/src/app/pages/settings/mailboxes.section.ts
@@ -20,11 +20,26 @@ import { AuthService } from '../../core/auth.service';
@if (error()) { {{ 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';
@@ -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));