Browse Source

Merge pull request #21 from deaflynx/feature/edge

EdgeEvents with type constants
pull/2436/head
VoBa 6 years ago
committed by GitHub
parent
commit
3341894223
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 13
      ui/src/app/common/types.constant.js
  2. 4
      ui/src/app/event/event-row.directive.js
  3. 5
      ui/src/app/event/event-table.directive.js

13
ui/src/app/common/types.constant.js

@ -376,6 +376,19 @@ export default angular.module('thingsboard.types', [])
entityView: "ENTITY_VIEW",
edge: "EDGE"
},
edgeEventType:{
dashboard: "DASHBOARD",
asset: "ASSET",
device: "DEVICE",
entityView: "ENTITY_VIEW",
alarm: "ALARM",
rulechain: "RULE_CHAIN",
ruleChainMetaData: "RULE_CHAIN_METADATA",
edge: "EDGE",
user: "USER",
customer: "CUSTOMER",
relation: "RELATION"
},
importEntityColumnType: {
name: {
name: 'import.column-type.name',

4
ui/src/app/event/event-row.directive.js

@ -100,10 +100,10 @@ export default function EventRowDirective($compile, $templateCache, $mdDialog, $
}
var content = '';
switch(scope.event.edgeEventType) {
case 'RELATION':
case types.edgeEventType.relation:
content = angular.toJson(scope.event.entityBody);
break;
case 'RULE_CHAIN_METADATA':
case types.edgeEventType.ruleChainMetaData:
content = ruleChainService.getRuleChainMetaData(scope.event.entityId, {}).then(
function success(info) {
return angular.toJson(info);

5
ui/src/app/event/event-table.directive.js

@ -100,8 +100,9 @@ export default function EventTableDirective($compile, $templateCache, $rootScope
fetchMoreItems_: function () {
if (scope.events.hasNext && !scope.events.pending) {
if (scope.entityType && scope.entityId && scope.eventType && scope.tenantId) {
if (scope.eventType !== "EDGE_EVENT") {
var promise = eventService.getEvents(scope.entityType, scope.entityId,
var promise = '';
if (scope.eventType !== types.eventType.edgeEvent.value) {
promise = eventService.getEvents(scope.entityType, scope.entityId,
scope.eventType, scope.tenantId, scope.events.nextPageLink);
} else {
promise = edgeService.getEdgeEvents(scope.entityId, scope.events.nextPageLink);

Loading…
Cancel
Save