UI: Add default storage TTL Days to tenant profile configuration

This commit is contained in:
Igor Kulikov 2020-11-28 15:22:53 +02:00
parent 4e8b0aa674
commit 8385d18c3a
5 changed files with 29 additions and 10 deletions

View File

@ -148,6 +148,18 @@
{{ 'tenant-profile.max-d-p-storage-days-range' | translate}}
</mat-error>
</mat-form-field>
<mat-form-field class="mat-block">
<mat-label translate>tenant-profile.default-storage-ttl-days</mat-label>
<input matInput required min="0" step="1"
formControlName="defaultStorageTtlDays"
type="number">
<mat-error *ngIf="defaultTenantProfileConfigurationFormGroup.get('defaultStorageTtlDays').hasError('required')">
{{ 'tenant-profile.default-storage-ttl-days-required' | translate}}
</mat-error>
<mat-error *ngIf="defaultTenantProfileConfigurationFormGroup.get('defaultStorageTtlDays').hasError('min')">
{{ 'tenant-profile.default-storage-ttl-days-range' | translate}}
</mat-error>
</mat-form-field>
<mat-form-field class="mat-block">
<mat-label translate>tenant-profile.max-rule-node-executions-per-message</mat-label>
<input matInput required min="0" step="1"

View File

@ -72,7 +72,8 @@ export class DefaultTenantProfileConfigurationComponent implements ControlValueA
maxDPStorageDays: [null, [Validators.required, Validators.min(0)]],
maxRuleNodeExecutionsPerMessage: [null, [Validators.required, Validators.min(0)]],
maxEmails: [null, [Validators.required, Validators.min(0)]],
maxSms: [null, [Validators.required, Validators.min(0)]]
maxSms: [null, [Validators.required, Validators.min(0)]],
defaultStorageTtlDays: [null, [Validators.required, Validators.min(0)]]
});
this.defaultTenantProfileConfigurationFormGroup.valueChanges.subscribe(() => {
this.updateModel();

View File

@ -1415,7 +1415,7 @@
{
"name": "storageDataPointsCountHourly",
"type": "timeseries",
"label": "Storage data points",
"label": "Data points storage days",
"color": "#1039ee",
"settings": {
"excludeFromStacking": false,
@ -2738,7 +2738,7 @@
{
"name": "storageDataPointsCountHourly",
"type": "timeseries",
"label": "Storage data points",
"label": "Data points storage days",
"color": "#1039ee",
"settings": {
"excludeFromStacking": false,
@ -2873,7 +2873,7 @@
{
"name": "storageDataPointsCount",
"type": "timeseries",
"label": "Storage data points",
"label": "Data points storage days",
"color": "#1039ee",
"settings": {
"excludeFromStacking": false,

View File

@ -46,6 +46,8 @@ export interface DefaultTenantProfileConfiguration {
maxRuleNodeExecutionsPerMessage: number;
maxEmails: number;
maxSms: number;
defaultStorageTtlDays: number;
}
export type TenantProfileConfigurations = DefaultTenantProfileConfiguration;
@ -73,7 +75,8 @@ export function createTenantProfileConfiguration(type: TenantProfileType): Tenan
maxDPStorageDays: 0,
maxRuleNodeExecutionsPerMessage: 0,
maxEmails: 0,
maxSms: 0
maxSms: 0,
defaultStorageTtlDays: 0
};
configuration = {...defaultConfiguration, type: TenantProfileType.DEFAULT};
break;

View File

@ -2011,19 +2011,22 @@
"max-transport-messages-range": "Maximum number of transport messages can't be negative",
"max-transport-data-points": "Maximum number of transport data points (0 - unlimited)",
"max-transport-data-points-required": "Maximum number of transport data points is required.",
"max-transport-data-points-range": "Minimum number of transport data points can't be negative",
"max-transport-data-points-range": "Maximum number of transport data points can't be negative",
"max-r-e-executions": "Maximum number of Rule Engine executions (0 - unlimited)",
"max-r-e-executions-required": "Maximum number of Rule Engine executions is required.",
"max-r-e-executions-range": "Minimum number of Rule Engine executions can't be negative",
"max-r-e-executions-range": "Maximum number of Rule Engine executions can't be negative",
"max-j-s-executions": "Maximum number of JavaScript executions (0 - unlimited)",
"max-j-s-executions-required": "Maximum number of JavaScript executions is required.",
"max-j-s-executions-range": "Minimum number of JavaScript executions can't be negative",
"max-j-s-executions-range": "Maximum number of JavaScript executions can't be negative",
"max-d-p-storage-days": "Maximum number of data points storage days (0 - unlimited)",
"max-d-p-storage-days-required": "Maximum number of data points storage days is required.",
"max-d-p-storage-days-range": "Minimum number of data points storage days can't be negative",
"max-d-p-storage-days-range": "Maximum number of data points storage days can't be negative",
"default-storage-ttl-days": "Default storage TTL days (0 - unlimited)",
"default-storage-ttl-days-required": "Default storage TTL days is required.",
"default-storage-ttl-days-range": "Default storage TTL days can't be negative",
"max-rule-node-executions-per-message": "Maximum number of rule node executions per message (0 - unlimited)",
"max-rule-node-executions-per-message-required": "Maximum number of rule node executions per message is required.",
"max-rule-node-executions-per-message-range": "Minimum number of rule node executions per message can't be negative",
"max-rule-node-executions-per-message-range": "Maximum number of rule node executions per message can't be negative",
"max-emails": "Maximum number of emails sent (0 - unlimited)",
"max-emails-required": "Maximum number of emails sent is required.",
"max-emails-range": "Maximum number of emails sent can't be negative",