Tenant profile rate limits configuration UI refactoring

This commit is contained in:
Viacheslav Klimov 2022-01-21 15:31:53 +02:00
parent d99a8066fe
commit f96be893b8
3 changed files with 33 additions and 40 deletions

View File

@ -16,8 +16,17 @@
--> -->
<form [formGroup]="tenantProfileDataFormGroup" style="padding-bottom: 16px;"> <form [formGroup]="tenantProfileDataFormGroup" style="padding-bottom: 16px;">
<mat-expansion-panel [expanded]="true">
<mat-expansion-panel-header>
<mat-panel-title>
<div translate>tenant-profile.profile-configuration</div>
</mat-panel-title>
</mat-expansion-panel-header>
<ng-template matExpansionPanelContent>
<tb-tenant-profile-configuration <tb-tenant-profile-configuration
formControlName="configuration" formControlName="configuration"
required> required>
</tb-tenant-profile-configuration> </tb-tenant-profile-configuration>
</ng-template>
</mat-expansion-panel>
</form> </form>

View File

@ -62,14 +62,14 @@
<div class="tb-hint">{{'tenant.isolated-tb-rule-engine-details' | translate}}</div> <div class="tb-hint">{{'tenant.isolated-tb-rule-engine-details' | translate}}</div>
</mat-checkbox> </mat-checkbox>
</div> </div>
<mat-form-field class="mat-block">
<mat-label translate>tenant-profile.description</mat-label>
<textarea matInput formControlName="description" rows="2"></textarea>
</mat-form-field>
<tb-tenant-profile-data <tb-tenant-profile-data
formControlName="profileData" formControlName="profileData"
required> required>
</tb-tenant-profile-data> </tb-tenant-profile-data>
<mat-form-field class="mat-block">
<mat-label translate>tenant-profile.description</mat-label>
<textarea matInput formControlName="description" rows="2"></textarea>
</mat-form-field>
</fieldset> </fieldset>
</form> </form>
</div> </div>

View File

@ -213,12 +213,10 @@
<input matInput required min="0" step="1" <input matInput required min="0" step="1"
formControlName="maxRuleNodeExecutionsPerMessage" formControlName="maxRuleNodeExecutionsPerMessage"
type="number"> type="number">
<mat-error <mat-error *ngIf="defaultTenantProfileConfigurationFormGroup.get('maxRuleNodeExecutionsPerMessage').hasError('required')">
*ngIf="defaultTenantProfileConfigurationFormGroup.get('maxRuleNodeExecutionsPerMessage').hasError('required')">
{{ 'tenant-profile.max-rule-node-executions-per-message-required' | translate}} {{ 'tenant-profile.max-rule-node-executions-per-message-required' | translate}}
</mat-error> </mat-error>
<mat-error <mat-error *ngIf="defaultTenantProfileConfigurationFormGroup.get('maxRuleNodeExecutionsPerMessage').hasError('min')">
*ngIf="defaultTenantProfileConfigurationFormGroup.get('maxRuleNodeExecutionsPerMessage').hasError('min')">
{{ 'tenant-profile.max-rule-node-executions-per-message-range' | translate}} {{ 'tenant-profile.max-rule-node-executions-per-message-range' | translate}}
</mat-error> </mat-error>
</mat-form-field> </mat-form-field>
@ -262,32 +260,28 @@
<mat-form-field class="mat-block"> <mat-form-field class="mat-block">
<mat-label translate>tenant-profile.transport-tenant-msg-rate-limit</mat-label> <mat-label translate>tenant-profile.transport-tenant-msg-rate-limit</mat-label>
<input matInput formControlName="transportTenantMsgRateLimit"> <input matInput formControlName="transportTenantMsgRateLimit">
<mat-error <mat-error *ngIf="defaultTenantProfileConfigurationFormGroup.get('transportTenantMsgRateLimit').hasError('pattern')">
*ngIf="defaultTenantProfileConfigurationFormGroup.get('transportTenantMsgRateLimit').hasError('pattern')">
{{ 'tenant-profile.incorrect-pattern-for-rate-limits' | translate}} {{ 'tenant-profile.incorrect-pattern-for-rate-limits' | translate}}
</mat-error> </mat-error>
</mat-form-field> </mat-form-field>
<mat-form-field class="mat-block"> <mat-form-field class="mat-block">
<mat-label translate>tenant-profile.transport-tenant-telemetry-msg-rate-limit</mat-label> <mat-label translate>tenant-profile.transport-tenant-telemetry-msg-rate-limit</mat-label>
<input matInput formControlName="transportTenantTelemetryMsgRateLimit"> <input matInput formControlName="transportTenantTelemetryMsgRateLimit">
<mat-error <mat-error *ngIf="defaultTenantProfileConfigurationFormGroup.get('transportTenantTelemetryMsgRateLimit').hasError('pattern')">
*ngIf="defaultTenantProfileConfigurationFormGroup.get('transportTenantTelemetryMsgRateLimit').hasError('pattern')">
{{ 'tenant-profile.incorrect-pattern-for-rate-limits' | translate}} {{ 'tenant-profile.incorrect-pattern-for-rate-limits' | translate}}
</mat-error> </mat-error>
</mat-form-field> </mat-form-field>
<mat-form-field class="mat-block"> <mat-form-field class="mat-block">
<mat-label translate>tenant-profile.transport-tenant-telemetry-data-points-rate-limit</mat-label> <mat-label translate>tenant-profile.transport-tenant-telemetry-data-points-rate-limit</mat-label>
<input matInput formControlName="transportTenantTelemetryDataPointsRateLimit"> <input matInput formControlName="transportTenantTelemetryDataPointsRateLimit">
<mat-error <mat-error *ngIf="defaultTenantProfileConfigurationFormGroup.get('transportTenantTelemetryDataPointsRateLimit').hasError('pattern')">
*ngIf="defaultTenantProfileConfigurationFormGroup.get('transportTenantTelemetryDataPointsRateLimit').hasError('pattern')">
{{ 'tenant-profile.incorrect-pattern-for-rate-limits' | translate}} {{ 'tenant-profile.incorrect-pattern-for-rate-limits' | translate}}
</mat-error> </mat-error>
</mat-form-field> </mat-form-field>
<mat-form-field class="mat-block"> <mat-form-field class="mat-block">
<mat-label translate>tenant-profile.transport-device-msg-rate-limit</mat-label> <mat-label translate>tenant-profile.transport-device-msg-rate-limit</mat-label>
<input matInput formControlName="transportDeviceMsgRateLimit"> <input matInput formControlName="transportDeviceMsgRateLimit">
<mat-error <mat-error *ngIf="defaultTenantProfileConfigurationFormGroup.get('transportDeviceMsgRateLimit').hasError('pattern')">
*ngIf="defaultTenantProfileConfigurationFormGroup.get('transportDeviceMsgRateLimit').hasError('pattern')">
{{ 'tenant-profile.incorrect-pattern-for-rate-limits' | translate}} {{ 'tenant-profile.incorrect-pattern-for-rate-limits' | translate}}
</mat-error> </mat-error>
</mat-form-field> </mat-form-field>
@ -298,8 +292,7 @@
<mat-form-field class="mat-block"> <mat-form-field class="mat-block">
<mat-label translate>tenant-profile.transport-device-telemetry-data-points-rate-limit</mat-label> <mat-label translate>tenant-profile.transport-device-telemetry-data-points-rate-limit</mat-label>
<input matInput formControlName="transportDeviceTelemetryDataPointsRateLimit"> <input matInput formControlName="transportDeviceTelemetryDataPointsRateLimit">
<mat-error <mat-error *ngIf="defaultTenantProfileConfigurationFormGroup.get('transportDeviceTelemetryDataPointsRateLimit').hasError('pattern')">
*ngIf="defaultTenantProfileConfigurationFormGroup.get('transportDeviceTelemetryDataPointsRateLimit').hasError('pattern')">
{{ 'tenant-profile.incorrect-pattern-for-rate-limits' | translate}} {{ 'tenant-profile.incorrect-pattern-for-rate-limits' | translate}}
</mat-error> </mat-error>
</mat-form-field> </mat-form-field>
@ -308,8 +301,7 @@
<input matInput <input matInput
formControlName="tenantServerRestLimitsConfiguration" formControlName="tenantServerRestLimitsConfiguration"
type="text"> type="text">
<mat-error <mat-error *ngIf="defaultTenantProfileConfigurationFormGroup.get('tenantServerRestLimitsConfiguration').hasError('pattern')">
*ngIf="defaultTenantProfileConfigurationFormGroup.get('tenantServerRestLimitsConfiguration').hasError('pattern')">
{{ 'tenant-profile.incorrect-pattern-for-rate-limits' | translate}} {{ 'tenant-profile.incorrect-pattern-for-rate-limits' | translate}}
</mat-error> </mat-error>
</mat-form-field> </mat-form-field>
@ -318,8 +310,7 @@
<input matInput <input matInput
formControlName="customerServerRestLimitsConfiguration" formControlName="customerServerRestLimitsConfiguration"
type="text"> type="text">
<mat-error <mat-error *ngIf="defaultTenantProfileConfigurationFormGroup.get('customerServerRestLimitsConfiguration').hasError('pattern')">
*ngIf="defaultTenantProfileConfigurationFormGroup.get('customerServerRestLimitsConfiguration').hasError('pattern')">
{{ 'tenant-profile.incorrect-pattern-for-rate-limits' | translate}} {{ 'tenant-profile.incorrect-pattern-for-rate-limits' | translate}}
</mat-error> </mat-error>
</mat-form-field> </mat-form-field>
@ -340,8 +331,7 @@
<mat-form-field class="mat-block"> <mat-form-field class="mat-block">
<mat-label translate>tenant-profile.ws-limit-max-sessions-per-public-user</mat-label> <mat-label translate>tenant-profile.ws-limit-max-sessions-per-public-user</mat-label>
<input matInput type="number" formControlName="maxWsSessionsPerRegularUser"> <input matInput type="number" formControlName="maxWsSessionsPerRegularUser">
<mat-error <mat-error *ngIf="defaultTenantProfileConfigurationFormGroup.get('maxWsSessionsPerRegularUser').hasError('min')">
*ngIf="defaultTenantProfileConfigurationFormGroup.get('maxWsSessionsPerRegularUser').hasError('min')">
{{ 'tenant-profile.too-small-value-zero' | translate}} {{ 'tenant-profile.too-small-value-zero' | translate}}
</mat-error> </mat-error>
</mat-form-field> </mat-form-field>
@ -362,48 +352,42 @@
<mat-form-field class="mat-block"> <mat-form-field class="mat-block">
<mat-label translate>tenant-profile.ws-limit-max-subscriptions-per-tenant</mat-label> <mat-label translate>tenant-profile.ws-limit-max-subscriptions-per-tenant</mat-label>
<input matInput type="number" formControlName="maxWsSubscriptionsPerTenant"> <input matInput type="number" formControlName="maxWsSubscriptionsPerTenant">
<mat-error <mat-error *ngIf="defaultTenantProfileConfigurationFormGroup.get('maxWsSubscriptionsPerTenant').hasError('min')">
*ngIf="defaultTenantProfileConfigurationFormGroup.get('maxWsSubscriptionsPerTenant').hasError('min')">
{{ 'tenant-profile.too-small-value-zero' | translate}} {{ 'tenant-profile.too-small-value-zero' | translate}}
</mat-error> </mat-error>
</mat-form-field> </mat-form-field>
<mat-form-field class="mat-block"> <mat-form-field class="mat-block">
<mat-label translate>tenant-profile.ws-limit-max-subscriptions-per-customer</mat-label> <mat-label translate>tenant-profile.ws-limit-max-subscriptions-per-customer</mat-label>
<input matInput type="number" formControlName="maxWsSubscriptionsPerCustomer"> <input matInput type="number" formControlName="maxWsSubscriptionsPerCustomer">
<mat-error <mat-error *ngIf="defaultTenantProfileConfigurationFormGroup.get('maxWsSubscriptionsPerCustomer').hasError('min')">
*ngIf="defaultTenantProfileConfigurationFormGroup.get('maxWsSubscriptionsPerCustomer').hasError('min')">
{{ 'tenant-profile.too-small-value-zero' | translate}} {{ 'tenant-profile.too-small-value-zero' | translate}}
</mat-error> </mat-error>
</mat-form-field> </mat-form-field>
<mat-form-field class="mat-block"> <mat-form-field class="mat-block">
<mat-label translate>tenant-profile.ws-limit-max-subscriptions-per-regular-user</mat-label> <mat-label translate>tenant-profile.ws-limit-max-subscriptions-per-regular-user</mat-label>
<input matInput type="number" formControlName="maxWsSubscriptionsPerRegularUser"> <input matInput type="number" formControlName="maxWsSubscriptionsPerRegularUser">
<mat-error <mat-error *ngIf="defaultTenantProfileConfigurationFormGroup.get('maxWsSubscriptionsPerRegularUser').hasError('min')">
*ngIf="defaultTenantProfileConfigurationFormGroup.get('maxWsSubscriptionsPerRegularUser').hasError('min')">
{{ 'tenant-profile.too-small-value-zero' | translate}} {{ 'tenant-profile.too-small-value-zero' | translate}}
</mat-error> </mat-error>
</mat-form-field> </mat-form-field>
<mat-form-field class="mat-block"> <mat-form-field class="mat-block">
<mat-label translate>tenant-profile.ws-limit-max-subscriptions-per-public-user</mat-label> <mat-label translate>tenant-profile.ws-limit-max-subscriptions-per-public-user</mat-label>
<input matInput type="number" formControlName="maxWsSubscriptionsPerPublicUser"> <input matInput type="number" formControlName="maxWsSubscriptionsPerPublicUser">
<mat-error <mat-error *ngIf="defaultTenantProfileConfigurationFormGroup.get('maxWsSubscriptionsPerPublicUser').hasError('min')">
*ngIf="defaultTenantProfileConfigurationFormGroup.get('maxWsSubscriptionsPerPublicUser').hasError('min')">
{{ 'tenant-profile.too-small-value-zero' | translate}} {{ 'tenant-profile.too-small-value-zero' | translate}}
</mat-error> </mat-error>
</mat-form-field> </mat-form-field>
<mat-form-field class="mat-block"> <mat-form-field class="mat-block">
<mat-label translate>tenant-profile.ws-limit-updates-per-session</mat-label> <mat-label translate>tenant-profile.ws-limit-updates-per-session</mat-label>
<input matInput type="text" formControlName="wsUpdatesPerSessionRateLimit"> <input matInput type="text" formControlName="wsUpdatesPerSessionRateLimit">
<mat-error <mat-error *ngIf="defaultTenantProfileConfigurationFormGroup.get('wsUpdatesPerSessionRateLimit').hasError('pattern')">
*ngIf="defaultTenantProfileConfigurationFormGroup.get('wsUpdatesPerSessionRateLimit').hasError('pattern')">
{{ 'tenant-profile.incorrect-pattern-for-rate-limits' | translate}} {{ 'tenant-profile.incorrect-pattern-for-rate-limits' | translate}}
</mat-error> </mat-error>
</mat-form-field> </mat-form-field>
<mat-form-field class="mat-block"> <mat-form-field class="mat-block">
<mat-label translate>tenant-profile.cassandra-tenant-limits-configuration</mat-label> <mat-label translate>tenant-profile.cassandra-tenant-limits-configuration</mat-label>
<input matInput type="text" formControlName="cassandraQueryTenantRateLimitsConfiguration"> <input matInput type="text" formControlName="cassandraQueryTenantRateLimitsConfiguration">
<mat-error <mat-error *ngIf="defaultTenantProfileConfigurationFormGroup.get('cassandraQueryTenantRateLimitsConfiguration').hasError('pattern')">
*ngIf="defaultTenantProfileConfigurationFormGroup.get('cassandraQueryTenantRateLimitsConfiguration').hasError('pattern')">
{{ 'tenant-profile.incorrect-pattern-for-rate-limits' | translate}} {{ 'tenant-profile.incorrect-pattern-for-rate-limits' | translate}}
</mat-error> </mat-error>
</mat-form-field> </mat-form-field>