Merge branch 'master' into release-3.0
This commit is contained in:
commit
cb2e75cfd1
18
msa/js-executor/package-lock.json
generated
18
msa/js-executor/package-lock.json
generated
@ -1428,7 +1428,7 @@
|
||||
},
|
||||
"enabled": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/enabled/-/enabled-1.0.2.tgz",
|
||||
"resolved": "http://registry.npmjs.org/enabled/-/enabled-1.0.2.tgz",
|
||||
"integrity": "sha1-ll9lE9LC0cX0ZStkouM5ZGf8L5M=",
|
||||
"requires": {
|
||||
"env-variable": "0.0.x"
|
||||
@ -1779,7 +1779,7 @@
|
||||
},
|
||||
"fecha": {
|
||||
"version": "2.3.3",
|
||||
"resolved": "https://registry.npmjs.org/fecha/-/fecha-2.3.3.tgz",
|
||||
"resolved": "http://registry.npmjs.org/fecha/-/fecha-2.3.3.tgz",
|
||||
"integrity": "sha512-lUGBnIamTAwk4znq5BcqsDaxSmZ9nDVJaij6NvRt/Tg4R69gERA+otPKbS86ROw9nxVMw2/mp1fnaiWqbs6Sdg=="
|
||||
},
|
||||
"file-stream-rotator": {
|
||||
@ -2472,7 +2472,7 @@
|
||||
},
|
||||
"get-stream": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz",
|
||||
"resolved": "http://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz",
|
||||
"integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=",
|
||||
"dev": true
|
||||
},
|
||||
@ -2597,7 +2597,7 @@
|
||||
},
|
||||
"got": {
|
||||
"version": "6.7.1",
|
||||
"resolved": "https://registry.npmjs.org/got/-/got-6.7.1.tgz",
|
||||
"resolved": "http://registry.npmjs.org/got/-/got-6.7.1.tgz",
|
||||
"integrity": "sha1-JAzQV4WpoY5WHcG0S0HHY+8ejbA=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
@ -2920,7 +2920,7 @@
|
||||
},
|
||||
"is-obj": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz",
|
||||
"resolved": "http://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz",
|
||||
"integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=",
|
||||
"dev": true
|
||||
},
|
||||
@ -3276,7 +3276,7 @@
|
||||
},
|
||||
"minimist": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
|
||||
"resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
|
||||
"integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=",
|
||||
"dev": true
|
||||
},
|
||||
@ -3604,7 +3604,7 @@
|
||||
},
|
||||
"path-is-absolute": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
|
||||
"resolved": "http://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
|
||||
"integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=",
|
||||
"dev": true
|
||||
},
|
||||
@ -4161,7 +4161,7 @@
|
||||
},
|
||||
"safe-regex": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz",
|
||||
"resolved": "http://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz",
|
||||
"integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
@ -4574,7 +4574,7 @@
|
||||
},
|
||||
"strip-eof": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz",
|
||||
"resolved": "http://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz",
|
||||
"integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=",
|
||||
"dev": true
|
||||
},
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -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">
|
||||
@ -87,6 +87,40 @@
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<tb-checkbox formControlName="enableProxy" style="display: block; padding-bottom: 16px;">
|
||||
{{ 'admin.enable-proxy' | translate }}
|
||||
</tb-checkbox>
|
||||
<div *ngIf="mailSettings.get('enableProxy').value">
|
||||
<div fxLayout.gt-sm="row" fxLayoutGap.gt-sm="8px">
|
||||
<mat-form-field class="mat-block" fxFlex="100" fxFlex.gt-sm="60">
|
||||
<mat-label translate>admin.proxy-host</mat-label>
|
||||
<input matInput required formControlName="proxyHost">
|
||||
<mat-error *ngIf="mailSettings.get('proxyHost').hasError('required')">
|
||||
{{ 'admin.proxy-host-required' | translate }}
|
||||
</mat-error>
|
||||
</mat-form-field>
|
||||
<mat-form-field class="mat-block" fxFlex="100" fxFlex.gt-sm="40">
|
||||
<mat-label translate>admin.proxy-port</mat-label>
|
||||
<input matInput required formControlName="proxyPort" type="number" step="1" min="1" max="65535">
|
||||
<mat-error *ngIf="mailSettings.get('proxyPort').hasError('required')">
|
||||
{{ 'admin.proxy-port-required' | translate }}
|
||||
</mat-error>
|
||||
<mat-error *ngIf="mailSettings.get('proxyPort').hasError('pattern')
|
||||
|| mailSettings.get('proxyPort').hasError('min')
|
||||
|| mailSettings.get('proxyPort').hasError('max')">
|
||||
{{ 'admin.proxy-port-range' | translate }}
|
||||
</mat-error>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<mat-form-field class="mat-block">
|
||||
<mat-label translate>admin.proxy-user</mat-label>
|
||||
<input matInput formControlName="proxyUser">
|
||||
</mat-form-field>
|
||||
<mat-form-field class="mat-block">
|
||||
<mat-label translate>admin.proxy-password</mat-label>
|
||||
<input matInput formControlName="proxyPassword">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<mat-form-field class="mat-block">
|
||||
<mat-label translate>common.username</mat-label>
|
||||
<input matInput formControlName="username" placeholder="{{ 'common.enter-username' | translate }}"/>
|
||||
|
||||
@ -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,7 +53,11 @@ 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();
|
||||
}
|
||||
);
|
||||
}
|
||||
@ -68,13 +73,33 @@ 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]],
|
||||
proxyPort: ['', [Validators.required, Validators.min(1), Validators.max(65535)]],
|
||||
proxyUser: [''],
|
||||
proxyPassword: [''],
|
||||
username: [''],
|
||||
password: ['']
|
||||
});
|
||||
this.registerDisableOnLoadFormControl(this.mailSettings.get('smtpProtocol'));
|
||||
this.registerDisableOnLoadFormControl(this.mailSettings.get('enableTls'));
|
||||
this.registerDisableOnLoadFormControl(this.mailSettings.get('enableProxy'));
|
||||
this.mailSettings.get('enableProxy').valueChanges.subscribe(() => {
|
||||
this.enableProxyChanged();
|
||||
});
|
||||
}
|
||||
|
||||
enableProxyChanged(): void {
|
||||
let enableProxy: boolean = this.mailSettings.get('enableProxy').value;
|
||||
if (enableProxy) {
|
||||
this.mailSettings.get('proxyHost').enable();
|
||||
this.mailSettings.get('proxyPort').enable();
|
||||
} else {
|
||||
this.mailSettings.get('proxyHost').disable();
|
||||
this.mailSettings.get('proxyPort').disable();
|
||||
}
|
||||
}
|
||||
|
||||
sendTestMail(): void {
|
||||
|
||||
@ -32,6 +32,11 @@ export interface MailServerSettings {
|
||||
enableTls: boolean;
|
||||
username: string;
|
||||
password: string;
|
||||
enableProxy: boolean;
|
||||
proxyHost: string;
|
||||
proxyPort: number;
|
||||
proxyUser: string;
|
||||
proxyPassword: string;
|
||||
}
|
||||
|
||||
export interface GeneralSettings {
|
||||
|
||||
@ -94,8 +94,8 @@
|
||||
"proxy-host": "Proxy host",
|
||||
"proxy-host-required": "Proxy host is required.",
|
||||
"proxy-port": "Proxy port",
|
||||
"proxy-port-required": "You must supply a proxy port.",
|
||||
"proxy-port-invalid": "That doesn't look like a valid proxy port.",
|
||||
"proxy-port-required": "Proxy port is required.",
|
||||
"proxy-port-range": "Proxy port should be in a range from 1 to 65535.",
|
||||
"proxy-user": "Proxy user",
|
||||
"proxy-password": "Proxy password",
|
||||
"send-test-mail": "Send test mail",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user