Browse Source

Edge overview widget final

pull/3957/head
deaflynx 6 years ago
parent
commit
bedb1d6245
  1. 12
      application/src/main/data/json/system/widget_bundles/edge_widgets.json
  2. 20
      ui/src/app/widget/lib/edges-overview-widget.js

12
application/src/main/data/json/system/widget_bundles/edge_widgets.json

File diff suppressed because one or more lines are too long

20
ui/src/app/widget/lib/edges-overview-widget.js

@ -30,7 +30,6 @@ function EdgesOverviewWidget() {
restrict: "E", restrict: "E",
scope: true, scope: true,
bindToController: { bindToController: {
hierarchyId: '=',
ctx: '=' ctx: '='
}, },
controller: EdgesOverviewWidgetController, controller: EdgesOverviewWidgetController,
@ -49,7 +48,6 @@ function EdgesOverviewWidgetController($scope, $translate, types, utils, entityS
vm.entityNodesMap = {}; vm.entityNodesMap = {};
vm.entityGroupsNodesMap = {}; vm.entityGroupsNodesMap = {};
vm.pendingUpdateNodeTasks = {};
vm.customerTitle = null; vm.customerTitle = null;
vm.edgeIsDatasource = true; vm.edgeIsDatasource = true;
@ -150,16 +148,16 @@ function EdgesOverviewWidgetController($scope, $translate, types, utils, entityS
allowedGroupTypes = edgeGroupsTypes.filter(type => type !== types.entityType.rulechain); allowedGroupTypes = edgeGroupsTypes.filter(type => type !== types.entityType.rulechain);
} }
allowedGroupTypes.forEach( allowedGroupTypes.forEach(
(groupType) => { (entityType) => {
var node = { var node = {
id: ++vm.nodeIdCounter, id: ++vm.nodeIdCounter,
icon: 'material-icons ' + iconForGroupType(groupType), icon: 'material-icons ' + iconForGroupType(entityType),
text: textForGroupType(groupType), text: textForGroupType(entityType),
children: true, children: true,
data: { data: {
groupType, entityType,
entity, entity,
internalId: entity ? entity.id.id + '_' + groupType : utils.guid() internalId: entity ? entity.id.id + '_' + entityType : utils.guid()
} }
}; };
nodes.push(node); nodes.push(node);
@ -168,8 +166,8 @@ function EdgesOverviewWidgetController($scope, $translate, types, utils, entityS
return nodes; return nodes;
} }
function iconForGroupType(groupType) { function iconForGroupType(entityType) {
switch (groupType) { switch (entityType) {
case types.entityType.asset: case types.entityType.asset:
return 'tb-asset-group'; return 'tb-asset-group';
case types.entityType.device: case types.entityType.device:
@ -184,8 +182,8 @@ function EdgesOverviewWidgetController($scope, $translate, types, utils, entityS
return ''; return '';
} }
function textForGroupType(groupType) { function textForGroupType(entityType) {
switch (groupType) { switch (entityType) {
case types.entityType.asset: case types.entityType.asset:
return $translate.instant('asset.assets'); return $translate.instant('asset.assets');
case types.entityType.device: case types.entityType.device:

Loading…
Cancel
Save