diff --git a/application/src/main/java/org/thingsboard/server/actors/ruleChain/RuleNodeActorMessageProcessor.java b/application/src/main/java/org/thingsboard/server/actors/ruleChain/RuleNodeActorMessageProcessor.java index a08dc3489c..93cb5fbf7f 100644 --- a/application/src/main/java/org/thingsboard/server/actors/ruleChain/RuleNodeActorMessageProcessor.java +++ b/application/src/main/java/org/thingsboard/server/actors/ruleChain/RuleNodeActorMessageProcessor.java @@ -69,14 +69,18 @@ public class RuleNodeActorMessageProcessor extends ComponentMsgProcessor -
event.event-time
+
event.event-time
event.server
-
event.type
-
event.entity
+
event.type
+
event.entity
event.message-id
event.message-type
-
event.data-type
-
event.data
-
event.metadata
-
event.error
+
event.data-type
+
event.data
+
event.metadata
+
event.error
diff --git a/ui/src/app/event/event-row-debug-rulenode.tpl.html b/ui/src/app/event/event-row-debug-rulenode.tpl.html index 5b96bafd62..bb832b15d8 100644 --- a/ui/src/app/event/event-row-debug-rulenode.tpl.html +++ b/ui/src/app/event/event-row-debug-rulenode.tpl.html @@ -15,14 +15,14 @@ limitations under the License. --> -
{{event.createdTime | date : 'yyyy-MM-dd HH:mm:ss'}}
+
{{event.createdTime | date : 'yyyy-MM-dd HH:mm:ss'}}
{{event.body.server}}
-
{{event.body.type}}
-
{{event.body.entityName}}
-
{{event.body.msgId}}
-
{{event.body.msgType}}
-
{{event.body.dataType}}
-
+
{{event.body.type}}
+
{{event.body.entityName}}
+
{{event.body.msgId}}
+
{{event.body.msgType}}
+
{{event.body.dataType}}
+
@@ -35,7 +35,7 @@
-
+
@@ -48,7 +48,7 @@
-
+
diff --git a/ui/src/app/event/event-row.directive.js b/ui/src/app/event/event-row.directive.js index 4643761b39..b808fb8fff 100644 --- a/ui/src/app/event/event-row.directive.js +++ b/ui/src/app/event/event-row.directive.js @@ -86,6 +86,14 @@ export default function EventRowDirective($compile, $templateCache, $mdDialog, $ }); } + scope.checkTooltip = function($event) { + var el = $event.target; + var $el = angular.element(el); + if(el.offsetWidth < el.scrollWidth && !$el.attr('title')){ + $el.attr('title', $el.text()); + } + } + $compile(element.contents())(scope); } diff --git a/ui/src/app/event/event.scss b/ui/src/app/event/event.scss index b3be35c19f..b0fc46fea5 100644 --- a/ui/src/app/event/event.scss +++ b/ui/src/app/event/event.scss @@ -24,6 +24,17 @@ md-list.tb-event-table { height: 48px; padding: 0px; overflow: hidden; + .tb-cell { + text-overflow: ellipsis; + &.tb-scroll { + white-space: nowrap; + overflow-y: hidden; + overflow-x: auto; + } + &.tb-nowrap { + white-space: nowrap; + } + } } .tb-row:hover { @@ -39,13 +50,19 @@ md-list.tb-event-table { color: rgba(0,0,0,.54); font-size: 12px; font-weight: 700; - white-space: nowrap; background: none; + white-space: nowrap; } } .tb-cell { - padding: 0 24px; + &:first-child { + padding-left: 14px; + } + &:last-child { + padding-right: 14px; + } + padding: 0 6px; margin: auto 0; color: rgba(0,0,0,.87); font-size: 13px; @@ -53,8 +70,8 @@ md-list.tb-event-table { text-align: left; overflow: hidden; .md-button { - padding: 0; - margin: 0; + padding: 0; + margin: 0; } } diff --git a/ui/src/app/locale/locale.constant.js b/ui/src/app/locale/locale.constant.js index f616fec1a0..9c0cd12ec3 100644 --- a/ui/src/app/locale/locale.constant.js +++ b/ui/src/app/locale/locale.constant.js @@ -43,6 +43,7 @@ export default angular.module('thingsboard.locale', []) "update": "Update", "remove": "Remove", "search": "Search", + "clear-search": "Clear search", "assign": "Assign", "unassign": "Unassign", "share": "Share", @@ -1188,6 +1189,7 @@ export default angular.module('thingsboard.locale', []) "details": "Details", "events": "Events", "search": "Search nodes", + "open-node-library": "Open node library", "add": "Add rule node", "name": "Name", "name-required": "Name is required.", diff --git a/ui/src/app/rulechain/rulechain.controller.js b/ui/src/app/rulechain/rulechain.controller.js index 7de72c31bd..14cf7985e7 100644 --- a/ui/src/app/rulechain/rulechain.controller.js +++ b/ui/src/app/rulechain/rulechain.controller.js @@ -37,6 +37,8 @@ export function RuleChainController($stateParams, $scope, $compile, $q, $mdUtil, vm.$mdExpansionPanel = $mdExpansionPanel; vm.types = types; + vm.isFullscreen = false; + vm.editingRuleNode = null; vm.isEditingRuleNode = false; @@ -57,6 +59,7 @@ export function RuleChainController($stateParams, $scope, $compile, $q, $mdUtil, }; vm.ruleNodeTypesModel = {}; + vm.ruleNodeTypesCanvasControl = {}; vm.ruleChainLibraryLoaded = false; for (var type in types.ruleNodeType) { if (!types.ruleNodeType[type].special) { @@ -67,9 +70,12 @@ export function RuleChainController($stateParams, $scope, $compile, $q, $mdUtil, }, selectedObjects: [] }; + vm.ruleNodeTypesCanvasControl[type] = {}; } } + + vm.selectedObjects = []; vm.modelservice = Modelfactory(vm.ruleChainModel, vm.selectedObjects); @@ -147,6 +153,7 @@ export function RuleChainController($stateParams, $scope, $compile, $q, $mdUtil, theForm.$setPristine(); vm.ruleChainModel.nodes[vm.editingRuleNodeIndex] = vm.editingRuleNode; vm.editingRuleNode = angular.copy(vm.editingRuleNode); + updateRuleNodesHighlight(); } }; @@ -313,12 +320,28 @@ export function RuleChainController($stateParams, $scope, $compile, $q, $mdUtil, } }; - loadRuleChainLibrary(); + loadRuleChainLibrary(ruleNodeComponents, true); - function loadRuleChainLibrary() { + $scope.$watch('vm.ruleNodeSearch', + function (newVal, oldVal) { + if (!angular.equals(newVal, oldVal)) { + var res = $filter('filter')(ruleNodeComponents, {name: vm.ruleNodeSearch}); + loadRuleChainLibrary(res); + } + } + ); + + $scope.$on('searchTextUpdated', function () { + updateRuleNodesHighlight(); + }); + + function loadRuleChainLibrary(ruleNodeComponents, loadRuleChain) { + for (var componentType in vm.ruleNodeTypesModel) { + vm.ruleNodeTypesModel[componentType].model.nodes.length = 0; + } for (var i=0;i { + for (componentType in vm.ruleNodeTypesCanvasControl) { + if (vm.ruleNodeTypesCanvasControl[componentType].adjustCanvasSize) { + vm.ruleNodeTypesCanvasControl[componentType].adjustCanvasSize(true); + } + } + }); } function prepareRuleChain() { @@ -519,6 +551,8 @@ export function RuleChainController($stateParams, $scope, $compile, $q, $mdUtil, vm.isDirty = false; + updateRuleNodesHighlight(); + $mdUtil.nextTick(() => { vm.ruleChainWatch = $scope.$watch('vm.ruleChainModel', function (newVal, oldVal) { @@ -530,6 +564,20 @@ export function RuleChainController($stateParams, $scope, $compile, $q, $mdUtil, }); } + function updateRuleNodesHighlight() { + for (var i=0;i + ng-keyup="vm.keyUp($event)" on-fullscreen-changed="vm.isFullscreen = expanded">
- - {{ 'action.apply-changes' | translate }} + + {{ 'rulenode.open-node-library' | translate }} @@ -43,7 +43,7 @@
search - + {{'rulenode.search' | translate}} @@ -53,15 +53,17 @@
- + close - - {{ 'action.close' | translate }} + + {{ 'action.clear-search' | translate }} chevron_left - + {{ 'action.close' | translate }} @@ -90,6 +92,7 @@ callbacks="vm.nodeLibCallbacks" node-width="170" node-height="50" + control="vm.ruleNodeTypesCanvasControl[typeId]" drop-target-id="'tb-rulchain-canvas'"> diff --git a/ui/src/app/rulechain/rulenode.tpl.html b/ui/src/app/rulechain/rulenode.tpl.html index 55ee3d3c2b..83ce988684 100644 --- a/ui/src/app/rulechain/rulenode.tpl.html +++ b/ui/src/app/rulechain/rulenode.tpl.html @@ -22,8 +22,8 @@ ng-mousedown="callbacks.mouseDown($event, node)" ng-mouseenter="callbacks.mouseEnter($event, node)" ng-mouseleave="callbacks.mouseLeave($event, node)"> -
-
+
+
{{node.icon}}