192 lines
10 KiB
HTML
192 lines
10 KiB
HTML
<!--
|
|
|
|
Copyright © 2016-2022 The Thingsboard Authors
|
|
|
|
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.
|
|
|
|
-->
|
|
<div class="tb-details-buttons" fxLayout.xs="column">
|
|
<button mat-raised-button color="primary" fxFlex.xs
|
|
[disabled]="(isLoading$ | async)"
|
|
(click)="onEntityAction($event, 'delete')"
|
|
[fxShow]="!hideDelete() && !isEdit">
|
|
{{'queue.delete' | translate }}
|
|
</button>
|
|
</div>
|
|
|
|
<div class="mat-padding" fxLayout="column">
|
|
<form [formGroup]="entityForm">
|
|
<fieldset [disabled]="(isLoading$ | async) || !isEdit">
|
|
<mat-form-field class="mat-block">
|
|
<mat-label translate>admin.queue-name</mat-label>
|
|
<input matInput formControlName="name" required>
|
|
<mat-error *ngIf="entityForm.get('name').hasError('required')">
|
|
{{ 'queue.name-required' | translate }}
|
|
</mat-error>
|
|
</mat-form-field>
|
|
<mat-form-field class="mat-block">
|
|
<mat-label translate>queue.poll-interval</mat-label>
|
|
<input type="number" matInput formControlName="pollInterval" required>
|
|
<mat-error *ngIf="entityForm.get('pollInterval').hasError('required')">
|
|
{{ 'queue.poll-interval-required' | translate }}
|
|
</mat-error>
|
|
<mat-error *ngIf="entityForm.get('pollInterval').hasError('min') &&
|
|
!entityForm.get('pollInterval').hasError('required')">
|
|
{{ 'queue.poll-interval-min-value' | translate }}
|
|
</mat-error>
|
|
</mat-form-field>
|
|
<mat-form-field class="mat-block">
|
|
<mat-label translate>queue.partitions</mat-label>
|
|
<input type="number" matInput formControlName="partitions" required>
|
|
<mat-error *ngIf="entityForm.get('partitions').hasError('required')">
|
|
{{ 'queue.partitions-required' | translate }}
|
|
</mat-error>
|
|
<mat-error *ngIf="entityForm.get('partitions').hasError('min') &&
|
|
!entityForm.get('partitions').hasError('required')">
|
|
{{ 'queue.partitions-min-value' | translate }}
|
|
</mat-error>
|
|
</mat-form-field>
|
|
|
|
<!-- <tb-checkbox formControlName="consumerPerPartition" style="display: block; padding-bottom: 16px;">-->
|
|
<!-- {{ 'queue.consumer-per-partition' | translate }}-->
|
|
<!-- </tb-checkbox>-->
|
|
|
|
<mat-checkbox class="hinted-checkbox" formControlName="consumerPerPartition">
|
|
<div>{{ 'queue.consumer-per-partition' | translate }}</div>
|
|
<div class="tb-hint">{{'queue.consumer-per-partition-hint' | translate}}</div>
|
|
</mat-checkbox>
|
|
|
|
<mat-form-field class="mat-block">
|
|
<mat-label translate>queue.processing-timeout</mat-label>
|
|
<input type="number" matInput formControlName="packProcessingTimeout" required>
|
|
<mat-error *ngIf="entityForm.get('packProcessingTimeout').hasError('required')">
|
|
{{ 'queue.pack-processing-timeout-required' | translate }}
|
|
</mat-error>
|
|
<mat-error *ngIf="entityForm.get('packProcessingTimeout').hasError('min') &&
|
|
!entityForm.get('packProcessingTimeout').hasError('required')">
|
|
{{ 'queue.pack-processing-timeout-min-value' | translate }}
|
|
</mat-error>
|
|
</mat-form-field>
|
|
|
|
<div class="mat-accordion-container">
|
|
<mat-accordion [multi]="true">
|
|
<mat-expansion-panel #panel1 hideToggle>
|
|
<mat-expansion-panel-header>
|
|
<mat-panel-title>
|
|
<mat-label translate>queue.submit-strategy</mat-label>
|
|
<mat-icon>{{panel1.expanded ? 'keyboard_arrow_up' : 'keyboard_arrow_down' }}</mat-icon>
|
|
</mat-panel-title>
|
|
</mat-expansion-panel-header>
|
|
<div formGroupName="submitStrategy">
|
|
<mat-form-field class="mat-block">
|
|
<mat-label translate>queue.submit-strategy</mat-label>
|
|
<mat-select formControlName="type" required>
|
|
<mat-option *ngFor="let strategy of submitStrategies" [value]="strategy">
|
|
{{ strategy }}
|
|
</mat-option>
|
|
</mat-select>
|
|
<mat-error *ngIf="entityForm.get('submitStrategy.type').hasError('required')">
|
|
{{ 'queue.submit-strategy-type-required' | translate }}
|
|
</mat-error>
|
|
</mat-form-field>
|
|
<mat-form-field class="mat-block" *ngIf="hideBatchSize">
|
|
<mat-label translate>queue.batch-size</mat-label>
|
|
<input type="number" matInput formControlName="batchSize" required>
|
|
<mat-error *ngIf="entityForm.get('submitStrategy.batchSize').hasError('required')">
|
|
{{ 'queue.batch-size-required' | translate }}
|
|
</mat-error>
|
|
<mat-error *ngIf="entityForm.get('submitStrategy.batchSize').hasError('min') &&
|
|
!entityForm.get('submitStrategy.batchSize').hasError('required')">
|
|
{{ 'queue.batch-size-min-value' | translate }}
|
|
</mat-error>
|
|
</mat-form-field>
|
|
</div>
|
|
</mat-expansion-panel>
|
|
<mat-expansion-panel #panel2 hideToggle>
|
|
<mat-expansion-panel-header>
|
|
<mat-panel-title>
|
|
<mat-label translate>queue.processing-strategy</mat-label>
|
|
<mat-icon>{{panel2.expanded ? 'keyboard_arrow_up' : 'keyboard_arrow_down' }}</mat-icon>
|
|
</mat-panel-title>
|
|
</mat-expansion-panel-header>
|
|
|
|
<div formGroupName="processingStrategy">
|
|
<mat-form-field class="mat-block">
|
|
<mat-label translate>queue.processing-strategy</mat-label>
|
|
<mat-select formControlName="type" required>
|
|
<mat-option *ngFor="let strategy of processingStrategies" [value]="strategy">
|
|
{{ strategy }}
|
|
</mat-option>
|
|
</mat-select>
|
|
<mat-error *ngIf="entityForm.get('processingStrategy.type').hasError('required')">
|
|
{{ 'queue.processing-strategy-type-required' | translate }}
|
|
</mat-error>
|
|
</mat-form-field>
|
|
<mat-form-field class="mat-block">
|
|
<mat-label translate>queue.retries</mat-label>
|
|
<input type="number" matInput formControlName="retries" required>
|
|
<mat-error *ngIf="entityForm.get('processingStrategy.retries').hasError('required')">
|
|
{{ 'queue.retries-required' | translate }}
|
|
</mat-error>
|
|
<mat-error *ngIf="entityForm.get('processingStrategy.retries').hasError('min') &&
|
|
!entityForm.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="entityForm.get('processingStrategy.failurePercentage').hasError('required')">
|
|
{{ 'queue.failure-percentage-required' | translate }}
|
|
</mat-error>
|
|
<mat-error *ngIf="entityForm.get('processingStrategy.failurePercentage').hasError('min') &&
|
|
!entityForm.get('processingStrategy.failurePercentage').hasError('required') &&
|
|
!entityForm.get('processingStrategy.failurePercentage').hasError('max')">
|
|
{{ 'queue.failure-percentage-min-value' | translate }}
|
|
</mat-error>
|
|
<mat-error *ngIf="entityForm.get('processingStrategy.failurePercentage').hasError('max') &&
|
|
!entityForm.get('processingStrategy.failurePercentage').hasError('required') &&
|
|
!entityForm.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="entityForm.get('processingStrategy.pauseBetweenRetries').hasError('required')">
|
|
{{ 'queue.pause-between-retries-required' | translate }}
|
|
</mat-error>
|
|
<mat-error *ngIf="entityForm.get('processingStrategy.pauseBetweenRetries').hasError('min') &&
|
|
!entityForm.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="entityForm.get('processingStrategy.maxPauseBetweenRetries').hasError('required')">
|
|
{{ 'queue.max-pause-between-retries-required' | translate }}
|
|
</mat-error>
|
|
<mat-error *ngIf="entityForm.get('processingStrategy.maxPauseBetweenRetries').hasError('min') &&
|
|
!entityForm.get('processingStrategy.maxPauseBetweenRetries').hasError('required')">
|
|
{{ 'queue.max-pause-between-retries-min-value' | translate }}
|
|
</mat-error>
|
|
</mat-form-field>
|
|
</div>
|
|
</mat-expansion-panel>
|
|
</mat-accordion>
|
|
</div>
|
|
</fieldset>
|
|
</form>
|
|
</div>
|