|
|
@ -15,112 +15,107 @@ |
|
|
limitations under the License. |
|
|
limitations under the License. |
|
|
|
|
|
|
|
|
--> |
|
|
--> |
|
|
<section [formGroup]="serverFormGroup" style="min-width: 400px;"> |
|
|
<section [formGroup]="serverFormGroup"> |
|
|
<div class="mat-padding"> |
|
|
<div fxLayout="row" fxLayout.xs="column" fxLayoutGap="8px" fxLayoutGap.xs="0px"> |
|
|
<div fxLayout="column"> |
|
|
<mat-form-field fxFlex> |
|
|
<div fxLayout="row" fxLayoutGap="8px"> |
|
|
<mat-label>{{ 'device-profile.lwm2m.mode' | translate }}</mat-label> |
|
|
<mat-form-field class="mat-block"> |
|
|
<mat-select formControlName="securityMode"> |
|
|
<mat-label>{{ 'device-profile.lwm2m.mode' | translate }}</mat-label> |
|
|
<mat-option *ngFor="let securityMode of securityConfigLwM2MTypes" |
|
|
<mat-select formControlName="securityMode"> |
|
|
[value]="securityMode"> |
|
|
<mat-option *ngFor="let securityMode of securityConfigLwM2MTypes" |
|
|
{{ credentialTypeLwM2MNamesMap.get(securityConfigLwM2MType[securityMode]) }} |
|
|
[value]="securityMode"> |
|
|
</mat-option> |
|
|
{{ credentialTypeLwM2MNamesMap.get(securityConfigLwM2MType[securityMode]) }} |
|
|
</mat-select> |
|
|
</mat-option> |
|
|
</mat-form-field> |
|
|
</mat-select> |
|
|
<mat-form-field fxFlex> |
|
|
</mat-form-field> |
|
|
<mat-label>{{ 'device-profile.lwm2m.server-host' | translate }}</mat-label> |
|
|
<mat-form-field class="mat-block"> |
|
|
<input matInput type="text" formControlName="host" required |
|
|
<mat-label>{{ 'device-profile.lwm2m.server-host' | translate }}</mat-label> |
|
|
matTooltip="{{'device-profile.lwm2m.server-host-tip' | translate}}" |
|
|
<input matInput type="text" formControlName="host" required |
|
|
matTooltipPosition="above"> |
|
|
matTooltip="{{'device-profile.lwm2m.server-host-tip' | translate}}" |
|
|
<mat-error *ngIf="serverFormGroup.get('host').hasError('required')"> |
|
|
matTooltipPosition="above"> |
|
|
{{ 'device-profile.lwm2m.server-host' | translate }} |
|
|
<mat-error *ngIf="serverFormGroup.get('host').hasError('required')"> |
|
|
<strong>{{ 'device-profile.lwm2m.required' | translate }}</strong> |
|
|
{{ 'device-profile.lwm2m.server-host' | translate }} |
|
|
</mat-error> |
|
|
<strong>{{ 'device-profile.lwm2m.required' | translate }}</strong> |
|
|
</mat-form-field> |
|
|
</mat-error> |
|
|
<mat-form-field fxFlex> |
|
|
</mat-form-field> |
|
|
<mat-label>{{ 'device-profile.lwm2m.server-port' | translate }}</mat-label> |
|
|
<mat-form-field class="mat-block"> |
|
|
<input matInput type="number" formControlName="port" required |
|
|
<mat-label>{{ 'device-profile.lwm2m.server-port' | translate }}</mat-label> |
|
|
matTooltip="{{'device-profile.lwm2m.server-port-tip' | translate}}" |
|
|
<input matInput type="number" formControlName="port" required |
|
|
matTooltipPosition="above"> |
|
|
matTooltip="{{'device-profile.lwm2m.server-port-tip' | translate}}" |
|
|
<mat-error *ngIf="serverFormGroup.get('port').hasError('required')"> |
|
|
matTooltipPosition="above"> |
|
|
{{ 'device-profile.lwm2m.server-port' | translate }} |
|
|
<mat-error *ngIf="serverFormGroup.get('port').hasError('required')"> |
|
|
<strong>{{ 'device-profile.lwm2m.required' | translate }}</strong> |
|
|
{{ 'device-profile.lwm2m.server-port' | translate }} |
|
|
</mat-error> |
|
|
<strong>{{ 'device-profile.lwm2m.required' | translate }}</strong> |
|
|
</mat-form-field> |
|
|
</mat-error> |
|
|
<mat-form-field fxFlex> |
|
|
</mat-form-field> |
|
|
<mat-label>{{ 'device-profile.lwm2m.short-id' | translate }}</mat-label> |
|
|
<mat-form-field class="mat-block"> |
|
|
<input matInput type="number" formControlName="serverId" required |
|
|
<mat-label>{{ 'device-profile.lwm2m.short-id' | translate }}</mat-label> |
|
|
matTooltip="{{'device-profile.lwm2m.short-id-tip' | translate}}" |
|
|
<input matInput type="number" formControlName="serverId" required |
|
|
matTooltipPosition="above"> |
|
|
matTooltip="{{'device-profile.lwm2m.short-id-tip' | translate}}" |
|
|
<mat-error *ngIf="serverFormGroup.get('serverId').hasError('required')"> |
|
|
matTooltipPosition="above"> |
|
|
{{ 'device-profile.lwm2m.short-id' | translate }} |
|
|
<mat-error *ngIf="serverFormGroup.get('serverId').hasError('required')"> |
|
|
<strong>{{ 'device-profile.lwm2m.required' | translate }}</strong> |
|
|
{{ 'device-profile.lwm2m.short-id' | translate }} |
|
|
</mat-error> |
|
|
<strong>{{ 'device-profile.lwm2m.required' | translate }}</strong> |
|
|
</mat-form-field> |
|
|
</mat-error> |
|
|
</div> |
|
|
</mat-form-field> |
|
|
<div fxLayout="row" fxLayout.xs="column" fxLayoutGap="8px" fxLayoutGap.xs="0px"> |
|
|
</div> |
|
|
<mat-form-field fxFlex> |
|
|
</div> |
|
|
<mat-label>{{ 'device-profile.lwm2m.client-hold-off-time' | translate }}</mat-label> |
|
|
<div fxLayout="column"> |
|
|
<input matInput type="number" formControlName="clientHoldOffTime" required |
|
|
<div fxLayout="row" fxLayoutGap="10px"> |
|
|
matTooltip="{{'device-profile.lwm2m.client-hold-off-time-tip' | translate}}" |
|
|
<mat-form-field class="mat-block"> |
|
|
matTooltipPosition="above"> |
|
|
<mat-label>{{ 'device-profile.lwm2m.client-hold-off-time' | translate }}</mat-label> |
|
|
<mat-error *ngIf="serverFormGroup.get('clientHoldOffTime').hasError('required')"> |
|
|
<input matInput type="number" formControlName="clientHoldOffTime" required |
|
|
{{ 'device-profile.lwm2m.client-hold-off-time' | translate }} |
|
|
matTooltip="{{'device-profile.lwm2m.client-hold-off-time-tip' | translate}}" |
|
|
<strong>{{ 'device-profile.lwm2m.required' | translate }}</strong> |
|
|
matTooltipPosition="above"> |
|
|
</mat-error> |
|
|
<mat-error *ngIf="serverFormGroup.get('clientHoldOffTime').hasError('required')"> |
|
|
</mat-form-field> |
|
|
{{ 'device-profile.lwm2m.client-hold-off-time' | translate }} |
|
|
<mat-form-field fxFlex> |
|
|
<strong>{{ 'device-profile.lwm2m.required' | translate }}</strong> |
|
|
<mat-label>{{ 'device-profile.lwm2m.bootstrap-server-account-timeout' | translate }}</mat-label> |
|
|
</mat-error> |
|
|
<input matInput type="number" formControlName="bootstrapServerAccountTimeout" required |
|
|
</mat-form-field> |
|
|
matTooltip="{{'device-profile.lwm2m.bootstrap-server-account-timeout-tip' | translate}}" |
|
|
<mat-form-field class="mat-block"> |
|
|
matTooltipPosition="above"> |
|
|
<mat-label>{{ 'device-profile.lwm2m.bootstrap-server-account-timeout' | translate }}</mat-label> |
|
|
<mat-error *ngIf="serverFormGroup.get('bootstrapServerAccountTimeout').hasError('required')"> |
|
|
<input matInput type="number" formControlName="bootstrapServerAccountTimeout" required |
|
|
{{ 'device-profile.lwm2m.bootstrap-server-account-timeout' | translate }} |
|
|
matTooltip="{{'device-profile.lwm2m.bootstrap-server-account-timeout-tip' | translate}}" |
|
|
<strong>{{ 'device-profile.lwm2m.required' | translate }}</strong> |
|
|
matTooltipPosition="above"> |
|
|
</mat-error> |
|
|
<mat-error *ngIf="serverFormGroup.get('bootstrapServerAccountTimeout').hasError('required')"> |
|
|
</mat-form-field> |
|
|
{{ 'device-profile.lwm2m.bootstrap-server-account-timeout' | translate }} |
|
|
<mat-checkbox fxFlex formControlName="bootstrapServerIs" color="primary"> |
|
|
<strong>{{ 'device-profile.lwm2m.required' | translate }}</strong> |
|
|
{{ 'device-profile.lwm2m.bootstrap-server' | translate }} |
|
|
</mat-error> |
|
|
</mat-checkbox> |
|
|
</mat-form-field> |
|
|
<div fxFlex></div> |
|
|
<mat-checkbox formControlName="bootstrapServerIs" color="primary"> |
|
|
</div> |
|
|
{{ 'device-profile.lwm2m.bootstrap-server' | translate }} |
|
|
<div *ngIf="serverFormGroup.get('securityMode').value === securityConfigLwM2MType.RPK || |
|
|
</mat-checkbox> |
|
|
serverFormGroup.get('securityMode').value === securityConfigLwM2MType.X509"> |
|
|
</div> |
|
|
<mat-form-field class="mat-block"> |
|
|
<div *ngIf="serverFormGroup.get('securityMode').value === securityConfigLwM2MType.RPK || |
|
|
<mat-label>{{ 'device-profile.lwm2m.server-public-key' | translate }}</mat-label> |
|
|
serverFormGroup.get('securityMode').value === securityConfigLwM2MType.X509"> |
|
|
<textarea matInput |
|
|
<mat-form-field class="mat-block"> |
|
|
#serverPublicKey |
|
|
<mat-label>{{ 'device-profile.lwm2m.server-public-key' | translate }}</mat-label> |
|
|
maxlength="{{lenMaxServerPublicKey}}" |
|
|
<textarea matInput |
|
|
cdkTextareaAutosize |
|
|
#serverPublicKey |
|
|
cdkAutosizeMinRows="1" |
|
|
maxlength="{{lenMaxServerPublicKey}}" |
|
|
cols="1" required |
|
|
cdkTextareaAutosize |
|
|
style="overflow:hidden" |
|
|
cdkAutosizeMinRows="1" |
|
|
formControlName="serverPublicKey" |
|
|
cols="1" required |
|
|
matTooltip="{{'device-profile.lwm2m.server-public-key-tip' | translate}}" |
|
|
style="overflow:hidden" |
|
|
></textarea> |
|
|
formControlName="serverPublicKey" |
|
|
<mat-hint align="end">{{serverPublicKey.value?.length || 0}}/{{lenMaxServerPublicKey}}</mat-hint> |
|
|
matTooltip="{{'device-profile.lwm2m.server-public-key-tip' | translate}}" |
|
|
<mat-error *ngIf="serverFormGroup.get('serverPublicKey').hasError('required')"> |
|
|
></textarea> |
|
|
{{ 'device-profile.lwm2m.server-public-key' | translate }} |
|
|
<mat-hint align="end">{{serverPublicKey.value?.length || 0}}/{{lenMaxServerPublicKey}}</mat-hint> |
|
|
<strong>{{ 'device-profile.lwm2m.required' | translate }}</strong> |
|
|
<mat-error *ngIf="serverFormGroup.get('serverPublicKey').hasError('required')"> |
|
|
</mat-error> |
|
|
{{ 'device-profile.lwm2m.server-public-key' | translate }} |
|
|
<mat-error *ngIf="serverFormGroup.get('serverPublicKey').hasError('pattern') && |
|
|
<strong>{{ 'device-profile.lwm2m.required' | translate }}</strong> |
|
|
(serverFormGroup.get('securityMode').value === securityConfigLwM2MType.RPK || |
|
|
</mat-error> |
|
|
serverFormGroup.get('securityMode').value === securityConfigLwM2MType.X509)"> |
|
|
<mat-error *ngIf="serverFormGroup.get('serverPublicKey').hasError('pattern') && |
|
|
{{ 'device-profile.lwm2m.server-public-key' | translate }} |
|
|
(serverFormGroup.get('securityMode').value === securityConfigLwM2MType.RPK || |
|
|
<strong>{{ 'device-profile.lwm2m.pattern_hex_dec' | translate: { |
|
|
serverFormGroup.get('securityMode').value === securityConfigLwM2MType.X509)"> |
|
|
count: 0} }}</strong> |
|
|
{{ 'device-profile.lwm2m.server-public-key' | translate }} |
|
|
</mat-error> |
|
|
<strong>{{ 'device-profile.lwm2m.pattern_hex_dec' | translate: { |
|
|
<mat-error *ngIf="(serverFormGroup.get('serverPublicKey').hasError('maxlength') || |
|
|
count: 0} }}</strong> |
|
|
serverFormGroup.get('serverPublicKey').hasError('minlength')) && |
|
|
</mat-error> |
|
|
serverFormGroup.get('securityMode').value === securityConfigLwM2MType.RPK"> |
|
|
<mat-error *ngIf="(serverFormGroup.get('serverPublicKey').hasError('maxlength') || |
|
|
{{ 'device-profile.lwm2m.server-public-key' | translate }} |
|
|
serverFormGroup.get('serverPublicKey').hasError('minlength')) && |
|
|
<strong>{{ 'device-profile.lwm2m.pattern_hex_dec' | translate: { |
|
|
serverFormGroup.get('securityMode').value === securityConfigLwM2MType.RPK"> |
|
|
count: lenMaxServerPublicKey } }}</strong> |
|
|
{{ 'device-profile.lwm2m.server-public-key' | translate }} |
|
|
</mat-error> |
|
|
<strong>{{ 'device-profile.lwm2m.pattern_hex_dec' | translate: { |
|
|
</mat-form-field> |
|
|
count: lenMaxServerPublicKey } }}</strong> |
|
|
|
|
|
</mat-error> |
|
|
|
|
|
</mat-form-field> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
</div> |
|
|
</section> |
|
|
</section> |
|
|
|