diff --git a/ui/src/app/common/types.constant.js b/ui/src/app/common/types.constant.js index a9a833bd7e..e43dd9aa8a 100644 --- a/ui/src/app/common/types.constant.js +++ b/ui/src/app/common/types.constant.js @@ -1076,6 +1076,127 @@ export default angular.module('thingsboard.types', []) }, translate: { customTranslationsPrefix: "custom." - } + }, + edgeEventActionType: { + "ADDED": { + name: "audit-log.type-added" + }, + "DELETED": { + name: "audit-log.type-deleted" + }, + "UPDATED": { + name: "audit-log.type-updated" + }, + "ATTRIBUTES_UPDATED": { + name: "audit-log.type-attributes-updated" + }, + "ATTRIBUTES_DELETED": { + name: "audit-log.type-attributes-deleted" + }, + "RPC_CALL": { + name: "audit-log.type-rpc-call" + }, + "CREDENTIALS_UPDATED": { + name: "audit-log.type-credentials-updated" + }, + "RELATION_ADD_OR_UPDATE": { + name: "audit-log.type-relation-add-or-update" + }, + "RELATION_DELETED": { + name: "audit-log.type-relation-delete" + }, + "ALARM_ACK": { + name: "audit-log.type-alarm-ack" + }, + "ALARM_CLEAR": { + name: "audit-log.type-alarm-clear" + }, + "CREDENTIALS_REQUEST": { + name: "edge.credentials-request" + }, + "ATTRIBUTES_REQUEST": { + name: "edge.attributes-request" + }, + "TIMESERIES_UPDATED": { + name: "edge.timeseries-updated" + }, + "RELATION_REQUEST": { + name: "edge.relation-request" + }, + "RULE_CHAIN_METADATA_REQUEST": { + name: "edge.rule-chain-metadata-request" + }, + "GROUP_ENTITIES_REQUEST": { + name: "edge.group_entities_request" + }, + "GROUP_PERMISSIONS_REQUEST": { + name: "edge.group-permissions-request" + }, + "ASSIGNED_TO_EDGE": { + name: "audit-log.type-assigned-to-edge" + }, + "UNASSIGNED_FROM_EDGE": { + name: "audit-log.type-unassigned-from-edge" + } + }, + edgeEventTypeTranslations:{ + "DASHBOARD": { + name: "entity.type-dashboard" + }, + "ASSET": { + name: "entity.type-asset" + }, + "DEVICE": { + name: "entity.type-device" + }, + "ENTITY_VIEW": { + name: "entity.type-entity_view" + }, + "ALARM": { + name: "entity.type-alarm" + }, + "RULE_CHAIN": { + name: "entity.type-rulechain" + }, + "RULE_CHAIN_META_DATA": { + name: "entity.type-rule-chain-metadata" + }, + "EDGE": { + name: "entity.type-edge" + }, + "USER": { + name: "entity.type-user" + }, + "CUSTOMER": { + name: "entity.type-customer" + }, + "RELATION": { + name: "entity.type-relation" + }, + "ENTITY_GROUP": { + name: "entity.type-entity-group" + }, + "SCHEDULER_EVENT": { + name: "entity.type-scheduler-event" + }, + "WHITE_LABELING": { + name: "white-labeling.white-labeling" + }, + "LOGIN_WHITE_LABELING": { + name: "white-labeling.login-white-labeling" + }, + "CUSTOM_TRANSLATION": { + name: "custom-translation.custom-translation", + }, + "WIDGETS_BUNDLE": { + name: "widget.widget-bundle" + }, + "WIDGET_TYPE": { + name: "widget.type" + }, + "ADMIN_SETTINGS": { + name: "permission.resource.display-type.ADMIN_SETTINGS" + } + }, } ).name; diff --git a/ui/src/app/event/event-row-edge-event.tpl.html b/ui/src/app/event/event-row-edge-event.tpl.html index 01b6c6e261..c88d98855a 100644 --- a/ui/src/app/event/event-row-edge-event.tpl.html +++ b/ui/src/app/event/event-row-edge-event.tpl.html @@ -16,8 +16,8 @@ -->
{{ event.createdTime | date : 'yyyy-MM-dd HH:mm:ss' }}
-
{{ event.type }}
-
{{ event.action }}
+
{{ event.edgeEventTypeText }}
+
{{ event.edgeEventActionText }}
{{ event.entityId }}
{{ updateStatus(event.createdTime) }}
diff --git a/ui/src/app/event/event-table.directive.js b/ui/src/app/event/event-table.directive.js index 746f82c405..ba41da8c34 100644 --- a/ui/src/app/event/event-table.directive.js +++ b/ui/src/app/event/event-table.directive.js @@ -22,7 +22,7 @@ import eventTableTemplate from './event-table.tpl.html'; /* eslint-enable import/no-unresolved, import/default */ /*@ngInject*/ -export default function EventTableDirective($compile, $templateCache, $rootScope, types, +export default function EventTableDirective($compile, $templateCache, $rootScope, $translate, types, eventService, edgeService, attributeService) { var linker = function (scope, element, attrs) { @@ -118,7 +118,11 @@ export default function EventTableDirective($compile, $templateCache, $rootScope scope.events.pending = true; promise.then( function success(events) { - scope.events.data = scope.events.data.concat(events.data); + if (scope.eventType === types.eventType.edgeEvent.value) { + scope.events.data = scope.events.data.concat(prepareEdgeEventData(events.data)); + } else { + scope.events.data = scope.events.data.concat(events.data); + } scope.events.nextPageLink = events.nextPageLink; scope.events.hasNext = events.hasNext; if (scope.events.hasNext) { @@ -266,6 +270,16 @@ export default function EventTableDirective($compile, $templateCache, $rootScope $compile(element.contents())(scope); } + + function prepareEdgeEventData(data) { + data.forEach( + edgeEvent => { + edgeEvent.edgeEventActionText = $translate.instant(types.edgeEventActionType[edgeEvent.action].name); + edgeEvent.edgeEventTypeText = $translate.instant(types.edgeEventTypeTranslations[edgeEvent.edgeId.entityType].name); + } + ); + return data; + } return { restrict: "E", diff --git a/ui/src/app/locale/locale.constant-en_US.json b/ui/src/app/locale/locale.constant-en_US.json index 77bd29dcb6..1469f23de4 100644 --- a/ui/src/app/locale/locale.constant-en_US.json +++ b/ui/src/app/locale/locale.constant-en_US.json @@ -854,7 +854,17 @@ "edge-type-list-empty": "No edge types selected.", "edge-types": "Edge types", "license-key-hint": "To obtain your license please navigate to the pricing page and select the best license option for your case.", - "cloud-endpoint-hint": "Edge requires HTTP(s) access to Cloud (ThingsBoard CE/PE) to verify the license key. Please specify Cloud URL that Edge is able to connect to." + "cloud-endpoint-hint": "Edge requires HTTP(s) access to Cloud (ThingsBoard CE/PE) to verify the license key. Please specify Cloud URL that Edge is able to connect to.", + + "set-edge-template-root-rulechain": "Make rule chain edge template root", + "set-edge-template-root-rulechain-title": "Are you sure you want to make the rule chain '{{ruleChainName}}' edge template root?", + "set-edge-template-root-rulechain-text": "After the confirmation the rule chain will become edge template root and will be root rule chain for a newly created edges.", + "set-auto-assign-to-edge": "Assign rule chain to edge(s) on creation", + "set-auto-assign-to-edge-title": "Are you sure you want to assign the edge rule chain '{{ruleChainName}}' to edge(s) on creation?", + "set-auto-assign-to-edge-text": "After the confirmation the edge rule chain will be automatically assigned to edge(s) on creation.", + "unset-auto-assign-to-edge": "Unset assign rule chain to edge(s) on creation", + "unset-auto-assign-to-edge-title": "Are you sure you want to unset assign the edge rule chain '{{ruleChainName}}' to edge(s) on creation?", + "unset-auto-assign-to-edge-text": "After the confirmation the edge rule chain will no longer be automatically assigned to edge(s) on creation." }, "error": { "unable-to-connect": "Unable to connect to the server! Please check your internet connection.",