added ui for send email rule node and refactored mail server
This commit is contained in:
		
							parent
							
								
									6066a6bf04
								
							
						
					
					
						commit
						1f065f99c9
					
				
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							@ -90,33 +90,37 @@
 | 
				
			|||||||
          <tb-checkbox formControlName="enableProxy" style="display: block; padding-bottom: 16px;">
 | 
					          <tb-checkbox formControlName="enableProxy" style="display: block; padding-bottom: 16px;">
 | 
				
			||||||
            {{ 'admin.enable-proxy' | translate }}
 | 
					            {{ 'admin.enable-proxy' | translate }}
 | 
				
			||||||
          </tb-checkbox>
 | 
					          </tb-checkbox>
 | 
				
			||||||
          <div fxLayout.gt-sm="row">
 | 
					          <div *ngIf="enableProxy()">
 | 
				
			||||||
            <mat-form-field class="mat-block"  *ngIf="enableProxy()" fxFlex="100" fxFlex.gt-sm="60">
 | 
					            <div fxLayout.gt-sm="row">
 | 
				
			||||||
              <mat-label translate>admin.proxy-host</mat-label>
 | 
					              <mat-form-field class="mat-block" fxFlex="100" fxFlex.gt-sm="60">
 | 
				
			||||||
              <input matInput required formControlName="proxyHost">
 | 
					                <mat-label translate>admin.proxy-host</mat-label>
 | 
				
			||||||
              <mat-error *ngIf="mailSettings.get('proxyHost').hasError('required')">
 | 
					                <input matInput required formControlName="proxyHost">
 | 
				
			||||||
                {{ 'admin.proxy-host-required' | translate }}
 | 
					                <mat-error *ngIf="mailSettings.get('proxyHost').hasError('required')">
 | 
				
			||||||
              </mat-error>
 | 
					                  {{ '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>
 | 
				
			||||||
            <mat-form-field class="mat-block" *ngIf="enableProxy()" fxFlex="100" fxFlex.gt-sm="40">
 | 
					            <mat-form-field class="mat-block">
 | 
				
			||||||
              <mat-label translate>admin.proxy-port</mat-label>
 | 
					              <mat-label translate>admin.proxy-password</mat-label>
 | 
				
			||||||
              <input matInput required formControlName="proxyPort" maxlength="5">
 | 
					              <input matInput formControlName="proxyPassword">
 | 
				
			||||||
              <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('maxlength')">
 | 
					 | 
				
			||||||
                {{ 'admin.proxy-port-invalid' | translate }}
 | 
					 | 
				
			||||||
              </mat-error>
 | 
					 | 
				
			||||||
            </mat-form-field>
 | 
					            </mat-form-field>
 | 
				
			||||||
          </div>
 | 
					          </div>
 | 
				
			||||||
          <mat-form-field class="mat-block" *ngIf="enableProxy()">
 | 
					 | 
				
			||||||
            <mat-label translate>admin.proxy-user</mat-label>
 | 
					 | 
				
			||||||
            <input matInput formControlName="proxyUser">
 | 
					 | 
				
			||||||
          </mat-form-field>
 | 
					 | 
				
			||||||
          <mat-form-field class="mat-block" *ngIf="enableProxy()">
 | 
					 | 
				
			||||||
            <mat-label translate>admin.proxy-password</mat-label>
 | 
					 | 
				
			||||||
            <input matInput formControlName="proxyPassword">
 | 
					 | 
				
			||||||
          </mat-form-field>
 | 
					 | 
				
			||||||
          <mat-form-field class="mat-block">
 | 
					          <mat-form-field class="mat-block">
 | 
				
			||||||
            <mat-label translate>common.username</mat-label>
 | 
					            <mat-label translate>common.username</mat-label>
 | 
				
			||||||
            <input matInput formControlName="username" placeholder="{{ 'common.enter-username' | translate }}"/>
 | 
					            <input matInput formControlName="username" placeholder="{{ 'common.enter-username' | translate }}"/>
 | 
				
			||||||
 | 
				
			|||||||
@ -20,7 +20,7 @@ import { AppState } from '@core/core.state';
 | 
				
			|||||||
import { PageComponent } from '@shared/components/page.component';
 | 
					import { PageComponent } from '@shared/components/page.component';
 | 
				
			||||||
import { Router } from '@angular/router';
 | 
					import { Router } from '@angular/router';
 | 
				
			||||||
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
 | 
					import { FormBuilder, FormGroup, Validators } from '@angular/forms';
 | 
				
			||||||
import { AdminSettings, MailServerSettings, portPattern } from '@shared/models/settings.models';
 | 
					import { AdminSettings, MailServerSettings, smtpPortPattern } from '@shared/models/settings.models';
 | 
				
			||||||
import { AdminService } from '@core/http/admin.service';
 | 
					import { AdminService } from '@core/http/admin.service';
 | 
				
			||||||
import { ActionNotificationShow } from '@core/notification/notification.actions';
 | 
					import { ActionNotificationShow } from '@core/notification/notification.actions';
 | 
				
			||||||
import { TranslateService } from '@ngx-translate/core';
 | 
					import { TranslateService } from '@ngx-translate/core';
 | 
				
			||||||
@ -63,7 +63,7 @@ export class MailServerComponent extends PageComponent implements OnInit, HasCon
 | 
				
			|||||||
      smtpProtocol: ['smtp'],
 | 
					      smtpProtocol: ['smtp'],
 | 
				
			||||||
      smtpHost: ['localhost', [Validators.required]],
 | 
					      smtpHost: ['localhost', [Validators.required]],
 | 
				
			||||||
      smtpPort: ['25', [Validators.required,
 | 
					      smtpPort: ['25', [Validators.required,
 | 
				
			||||||
        Validators.pattern(portPattern),
 | 
					        Validators.pattern(smtpPortPattern),
 | 
				
			||||||
        Validators.maxLength(5)]],
 | 
					        Validators.maxLength(5)]],
 | 
				
			||||||
      timeout: ['10000', [Validators.required,
 | 
					      timeout: ['10000', [Validators.required,
 | 
				
			||||||
        Validators.pattern(/^[0-9]{1,6}$/),
 | 
					        Validators.pattern(/^[0-9]{1,6}$/),
 | 
				
			||||||
@ -72,7 +72,7 @@ export class MailServerComponent extends PageComponent implements OnInit, HasCon
 | 
				
			|||||||
      tlsVersion: [],
 | 
					      tlsVersion: [],
 | 
				
			||||||
      enableProxy: ['false', []],
 | 
					      enableProxy: ['false', []],
 | 
				
			||||||
      proxyHost: ['', [Validators.required]],
 | 
					      proxyHost: ['', [Validators.required]],
 | 
				
			||||||
      proxyPort: ['', [Validators.required, Validators.maxLength(5), Validators.pattern(portPattern)]],
 | 
					      proxyPort: ['', [Validators.required, Validators.min(1), Validators.max(65535)]],
 | 
				
			||||||
      proxyUser: [''],
 | 
					      proxyUser: [''],
 | 
				
			||||||
      proxyPassword: [''],
 | 
					      proxyPassword: [''],
 | 
				
			||||||
      username: [''],
 | 
					      username: [''],
 | 
				
			||||||
 | 
				
			|||||||
@ -14,7 +14,7 @@
 | 
				
			|||||||
/// limitations under the License.
 | 
					/// limitations under the License.
 | 
				
			||||||
///
 | 
					///
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export const portPattern: RegExp = /^([0-9]{1,4}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])$/;
 | 
					export const smtpPortPattern: RegExp = /^([0-9]{1,4}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])$/;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export interface AdminSettings<T> {
 | 
					export interface AdminSettings<T> {
 | 
				
			||||||
  key: string;
 | 
					  key: string;
 | 
				
			||||||
 | 
				
			|||||||
@ -94,8 +94,8 @@
 | 
				
			|||||||
        "proxy-host": "Proxy host",
 | 
					        "proxy-host": "Proxy host",
 | 
				
			||||||
        "proxy-host-required": "Proxy host is required.",
 | 
					        "proxy-host-required": "Proxy host is required.",
 | 
				
			||||||
        "proxy-port": "Proxy port",
 | 
					        "proxy-port": "Proxy port",
 | 
				
			||||||
        "proxy-port-required": "You must supply a proxy port.",
 | 
					        "proxy-port-required": "Proxy port is required.",
 | 
				
			||||||
        "proxy-port-invalid": "That doesn't look like a valid proxy port.",
 | 
					        "proxy-port-range": "Proxy port should be in a range from 1 to 65535.",
 | 
				
			||||||
        "proxy-user": "Proxy user",
 | 
					        "proxy-user": "Proxy user",
 | 
				
			||||||
        "proxy-password": "Proxy password",
 | 
					        "proxy-password": "Proxy password",
 | 
				
			||||||
        "send-test-mail": "Send test mail",
 | 
					        "send-test-mail": "Send test mail",
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user