|
|
@ -98,16 +98,14 @@ export class Lwm2mDeviceConfigServerComponent implements OnInit, ControlValueAcc |
|
|
ngOnInit(): void { |
|
|
ngOnInit(): void { |
|
|
this.serverFormGroup = this.fb.group({ |
|
|
this.serverFormGroup = this.fb.group({ |
|
|
host: ['', Validators.required], |
|
|
host: ['', Validators.required], |
|
|
port: ['', [Validators.required, Validators.min(5683), Validators.max(5688), Validators.pattern('[0-9]*')]], |
|
|
port: ['', [Validators.required, Validators.min(1), Validators.max(65535), Validators.pattern('[0-9]*')]], |
|
|
securityMode: [Lwm2mSecurityType.NO_SEC], |
|
|
securityMode: [Lwm2mSecurityType.NO_SEC], |
|
|
serverPublicKey: [''], |
|
|
serverPublicKey: [''], |
|
|
clientHoldOffTime: ['', [Validators.required, Validators.min(0), Validators.pattern('[0-9]*')]], |
|
|
clientHoldOffTime: ['', [Validators.required, Validators.min(0), Validators.pattern('[0-9]*')]], |
|
|
// shortServerId: ['', [Validators.required, Validators.pattern(this.isBootstrap ? '^(' + this.shortServerIdBsMin+ '|' + this.shortServerIdBsMax + ')$' : '[0-9]*'), !this.isBootstrap ? [Validators.min(this.shortServerIdMin), Validators.max(this.shortServerIdMax)] : [] ]],
|
|
|
shortServerId: ['', this.isBootstrap |
|
|
shortServerId: ['', [Validators.required, Validators.pattern(this.isBootstrap ? '^(' + this.shortServerIdBsMin+ '|' + this.shortServerIdBsMax + ')$' : '[0-9]*'), |
|
|
? [Validators.required, Validators.pattern('^(' + this.shortServerIdBsMin+ '|' + this.shortServerIdBsMax + ')$' )] |
|
|
...(!this.isBootstrap ? [ |
|
|
: [Validators.required, Validators.pattern('[0-9]*'),Validators.min(this.shortServerIdMin), Validators.max(this.shortServerIdMax)] |
|
|
Validators.min(this.shortServerIdMin), |
|
|
], |
|
|
Validators.max(this.shortServerIdMax) |
|
|
|
|
|
] : []) ]], |
|
|
|
|
|
bootstrapServerAccountTimeout: ['', [Validators.required, Validators.min(0), Validators.pattern('[0-9]*')]], |
|
|
bootstrapServerAccountTimeout: ['', [Validators.required, Validators.min(0), Validators.pattern('[0-9]*')]], |
|
|
binding: [''], |
|
|
binding: [''], |
|
|
lifetime: [null, [Validators.required, Validators.min(0), Validators.pattern('[0-9]*')]], |
|
|
lifetime: [null, [Validators.required, Validators.min(0), Validators.pattern('[0-9]*')]], |
|
|
|