Browse Source

Improve mail server settings

pull/2903/head
Igor Kulikov 6 years ago
parent
commit
9e94611004
  1. 4
      ui-ngx/src/app/modules/home/pages/admin/mail-server.component.html
  2. 6
      ui-ngx/src/app/modules/home/pages/admin/mail-server.component.ts

4
ui-ngx/src/app/modules/home/pages/admin/mail-server.component.html

@ -76,10 +76,10 @@
{{ 'admin.timeout-invalid' | translate }}
</mat-error>
</mat-form-field>
<tb-checkbox formControlName="enableTls" trueValue="true" falseValue="false" style="display: block; padding-bottom: 16px;">
<tb-checkbox formControlName="enableTls" style="display: block; padding-bottom: 16px;">
{{ 'admin.enable-tls' | translate }}
</tb-checkbox>
<mat-form-field class="mat-block" *ngIf="mailSettings.get('enableTls').value === 'true'">
<mat-form-field class="mat-block" *ngIf="mailSettings.get('enableTls').value">
<mat-label translate>admin.tls-version</mat-label>
<mat-select formControlName="tlsVersion">
<mat-option *ngFor="let tlsVersion of tlsVersions" [value]="tlsVersion">

6
ui-ngx/src/app/modules/home/pages/admin/mail-server.component.ts

@ -25,6 +25,7 @@ import { AdminService } from '@core/http/admin.service';
import { ActionNotificationShow } from '@core/notification/notification.actions';
import { TranslateService } from '@ngx-translate/core';
import { HasConfirmForm } from '@core/guards/confirm-on-exit.guard';
import { isString } from '@core/utils';
@Component({
selector: 'tb-mail-server',
@ -52,6 +53,9 @@ export class MailServerComponent extends PageComponent implements OnInit, HasCon
this.adminService.getAdminSettings<MailServerSettings>('mail').subscribe(
(adminSettings) => {
this.adminSettings = adminSettings;
if (this.adminSettings.jsonValue && isString(this.adminSettings.jsonValue.enableTls)) {
this.adminSettings.jsonValue.enableTls = (this.adminSettings.jsonValue.enableTls as any) === 'true';
}
this.mailSettings.reset(this.adminSettings.jsonValue);
this.enableProxyChanged();
}
@ -69,7 +73,7 @@ export class MailServerComponent extends PageComponent implements OnInit, HasCon
timeout: ['10000', [Validators.required,
Validators.pattern(/^[0-9]{1,6}$/),
Validators.maxLength(6)]],
enableTls: ['false'],
enableTls: [false],
tlsVersion: [],
enableProxy: [false, []],
proxyHost: ['', [Validators.required]],

Loading…
Cancel
Save