Browse Source

Rate limits added tenant entity version/load

pull/6979/head
Artem Babak 4 years ago
parent
commit
a5d67401f8
  1. 20
      ui-ngx/src/app/modules/home/components/profile/tenant/default-tenant-profile-configuration.component.html
  2. 4
      ui-ngx/src/app/modules/home/components/profile/tenant/default-tenant-profile-configuration.component.ts
  3. 4
      ui-ngx/src/app/modules/home/components/profile/tenant/rate-limits/rate-limits-details-dialog.component.html
  4. 7
      ui-ngx/src/app/modules/home/components/profile/tenant/rate-limits/rate-limits-list.component.html
  5. 12
      ui-ngx/src/app/modules/home/components/profile/tenant/rate-limits/rate-limits-list.component.scss
  6. 13
      ui-ngx/src/app/modules/home/components/profile/tenant/rate-limits/rate-limits.component.html
  7. 4
      ui-ngx/src/app/modules/home/components/profile/tenant/rate-limits/rate-limits.component.scss
  8. 8
      ui-ngx/src/app/shared/models/rate-limits.models.ts
  9. 6
      ui-ngx/src/assets/locale/locale.constant-en_US.json

20
ui-ngx/src/app/modules/home/components/profile/tenant/default-tenant-profile-configuration.component.html

@ -469,20 +469,12 @@
</tb-rate-limits> </tb-rate-limits>
</div> </div>
<div fxFlex fxLayout="row" fxLayout.xs="column" fxLayoutGap.gt-xs="16px"> <div fxFlex fxLayout="row" fxLayout.xs="column" fxLayoutGap.gt-xs="16px">
<mat-form-field fxFlex class="mat-block"> <tb-rate-limits fxFlex="50" formControlName="tenantEntityExportRateLimit"
<mat-label translate>tenant-profile.tenant-entity-export-rate-limit</mat-label> [type]="rateLimitsType.TENANT_ENTITY_EXPORT_RATE_LIMIT">
<input matInput formControlName="tenantEntityExportRateLimit"> </tb-rate-limits>
</mat-form-field> <tb-rate-limits fxFlex="50" formControlName="tenantEntityImportRateLimit"
<mat-form-field fxFlex class="mat-block"> [type]="rateLimitsType.TENANT_ENTITY_IMPORT_RATE_LIMIT">
<mat-label translate>tenant-profile.tenant-entity-import-rate-limit</mat-label> </tb-rate-limits>
<input matInput formControlName="tenantEntityImportRateLimit">
</mat-form-field>
<!-- <tb-rate-limits fxFlex="50" formControlName="tenantEntityExportRateLimit"
[type]="rateLimitsType.TENANT_ENTITY_EXPORT_RATE_LIMIT">
</tb-rate-limits>
<tb-rate-limits fxFlex="50" formControlName="tenantEntityImportRateLimit"
[type]="rateLimitsType.TENANT_ENTITY_IMPORT_RATE_LIMIT">
</tb-rate-limits>-->
</div> </div>
</ng-template> </ng-template>
</mat-expansion-panel> </mat-expansion-panel>

4
ui-ngx/src/app/modules/home/components/profile/tenant/default-tenant-profile-configuration.component.ts

@ -71,8 +71,8 @@ export class DefaultTenantProfileConfigurationComponent implements ControlValueA
transportDeviceMsgRateLimit: [null, [Validators.pattern(this.rateLimitsPattern)]], transportDeviceMsgRateLimit: [null, [Validators.pattern(this.rateLimitsPattern)]],
transportDeviceTelemetryMsgRateLimit: [null, [Validators.pattern(this.rateLimitsPattern)]], transportDeviceTelemetryMsgRateLimit: [null, [Validators.pattern(this.rateLimitsPattern)]],
transportDeviceTelemetryDataPointsRateLimit: [null, [Validators.pattern(this.rateLimitsPattern)]], transportDeviceTelemetryDataPointsRateLimit: [null, [Validators.pattern(this.rateLimitsPattern)]],
tenantEntityExportRateLimit: [null, []], tenantEntityExportRateLimit: [null, [Validators.pattern(this.rateLimitsPattern)]],
tenantEntityImportRateLimit: [null, []], tenantEntityImportRateLimit: [null, [Validators.pattern(this.rateLimitsPattern)]],
maxTransportMessages: [null, [Validators.required, Validators.min(0)]], maxTransportMessages: [null, [Validators.required, Validators.min(0)]],
maxTransportDataPoints: [null, [Validators.required, Validators.min(0)]], maxTransportDataPoints: [null, [Validators.required, Validators.min(0)]],
maxREExecutions: [null, [Validators.required, Validators.min(0)]], maxREExecutions: [null, [Validators.required, Validators.min(0)]],

4
ui-ngx/src/app/modules/home/components/profile/tenant/rate-limits/rate-limits-details-dialog.component.html

@ -15,9 +15,9 @@
limitations under the License. limitations under the License.
--> -->
<form [formGroup]="editDetailsFormGroup" style="width: 800px;"> <form [formGroup]="editDetailsFormGroup">
<mat-toolbar color="primary"> <mat-toolbar color="primary">
<h2 translate>{{ title }}</h2> <h2>{{ title | translate }}</h2>
<span fxFlex></span> <span fxFlex></span>
<button mat-icon-button <button mat-icon-button
(click)="cancel()" (click)="cancel()"

7
ui-ngx/src/app/modules/home/components/profile/tenant/rate-limits/rate-limits-list.component.html

@ -28,6 +28,9 @@
<mat-error *ngIf="rateLimit.get('value').hasError('required')"> <mat-error *ngIf="rateLimit.get('value').hasError('required')">
{{ 'tenant-profile.rate-limits.number-of-messages-required' | translate }} {{ 'tenant-profile.rate-limits.number-of-messages-required' | translate }}
</mat-error> </mat-error>
<mat-error *ngIf="rateLimit.get('value').hasError('min')">
{{ 'tenant-profile.rate-limits.number-of-messages-min' | translate }}
</mat-error>
</mat-form-field> </mat-form-field>
<mat-form-field fxFlex hideRequiredMarker appearance="fill" class="mat-block"> <mat-form-field fxFlex hideRequiredMarker appearance="fill" class="mat-block">
<mat-label translate>tenant-profile.rate-limits.per-seconds</mat-label> <mat-label translate>tenant-profile.rate-limits.per-seconds</mat-label>
@ -36,8 +39,12 @@
<mat-error *ngIf="rateLimit.get('time').hasError('required')"> <mat-error *ngIf="rateLimit.get('time').hasError('required')">
{{ 'tenant-profile.rate-limits.per-seconds-required' | translate }} {{ 'tenant-profile.rate-limits.per-seconds-required' | translate }}
</mat-error> </mat-error>
<mat-error *ngIf="rateLimit.get('time').hasError('min')">
{{ 'tenant-profile.rate-limits.per-seconds-min' | translate }}
</mat-error>
</mat-form-field> </mat-form-field>
<button mat-icon-button type="button" color="primary" <button mat-icon-button type="button" color="primary"
class="tb-rate-limits-button"
*ngIf="!rateLimitsFormArray().disabled" *ngIf="!rateLimitsFormArray().disabled"
(click)="removeRateLimits($index)" (click)="removeRateLimits($index)"
[matTooltip]="'tenant-profile.rate-limits.remove-limit' | translate" matTooltipPosition="above"> [matTooltip]="'tenant-profile.rate-limits.remove-limit' | translate" matTooltipPosition="above">

12
ui-ngx/src/app/modules/home/components/profile/tenant/rate-limits/rate-limits-list.component.scss

@ -14,12 +14,6 @@
* limitations under the License. * limitations under the License.
*/ */
:host { :host {
button {
min-width: 40px;
mat-icon {
margin-top: 0.6em;
}
}
.tb-rate-limits-preview { .tb-rate-limits-preview {
margin-top: 1.5em; margin-top: 1.5em;
span { span {
@ -36,6 +30,9 @@
color: rgba(0,0,0,.54); color: rgba(0,0,0,.54);
margin-bottom: 16px; margin-bottom: 16px;
} }
.tb-rate-limits-button {
margin-top: 0.5em;
}
} }
:host ::ng-deep { :host ::ng-deep {
@ -43,5 +40,8 @@
.mat-form-field-wrapper { .mat-form-field-wrapper {
padding-bottom: 1em; padding-bottom: 1em;
} }
.mat-form-field-infix {
width: 100%;
}
} }
} }

13
ui-ngx/src/app/modules/home/components/profile/tenant/rate-limits/rate-limits.component.html

@ -24,11 +24,10 @@
<tb-rate-limits-text formControlName="rateLimits"></tb-rate-limits-text> <tb-rate-limits-text formControlName="rateLimits"></tb-rate-limits-text>
</div> </div>
</fieldset> </fieldset>
<div style="padding-top: 12px"> <button mat-icon-button color="primary" type="button" *ngIf="!disabled"
<button mat-icon-button color="primary" type="button" *ngIf="!disabled" class="tb-rate-limits-button"
(click)="onClick($event, 'add')" (click)="onClick($event, 'add')"
[matTooltip]="'tenant-profile.rate-limits.add-limit' | translate" matTooltipPosition="above"> [matTooltip]="'tenant-profile.rate-limits.add-limit' | translate" matTooltipPosition="above">
<mat-icon>add_circle_outline</mat-icon> <mat-icon>add_circle_outline</mat-icon>
</button> </button>
</div>
</div> </div>

4
ui-ngx/src/app/modules/home/components/profile/tenant/rate-limits/rate-limits.component.scss

@ -28,4 +28,8 @@
font-size: 12px; font-size: 12px;
} }
} }
.tb-rate-limits-button {
margin-top: 0.5em;
}
} }

8
ui-ngx/src/app/shared/models/rate-limits.models.ts

@ -32,6 +32,8 @@ export enum RateLimitsType {
CUSTOMER_SERVER_REST_LIMITS_CONFIGURATION = 'CUSTOMER_SERVER_REST_LIMITS_CONFIGURATION', CUSTOMER_SERVER_REST_LIMITS_CONFIGURATION = 'CUSTOMER_SERVER_REST_LIMITS_CONFIGURATION',
WS_UPDATE_PER_SESSION_RATE_LIMIT = 'WS_UPDATE_PER_SESSION_RATE_LIMIT', WS_UPDATE_PER_SESSION_RATE_LIMIT = 'WS_UPDATE_PER_SESSION_RATE_LIMIT',
CASSANDRA_QUERY_TENANT_RATE_LIMITS_CONFIGURATION = 'CASSANDRA_QUERY_TENANT_RATE_LIMITS_CONFIGURATION', CASSANDRA_QUERY_TENANT_RATE_LIMITS_CONFIGURATION = 'CASSANDRA_QUERY_TENANT_RATE_LIMITS_CONFIGURATION',
TENANT_ENTITY_EXPORT_RATE_LIMIT = 'TENANT_ENTITY_EXPORT_RATE_LIMIT',
TENANT_ENTITY_IMPORT_RATE_LIMIT = 'TENANT_ENTITY_IMPORT_RATE_LIMIT'
} }
export const rateLimitLabelTranslationMap = new Map<RateLimitsType, string>( export const rateLimitLabelTranslationMap = new Map<RateLimitsType, string>(
@ -46,6 +48,8 @@ export const rateLimitLabelTranslationMap = new Map<RateLimitsType, string>(
[RateLimitsType.CUSTOMER_SERVER_REST_LIMITS_CONFIGURATION, 'tenant-profile.customer-rest-limits'], [RateLimitsType.CUSTOMER_SERVER_REST_LIMITS_CONFIGURATION, 'tenant-profile.customer-rest-limits'],
[RateLimitsType.WS_UPDATE_PER_SESSION_RATE_LIMIT, 'tenant-profile.ws-limit-updates-per-session'], [RateLimitsType.WS_UPDATE_PER_SESSION_RATE_LIMIT, 'tenant-profile.ws-limit-updates-per-session'],
[RateLimitsType.CASSANDRA_QUERY_TENANT_RATE_LIMITS_CONFIGURATION, 'tenant-profile.cassandra-tenant-limits-configuration'], [RateLimitsType.CASSANDRA_QUERY_TENANT_RATE_LIMITS_CONFIGURATION, 'tenant-profile.cassandra-tenant-limits-configuration'],
[RateLimitsType.TENANT_ENTITY_EXPORT_RATE_LIMIT, 'tenant-profile.tenant-entity-export-rate-limit'],
[RateLimitsType.TENANT_ENTITY_IMPORT_RATE_LIMIT, 'tenant-profile.tenant-entity-import-rate-limit'],
] ]
); );
@ -61,6 +65,8 @@ export const editRateLimitTranslationMap = new Map<RateLimitsType, string>(
[RateLimitsType.CUSTOMER_SERVER_REST_LIMITS_CONFIGURATION, 'tenant-profile.rate-limits.edit-customer-rest-limits-title'], [RateLimitsType.CUSTOMER_SERVER_REST_LIMITS_CONFIGURATION, 'tenant-profile.rate-limits.edit-customer-rest-limits-title'],
[RateLimitsType.WS_UPDATE_PER_SESSION_RATE_LIMIT, 'tenant-profile.rate-limits.edit-ws-limit-updates-per-session-title'], [RateLimitsType.WS_UPDATE_PER_SESSION_RATE_LIMIT, 'tenant-profile.rate-limits.edit-ws-limit-updates-per-session-title'],
[RateLimitsType.CASSANDRA_QUERY_TENANT_RATE_LIMITS_CONFIGURATION, 'tenant-profile.rate-limits.edit-cassandra-tenant-limits-configuration-title'], [RateLimitsType.CASSANDRA_QUERY_TENANT_RATE_LIMITS_CONFIGURATION, 'tenant-profile.rate-limits.edit-cassandra-tenant-limits-configuration-title'],
[RateLimitsType.TENANT_ENTITY_EXPORT_RATE_LIMIT, 'tenant-profile.rate-limits.edit-tenant-entity-export-rate-limit-title'],
[RateLimitsType.TENANT_ENTITY_IMPORT_RATE_LIMIT, 'tenant-profile.rate-limits.edit-tenant-entity-import-rate-limit-title'],
] ]
); );
@ -76,6 +82,8 @@ export const addRateLimitTranslationMap = new Map<RateLimitsType, string>(
[RateLimitsType.CUSTOMER_SERVER_REST_LIMITS_CONFIGURATION, 'tenant-profile.rate-limits.add-customer-rest-limits-title'], [RateLimitsType.CUSTOMER_SERVER_REST_LIMITS_CONFIGURATION, 'tenant-profile.rate-limits.add-customer-rest-limits-title'],
[RateLimitsType.WS_UPDATE_PER_SESSION_RATE_LIMIT, 'tenant-profile.rate-limits.add-ws-limit-updates-per-session-title'], [RateLimitsType.WS_UPDATE_PER_SESSION_RATE_LIMIT, 'tenant-profile.rate-limits.add-ws-limit-updates-per-session-title'],
[RateLimitsType.CASSANDRA_QUERY_TENANT_RATE_LIMITS_CONFIGURATION, 'tenant-profile.rate-limits.add-cassandra-tenant-limits-configuration-title'], [RateLimitsType.CASSANDRA_QUERY_TENANT_RATE_LIMITS_CONFIGURATION, 'tenant-profile.rate-limits.add-cassandra-tenant-limits-configuration-title'],
[RateLimitsType.TENANT_ENTITY_EXPORT_RATE_LIMIT, 'tenant-profile.rate-limits.add-tenant-entity-export-rate-limit-title'],
[RateLimitsType.TENANT_ENTITY_IMPORT_RATE_LIMIT, 'tenant-profile.rate-limits.add-tenant-entity-import-rate-limit-title'],
] ]
); );

6
ui-ngx/src/assets/locale/locale.constant-en_US.json

@ -3200,6 +3200,8 @@
"add-customer-rest-limits-title": "Add REST requests for customer rate limits", "add-customer-rest-limits-title": "Add REST requests for customer rate limits",
"add-ws-limit-updates-per-session-title": "Add WS updates per session rate limits", "add-ws-limit-updates-per-session-title": "Add WS updates per session rate limits",
"add-cassandra-tenant-limits-configuration-title": "Add Cassandra query for tenant rate limits", "add-cassandra-tenant-limits-configuration-title": "Add Cassandra query for tenant rate limits",
"add-tenant-entity-export-rate-limit-title": "Add entity version creation rate limits",
"add-tenant-entity-import-rate-limit-title": "Add entity version load rate limits",
"advanced-settings": "Advanced settings", "advanced-settings": "Advanced settings",
"edit-limit": "Edit limit", "edit-limit": "Edit limit",
"but-less-than": "but less than", "but-less-than": "but less than",
@ -3213,13 +3215,17 @@
"edit-customer-rest-limits-title": "Edit REST requests for customer rate limits", "edit-customer-rest-limits-title": "Edit REST requests for customer rate limits",
"edit-ws-limit-updates-per-session-title": "Edit WS updates per session rate limits", "edit-ws-limit-updates-per-session-title": "Edit WS updates per session rate limits",
"edit-cassandra-tenant-limits-configuration-title": "Edit Cassandra query for tenant rate limits", "edit-cassandra-tenant-limits-configuration-title": "Edit Cassandra query for tenant rate limits",
"edit-tenant-entity-export-rate-limit-title": "Edit entity version creation rate limits",
"edit-tenant-entity-import-rate-limit-title": "Edit entity version load rate limits",
"messages-per": "messages per", "messages-per": "messages per",
"not-set": "Not set", "not-set": "Not set",
"number-of-messages": "Number of messages", "number-of-messages": "Number of messages",
"number-of-messages-required": "Number of messages is required.", "number-of-messages-required": "Number of messages is required.",
"number-of-messages-min": "Minimum value is 1.",
"preview": "Preview", "preview": "Preview",
"per-seconds": "Per seconds", "per-seconds": "Per seconds",
"per-seconds-required": "Time rate is required.", "per-seconds-required": "Time rate is required.",
"per-seconds-min": "Minimum value is 1.",
"rate-limits": "Rate limits", "rate-limits": "Rate limits",
"remove-limit": "Remove limit", "remove-limit": "Remove limit",
"transport-tenant-msg": "Transport tenant messages", "transport-tenant-msg": "Transport tenant messages",

Loading…
Cancel
Save