diff --git a/ui/src/app/dashboard/dashboards.controller.js b/ui/src/app/dashboard/dashboards.controller.js index f5fc50d538..4186745ff4 100644 --- a/ui/src/app/dashboard/dashboards.controller.js +++ b/ui/src/app/dashboard/dashboards.controller.js @@ -383,7 +383,7 @@ export function DashboardsController(userService, dashboardService, customerServ } } else if (vm.dashboardsScope === 'edge') { fetchDashboardsFunction = function (pageLink) { - return dashboardService.getEdgeDashboards(edgeId, pageLink); + return dashboardService.getEdgeDashboards(edgeId, pageLink, null); }; deleteDashboardFunction = function (dashboardId) { return dashboardService.unassignDashboardFromEdge(edgeId, dashboardId); diff --git a/ui/src/app/widget/lib/entities-hierarchy-widget.js b/ui/src/app/widget/lib/entities-hierarchy-widget.js index 3bd5c30d59..a34abf79d6 100644 --- a/ui/src/app/widget/lib/entities-hierarchy-widget.js +++ b/ui/src/app/widget/lib/entities-hierarchy-widget.js @@ -41,7 +41,8 @@ function EntitiesHierarchyWidget() { } /*@ngInject*/ -function EntitiesHierarchyWidgetController($element, $scope, $q, $timeout, toast, types, entityService, entityRelationService /*$filter, $mdMedia, $mdPanel, $document, $translate, $timeout, utils, types*/) { +function EntitiesHierarchyWidgetController($element, $scope, $q, $timeout, toast, types, entityService, entityRelationService, + assetService, deviceService, entityViewService, dashboardService, ruleChainService /*$filter, $mdMedia, $mdPanel, $document, $translate, $timeout, utils, types*/) { var vm = this; vm.showData = true; @@ -293,27 +294,95 @@ function EntitiesHierarchyWidgetController($element, $scope, $q, $timeout, toast }); } else { if (node.data && node.data.nodeCtx.entity && node.data.nodeCtx.entity.id && node.data.nodeCtx.entity.id.entityType !== 'function') { - var relationQuery = prepareNodeRelationQuery(node.data.nodeCtx); - entityRelationService.findByQuery(relationQuery, {ignoreErrors: true, ignoreLoading: true}).then( - (entityRelations) => { - var tasks = []; - for (var i=0;i { + var tasks = []; + for (var i=0;i { + cb(prepareNodes(nodes)); + }); } - $q.all(tasks).then((nodes) => { - cb(prepareNodes(nodes)); - }); - }, - (error) => { - var errorText = "Failed to get relations!"; - if (error && error.status === 400) { - errorText = "Invalid relations query returned by 'Node relations query function'! Please check widget configuration!"; + ); + deviceService.getEdgeDevices(node.data.nodeCtx.entity.id.id, {limit: 20}, null).then( + (entities) => { + var tasks = []; + for (var i=0;i { + cb(prepareNodes(nodes)); + }); } - showError(errorText); - } - ); + ); + entityViewService.getEdgeEntityViews(node.data.nodeCtx.entity.id.id, {limit: 20}, null).then( + (entities) => { + var tasks = []; + for (var i=0;i { + cb(prepareNodes(nodes)); + }); + } + ); + dashboardService.getEdgeDashboards(node.data.nodeCtx.entity.id.id, {limit: 20}, null).then( + (entities) => { + var tasks = []; + for (var i=0;i { + cb(prepareNodes(nodes)); + }); + } + ) + ruleChainService.getEdgeRuleChains(node.data.nodeCtx.entity.id.id, {limit: 20}, null).then( + (entities) => { + var tasks = []; + for (var i=0;i { + cb(prepareNodes(nodes)); + }); + } + ) + } else { + var relationQuery = prepareNodeRelationQuery(node.data.nodeCtx); + entityRelationService.findByQuery(relationQuery, {ignoreErrors: true, ignoreLoading: true}).then( + (entityRelations) => { + var tasks = []; + for (var i=0;i { + cb(prepareNodes(nodes)); + }); + }, + (error) => { + var errorText = "Failed to get relations!"; + if (error && error.status === 400) { + errorText = "Invalid relations query returned by 'Node relations query function'! Please check widget configuration!"; + } + showError(errorText); + } + ); + } } else { cb([]); } @@ -511,6 +580,9 @@ function EntitiesHierarchyWidgetController($element, $scope, $q, $timeout, toast case types.entityType.edge: materialIcon = 'router'; break; + case types.entityType.rulechain: + materialIcon = 'settings_ethernet'; + break; } } return {