thingsboard/ui-ngx/src/app/modules/home/components/queue/queue-form.component.html

212 lines
11 KiB
HTML
Raw Normal View History

2022-05-05 11:02:45 +03:00
<!--
2023-01-31 10:43:56 +02:00
Copyright © 2016-2023 The Thingsboard Authors
2022-05-05 11:02:45 +03:00
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<form [formGroup]="queueFormGroup" fxLayout="column">
<mat-form-field class="mat-block" appearance="fill">
2022-06-01 19:14:09 +03:00
<mat-label translate>admin.queue-name</mat-label>
<input matInput formControlName="name" required>
<mat-error *ngIf="queueFormGroup.get('name').hasError('required')">
{{ 'queue.name-required' | translate }}
</mat-error>
<mat-error *ngIf="queueFormGroup.get('name').hasError('unique')">
{{ 'queue.name-unique' | translate }}
</mat-error>
2022-06-28 14:54:38 +02:00
<mat-error *ngIf="queueFormGroup.get('name').hasError('pattern')">
{{ 'queue.name-pattern' | translate }}
</mat-error>
2022-06-01 19:14:09 +03:00
</mat-form-field>
<mat-accordion class="queue-strategy" [multi]="true">
<mat-expansion-panel [expanded]="true">
2022-06-01 19:14:09 +03:00
<mat-expansion-panel-header>
<mat-panel-title class="panel-title" translate>
queue.submit-settings
2022-06-01 19:14:09 +03:00
</mat-panel-title>
</mat-expansion-panel-header>
<ng-template matExpansionPanelContent>
2023-02-27 16:24:50 +02:00
<div fxFlex fxLayout="row" fxLayout.xs="column" fxLayoutGap="16px" formGroupName="submitStrategy">
<div fxFlex>
<label class="group-label" translate>queue.submit-strategy</label>
2023-05-22 12:40:41 +03:00
<mat-radio-group fxFlex fxLayout="column" formControlName="type" required>
<mat-radio-button *ngFor="let strategy of submitStrategies" [value]="strategy">
2022-06-01 19:14:09 +03:00
{{ queueSubmitStrategyTypesMap.get(queueSubmitStrategyTypes[strategy]).label | translate }}
<mat-icon
class="hint-icon"
matTooltip="{{ queueSubmitStrategyTypesMap.get(queueSubmitStrategyTypes[strategy]).hint | translate }}"
svgIcon="mdi:information-outline">
</mat-icon>
</mat-radio-button>
</mat-radio-group>
</div>
<div fxFlex *ngIf="hideBatchSize">
<label class="group-label" translate>queue.grouping-parameter</label>
<mat-form-field class="mat-block">
<mat-label translate>queue.batch-size</mat-label>
<input type="number" matInput formControlName="batchSize" required>
<mat-error *ngIf="queueFormGroup.get('submitStrategy.batchSize').hasError('required')">
{{ 'queue.batch-size-required' | translate }}
</mat-error>
<mat-error *ngIf="queueFormGroup.get('submitStrategy.batchSize').hasError('min') &&
!queueFormGroup.get('submitStrategy.batchSize').hasError('required')">
{{ 'queue.batch-size-min-value' | translate }}
</mat-error>
</mat-form-field>
</div>
2022-06-01 19:14:09 +03:00
</div>
</ng-template>
</mat-expansion-panel>
<mat-expansion-panel [expanded]="true">
2022-06-01 19:14:09 +03:00
<mat-expansion-panel-header>
<mat-panel-title class="panel-title" translate>
queue.processing-settings
2022-06-01 19:14:09 +03:00
</mat-panel-title>
</mat-expansion-panel-header>
<ng-template matExpansionPanelContent>
2023-02-27 16:24:50 +02:00
<div fxFlex fxLayout="row" fxLayout.xs="column" fxLayoutGap="16px" formGroupName="processingStrategy">
<div fxFlex>
<label class="group-label" translate>queue.processing-strategy</label>
2023-05-22 12:40:41 +03:00
<mat-radio-group fxFlex fxLayout="column" formControlName="type" required>
<mat-radio-button *ngFor="let strategy of processingStrategies" [value]="strategy">
{{ queueProcessingStrategyTypesMap.get(queueProcessingStrategyTypes[strategy]).label | translate }}
<mat-icon
class="hint-icon"
matTooltip="{{ queueProcessingStrategyTypesMap.get(queueProcessingStrategyTypes[strategy]).hint | translate }}"
svgIcon="mdi:information-outline">
</mat-icon>
</mat-radio-button>
</mat-radio-group>
</div>
<div fxFlex>
<label class="group-label" translate>queue.retries-settings</label>
<mat-form-field class="mat-block">
<mat-label translate>queue.retries</mat-label>
<input type="number" matInput formControlName="retries" required>
<mat-error *ngIf="queueFormGroup.get('processingStrategy.retries').hasError('required')">
{{ 'queue.retries-required' | translate }}
</mat-error>
<mat-error *ngIf="queueFormGroup.get('processingStrategy.retries').hasError('min') &&
2022-06-01 19:14:09 +03:00
!queueFormGroup.get('processingStrategy.retries').hasError('required')">
{{ 'queue.retries-min-value' | translate }}
</mat-error>
</mat-form-field>
<mat-form-field class="mat-block">
<mat-label translate>queue.failure-percentage</mat-label>
<input type="number" matInput formControlName="failurePercentage" required>
<mat-error *ngIf="queueFormGroup.get('processingStrategy.failurePercentage').hasError('required')">
{{ 'queue.failure-percentage-required' | translate }}
</mat-error>
<mat-error *ngIf="queueFormGroup.get('processingStrategy.failurePercentage').hasError('min') &&
2022-06-01 19:14:09 +03:00
!queueFormGroup.get('processingStrategy.failurePercentage').hasError('required') &&
!queueFormGroup.get('processingStrategy.failurePercentage').hasError('max')">
{{ 'queue.failure-percentage-min-value' | translate }}
</mat-error>
<mat-error *ngIf="queueFormGroup.get('processingStrategy.failurePercentage').hasError('max') &&
2022-06-01 19:14:09 +03:00
!queueFormGroup.get('processingStrategy.failurePercentage').hasError('required') &&
!queueFormGroup.get('processingStrategy.failurePercentage').hasError('min')">
{{ 'queue.failure-percentage-max-value' | translate }}
</mat-error>
</mat-form-field>
<mat-form-field class="mat-block">
<mat-label translate>queue.pause-between-retries</mat-label>
<input type="number" matInput formControlName="pauseBetweenRetries" required>
<mat-error *ngIf="queueFormGroup.get('processingStrategy.pauseBetweenRetries').hasError('required')">
{{ 'queue.pause-between-retries-required' | translate }}
</mat-error>
<mat-error *ngIf="queueFormGroup.get('processingStrategy.pauseBetweenRetries').hasError('min') &&
2022-06-01 19:14:09 +03:00
!queueFormGroup.get('processingStrategy.pauseBetweenRetries').hasError('required')">
{{ 'queue.pause-between-retries-min-value' | translate }}
</mat-error>
</mat-form-field>
<mat-form-field class="mat-block">
<mat-label translate>queue.max-pause-between-retries</mat-label>
<input type="number" matInput formControlName="maxPauseBetweenRetries" required>
<mat-error *ngIf="queueFormGroup.get('processingStrategy.maxPauseBetweenRetries').hasError('required')">
{{ 'queue.max-pause-between-retries-required' | translate }}
</mat-error>
<mat-error *ngIf="queueFormGroup.get('processingStrategy.maxPauseBetweenRetries').hasError('min') &&
2022-06-01 19:14:09 +03:00
!queueFormGroup.get('processingStrategy.maxPauseBetweenRetries').hasError('required')">
{{ 'queue.max-pause-between-retries-min-value' | translate }}
</mat-error>
</mat-form-field>
</div>
</div>
</ng-template>
</mat-expansion-panel>
<mat-expansion-panel [expanded]="true">
<mat-expansion-panel-header>
<mat-panel-title class="panel-title" translate>
queue.polling-settings
</mat-panel-title>
</mat-expansion-panel-header>
<ng-template matExpansionPanelContent>
2023-02-27 16:24:50 +02:00
<div fxFlex fxLayout="column" fxLayoutGap="10px">
<div fxFlex>
<label class="group-label" translate>queue.batch-processing</label>
<div fxFlex fxLayout="row" fxLayout.xs="column" fxLayoutGap="10px">
<mat-form-field fxFlex class="mat-block">
<mat-label translate>queue.poll-interval</mat-label>
<input type="number" matInput formControlName="pollInterval" required>
<mat-error *ngIf="queueFormGroup.get('pollInterval').hasError('required')">
{{ 'queue.poll-interval-required' | translate }}
</mat-error>
<mat-error *ngIf="queueFormGroup.get('pollInterval').hasError('min') &&
!queueFormGroup.get('pollInterval').hasError('required')">
{{ 'queue.poll-interval-min-value' | translate }}
</mat-error>
</mat-form-field>
<mat-form-field fxFlex class="mat-block">
<mat-label translate>queue.partitions</mat-label>
<input type="number" matInput formControlName="partitions" required>
<mat-error *ngIf="queueFormGroup.get('partitions').hasError('required')">
{{ 'queue.partitions-required' | translate }}
</mat-error>
<mat-error *ngIf="queueFormGroup.get('partitions').hasError('min') &&
!queueFormGroup.get('partitions').hasError('required')">
{{ 'queue.partitions-min-value' | translate }}
</mat-error>
</mat-form-field>
</div>
</div>
<div fxFlex>
<label class="group-label" translate>queue.immediate-processing</label>
<div fxFlex fxLayout="row" fxLayout.xs="column" fxLayoutGap="10px">
<mat-checkbox fxFlex fxFlexAlign.gt-xs="center" formControlName="consumerPerPartition">
{{ 'queue.consumer-per-partition' | translate }}
</mat-checkbox>
<mat-form-field fxFlex class="mat-block">
<mat-label translate>queue.processing-timeout</mat-label>
<input type="number" matInput formControlName="packProcessingTimeout" required>
<mat-error *ngIf="queueFormGroup.get('packProcessingTimeout').hasError('required')">
{{ 'queue.pack-processing-timeout-required' | translate }}
</mat-error>
<mat-error *ngIf="queueFormGroup.get('packProcessingTimeout').hasError('min') &&
!queueFormGroup.get('packProcessingTimeout').hasError('required')">
{{ 'queue.pack-processing-timeout-min-value' | translate }}
</mat-error>
</mat-form-field>
</div>
</div>
2022-06-01 19:14:09 +03:00
</div>
</ng-template>
</mat-expansion-panel>
</mat-accordion>
<mat-form-field class="mat-block" formGroupName="additionalInfo" appearance="fill">
2022-06-01 19:14:09 +03:00
<mat-label translate>queue.description</mat-label>
<textarea matInput formControlName="description" rows="2"></textarea>
<mat-hint translate>queue.description-hint</mat-hint>
</mat-form-field>
</form>