Commit 94084b9914e879259e0ae8929f7e463ff9e93438

Authored by fengwotao
1 parent 7061943d

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

... ... @@ -8,10 +8,17 @@ VITE_GLOB_PUBLIC_PATH = /
8 8 # Please note that no line breaks
9 9
10 10 # 本地
11   -VITE_PROXY = [["/api","http://localhost:8080/api"],["/thingskit-scada","http://localhost:3000/"],["/large-designer", "http://localhost:5555/large-designer/"]]
  11 +<<<<<<< Updated upstream
  12 +VITE_PROXY = [["/api","http://192.168.10.146:8080/api"],["/thingskit-scada","http://localhost:3000/"],["/large-designer", "http://localhost:5555/large-designer/"]]
12 13
13 14 # 实时数据的ws地址
14   -VITE_GLOB_WEB_SOCKET = ws://localhost:8080/api/ws/plugins/telemetry?token=
  15 +VITE_GLOB_WEB_SOCKET = ws://192.168.10.146:8080/api/ws/plugins/telemetry?token=
  16 +=======
  17 +VITE_PROXY = [["/api","http://222.180.200.114:48080/api"],["/thingskit-scada","http://192.168.10.115:3000/"],["/large-designer", "http://192.168.10.115:5555/large-designer/"]]
  18 +
  19 +# 实时数据的ws地址
  20 +VITE_GLOB_WEB_SOCKET = ws://222.180.200.114:48080/api/ws/plugins/telemetry?token=
  21 +>>>>>>> Stashed changes
15 22
16 23 # Delete console
17 24 VITE_GLOB_DROP_CONSOLE = true
... ...
... ... @@ -12,17 +12,17 @@
12 12 overlayClassName="app-locale-picker-overlay"
13 13 >
14 14 <span class="cursor-pointer flex items-center" :style="{ color: color }">
15   - <!-- <Icon icon="ion:language" /> -->
16   - <!-- <span v-if="showText" class="ml-1">{{ getLocaleText }}</span> -->
  15 + <Icon icon="ion:language" />
  16 + <span v-if="showText" class="ml-1">{{ getLocaleText }}</span>
17 17 </span>
18 18 </Dropdown>
19 19 </template>
20 20 <script lang="ts" setup>
21 21 import type { LocaleType } from '/#/config';
22 22 import type { DropMenu } from '/@/components/Dropdown';
23   - import { ref, watchEffect, unref } from 'vue';
  23 + import { ref, watchEffect, unref, computed } from 'vue';
24 24 import { Dropdown } from '/@/components/Dropdown';
25   - // import { Icon } from '/@/components/Icon';
  25 + import { Icon } from '/@/components/Icon';
26 26 import { useLocale } from '/@/locales/useLocale';
27 27 import { localeList } from '/@/settings/localeSetting';
28 28
... ... @@ -45,13 +45,13 @@
45 45
46 46 const { changeLocale, getLocale } = useLocale();
47 47
48   - // const getLocaleText = computed(() => {
49   - // const key = selectedKeys.value[0];
50   - // if (!key) {
51   - // return '';
52   - // }
53   - // return localeList.find((item) => item.event === key)?.text;
54   - // });
  48 + const getLocaleText = computed(() => {
  49 + const key = selectedKeys.value[0];
  50 + if (!key) {
  51 + return '';
  52 + }
  53 + return localeList.find((item) => item.event === key)?.text;
  54 + });
55 55
56 56 watchEffect(() => {
57 57 selectedKeys.value = [unref(getLocale)];
... ...
  1 +/**
  2 + *规则链 属性集 英文配置文件
  3 + 目前共有10个,分类按名称进行配置
  4 + */
  5 +export default {
  6 + calculateDelta: {
  7 + name: 'calculate delta',
  8 + details: `Calculates delta and period based on the previous time-series reading and current data. Delta calculation is done in scope of the message originator, e.g. device, asset or customer. If there is input key, the output relation will be 'Success' unless delta is negative and corresponding configuration parameter is set. If there is no input value key in the incoming message, the output relation will be 'Other'.`,
  9 + description: `Calculates and adds 'delta' value into message based on the incoming and previous value`,
  10 + },
  11 + customerAttributes: {
  12 + name: 'customer attributes',
  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`,
  15 + },
  16 + customerDetails: {
  17 + name: 'customer details',
  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`,
  20 + },
  21 + originatorAttributes: {
  22 + name: 'originator attributes',
  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`,
  25 + },
  26 +};
... ...
  1 +/**
  2 + *规则链 筛选器 英文配置文件
  3 + 目前共有11个,分类按名称进行配置
  4 + */
  5 +export default {
  6 + checkAlarmStatus: {
  7 + name: 'check alarm status',
  8 + details:
  9 + 'If the alarm status matches the specified one - msg is success if does not match - msg is failure.',
  10 + description: 'Checks alarm status.',
  11 + },
  12 + checkExistenceFields: {
  13 + name: 'check existence fields',
  14 + details: `If selected checkbox 'Check that all selected keys are present'\" and all keys in message data and metadata are exist - send Message via <b>True</b> chain, otherwise <b>False</b> chain is used.\nElse if the checkbox is not selected, and at least one of the keys from data or metadata of the message exists - send Message via <b>True</b> chain, otherwise, <b>False</b> chain is used. `,
  15 + description: 'Checks the existence of the selected keys from message data and metadata.',
  16 + },
  17 + checkRelation: {
  18 + name: 'check relation',
  19 + details:
  20 + 'If at least one relation exists - send Message via <b>True</b> chain, otherwise <b>False</b> chain is used.',
  21 + description: `Checks the relation from the selected entity to the originator of the message by type and direction if 'Check for single entity' is set to true, otherwise rule node will check if exist any relation to the originator of the message by type and direction.`,
  22 + },
  23 + gpsGeofencingFilter: {
  24 + name: 'gps geofencing filter',
  25 + details: `Extracts latitude and longitude parameters from incoming message and returns 'True' if they are inside configured perimeters, 'False' otherwise.`,
  26 + description: 'Filter incoming messages by GPS based geofencing',
  27 + },
  28 + messageType: {
  29 + name: 'message type',
  30 + details: `If incoming MessageType is expected - send Message via <b>True</b> chain, otherwise <b>False</b> chain is used.`,
  31 + description: 'Filter incoming messages by Message Type',
  32 + },
  33 + messageTypeSwitch: {
  34 + name: 'message type switch',
  35 + details: `Sends messages with message types <b>"Post attributes", "Post telemetry", "RPC Request"</b> etc. via corresponding chain, otherwise <b>Other</b> chain is used.`,
  36 + description: 'Route incoming messages by Message Type',
  37 + },
  38 + originatorType: {
  39 + name: 'originator type',
  40 + details: `If Originator Type of incoming message is expected - send Message via <b>True</b> chain, otherwise <b>False</b> chain is used.`,
  41 + description: 'Filter incoming messages by message Originator Type',
  42 + },
  43 + originatorTypeSwitch: {
  44 + name: 'originator type switch',
  45 + details: `Routes messages to chain according to the originator type ('Device', 'Asset', etc.).`,
  46 + description: 'Route incoming messages by Message Originator Type',
  47 + },
  48 + sceneReact: {
  49 + name: 'originator type switch',
  50 + details: `Implement interactive control of devices based on business scenarios`,
  51 + description: 'Implement interactive control of devices based on business scenarios',
  52 + },
  53 + script: {
  54 + name: 'script',
  55 + details: `Evaluate incoming Message with configured JS condition. If <b>True</b> - send Message via <b>True</b> chain, otherwise <b>False</b> chain is used.Message payload can be accessed via <code>msg</code> property. For example <code>msg.temperature < 10;</code><br/>Message metadata can be accessed via <code>metadata</code> property. For example <code>metadata.customerName === 'John';</code><br/>Message type can be accessed via <code>msgType</code> property.`,
  56 + description: 'Filter incoming messages using JS script',
  57 + },
  58 + switch: {
  59 + name: 'switch',
  60 + details: `Node executes configured JS script. Script should return array of next Chain names where Message should be routed. If Array is empty - message not routed to next Node. Message payload can be accessed via <code>msg</code> property. For example <code>msg.temperature < 10;</code><br/>Message metadata can be accessed via <code>metadata</code> property. For example <code>metadata.customerName === 'John';</code><br/>Message type can be accessed via <code>msgType</code> property.`,
  61 + description: 'Route incoming Message to one or multiple output chains',
  62 + },
  63 +};
... ...
  1 +/**
  2 + *规则链 属性集 中文配置文件
  3 + 目前共有10个,分类按名称进行配置
  4 + */
  5 +export default {
  6 + calculateDelta: {
  7 + name: '计算增量',
  8 + details: `该节点可以在规则中获取上一次遥测的值,以此可以实现二次遥测的差。比如一个设备,一天上传一次数据,如果你要对比今天和昨天的数据,并将两者数据差保存到数据库,就能够使用该节点。增量计算是在消息发起者的范围内完成的,例如设备、资产或客户。如果有输入键,则输出关系将为“成功”,除非增量为负并且设置了相应的配置参数。如果传入消息中没有输入值键,则输出关系将为“其他”。`,
  9 + description: `根据传入值和上一个值计算增量值并将其添加到消息中。`,
  10 + },
  11 + customerAttributes: {
  12 + name: '客户端属性',
  13 + details: `如果已配置属性,则会将服务器范围属性添加到消息元数据中。如果配置了'最新遥测',则将最新遥测添加到元数据中。要访问其他节点中的这些属性,可以使用metadata.temperature访问。`,
  14 + description: `将发起者客户端属性或最新遥测添加到消息元数据中。`,
  15 + },
  16 + customerDetails: {
  17 + name: '客户详情',
  18 + details: `如果选中:【将选定的详细信息添加到消息元数据】,则现有字段将添加到消息元数据,而不是消息数据。注意:只允许设备、资产和实体视图类型;如果消息的原始发件人未分配给客户或者不支持原始发件人类型的消息将转发到失败链路,否则将使用成功链路。`,
  19 + description: `将“客户详细信息”中的字段添加到消息正文或元数据中。`,
  20 + },
  21 + originatorAttributes: {
  22 + name: '客户详情',
  23 + details: `如果选中:【将选定的详细信息添加到消息元数据】,则现有字段将添加到消息元数据,而不是消息数据。注意:只允许设备、资产和实体视图类型;如果消息的原始发件人未分配给客户或者不支持原始发件人类型的消息将转发到失败链路,否则将使用成功链路。`,
  24 + description: `将“客户详细信息”中的字段添加到消息正文或元数据中。`,
  25 + },
  26 +};
... ...
  1 +/**
  2 + *规则链 筛选器 中文配置文件
  3 + 目前共有11个,分类按名称进行配置
  4 + */
  5 +export default {
  6 + checkAlarmStatus: {
  7 + name: '检测报警状态',
  8 + details: '如果警报状态与指定的状态匹配,则消息成功;如果不匹配,则消息失败。',
  9 + description: '检测报警状态',
  10 + },
  11 + checkExistenceFields: {
  12 + name: '检测字段是否存在',
  13 + details: `如果选中【检查所有选择的键是否存在】 ,就必选满足Message data中配置的字段和Message metadata中配置的字段,都必须存在才会返回true发送消息,否则返回false。
  14 + 如果未选中,Message data中配置的字段或者Message metadata中配置的字段至少有一个键存在返回true,否则返回false。`,
  15 + description: '检查消息中的字段数据和消息元数据中所选择的键是否都存在。',
  16 + },
  17 + checkRelation: {
  18 + name: '检查实体关系是否存在',
  19 + details: '如果至少存在一个关系,通过True链路发送消息,否则使用False链路。',
  20 + description: `检查关系是按类型和方向将所选实体发送给消息的发起者;如果“检查单个实体”设置为true,否则规则节点将按类型和方向检查是否存在与消息发起者的任何关系。`,
  21 + },
  22 + gpsGeofencingFilter: {
  23 + name: 'GPS地理围栏过滤器',
  24 + details: `从传入消息中提取纬度和经度参数,如果它们位于配置的周界内,则返回'True',否则返回'False'。`,
  25 + description: '通过基于GPS的地理围栏过滤传入消息。',
  26 + },
  27 + messageType: {
  28 + name: '消息类型',
  29 + details: `如果需要传入消息类型通过,则'True'链发送消息,否则使用'False'链路。`,
  30 + description: '按消息类型筛选传入消息。',
  31 + },
  32 + messageTypeSwitch: {
  33 + name: '消息类型转换',
  34 + details: `通过相应链发送消息类型为'属性上报','遥测上报','RPC请求'等的消息,否则使用其他链。`,
  35 + description: '按消息类型路由传入消息。',
  36 + },
  37 + originatorType: {
  38 + name: '发起者类型',
  39 + details: `如果预期传入消息的发起者类型,通过则True链发送消息,否则使用False链路。`,
  40 + description: '按消息发起者类型过滤传入消息。',
  41 + },
  42 + originatorTypeSwitch: {
  43 + name: '发起者类型转换',
  44 + details: `根据发起方类型(设备、资产等)将消息路由到链。`,
  45 + description: '按消息发起者类型路由传入消息。',
  46 + },
  47 + sceneReact: {
  48 + name: '场景交互',
  49 + details: `基于业务场景,实现设备的交互控制。`,
  50 + description: '基于业务场景,实现设备的交互控。',
  51 + },
  52 + script: {
  53 + name: 'JS脚本',
  54 + details: `使用配置的JS匹配条件传入消息。如果为True,则通过True链发送消息,否则使用False链。可以通过msg属性访问消息负载。 例如 msg.temperature < 10 ;可以通过metadata属性访问消息元数据。例如metadata.customerName === 'John';可以通过msgType属性访问消息类型。`,
  55 + description: '使用JS脚本过滤传入消息。',
  56 + },
  57 + switch: {
  58 + name: '转换器',
  59 + details: `节点执行配置的JS脚本。脚本返回的消息应该路由到下一个链名称的数组。如果数组为空,则消息不会路由到下一个节点。可以通过 msg 属性访问消息负载。例如 msg.temperature < 10; 可以通过 metadata 属性访问消息元数据。例如 metadata.customerName==='John' ;可以通过 msgType属性访问消息类型。`,
  60 + description: '将传入消息路由到一个或多个输出链。',
  61 + },
  62 +};
... ...
... ... @@ -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.CALCULATE_DELTA);
7 8
  9 +const { t } = useI18n(); //加载国际化
8 10 export interface CalculateDeltaDataType {
9 11 someConfiguration?: Recordable;
10 12 }
... ... @@ -13,13 +15,11 @@ export const CalculateDeltaConfig: NodeItemConfigType = {
13 15 ...keys,
14 16 clazz: 'org.thingsboard.rule.engine.metadata.CalculateDeltaNode',
15 17 categoryType: RuleNodeTypeEnum.ENRICHMENT,
16   - name: 'calculate delta',
  18 + name: t('enrichments.index.calculateDelta.name'),
17 19 configurationDescriptor: {
18 20 nodeDefinition: {
19   - details:
20   - "Calculates delta and period based on the previous time-series reading and current data. Delta calculation is done in scope of the message originator, e.g. device, asset or customer. If there is input key, the output relation will be 'Success' unless delta is negative and corresponding configuration parameter is set. If there is no input value key in the incoming message, the output relation will be 'Other'.",
21   - description:
22   - "Calculates and adds 'delta' value into message based on the incoming and previous value",
  21 + details: t('enrichments.index.calculateDelta.details'),
  22 + description: t('enrichments.index.calculateDelta.description'),
23 23 inEnabled: true,
24 24 outEnabled: true,
25 25 relationTypes: ['Success', 'Failure', 'Other'],
... ...
... ... @@ -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.CUSTOMER_ATTRIBUTES);
7 8
  9 +const { t } = useI18n(); //加载国际化
8 10 export interface CustomerAttributesDataType {
9 11 someConfiguration?: Recordable;
10 12 }
... ... @@ -13,12 +15,11 @@ export const CustomerAttributesConfig: NodeItemConfigType = {
13 15 ...keys,
14 16 clazz: 'org.thingsboard.rule.engine.metadata.TbGetCustomerAttributeNode',
15 17 categoryType: RuleNodeTypeEnum.ENRICHMENT,
16   - name: 'customer attributes',
  18 + name: t('enrichments.index.customerAttributes.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 Customer Attributes or Latest Telemetry into Message Metadata',
  21 + details: t('enrichments.index.customerAttributes.details'),
  22 + description: t('enrichments.index.customerAttributes.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.CUSTOMER_DETAILS);
7 8
  9 +const { t } = useI18n(); //加载国际化
8 10 export interface CustomerDetailsDataType {
9 11 someConfiguration?: Recordable;
10 12 }
... ... @@ -13,12 +15,11 @@ export const CustomerDetailsConfig: NodeItemConfigType = {
13 15 ...keys,
14 16 clazz: 'org.thingsboard.rule.engine.metadata.TbGetCustomerDetailsNode',
15 17 categoryType: RuleNodeTypeEnum.ENRICHMENT,
16   - name: 'customer details',
  18 + name: t('enrichments.index.customerDetails.name'),
17 19 configurationDescriptor: {
18 20 nodeDefinition: {
19   - details:
20   - '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.',
21   - description: 'Adds fields from Customer details to the message body or metadata',
  21 + details: t('enrichments.index.customerDetails.details'),
  22 + description: t('enrichments.index.customerDetails.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_ATTRIBUTES);
7 8
  9 +const { t } = useI18n(); //加载国际化
8 10 export interface OriginatorAttributesDataType {
9 11 someConfiguration?: Recordable;
10 12 }
... ... @@ -13,12 +15,11 @@ export const OriginatorAttributesConfig: NodeItemConfigType = {
13 15 ...keys,
14 16 clazz: 'org.thingsboard.rule.engine.metadata.TbGetAttributesNode',
15 17 categoryType: RuleNodeTypeEnum.ENRICHMENT,
16   - name: 'originator attributes',
  18 + name: t('enrichments.index.originatorAttributes.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: 'Add Message Originator Attributes or Latest Telemetry into Message Metadata',
  21 + details: t('enrichments.index.originatorAttributes.details'),
  22 + description: t('enrichments.index.originatorAttributes.description'),
22 23 inEnabled: true,
23 24 outEnabled: true,
24 25 relationTypes: ['Success', 'Failure'],
... ...
... ... @@ -3,9 +3,11 @@ import { useCreateNodeKey } from '../../../hook/useCreateNodeKey';
3 3 import type { NodeItemConfigType } from '../../../types/node';
4 4 import { RuleNodeTypeEnum } from '../../index.type';
5 5 import { AlarmStatus } from '/@/enums/alarmEnum';
  6 +import { useI18n } from '/@/hooks/web/useI18n';
6 7
7 8 const keys = useCreateNodeKey(FilterCategoryComponentEnum.CHECK_ALARM_STATUS);
8 9
  10 +const { t } = useI18n(); //加载国际化
9 11 export interface CheckAlarmStatusDataType {
10 12 alarmStatusList: AlarmStatus[];
11 13 }
... ... @@ -14,13 +16,12 @@ export const CheckAlarmStatusConfig: NodeItemConfigType = {
14 16 ...keys,
15 17 clazz: 'org.thingsboard.rule.engine.filter.TbCheckAlarmStatusNode',
16 18 categoryType: RuleNodeTypeEnum.FILTER,
17   - name: 'check alarm status',
  19 + name: t('filters.index.checkAlarmStatus.name'),
18 20 configurationDescriptor: {
19 21 nodeDefinition: {
20 22 icon: 'material-symbols:filter-list',
21   - details:
22   - 'If the alarm status matches the specified one - msg is success if does not match - msg is failure.',
23   - description: 'Checks alarm status.',
  23 + details: t('filters.index.checkAlarmStatus.details'),
  24 + description: t('filters.index.checkAlarmStatus.description'),
24 25 inEnabled: true,
25 26 outEnabled: true,
26 27 relationTypes: ['True', 'False', 'Failure'],
... ...
... ... @@ -2,9 +2,11 @@ import { FilterCategoryComponentEnum } 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(FilterCategoryComponentEnum.CHECK_EXISTENCE_FIELDS);
7 8
  9 +const { t } = useI18n(); //加载国际化
8 10 export interface CheckExistenceFieldsDataType {
9 11 someConfiguration?: Recordable;
10 12 }
... ... @@ -13,12 +15,11 @@ export const CheckExistenceFieldsConfig: NodeItemConfigType = {
13 15 ...keys,
14 16 clazz: 'org.thingsboard.rule.engine.filter.TbCheckMessageNode',
15 17 categoryType: RuleNodeTypeEnum.FILTER,
16   - name: 'check existence fields',
  18 + name: t('filters.index.checkExistenceFields.name'),
17 19 configurationDescriptor: {
18 20 nodeDefinition: {
19   - details:
20   - "If selected checkbox 'Check that all selected keys are present'\" and all keys in message data and metadata are exist - send Message via <b>True</b> chain, otherwise <b>False</b> chain is used.\nElse if the checkbox is not selected, and at least one of the keys from data or metadata of the message exists - send Message via <b>True</b> chain, otherwise, <b>False</b> chain is used. ",
21   - description: 'Checks the existence of the selected keys from message data and metadata.',
  21 + details: t('filters.index.checkExistenceFields.details'),
  22 + description: t('filters.index.checkExistenceFields.description'),
22 23 inEnabled: true,
23 24 outEnabled: true,
24 25 relationTypes: ['True', 'False', 'Failure'],
... ...
... ... @@ -2,9 +2,12 @@ import { FilterCategoryComponentEnum } 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(FilterCategoryComponentEnum.CHECK_RELATION);
7 8
  9 +const { t } = useI18n(); //加载国际化
  10 +
8 11 export interface CheckRelationDataType {
9 12 someConfiguration?: Recordable;
10 13 }
... ... @@ -13,13 +16,11 @@ export const CheckRelationConfig: NodeItemConfigType = {
13 16 ...keys,
14 17 clazz: 'org.thingsboard.rule.engine.filter.TbCheckRelationNode',
15 18 categoryType: RuleNodeTypeEnum.FILTER,
16   - name: 'check relation',
  19 + name: t('filters.index.checkRelation.name'),
17 20 configurationDescriptor: {
18 21 nodeDefinition: {
19   - details:
20   - 'If at least one relation exists - send Message via <b>True</b> chain, otherwise <b>False</b> chain is used.',
21   - description:
22   - "Checks the relation from the selected entity to the originator of the message by type and direction if 'Check for single entity' is set to true, otherwise rule node will check if exist any relation to the originator of the message by type and direction.",
  22 + details: t('filters.index.checkRelation.details'),
  23 + description: t('filters.index.checkRelation.description'),
23 24 inEnabled: true,
24 25 outEnabled: true,
25 26 relationTypes: ['True', 'False', 'Failure'],
... ...
... ... @@ -2,9 +2,11 @@ import { FilterCategoryComponentEnum } 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(FilterCategoryComponentEnum.GPS_GEOFENCING_FILTER);
7 8
  9 +const { t } = useI18n(); //加载国际化
8 10 export interface GpsGeofencingFilterDataType {
9 11 someConfiguration?: Recordable;
10 12 }
... ... @@ -13,12 +15,11 @@ export const GpsGeofencingFilterConfig: NodeItemConfigType = {
13 15 ...keys,
14 16 clazz: 'org.thingsboard.rule.engine.geo.TbGpsGeofencingFilterNode',
15 17 categoryType: RuleNodeTypeEnum.FILTER,
16   - name: 'gps geofencing filter',
  18 + name: t('filters.index.gpsGeofencingFilter.name'),
17 19 configurationDescriptor: {
18 20 nodeDefinition: {
19   - details:
20   - "Extracts latitude and longitude parameters from incoming message and returns 'True' if they are inside configured perimeters, 'False' otherwise.",
21   - description: 'Filter incoming messages by GPS based geofencing',
  21 + details: t('filters.index.gpsGeofencingFilter.details'),
  22 + description: t('filters.index.gpsGeofencingFilter.description'),
22 23 inEnabled: true,
23 24 outEnabled: true,
24 25 relationTypes: ['True', 'False', 'Failure'],
... ...
... ... @@ -2,9 +2,12 @@ import { FilterCategoryComponentEnum } 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(FilterCategoryComponentEnum.MESSAGE_TYPE);
7 8
  9 +const { t } = useI18n(); //加载国际化
  10 +
8 11 export interface MessageTypeDataType {
9 12 someConfiguration?: Recordable;
10 13 }
... ... @@ -13,12 +16,11 @@ export const MessageTypeConfig: NodeItemConfigType = {
13 16 ...keys,
14 17 clazz: 'org.thingsboard.rule.engine.filter.TbMsgTypeFilterNode',
15 18 categoryType: RuleNodeTypeEnum.FILTER,
16   - name: 'message type',
  19 + name: t('filters.index.messageType.name'),
17 20 configurationDescriptor: {
18 21 nodeDefinition: {
19   - details:
20   - 'If incoming MessageType is expected - send Message via <b>True</b> chain, otherwise <b>False</b> chain is used.',
21   - description: 'Filter incoming messages by Message Type',
  22 + details: t('filters.index.messageType.details'),
  23 + description: t('filters.index.messageType.description'),
22 24 inEnabled: true,
23 25 outEnabled: true,
24 26 relationTypes: ['True', 'False', 'Failure'],
... ...
... ... @@ -2,9 +2,11 @@ import { FilterCategoryComponentEnum } 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(FilterCategoryComponentEnum.MESSAGE_TYPE_SWITCH);
7 8
  9 +const { t } = useI18n(); //加载国际化
8 10 export interface MessageTypeSwitchDataType {
9 11 someConfiguration?: Recordable;
10 12 }
... ... @@ -13,12 +15,11 @@ export const MessageTypeSwitchConfig: NodeItemConfigType = {
13 15 ...keys,
14 16 clazz: 'org.thingsboard.rule.engine.filter.TbMsgTypeSwitchNode',
15 17 categoryType: RuleNodeTypeEnum.FILTER,
16   - name: 'message type switch',
  18 + name: t('filters.index.messageTypeSwitch.name'),
17 19 configurationDescriptor: {
18 20 nodeDefinition: {
19   - details:
20   - 'Sends messages with message types <b>"Post attributes", "Post telemetry", "RPC Request"</b> etc. via corresponding chain, otherwise <b>Other</b> chain is used.',
21   - description: 'Route incoming messages by Message Type',
  21 + details: t('filters.index.messageTypeSwitch.details'),
  22 + description: t('filters.index.messageTypeSwitch.description'),
22 23 inEnabled: true,
23 24 outEnabled: true,
24 25 relationTypes: [
... ...
... ... @@ -2,9 +2,11 @@ import { FilterCategoryComponentEnum } 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(FilterCategoryComponentEnum.ORIGINATOR_TYPE);
7 8
  9 +const { t } = useI18n(); //加载国际化
8 10 export interface OriginatorTypeDataType {
9 11 someConfiguration?: Recordable;
10 12 }
... ... @@ -13,12 +15,11 @@ export const OriginatorTypeConfig: NodeItemConfigType = {
13 15 ...keys,
14 16 clazz: 'org.thingsboard.rule.engine.filter.TbOriginatorTypeFilterNode',
15 17 categoryType: RuleNodeTypeEnum.FILTER,
16   - name: 'originator type',
  18 + name: t('filters.index.originatorType.name'),
17 19 configurationDescriptor: {
18 20 nodeDefinition: {
19   - details:
20   - 'If Originator Type of incoming message is expected - send Message via <b>True</b> chain, otherwise <b>False</b> chain is used.',
21   - description: 'Filter incoming messages by message Originator Type',
  21 + details: t('filters.index.originatorType.details'),
  22 + description: t('filters.index.originatorType.description'),
22 23 inEnabled: true,
23 24 outEnabled: true,
24 25 relationTypes: ['True', 'False', 'Failure'],
... ...
... ... @@ -2,9 +2,11 @@ import { FilterCategoryComponentEnum } 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(FilterCategoryComponentEnum.ORIGINATOR_TYPE_SWITCH);
7 8
  9 +const { t } = useI18n(); //加载国际化
8 10 export interface OriginatorTypeSwitchDataType {
9 11 someConfiguration?: Recordable;
10 12 }
... ... @@ -13,12 +15,11 @@ export const OriginatorTypeSwitchConfig: NodeItemConfigType = {
13 15 ...keys,
14 16 clazz: 'org.thingsboard.rule.engine.filter.TbOriginatorTypeSwitchNode',
15 17 categoryType: RuleNodeTypeEnum.FILTER,
16   - name: 'originator type switch',
  18 + name: t('filters.index.originatorTypeSwitch.name'),
17 19 configurationDescriptor: {
18 20 nodeDefinition: {
19   - details:
20   - "Routes messages to chain according to the originator type ('Device', 'Asset', etc.).",
21   - description: 'Route incoming messages by Message Originator Type',
  21 + details: t('filters.index.originatorTypeSwitch.details'),
  22 + description: t('filters.index.originatorTypeSwitch.description'),
22 23 inEnabled: true,
23 24 outEnabled: true,
24 25 relationTypes: [
... ...
... ... @@ -2,9 +2,11 @@ import { FilterCategoryComponentEnum } 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(FilterCategoryComponentEnum.SCENE_REACT);
7 8
  9 +const { t } = useI18n(); //加载国际化
8 10 export interface SceneReactDataType {
9 11 someConfiguration?: Recordable;
10 12 }
... ... @@ -13,11 +15,11 @@ export const SceneReactConfig: NodeItemConfigType = {
13 15 ...keys,
14 16 clazz: 'org.thingsboard.rule.engine.yunteng.scene.TbSceneReactNode',
15 17 categoryType: RuleNodeTypeEnum.FILTER,
16   - name: 'scene react',
  18 + name: t('filters.index.sceneReact.name'),
17 19 configurationDescriptor: {
18 20 nodeDefinition: {
19   - details: '基于业务场景,实现设备的交互控制。',
20   - description: '基于业务场景,实现设备的交互控制。',
  21 + details: t('filters.index.sceneReact.details'),
  22 + description: t('filters.index.sceneReact.description'),
21 23 inEnabled: true,
22 24 outEnabled: true,
23 25 relationTypes: ['Message', 'Alarm Created', 'Alarm Updated', 'RPC Request', 'Failure'],
... ...
... ... @@ -2,9 +2,11 @@ import { FilterCategoryComponentEnum } 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(FilterCategoryComponentEnum.SCRIPT);
7 8
  9 +const { t } = useI18n(); //加载国际化
8 10 export interface ScriptDataType {
9 11 someConfiguration?: Recordable;
10 12 }
... ... @@ -13,12 +15,11 @@ export const ScriptConfig: NodeItemConfigType = {
13 15 ...keys,
14 16 clazz: 'org.thingsboard.rule.engine.filter.TbJsFilterNode',
15 17 categoryType: RuleNodeTypeEnum.FILTER,
16   - name: 'script',
  18 + name: t('filters.index.script.name'),
17 19 configurationDescriptor: {
18 20 nodeDefinition: {
19   - details:
20   - "Evaluate incoming Message with configured JS condition. If <b>True</b> - send Message via <b>True</b> chain, otherwise <b>False</b> chain is used.Message payload can be accessed via <code>msg</code> property. For example <code>msg.temperature < 10;</code><br/>Message metadata can be accessed via <code>metadata</code> property. For example <code>metadata.customerName === 'John';</code><br/>Message type can be accessed via <code>msgType</code> property.",
21   - description: 'Filter incoming messages using JS script',
  21 + details: t('filters.index.script.details'),
  22 + description: t('filters.index.script.description'),
22 23 inEnabled: true,
23 24 outEnabled: true,
24 25 relationTypes: ['True', 'False', 'Failure'],
... ...
... ... @@ -2,9 +2,11 @@ import { FilterCategoryComponentEnum } 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(FilterCategoryComponentEnum.SWITCH);
7 8
  9 +const { t } = useI18n(); //加载国际化
8 10 export interface SwitchDataType {
9 11 someConfiguration?: Recordable;
10 12 }
... ... @@ -13,12 +15,11 @@ export const SwitchConfig: NodeItemConfigType = {
13 15 ...keys,
14 16 clazz: 'org.thingsboard.rule.engine.filter.TbJsSwitchNode',
15 17 categoryType: RuleNodeTypeEnum.FILTER,
16   - name: 'switch',
  18 + name: t('filters.index.switch.name'),
17 19 configurationDescriptor: {
18 20 nodeDefinition: {
19   - details:
20   - "Node executes configured JS script. Script should return array of next Chain names where Message should be routed. If Array is empty - message not routed to next Node. Message payload can be accessed via <code>msg</code> property. For example <code>msg.temperature < 10;</code><br/>Message metadata can be accessed via <code>metadata</code> property. For example <code>metadata.customerName === 'John';</code><br/>Message type can be accessed via <code>msgType</code> property.",
21   - description: 'Route incoming Message to one or multiple output chains',
  21 + details: t('filters.index.switch.details'),
  22 + description: t('filters.index.switch.description'),
22 23 inEnabled: true,
23 24 outEnabled: true,
24 25 relationTypes: ['Failure'],
... ...