Commit 2c7a7b63e86a8cbda9d8e60b3e046e808af3966a

Authored by fengwotao
1 parent 54c4a4f2

feat: 新增规则链中英文配置

... ... @@ -11,16 +11,48 @@ export default {
11 11 customerAttributes: {
12 12 name: 'customer attributes',
13 13 details: `If Attributes enrichment configured, server scope attributes are added into Message metadata. If Latest Telemetry enrichment configured, latest telemetry added into metadata. To access those attributes in other nodes this template can be used <code>metadata.temperature</code>.`,
14   - description: `Add Originators Customer Attributes or Latest Telemetry into Message Metadata`,
  14 + description: 'Add Originators Customer Attributes or Latest Telemetry into Message Metadata',
15 15 },
16 16 customerDetails: {
17 17 name: 'customer details',
18 18 details: `If checkbox: <b>Add selected details to the message metadata</b> is selected, existing fields will be added to the message metadata instead of message data.<br><br><b>Note:</b> only Device, Asset, and Entity View type are allowed.<br><br>If the originator of the message is not assigned to Customer, or originator type is not supported - Message will be forwarded to <b>Failure</b> chain, otherwise, <b>Success</b> chain will be used.`,
19   - description: `Adds fields from Customer details to the message body or metadata`,
  19 + description: 'Adds fields from Customer details to the message body or metadata',
20 20 },
21 21 originatorAttributes: {
22 22 name: 'originator attributes',
23 23 details: `If Attributes enrichment configured, <b>CLIENT/SHARED/SERVER</b> attributes are added into Message metadata with specific prefix: <i>cs/shared/ss</i>. Latest telemetry value added into metadata without prefix. To access those attributes in other nodes this template can be used <code>metadata.cs_temperature</code> or <code>metadata.shared_limit</code> `,
24   - description: `Add Message Originator Attributes or Latest Telemetry into Message Metadata`,
  24 + description: 'Add Message Originator Attributes or Latest Telemetry into Message Metadata',
  25 + },
  26 + originatorFields: {
  27 + name: 'originator fields',
  28 + details: `Will fetch fields values specified in mapping. If specified field is not part of originator fields it will be ignored.`,
  29 + description: 'Add Message Originator fields values into Message Metadata',
  30 + },
  31 + originatorTelemetry: {
  32 + name: 'originator telemetry',
  33 + details: `The node allows you to select fetch mode: <b>FIRST/LAST/ALL</b> to fetch telemetry of certain time range that are added into Message metadata without any prefix. If selected fetch mode <b>ALL</b> Telemetry will be added like array into Message Metadata where <b>key</b> is Timestamp and <b>value</b> is value of Telemetry.</br>If selected fetch mode <b>FIRST</b> or <b>LAST</b> Telemetry will be added like string without Timestamp.</br>Also, the rule node allows you to select telemetry sampling order: <b>ASC</b> or <b>DESC</b>. </br>Aggregation feature allows you to fetch aggregated telemetry as a single value by <b>AVG, COUNT, SUM, MIN, MAX, NONE</b>. </br><b>Note</b>: The maximum size of the fetched array is 1000 records.\n `,
  34 + description: 'Add Message Originator Telemetry for selected time range into Message Metadata\n',
  35 + },
  36 + relatedAttributes: {
  37 + name: 'related attributes',
  38 + details: `Related Entity found using configured relation direction and Relation Type. If multiple Related Entities are found, only first Entity is used for attributes enrichment, other entities are discarded. If Attributes enrichment configured, server scope attributes are added into Message metadata. If Latest Telemetry enrichment configured, latest telemetry added into metadata. To access those attributes in other nodes this template can be used <code>metadata.temperature</code>.`,
  39 + description:
  40 + 'Add Originators Related Entity Attributes or Latest Telemetry into Message Metadata',
  41 + },
  42 + relatedDeviceAttributes: {
  43 + name: 'related device attributes',
  44 + details: `If Attributes enrichment configured, <b>CLIENT/SHARED/SERVER</b> attributes are added into Message metadata with specific prefix: <i>cs/shared/ss</i>. Latest telemetry value added into metadata without prefix. To access those attributes in other nodes this template can be used <code>metadata.cs_temperature</code> or <code>metadata.shared_limit</code>`,
  45 + description:
  46 + 'Add Originators Related Device Attributes and Latest Telemetry value into Message Metadata',
  47 + },
  48 + tenantAttributes: {
  49 + name: 'tenant attributes',
  50 + details: `If Attributes enrichment configured, server scope attributes are added into Message metadata. If Latest Telemetry enrichment configured, latest telemetry added into metadata. To access those attributes in other nodes this template can be used <code>metadata.temperature</code>.`,
  51 + description: 'Add Originators Tenant Attributes or Latest Telemetry into Message Metadata',
  52 + },
  53 + tenantDetails: {
  54 + name: 'tenant details',
  55 + details: `If checkbox: <b>Add selected details to the message metadata</b> is selected, existing fields will be added to the message metadata instead of message data.<br><br><b>Note:</b> only Device, Asset, and Entity View type are allowed.<br><br>If the originator of the message is not assigned to Tenant, or originator type is not supported - Message will be forwarded to <b>Failure</b> chain, otherwise, <b>Success</b> chain will be used.`,
  56 + description: 'Adds fields from Tenant details to the message body or metadata',
25 57 },
26 58 };
... ...
... ... @@ -19,8 +19,38 @@ export default {
19 19 description: `将“客户详细信息”中的字段添加到消息正文或元数据中。`,
20 20 },
21 21 originatorAttributes: {
22   - name: '客户详情',
23   - details: `如果选中:【将选定的详细信息添加到消息元数据】,则现有字段将添加到消息元数据,而不是消息数据。注意:只允许设备、资产和实体视图类型;如果消息的原始发件人未分配给客户或者不支持原始发件人类型的消息将转发到失败链路,否则将使用成功链路。`,
24   - description: `将“客户详细信息”中的字段添加到消息正文或元数据中。`,
  22 + name: '发起者属性',
  23 + details: `如果配置了单个/多个属性,客户端属性/共享属性/服务器属性将添加到具有特定前缀的消息元数据中:cs/SHARED/ss。添加到元数据中的最新遥测值,不带前缀。要访问其他节点中的这些属性,可以使用metadata.cs_temperature或metadata.shared_limit。`,
  24 + description: `将消息发起者的属性或最新遥测添加到消息元数据中。`,
  25 + },
  26 + originatorFields: {
  27 + name: '发起者字段',
  28 + details: `将获取映射中指定的字段值。如果指定的字段不是原始发件人字段的一部分,它将被忽略。`,
  29 + description: '将消息发起人字段值添加到消息元数据中。',
  30 + },
  31 + originatorTelemetry: {
  32 + name: '发起者遥测',
  33 + details: `该节点允许您选择提取模式:FIRST/LAST/ALL 以提取添加到消息元数据中的特定时间范围的遥测数据,而不带任何前缀。如果选择提取模式,ALL遥测将像数组一样添加到消息元数据中,其中Key为时间戳,Value是遥测的值;如果选择提取模式FIRST或LAST遥测将像不带时间戳的字符串一样添加;此外,规则节点允许您选择遥测采样顺序:ASC或DESC;聚合功能允许您通过AVG、COUNT、SUM、MIN、MAX、NONE将聚合遥测作为单个值获取;注意:提取数据放入数组中最大记录为1000条。`,
  34 + description: '将选定时间范围的消息发起人遥测添加到消息元数据中。',
  35 + },
  36 + relatedAttributes: {
  37 + name: '关联属性',
  38 + details: `使用配置的关系方向和关系类型找到相关实体;若找到多个相关实体,则只有第一个实体用于单个/多个属性,其他实体将被丢弃;如果配置了属性,则会将服务器范围属性添加到消息元数据中;如果配置了最新遥测,则将最新遥测添加到元数据中。要访问其他节点中的这些属性,可以使用metadata.temperature访问。`,
  39 + description: '将发起人相关实体属性或最新遥测添加到消息元数据中。',
  40 + },
  41 + relatedDeviceAttributes: {
  42 + name: '关联设备属性',
  43 + details: `如果配置了单个/多个属性,CLIENT/SHARED/SERVER 属性将添加到具有特定前缀的消息元数据中:cs/SHARED/ss。添加到元数据中的最新遥测值,不带前缀。要访问其他节点中的这些属性,可以使用 metadata.cs_temperature或metadata.shared_limit。`,
  44 + description: '关联设备属性将发起者关联设备属性和最新遥测值添加到消息元数据中。',
  45 + },
  46 + tenantAttributes: {
  47 + name: '租户属性',
  48 + details: `如果配置了单个/多个属性,则会将服务器范围属性添加到消息元数据中。如果配置了单个/多个“最新遥测”,则将最新遥测添加到元数据中。要访问其他节点中的这些属性,可以使用metadata.temperature。`,
  49 + description: '将发起者租户属性或最新遥测添加到消息元数据中。',
  50 + },
  51 + tenantDetails: {
  52 + name: '租户属性',
  53 + details: `如果配置了单个/多个属性,则会将服务器范围属性添加到消息元数据中。如果配置了单个/多个“最新遥测”,则将最新遥测添加到元数据中。要访问其他节点中的这些属性,可以使用metadata.temperature。`,
  54 + description: '将发起者租户属性或最新遥测添加到消息元数据中。',
25 55 },
26 56 };
... ...
... ... @@ -2,9 +2,11 @@ import { EnrichmentCategoryComponentEnum } from '../../../enum/category';
2 2 import { useCreateNodeKey } from '../../../hook/useCreateNodeKey';
3 3 import type { NodeItemConfigType } from '../../../types/node';
4 4 import { RuleNodeTypeEnum } from '../../index.type';
  5 +import { useI18n } from '/@/hooks/web/useI18n';
5 6
6 7 const keys = useCreateNodeKey(EnrichmentCategoryComponentEnum.ORIGINATOR_FIELDS);
7 8
  9 +const { t } = useI18n(); //加载国际化
8 10 export interface OriginatorFieldsDataType {
9 11 someConfiguration?: Recordable;
10 12 }
... ... @@ -13,12 +15,11 @@ export const OriginatorFieldsConfig: NodeItemConfigType = {
13 15 ...keys,
14 16 clazz: 'org.thingsboard.rule.engine.metadata.TbGetOriginatorFieldsNode',
15 17 categoryType: RuleNodeTypeEnum.ENRICHMENT,
16   - name: 'originator fields',
  18 + name: t('enrichments.index.originatorFields.name'),
17 19 configurationDescriptor: {
18 20 nodeDefinition: {
19   - details:
20   - 'Will fetch fields values specified in mapping. If specified field is not part of originator fields it will be ignored.',
21   - description: 'Add Message Originator fields values into Message Metadata',
  21 + details: t('enrichments.index.originatorFields.details'),
  22 + description: t('enrichments.index.originatorFields.description'),
22 23 inEnabled: true,
23 24 outEnabled: true,
24 25 relationTypes: ['Success', 'Failure'],
... ...
... ... @@ -2,9 +2,11 @@ import { EnrichmentCategoryComponentEnum } from '../../../enum/category';
2 2 import { useCreateNodeKey } from '../../../hook/useCreateNodeKey';
3 3 import type { NodeItemConfigType } from '../../../types/node';
4 4 import { RuleNodeTypeEnum } from '../../index.type';
  5 +import { useI18n } from '/@/hooks/web/useI18n';
5 6
6 7 const keys = useCreateNodeKey(EnrichmentCategoryComponentEnum.ORIGINATOR_TELEMETRY);
7 8
  9 +const { t } = useI18n(); //加载国际化
8 10 export interface OriginatorTelemetryDataType {
9 11 someConfiguration?: Recordable;
10 12 }
... ... @@ -13,13 +15,11 @@ export const OriginatorTelemetryConfig: NodeItemConfigType = {
13 15 ...keys,
14 16 clazz: 'org.thingsboard.rule.engine.metadata.TbGetTelemetryNode',
15 17 categoryType: RuleNodeTypeEnum.ENRICHMENT,
16   - name: 'originator telemetry',
  18 + name: t('enrichments.index.originatorTelemetry.name'),
17 19 configurationDescriptor: {
18 20 nodeDefinition: {
19   - details:
20   - 'The node allows you to select fetch mode: <b>FIRST/LAST/ALL</b> to fetch telemetry of certain time range that are added into Message metadata without any prefix. If selected fetch mode <b>ALL</b> Telemetry will be added like array into Message Metadata where <b>key</b> is Timestamp and <b>value</b> is value of Telemetry.</br>If selected fetch mode <b>FIRST</b> or <b>LAST</b> Telemetry will be added like string without Timestamp.</br>Also, the rule node allows you to select telemetry sampling order: <b>ASC</b> or <b>DESC</b>. </br>Aggregation feature allows you to fetch aggregated telemetry as a single value by <b>AVG, COUNT, SUM, MIN, MAX, NONE</b>. </br><b>Note</b>: The maximum size of the fetched array is 1000 records.\n ',
21   - description:
22   - 'Add Message Originator Telemetry for selected time range into Message Metadata\n',
  21 + details: t('enrichments.index.originatorTelemetry.details'),
  22 + description: t('enrichments.index.originatorTelemetry.description'),
23 23 inEnabled: true,
24 24 outEnabled: true,
25 25 relationTypes: ['Success', 'Failure'],
... ...
... ... @@ -2,9 +2,11 @@ import { EnrichmentCategoryComponentEnum } from '../../../enum/category';
2 2 import { useCreateNodeKey } from '../../../hook/useCreateNodeKey';
3 3 import type { NodeItemConfigType } from '../../../types/node';
4 4 import { RuleNodeTypeEnum } from '../../index.type';
  5 +import { useI18n } from '/@/hooks/web/useI18n';
5 6
6 7 const keys = useCreateNodeKey(EnrichmentCategoryComponentEnum.RELATED_ATTRIBUTES);
7 8
  9 +const { t } = useI18n(); //加载国际化
8 10 export interface RelatedAttributesDataType {
9 11 someConfiguration?: Recordable;
10 12 }
... ... @@ -13,13 +15,11 @@ export const RelatedAttributesConfig: NodeItemConfigType = {
13 15 ...keys,
14 16 clazz: 'org.thingsboard.rule.engine.metadata.TbGetRelatedAttributeNode',
15 17 categoryType: RuleNodeTypeEnum.ENRICHMENT,
16   - name: 'related attributes',
  18 + name: t('enrichments.index.relatedAttributes.name'),
17 19 configurationDescriptor: {
18 20 nodeDefinition: {
19   - details:
20   - 'Related Entity found using configured relation direction and Relation Type. If multiple Related Entities are found, only first Entity is used for attributes enrichment, other entities are discarded. If Attributes enrichment configured, server scope attributes are added into Message metadata. If Latest Telemetry enrichment configured, latest telemetry added into metadata. To access those attributes in other nodes this template can be used <code>metadata.temperature</code>.',
21   - description:
22   - 'Add Originators Related Entity Attributes or Latest Telemetry into Message Metadata',
  21 + details: t('enrichments.index.relatedAttributes.details'),
  22 + description: t('enrichments.index.relatedAttributes.description'),
23 23 inEnabled: true,
24 24 outEnabled: true,
25 25 relationTypes: ['Success', 'Failure'],
... ...
... ... @@ -2,9 +2,11 @@ import { EnrichmentCategoryComponentEnum } from '../../../enum/category';
2 2 import { useCreateNodeKey } from '../../../hook/useCreateNodeKey';
3 3 import type { NodeItemConfigType } from '../../../types/node';
4 4 import { RuleNodeTypeEnum } from '../../index.type';
  5 +import { useI18n } from '/@/hooks/web/useI18n';
5 6
6 7 const keys = useCreateNodeKey(EnrichmentCategoryComponentEnum.RELATED_DEVICE_ATTRIBUTES);
7 8
  9 +const { t } = useI18n(); //加载国际化
8 10 export interface RelatedDeviceAttributesDataType {
9 11 someConfiguration?: Recordable;
10 12 }
... ... @@ -13,13 +15,11 @@ export const RelatedDeviceAttributesConfig: NodeItemConfigType = {
13 15 ...keys,
14 16 clazz: 'org.thingsboard.rule.engine.metadata.TbGetDeviceAttrNode',
15 17 categoryType: RuleNodeTypeEnum.ENRICHMENT,
16   - name: 'related device attributes',
  18 + name: t('enrichments.index.relatedDeviceAttributes.name'),
17 19 configurationDescriptor: {
18 20 nodeDefinition: {
19   - details:
20   - 'If Attributes enrichment configured, <b>CLIENT/SHARED/SERVER</b> attributes are added into Message metadata with specific prefix: <i>cs/shared/ss</i>. Latest telemetry value added into metadata without prefix. To access those attributes in other nodes this template can be used <code>metadata.cs_temperature</code> or <code>metadata.shared_limit</code> ',
21   - description:
22   - 'Add Originators Related Device Attributes and Latest Telemetry value into Message Metadata',
  21 + details: t('enrichments.index.relatedDeviceAttributes.details'),
  22 + description: t('enrichments.index.relatedDeviceAttributes.description'),
23 23 inEnabled: true,
24 24 outEnabled: true,
25 25 relationTypes: ['Success', 'Failure'],
... ...
... ... @@ -2,9 +2,11 @@ import { EnrichmentCategoryComponentEnum } from '../../../enum/category';
2 2 import { useCreateNodeKey } from '../../../hook/useCreateNodeKey';
3 3 import type { NodeItemConfigType } from '../../../types/node';
4 4 import { RuleNodeTypeEnum } from '../../index.type';
  5 +import { useI18n } from '/@/hooks/web/useI18n';
5 6
6 7 const keys = useCreateNodeKey(EnrichmentCategoryComponentEnum.TENANT_ATTRIBUTES);
7 8
  9 +const { t } = useI18n(); //加载国际化
8 10 export interface TenantAttributesDataType {
9 11 someConfiguration?: Recordable;
10 12 }
... ... @@ -13,12 +15,11 @@ export const TenantAttributesConfig: NodeItemConfigType = {
13 15 ...keys,
14 16 clazz: 'org.thingsboard.rule.engine.metadata.TbGetTenantAttributeNode',
15 17 categoryType: RuleNodeTypeEnum.ENRICHMENT,
16   - name: 'tenant attributes',
  18 + name: t('enrichments.index.tenantAttributes.name'),
17 19 configurationDescriptor: {
18 20 nodeDefinition: {
19   - details:
20   - 'If Attributes enrichment configured, server scope attributes are added into Message metadata. If Latest Telemetry enrichment configured, latest telemetry added into metadata. To access those attributes in other nodes this template can be used <code>metadata.temperature</code>.',
21   - description: 'Add Originators Tenant Attributes or Latest Telemetry into Message Metadata',
  21 + details: t('enrichments.index.tenantAttributes.details'),
  22 + description: t('enrichments.index.tenantAttributes.description'),
22 23 inEnabled: true,
23 24 outEnabled: true,
24 25 relationTypes: ['Success', 'Failure'],
... ...