Browse Source

UI: Add CF output strategy new settings sendAttributesUpdatedNotification

pull/14441/head
Vladyslav_Prykhodko 10 months ago
parent
commit
4d48b4f2d6
  1. 7
      ui-ngx/src/app/modules/home/components/calculated-fields/components/output/calculated-field-output.component.html
  2. 2
      ui-ngx/src/app/modules/home/components/calculated-fields/components/output/calculated-field-output.component.ts
  3. 1
      ui-ngx/src/app/shared/models/calculated-field.models.ts
  4. 2
      ui-ngx/src/assets/locale/locale.constant-en_US.json

7
ui-ngx/src/app/modules/home/components/calculated-fields/components/output/calculated-field-output.component.html

@ -140,6 +140,13 @@
</div>
</mat-slide-toggle>
</div>
<div class="tb-form-row flex-1">
<mat-slide-toggle class="mat-slide" formControlName="sendAttributesUpdatedNotification">
<div tb-hint-tooltip-icon="{{ 'calculated-fields.output-strategy.hint.send-attributes-updated-notification' | translate }}">
<div translate tbTruncateWithTooltip>calculated-fields.output-strategy.send-attributes-updated-notification</div>
</div>
</mat-slide-toggle>
</div>
} @else {
<div class="tb-form-row space-between column-xs">
<mat-slide-toggle class="mat-slide" formControlName="useCustomTtl">

2
ui-ngx/src/app/modules/home/components/calculated-fields/components/output/calculated-field-output.component.ts

@ -104,6 +104,7 @@ export class CalculatedFieldOutputComponent implements ControlValueAccessor, Val
sendWsUpdate: [true],
processCfs: [true],
updateAttributesOnlyOnValueChange: [true],
sendAttributesUpdatedNotification: [false],
useCustomTtl: [false],
ttl: [0]
})
@ -230,6 +231,7 @@ export class CalculatedFieldOutputComponent implements ControlValueAccessor, Val
if (outputType === OutputType.Attribute) {
this.outputForm.get('strategy.saveAttribute').enable({emitEvent: false});
this.outputForm.get('strategy.updateAttributesOnlyOnValueChange').enable({emitEvent: false});
this.outputForm.get('strategy.sendAttributesUpdatedNotification').enable({emitEvent: false});
} else {
this.outputForm.get('strategy.saveTimeSeries').enable({emitEvent: false});
this.outputForm.get('strategy.saveLatest').enable({emitEvent: false});

1
ui-ngx/src/app/shared/models/calculated-field.models.ts

@ -233,6 +233,7 @@ export type AttributeOutputStrategy =
export interface AttributeImmediateOutputStrategy {
type: OutputStrategyType.IMMEDIATE;
updateAttributesOnlyOnValueChange: boolean;
sendAttributesUpdatedNotification: boolean;
saveAttribute: boolean;
sendWsUpdate: boolean;
processCfs: boolean;

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

@ -1260,6 +1260,7 @@
"send-web-sockets": "Send to WebSockets",
"save-calculated-fields": "Send to Calculated fields",
"update-attribute-only-on-value-change": "Update attribute only on value change",
"send-attributes-updated-notification": "Send attributes updated notification",
"ttl": "Custom TTL",
"ttl-required": "TTL is required",
"ttl-min": "Only 0 minimum TTL is allowed",
@ -1269,6 +1270,7 @@
"processing-options": "Processing options",
"update-attribute-only-on-value-change": "Updates attribute on every incoming message, regardless of whether the value has changed. This increases API usage and reduces performance.",
"update-attribute-only-on-value-change-enabled": "Updates attribute only when the value changes. If the value is unchanged, timestamps are not updated and notifications are not sent.",
"send-attributes-updated-notification": "Sends an Attributes Updated event to the default rule chain.",
"save-time-series": "Saves time series data to the ts_kv table in the database.",
"save-database": "Saves attribute data to the database.",
"save-latest-values": "Updates time series data in the ts_kv_latest table in the database if the new value is more recent.",

Loading…
Cancel
Save