Commit a1db669a9de207fc5358944170fef78ec7531fe3
Committed by
GitHub
Merge pull request #46 from deaflynx/feature/edge
CE refactored & reviewed
Showing
17 changed files
with
149 additions
and
159 deletions
@@ -28,31 +28,31 @@ function ComponentDescriptorService($http, $q) { | @@ -28,31 +28,31 @@ function ComponentDescriptorService($http, $q) { | ||
28 | 28 | ||
29 | return service; | 29 | return service; |
30 | 30 | ||
31 | - function getComponentDescriptorsByTypes(componentTypes, ruleChainType) { | 31 | + function getComponentDescriptorsByTypes(componentTypes, type) { |
32 | var deferred = $q.defer(); | 32 | var deferred = $q.defer(); |
33 | var result = []; | 33 | var result = []; |
34 | - if (!componentsByType[ruleChainType]) { | ||
35 | - componentsByType[ruleChainType] = {}; | 34 | + if (!componentsByType[type]) { |
35 | + componentsByType[type] = {}; | ||
36 | } | 36 | } |
37 | for (var i=componentTypes.length-1;i>=0;i--) { | 37 | for (var i=componentTypes.length-1;i>=0;i--) { |
38 | var componentType = componentTypes[i]; | 38 | var componentType = componentTypes[i]; |
39 | - if (componentsByType[ruleChainType][componentType]) { | ||
40 | - result = result.concat(componentsByType[ruleChainType][componentType]); | 39 | + if (componentsByType[type][componentType]) { |
40 | + result = result.concat(componentsByType[type][componentType]); | ||
41 | componentTypes.splice(i, 1); | 41 | componentTypes.splice(i, 1); |
42 | } | 42 | } |
43 | } | 43 | } |
44 | if (!componentTypes.length) { | 44 | if (!componentTypes.length) { |
45 | deferred.resolve(result); | 45 | deferred.resolve(result); |
46 | } else { | 46 | } else { |
47 | - var url = '/api/components?componentTypes=' + componentTypes.join(',') + '&ruleChainType=' + ruleChainType; | 47 | + var url = '/api/components?componentTypes=' + componentTypes.join(',') + '&ruleChainType=' + type; |
48 | $http.get(url, null).then(function success(response) { | 48 | $http.get(url, null).then(function success(response) { |
49 | var components = response.data; | 49 | var components = response.data; |
50 | for (var i = 0; i < components.length; i++) { | 50 | for (var i = 0; i < components.length; i++) { |
51 | var component = components[i]; | 51 | var component = components[i]; |
52 | - var componentsList = componentsByType[ruleChainType][component.type]; | 52 | + var componentsList = componentsByType[type][component.type]; |
53 | if (!componentsList) { | 53 | if (!componentsList) { |
54 | componentsList = []; | 54 | componentsList = []; |
55 | - componentsByType[ruleChainType][component.type] = componentsList; | 55 | + componentsByType[type][component.type] = componentsList; |
56 | } | 56 | } |
57 | componentsList.push(component); | 57 | componentsList.push(component); |
58 | componentsByClazz[component.clazz] = component; | 58 | componentsByClazz[component.clazz] = component; |
@@ -311,7 +311,7 @@ function RuleChainService($http, $q, $filter, $ocLazyLoad, $translate, types, co | @@ -311,7 +311,7 @@ function RuleChainService($http, $q, $filter, $ocLazyLoad, $translate, types, co | ||
311 | } | 311 | } |
312 | 312 | ||
313 | function getEdgesRuleChains(pageLink, config) { | 313 | function getEdgesRuleChains(pageLink, config) { |
314 | - return getRuleChains(pageLink, config, types.edgeRuleChainType); | 314 | + return getRuleChains(pageLink, config, types.ruleChainType.edge); |
315 | } | 315 | } |
316 | 316 | ||
317 | function getEdgeRuleChains(edgeId, pageLink, config) { | 317 | function getEdgeRuleChains(edgeId, pageLink, config) { |
@@ -393,7 +393,15 @@ export default angular.module('thingsboard.types', []) | @@ -393,7 +393,15 @@ export default angular.module('thingsboard.types', []) | ||
393 | edge: "EDGE", | 393 | edge: "EDGE", |
394 | user: "USER", | 394 | user: "USER", |
395 | customer: "CUSTOMER", | 395 | customer: "CUSTOMER", |
396 | - relation: "RELATION" | 396 | + relation: "RELATION", |
397 | + entityGroup: "ENTITY_GROUP", | ||
398 | + schedulerEvent: "SCHEDULER_EVENT", | ||
399 | + whiteLabeling: "WHITE_LABELING", | ||
400 | + loginWhiteLabeling: "LOGIN_WHITE_LABELING", | ||
401 | + customTranslation: "CUSTOM_TRANSLATION", | ||
402 | + widgetsBundle: "WIDGETS_BUNDLE", | ||
403 | + widgetType: "WIDGET_TYPE", | ||
404 | + adminSettings: "ADMIN_SETTINGS" | ||
397 | }, | 405 | }, |
398 | edgeEventAction: { | 406 | edgeEventAction: { |
399 | updated: "UPDATED", | 407 | updated: "UPDATED", |
@@ -786,8 +794,10 @@ export default angular.module('thingsboard.types', []) | @@ -786,8 +794,10 @@ export default angular.module('thingsboard.types', []) | ||
786 | clientSide: false | 794 | clientSide: false |
787 | } | 795 | } |
788 | }, | 796 | }, |
789 | - coreRuleChainType: "CORE", | ||
790 | - edgeRuleChainType: "EDGE", | 797 | + ruleChainType: { |
798 | + core: "CORE", | ||
799 | + edge: "EDGE" | ||
800 | + }, | ||
791 | ruleNodeTypeComponentTypes: ["FILTER", "ENRICHMENT", "TRANSFORMATION", "ACTION", "EXTERNAL"], | 801 | ruleNodeTypeComponentTypes: ["FILTER", "ENRICHMENT", "TRANSFORMATION", "ACTION", "EXTERNAL"], |
792 | ruleChainNodeComponent: { | 802 | ruleChainNodeComponent: { |
793 | type: 'RULE_CHAIN', | 803 | type: 'RULE_CHAIN', |
@@ -53,13 +53,7 @@ export default function AddDashboardsToEdgeController(dashboardService, types, $ | @@ -53,13 +53,7 @@ export default function AddDashboardsToEdgeController(dashboardService, types, $ | ||
53 | fetchMoreItems_: function () { | 53 | fetchMoreItems_: function () { |
54 | if (vm.dashboards.hasNext && !vm.dashboards.pending) { | 54 | if (vm.dashboards.hasNext && !vm.dashboards.pending) { |
55 | vm.dashboards.pending = true; | 55 | vm.dashboards.pending = true; |
56 | - var fetchDashboardsPromise; | ||
57 | - if (edgeCustomerId === vm.types.id.nullUid) { | ||
58 | - fetchDashboardsPromise = dashboardService.getTenantDashboards(vm.dashboards.nextPageLink); | ||
59 | - } else { | ||
60 | - fetchDashboardsPromise = dashboardService.getCustomerDashboards(edgeCustomerId, vm.dashboards.nextPageLink); | ||
61 | - } | ||
62 | - fetchDashboardsPromise.then( | 56 | + dashboardService.getTenantDashboards(vm.dashboards.nextPageLink).then( |
63 | function success(dashboards) { | 57 | function success(dashboards) { |
64 | vm.dashboards.data = vm.dashboards.data.concat(dashboards.data); | 58 | vm.dashboards.data = vm.dashboards.data.concat(dashboards.data); |
65 | vm.dashboards.nextPageLink = dashboards.nextPageLink; | 59 | vm.dashboards.nextPageLink = dashboards.nextPageLink; |
@@ -708,14 +708,7 @@ export function DashboardsController(userService, dashboardService, customerServ | @@ -708,14 +708,7 @@ export function DashboardsController(userService, dashboardService, customerServ | ||
708 | $event.stopPropagation(); | 708 | $event.stopPropagation(); |
709 | } | 709 | } |
710 | var pageSize = 10; | 710 | var pageSize = 10; |
711 | - var fetchDashboardsPromise; | ||
712 | - if (vm.edgeCustomerId.id === vm.types.id.nullUid) { | ||
713 | - fetchDashboardsPromise = dashboardService.getTenantDashboards({limit: pageSize, textSearch: ''}); | ||
714 | - } else { | ||
715 | - fetchDashboardsPromise = dashboardService.getCustomerDashboards(vm.edgeCustomerId.id, {limit: pageSize, textSearch: ''}); | ||
716 | - } | ||
717 | - | ||
718 | - fetchDashboardsPromise.then( | 711 | + dashboardService.getTenantDashboards({limit: pageSize, textSearch: ''}).then( |
719 | function success(_dashboards) { | 712 | function success(_dashboards) { |
720 | var dashboards = { | 713 | var dashboards = { |
721 | pageSize: pageSize, | 714 | pageSize: pageSize, |
@@ -21,6 +21,8 @@ import devicesTemplate from "../device/devices.tpl.html"; | @@ -21,6 +21,8 @@ import devicesTemplate from "../device/devices.tpl.html"; | ||
21 | import assetsTemplate from "../asset/assets.tpl.html"; | 21 | import assetsTemplate from "../asset/assets.tpl.html"; |
22 | import dashboardsTemplate from "../dashboard/dashboards.tpl.html"; | 22 | import dashboardsTemplate from "../dashboard/dashboards.tpl.html"; |
23 | import dashboardTemplate from "../dashboard/dashboard.tpl.html"; | 23 | import dashboardTemplate from "../dashboard/dashboard.tpl.html"; |
24 | +import ruleChainsTemplate from "../rulechain/rulechains.tpl.html"; | ||
25 | +import ruleChainTemplate from "../rulechain/rulechain.tpl.html"; | ||
24 | 26 | ||
25 | /* eslint-enable import/no-unresolved, import/default */ | 27 | /* eslint-enable import/no-unresolved, import/default */ |
26 | 28 | ||
@@ -49,8 +51,7 @@ export default function EdgeRoutes($stateProvider, types) { | @@ -49,8 +51,7 @@ export default function EdgeRoutes($stateProvider, types) { | ||
49 | ncyBreadcrumb: { | 51 | ncyBreadcrumb: { |
50 | label: '{"icon": "transform", "label": "edge.edges"}' | 52 | label: '{"icon": "transform", "label": "edge.edges"}' |
51 | } | 53 | } |
52 | - }) | ||
53 | - .state('home.edges.entityViews', { | 54 | + }).state('home.edges.entityViews', { |
54 | url: '/:edgeId/entityViews', | 55 | url: '/:edgeId/entityViews', |
55 | params: {'topIndex': 0}, | 56 | params: {'topIndex': 0}, |
56 | module: 'private', | 57 | module: 'private', |
@@ -72,8 +73,7 @@ export default function EdgeRoutes($stateProvider, types) { | @@ -72,8 +73,7 @@ export default function EdgeRoutes($stateProvider, types) { | ||
72 | ncyBreadcrumb: { | 73 | ncyBreadcrumb: { |
73 | label: '{"icon": "view_quilt", "label": "edge.entity-views"}' | 74 | label: '{"icon": "view_quilt", "label": "edge.entity-views"}' |
74 | } | 75 | } |
75 | - }) | ||
76 | - .state('home.edges.devices', { | 76 | + }).state('home.edges.devices', { |
77 | url: '/:edgeId/devices', | 77 | url: '/:edgeId/devices', |
78 | params: {'topIndex': 0}, | 78 | params: {'topIndex': 0}, |
79 | module: 'private', | 79 | module: 'private', |
@@ -95,8 +95,7 @@ export default function EdgeRoutes($stateProvider, types) { | @@ -95,8 +95,7 @@ export default function EdgeRoutes($stateProvider, types) { | ||
95 | ncyBreadcrumb: { | 95 | ncyBreadcrumb: { |
96 | label: '{"icon": "devices_other", "label": "edge.devices"}' | 96 | label: '{"icon": "devices_other", "label": "edge.devices"}' |
97 | } | 97 | } |
98 | - }) | ||
99 | - .state('home.edges.assets', { | 98 | + }).state('home.edges.assets', { |
100 | url: '/:edgeId/assets', | 99 | url: '/:edgeId/assets', |
101 | params: {'topIndex': 0}, | 100 | params: {'topIndex': 0}, |
102 | module: 'private', | 101 | module: 'private', |
@@ -118,29 +117,27 @@ export default function EdgeRoutes($stateProvider, types) { | @@ -118,29 +117,27 @@ export default function EdgeRoutes($stateProvider, types) { | ||
118 | ncyBreadcrumb: { | 117 | ncyBreadcrumb: { |
119 | label: '{"icon": "domain", "label": "edge.assets"}' | 118 | label: '{"icon": "domain", "label": "edge.assets"}' |
120 | } | 119 | } |
121 | - }) | ||
122 | - .state('home.edges.dashboards', { | ||
123 | - url: '/:edgeId/dashboards', | ||
124 | - params: {'topIndex': 0}, | ||
125 | - module: 'private', | ||
126 | - auth: ['TENANT_ADMIN'], | ||
127 | - views: { | ||
128 | - "content@home": { | ||
129 | - templateUrl: dashboardsTemplate, | ||
130 | - controllerAs: 'vm', | ||
131 | - controller: 'DashboardsController' | 120 | + }).state('home.edges.dashboards', { |
121 | + url: '/:edgeId/dashboards', | ||
122 | + params: {'topIndex': 0}, | ||
123 | + module: 'private', | ||
124 | + auth: ['TENANT_ADMIN'], | ||
125 | + views: { | ||
126 | + "content@home": { | ||
127 | + templateUrl: dashboardsTemplate, | ||
128 | + controllerAs: 'vm', | ||
129 | + controller: 'DashboardsController' | ||
130 | + } | ||
131 | + }, | ||
132 | + data: { | ||
133 | + dashboardsType: 'edge', | ||
134 | + searchEnabled: true, | ||
135 | + pageTitle: 'edge.dashboards' | ||
136 | + }, | ||
137 | + ncyBreadcrumb: { | ||
138 | + label: '{"icon": "dashboard", "label": "edge.dashboards"}' | ||
132 | } | 139 | } |
133 | - }, | ||
134 | - data: { | ||
135 | - dashboardsType: 'edge', | ||
136 | - searchEnabled: true, | ||
137 | - pageTitle: 'edge.dashboards' | ||
138 | - }, | ||
139 | - ncyBreadcrumb: { | ||
140 | - label: '{"icon": "dashboard", "label": "edge.dashboards"}' | ||
141 | - } | ||
142 | - }) | ||
143 | - .state('home.edges.dashboards.dashboard', { | 140 | + }).state('home.edges.dashboards.dashboard', { |
144 | url: '/:dashboardId?state', | 141 | url: '/:dashboardId?state', |
145 | reloadOnSearch: false, | 142 | reloadOnSearch: false, |
146 | module: 'private', | 143 | module: 'private', |
@@ -161,8 +158,7 @@ export default function EdgeRoutes($stateProvider, types) { | @@ -161,8 +158,7 @@ export default function EdgeRoutes($stateProvider, types) { | ||
161 | ncyBreadcrumb: { | 158 | ncyBreadcrumb: { |
162 | label: '{"icon": "dashboard", "label": "{{ vm.dashboard.title }}", "translate": "false"}' | 159 | label: '{"icon": "dashboard", "label": "{{ vm.dashboard.title }}", "translate": "false"}' |
163 | } | 160 | } |
164 | - }) | ||
165 | - .state('home.customers.edges', { | 161 | + }).state('home.customers.edges', { |
166 | url: '/:customerId/edges', | 162 | url: '/:customerId/edges', |
167 | params: {'topIndex': 0}, | 163 | params: {'topIndex': 0}, |
168 | module: 'private', | 164 | module: 'private', |
@@ -184,5 +180,62 @@ export default function EdgeRoutes($stateProvider, types) { | @@ -184,5 +180,62 @@ export default function EdgeRoutes($stateProvider, types) { | ||
184 | ncyBreadcrumb: { | 180 | ncyBreadcrumb: { |
185 | label: '{"icon": "router", "label": "{{ vm.customerEdgesTitle }}", "translate": "false"}' | 181 | label: '{"icon": "router", "label": "{{ vm.customerEdgesTitle }}", "translate": "false"}' |
186 | } | 182 | } |
183 | + }).state('home.edges.ruleChains', { | ||
184 | + url: '/:edgeId/ruleChains', | ||
185 | + params: {'topIndex': 0}, | ||
186 | + module: 'private', | ||
187 | + auth: ['TENANT_ADMIN'], | ||
188 | + views: { | ||
189 | + "content@home": { | ||
190 | + templateUrl: ruleChainsTemplate, | ||
191 | + controllerAs: 'vm', | ||
192 | + controller: 'RuleChainsController' | ||
193 | + } | ||
194 | + }, | ||
195 | + data: { | ||
196 | + searchEnabled: true, | ||
197 | + pageTitle: 'edge.rulechains', | ||
198 | + ruleChainsType: 'edge' | ||
199 | + }, | ||
200 | + ncyBreadcrumb: { | ||
201 | + label: '{"icon": "settings_ethernet", "label": "rulechain.edge-rulechains"}' | ||
202 | + } | ||
203 | + }).state('home.edges.ruleChains.ruleChain', { | ||
204 | + url: '/:ruleChainId', | ||
205 | + reloadOnSearch: false, | ||
206 | + module: 'private', | ||
207 | + auth: ['SYS_ADMIN', 'TENANT_ADMIN'], | ||
208 | + views: { | ||
209 | + "content@home": { | ||
210 | + templateUrl: ruleChainTemplate, | ||
211 | + controller: 'RuleChainController', | ||
212 | + controllerAs: 'vm' | ||
213 | + } | ||
214 | + }, | ||
215 | + resolve: { | ||
216 | + ruleChain: | ||
217 | + /*@ngInject*/ | ||
218 | + function($stateParams, ruleChainService) { | ||
219 | + return ruleChainService.getRuleChain($stateParams.ruleChainId); | ||
220 | + }, | ||
221 | + ruleChainMetaData: | ||
222 | + /*@ngInject*/ | ||
223 | + function($stateParams, ruleChainService) { | ||
224 | + return ruleChainService.getRuleChainMetaData($stateParams.ruleChainId); | ||
225 | + }, | ||
226 | + ruleNodeComponents: | ||
227 | + /*@ngInject*/ | ||
228 | + function($stateParams, ruleChainService) { | ||
229 | + return ruleChainService.getRuleNodeComponents(types.ruleChainType.edge); | ||
230 | + } | ||
231 | + }, | ||
232 | + data: { | ||
233 | + import: false, | ||
234 | + searchEnabled: false, | ||
235 | + pageTitle: 'edge.rulechain' | ||
236 | + }, | ||
237 | + ncyBreadcrumb: { | ||
238 | + label: '{"icon": "settings_ethernet", "label": "{{ vm.ruleChain.name }}", "translate": "false"}' | ||
239 | + } | ||
187 | }); | 240 | }); |
188 | } | 241 | } |
@@ -16,12 +16,12 @@ | @@ -16,12 +16,12 @@ | ||
16 | 16 | ||
17 | --> | 17 | --> |
18 | <div class="tb-cell" flex="20">{{ event.createdTime | date : 'yyyy-MM-dd HH:mm:ss' }}</div> | 18 | <div class="tb-cell" flex="20">{{ event.createdTime | date : 'yyyy-MM-dd HH:mm:ss' }}</div> |
19 | -<div class="tb-cell" flex="20">{{ event.edgeEventType }}</div> | ||
20 | -<div class="tb-cell" flex="40">{{ event.edgeEventAction }}</div> | 19 | +<div class="tb-cell" flex="20">{{ event.type }}</div> |
20 | +<div class="tb-cell" flex="40">{{ event.action }}</div> | ||
21 | <div class="tb-cell" flex="20">{{ event.entityId }}</div> | 21 | <div class="tb-cell" flex="20">{{ event.entityId }}</div> |
22 | <div class="tb-cell" flex="15" ng-style="isPending ? {'color': 'rgba(0, 0, 0, .38)'} : {'color': '#000'}">{{ updateStatus(event.createdTime) | translate }}</div> | 22 | <div class="tb-cell" flex="15" ng-style="isPending ? {'color': 'rgba(0, 0, 0, .38)'} : {'color': '#000'}">{{ updateStatus(event.createdTime) | translate }}</div> |
23 | <div class="tb-cell" flex="10"> | 23 | <div class="tb-cell" flex="10"> |
24 | - <md-button class="md-icon-button md-primary" | 24 | + <md-button ng-if="checkEdgeEventType(event.type)" class="md-icon-button md-primary" |
25 | ng-click="showEdgeEntityContent($event, 'edge.entity-info', 'JSON')" | 25 | ng-click="showEdgeEntityContent($event, 'edge.entity-info', 'JSON')" |
26 | aria-label="{{ 'action.view' | translate }}"> | 26 | aria-label="{{ 'action.view' | translate }}"> |
27 | <md-tooltip md-direction="top"> | 27 | <md-tooltip md-direction="top"> |
@@ -106,9 +106,9 @@ export default function EventRowDirective($compile, $templateCache, $mdDialog, $ | @@ -106,9 +106,9 @@ export default function EventRowDirective($compile, $templateCache, $mdDialog, $ | ||
106 | contentType = null; | 106 | contentType = null; |
107 | } | 107 | } |
108 | var content = ''; | 108 | var content = ''; |
109 | - switch(scope.event.edgeEventType) { | 109 | + switch(scope.event.type) { |
110 | case types.edgeEventType.relation: | 110 | case types.edgeEventType.relation: |
111 | - content = angular.toJson(scope.event.entityBody); | 111 | + content = angular.toJson(scope.event.body); |
112 | showDialog(); | 112 | showDialog(); |
113 | break; | 113 | break; |
114 | case types.edgeEventType.ruleChainMetaData: | 114 | case types.edgeEventType.ruleChainMetaData: |
@@ -121,7 +121,7 @@ export default function EventRowDirective($compile, $templateCache, $mdDialog, $ | @@ -121,7 +121,7 @@ export default function EventRowDirective($compile, $templateCache, $mdDialog, $ | ||
121 | }); | 121 | }); |
122 | break; | 122 | break; |
123 | default: | 123 | default: |
124 | - content = entityService.getEntity(scope.event.edgeEventType, scope.event.entityId, {ignoreErrors: true}).then( | 124 | + content = entityService.getEntity(scope.event.type, scope.event.entityId, {ignoreErrors: true}).then( |
125 | function success(info) { | 125 | function success(info) { |
126 | showDialog(); | 126 | showDialog(); |
127 | return angular.toJson(info); | 127 | return angular.toJson(info); |
@@ -150,6 +150,12 @@ export default function EventRowDirective($compile, $templateCache, $mdDialog, $ | @@ -150,6 +150,12 @@ export default function EventRowDirective($compile, $templateCache, $mdDialog, $ | ||
150 | } | 150 | } |
151 | } | 151 | } |
152 | 152 | ||
153 | + scope.checkEdgeEventType = function (type) { | ||
154 | + return !(type === types.edgeEventType.widgetType || | ||
155 | + type === types.edgeEventType.adminSettings || | ||
156 | + type === types.edgeEventType.widgetsBundle ); | ||
157 | + } | ||
158 | + | ||
153 | scope.checkTooltip = function($event) { | 159 | scope.checkTooltip = function($event) { |
154 | var el = $event.target; | 160 | var el = $event.target; |
155 | var $el = angular.element(el); | 161 | var $el = angular.element(el); |
@@ -257,9 +257,6 @@ export default function ImportExport($log, $translate, $q, $mdDialog, $document, | @@ -257,9 +257,6 @@ export default function ImportExport($log, $translate, $q, $mdDialog, $document, | ||
257 | ruleChain.firstRuleNodeId = null; | 257 | ruleChain.firstRuleNodeId = null; |
258 | } | 258 | } |
259 | ruleChain.root = false; | 259 | ruleChain.root = false; |
260 | - delete ruleChain.assignedEdgesText; | ||
261 | - delete ruleChain.assignedEdges; | ||
262 | - delete ruleChain.assignedEdgesIds; | ||
263 | return ruleChain; | 260 | return ruleChain; |
264 | } | 261 | } |
265 | 262 |
@@ -67,7 +67,7 @@ | @@ -67,7 +67,7 @@ | ||
67 | "general-settings": "Allgemeine Einstellungen", | 67 | "general-settings": "Allgemeine Einstellungen", |
68 | "outgoing-mail": "E-Mail Versand", | 68 | "outgoing-mail": "E-Mail Versand", |
69 | "outgoing-mail-settings": "Konfiguration des Postausgangsservers", | 69 | "outgoing-mail-settings": "Konfiguration des Postausgangsservers", |
70 | - "system-settings": "Systeminstellungen", | 70 | + "system-settings": "Systemeinstellungen", |
71 | "test-mail-sent": "Test E-Mail wurde erfolgreich versendet!", | 71 | "test-mail-sent": "Test E-Mail wurde erfolgreich versendet!", |
72 | "base-url": "Basis-URL", | 72 | "base-url": "Basis-URL", |
73 | "base-url-required": "Basis-URL ist erforderlich.", | 73 | "base-url-required": "Basis-URL ist erforderlich.", |
@@ -54,7 +54,7 @@ export default function AddRuleChainsToEdgeController(ruleChainService, $mdDialo | @@ -54,7 +54,7 @@ export default function AddRuleChainsToEdgeController(ruleChainService, $mdDialo | ||
54 | vm.ruleChains.pending = true; | 54 | vm.ruleChains.pending = true; |
55 | ruleChainService.getEdgesRuleChains(vm.ruleChains.nextPageLink).then( | 55 | ruleChainService.getEdgesRuleChains(vm.ruleChains.nextPageLink).then( |
56 | function success(ruleChains) { | 56 | function success(ruleChains) { |
57 | - vm.ruleChains.data = ruleChains.data; | 57 | + vm.ruleChains.data = vm.ruleChains.data.concat(ruleChains.data); |
58 | vm.ruleChains.nextPageLink = ruleChains.nextPageLink; | 58 | vm.ruleChains.nextPageLink = ruleChains.nextPageLink; |
59 | vm.ruleChains.hasNext = ruleChains.hasNext; | 59 | vm.ruleChains.hasNext = ruleChains.hasNext; |
60 | if (vm.ruleChains.hasNext) { | 60 | if (vm.ruleChains.hasNext) { |
@@ -36,11 +36,6 @@ | @@ -36,11 +36,6 @@ | ||
36 | </div> | 36 | </div> |
37 | 37 | ||
38 | <md-content class="md-padding tb-rulechain-fieldset" layout="column"> | 38 | <md-content class="md-padding tb-rulechain-fieldset" layout="column"> |
39 | - <md-input-container class="md-block" | ||
40 | - ng-show="!isEdit && ruleChain.assignedEdgesText && ruleChainScope === 'tenant'"> | ||
41 | - <label translate>rulechain.assigned-to-edges</label> | ||
42 | - <input ng-model="ruleChain.assignedEdgesText" disabled> | ||
43 | - </md-input-container> | ||
44 | <fieldset ng-disabled="$root.loading || !isEdit || isReadOnly"> | 39 | <fieldset ng-disabled="$root.loading || !isEdit || isReadOnly"> |
45 | <md-input-container class="md-block"> | 40 | <md-input-container class="md-block"> |
46 | <label translate>rulechain.name</label> | 41 | <label translate>rulechain.name</label> |
@@ -1180,7 +1180,7 @@ export function RuleChainController($state, $scope, $compile, $q, $mdUtil, $time | @@ -1180,7 +1180,7 @@ export function RuleChainController($state, $scope, $compile, $q, $mdUtil, $time | ||
1180 | var saveRuleChainPromise; | 1180 | var saveRuleChainPromise; |
1181 | if (vm.isImport) { | 1181 | if (vm.isImport) { |
1182 | if (angular.isUndefined(vm.ruleChain.type)) { | 1182 | if (angular.isUndefined(vm.ruleChain.type)) { |
1183 | - vm.ruleChain.type = types.coreRuleChainType; | 1183 | + vm.ruleChain.type = types.ruleChainType.core; |
1184 | } | 1184 | } |
1185 | saveRuleChainPromise = ruleChainService.saveRuleChain(vm.ruleChain); | 1185 | saveRuleChainPromise = ruleChainService.saveRuleChain(vm.ruleChain); |
1186 | } else { | 1186 | } else { |
@@ -1269,7 +1269,7 @@ export function RuleChainController($state, $scope, $compile, $q, $mdUtil, $time | @@ -1269,7 +1269,7 @@ export function RuleChainController($state, $scope, $compile, $q, $mdUtil, $time | ||
1269 | vm.isDirty = false; | 1269 | vm.isDirty = false; |
1270 | vm.isImport = false; | 1270 | vm.isImport = false; |
1271 | $mdUtil.nextTick(() => { | 1271 | $mdUtil.nextTick(() => { |
1272 | - if (vm.ruleChain.type === vm.types.coreRuleChainType) { | 1272 | + if (vm.ruleChain.type === vm.types.ruleChainType.core) { |
1273 | $state.go('home.ruleChains.core.ruleChain', {ruleChainId: vm.ruleChain.id.id}); | 1273 | $state.go('home.ruleChains.core.ruleChain', {ruleChainId: vm.ruleChain.id.id}); |
1274 | } else { | 1274 | } else { |
1275 | $state.go('home.ruleChains.edge.ruleChain', {ruleChainId: vm.ruleChain.id.id}); | 1275 | $state.go('home.ruleChains.edge.ruleChain', {ruleChainId: vm.ruleChain.id.id}); |
@@ -1293,7 +1293,7 @@ export function RuleChainController($state, $scope, $compile, $q, $mdUtil, $time | @@ -1293,7 +1293,7 @@ export function RuleChainController($state, $scope, $compile, $q, $mdUtil, $time | ||
1293 | ruleNode.configuration = angular.copy(ruleNode.component.configurationDescriptor.nodeDefinition.defaultConfiguration); | 1293 | ruleNode.configuration = angular.copy(ruleNode.component.configurationDescriptor.nodeDefinition.defaultConfiguration); |
1294 | 1294 | ||
1295 | var ruleChainId = vm.ruleChain.id ? vm.ruleChain.id.id : null; | 1295 | var ruleChainId = vm.ruleChain.id ? vm.ruleChain.id.id : null; |
1296 | - var ruleChainType = vm.ruleChain.type ? vm.ruleChain.type : types.coreRuleChainType; | 1296 | + var ruleChainType = vm.ruleChain.type ? vm.ruleChain.type : types.ruleChainType.core; |
1297 | 1297 | ||
1298 | vm.enableHotKeys = false; | 1298 | vm.enableHotKeys = false; |
1299 | 1299 |
@@ -22,8 +22,8 @@ import ruleChainFieldsetTemplate from './rulechain-fieldset.tpl.html'; | @@ -22,8 +22,8 @@ import ruleChainFieldsetTemplate from './rulechain-fieldset.tpl.html'; | ||
22 | /*@ngInject*/ | 22 | /*@ngInject*/ |
23 | export default function RuleChainDirective($compile, $templateCache, $mdDialog, $document, $q, $translate, types, toast) { | 23 | export default function RuleChainDirective($compile, $templateCache, $mdDialog, $document, $q, $translate, types, toast) { |
24 | var linker = function (scope, element) { | 24 | var linker = function (scope, element) { |
25 | - | ||
26 | var template = $templateCache.get(ruleChainFieldsetTemplate); | 25 | var template = $templateCache.get(ruleChainFieldsetTemplate); |
26 | + | ||
27 | element.html(template); | 27 | element.html(template); |
28 | 28 | ||
29 | scope.onRuleChainIdCopied = function() { | 29 | scope.onRuleChainIdCopied = function() { |
@@ -82,7 +82,7 @@ export default function RuleChainRoutes($stateProvider, NodeTemplatePathProvider | @@ -82,7 +82,7 @@ export default function RuleChainRoutes($stateProvider, NodeTemplatePathProvider | ||
82 | ruleNodeComponents: | 82 | ruleNodeComponents: |
83 | /*@ngInject*/ | 83 | /*@ngInject*/ |
84 | function($stateParams, ruleChainService) { | 84 | function($stateParams, ruleChainService) { |
85 | - return ruleChainService.getRuleNodeComponents(types.coreRuleChainType); | 85 | + return ruleChainService.getRuleNodeComponents(types.ruleChainType.core); |
86 | } | 86 | } |
87 | }, | 87 | }, |
88 | data: { | 88 | data: { |
@@ -180,64 +180,7 @@ export default function RuleChainRoutes($stateProvider, NodeTemplatePathProvider | @@ -180,64 +180,7 @@ export default function RuleChainRoutes($stateProvider, NodeTemplatePathProvider | ||
180 | ruleNodeComponents: | 180 | ruleNodeComponents: |
181 | /*@ngInject*/ | 181 | /*@ngInject*/ |
182 | function($stateParams, ruleChainService) { | 182 | function($stateParams, ruleChainService) { |
183 | - return ruleChainService.getRuleNodeComponents(types.edgeRuleChainType); | ||
184 | - } | ||
185 | - }, | ||
186 | - data: { | ||
187 | - import: false, | ||
188 | - searchEnabled: false, | ||
189 | - pageTitle: 'edge.rulechain' | ||
190 | - }, | ||
191 | - ncyBreadcrumb: { | ||
192 | - label: '{"icon": "settings_ethernet", "label": "{{ vm.ruleChain.name }}", "translate": "false"}' | ||
193 | - } | ||
194 | - }).state('home.edges.ruleChains', { | ||
195 | - url: '/:edgeId/ruleChains', | ||
196 | - params: {'topIndex': 0}, | ||
197 | - module: 'private', | ||
198 | - auth: ['TENANT_ADMIN'], | ||
199 | - views: { | ||
200 | - "content@home": { | ||
201 | - templateUrl: ruleChainsTemplate, | ||
202 | - controllerAs: 'vm', | ||
203 | - controller: 'RuleChainsController' | ||
204 | - } | ||
205 | - }, | ||
206 | - data: { | ||
207 | - searchEnabled: true, | ||
208 | - pageTitle: 'edge.rulechains', | ||
209 | - ruleChainsType: 'edge' | ||
210 | - }, | ||
211 | - ncyBreadcrumb: { | ||
212 | - label: '{"icon": "settings_ethernet", "label": "rulechain.edge-rulechains"}' | ||
213 | - } | ||
214 | - }).state('home.edges.ruleChains.ruleChain', { | ||
215 | - url: '/:ruleChainId', | ||
216 | - reloadOnSearch: false, | ||
217 | - module: 'private', | ||
218 | - auth: ['SYS_ADMIN', 'TENANT_ADMIN'], | ||
219 | - views: { | ||
220 | - "content@home": { | ||
221 | - templateUrl: ruleChainTemplate, | ||
222 | - controller: 'RuleChainController', | ||
223 | - controllerAs: 'vm' | ||
224 | - } | ||
225 | - }, | ||
226 | - resolve: { | ||
227 | - ruleChain: | ||
228 | - /*@ngInject*/ | ||
229 | - function($stateParams, ruleChainService) { | ||
230 | - return ruleChainService.getRuleChain($stateParams.ruleChainId); | ||
231 | - }, | ||
232 | - ruleChainMetaData: | ||
233 | - /*@ngInject*/ | ||
234 | - function($stateParams, ruleChainService) { | ||
235 | - return ruleChainService.getRuleChainMetaData($stateParams.ruleChainId); | ||
236 | - }, | ||
237 | - ruleNodeComponents: | ||
238 | - /*@ngInject*/ | ||
239 | - function($stateParams, ruleChainService) { | ||
240 | - return ruleChainService.getRuleNodeComponents(types.edgeRuleChainType); | 183 | + return ruleChainService.getRuleNodeComponents(types.ruleChainType.edge); |
241 | } | 184 | } |
242 | }, | 185 | }, |
243 | data: { | 186 | data: { |
@@ -22,8 +22,8 @@ import addRuleChainsToEdgeTemplate from "./add-rulechains-to-edge.tpl.html"; | @@ -22,8 +22,8 @@ import addRuleChainsToEdgeTemplate from "./add-rulechains-to-edge.tpl.html"; | ||
22 | /* eslint-enable import/no-unresolved, import/default */ | 22 | /* eslint-enable import/no-unresolved, import/default */ |
23 | 23 | ||
24 | /*@ngInject*/ | 24 | /*@ngInject*/ |
25 | -export default function RuleChainsController(ruleChainService, userService, edgeService, importExport, $state, | ||
26 | - $stateParams, $filter, $translate, $mdDialog, $document, $q, types) { | 25 | +export default function RuleChainsController(ruleChainService, userService, importExport, $state, $stateParams, $filter, $translate, $mdDialog, types, |
26 | + $document, $q, edgeService) { | ||
27 | 27 | ||
28 | var vm = this; | 28 | var vm = this; |
29 | var edgeId = $stateParams.edgeId; | 29 | var edgeId = $stateParams.edgeId; |
@@ -114,7 +114,7 @@ export default function RuleChainsController(ruleChainService, userService, edge | @@ -114,7 +114,7 @@ export default function RuleChainsController(ruleChainService, userService, edge | ||
114 | 114 | ||
115 | if (vm.ruleChainsScope === 'tenant') { | 115 | if (vm.ruleChainsScope === 'tenant') { |
116 | fetchRuleChainsFunction = function (pageLink) { | 116 | fetchRuleChainsFunction = function (pageLink) { |
117 | - return fetchRuleChains(pageLink, types.coreRuleChainType); | 117 | + return fetchRuleChains(pageLink, types.ruleChainType.core); |
118 | }; | 118 | }; |
119 | deleteRuleChainFunction = function (ruleChainId) { | 119 | deleteRuleChainFunction = function (ruleChainId) { |
120 | return deleteRuleChain(ruleChainId); | 120 | return deleteRuleChain(ruleChainId); |
@@ -162,9 +162,9 @@ export default function RuleChainsController(ruleChainService, userService, edge | @@ -162,9 +162,9 @@ export default function RuleChainsController(ruleChainService, userService, edge | ||
162 | }); | 162 | }); |
163 | vm.ruleChainGridConfig.addItemActions.push({ | 163 | vm.ruleChainGridConfig.addItemActions.push({ |
164 | onAction: function ($event) { | 164 | onAction: function ($event) { |
165 | - importExport.importRuleChain($event, types.coreRuleChainType).then( | 165 | + importExport.importRuleChain($event, types.ruleChainType.core).then( |
166 | function(ruleChainImport) { | 166 | function(ruleChainImport) { |
167 | - $state.go('home.ruleChains.importRuleChain', {ruleChainImport:ruleChainImport, ruleChainType: types.coreRuleChainType}); | 167 | + $state.go('home.ruleChains.importRuleChain', {ruleChainImport:ruleChainImport, ruleChainType: types.ruleChainType.core}); |
168 | } | 168 | } |
169 | ); | 169 | ); |
170 | }, | 170 | }, |
@@ -175,7 +175,7 @@ export default function RuleChainsController(ruleChainService, userService, edge | @@ -175,7 +175,7 @@ export default function RuleChainsController(ruleChainService, userService, edge | ||
175 | 175 | ||
176 | } else if (vm.ruleChainsScope === 'edges') { | 176 | } else if (vm.ruleChainsScope === 'edges') { |
177 | fetchRuleChainsFunction = function (pageLink) { | 177 | fetchRuleChainsFunction = function (pageLink) { |
178 | - return fetchRuleChains(pageLink, types.edgeRuleChainType); | 178 | + return fetchRuleChains(pageLink, types.ruleChainType.edge); |
179 | }; | 179 | }; |
180 | deleteRuleChainFunction = function (ruleChainId) { | 180 | deleteRuleChainFunction = function (ruleChainId) { |
181 | return deleteRuleChain(ruleChainId); | 181 | return deleteRuleChain(ruleChainId); |
@@ -203,21 +203,21 @@ export default function RuleChainsController(ruleChainService, userService, edge | @@ -203,21 +203,21 @@ export default function RuleChainsController(ruleChainService, userService, edge | ||
203 | 203 | ||
204 | ruleChainActionsList.push({ | 204 | ruleChainActionsList.push({ |
205 | onAction: function ($event, item) { | 205 | onAction: function ($event, item) { |
206 | - vm.grid.deleteItem($event, item); | 206 | + setDefaultRootEdgeRuleChain($event, item); |
207 | }, | 207 | }, |
208 | - name: function() { return $translate.instant('action.delete') }, | ||
209 | - details: function() { return $translate.instant('rulechain.delete') }, | ||
210 | - icon: "delete", | 208 | + name: function() { return $translate.instant('rulechain.set-default-root-edge') }, |
209 | + details: function() { return $translate.instant('rulechain.set-default-root-edge') }, | ||
210 | + icon: "flag", | ||
211 | isEnabled: isNonRootRuleChain | 211 | isEnabled: isNonRootRuleChain |
212 | }); | 212 | }); |
213 | 213 | ||
214 | ruleChainActionsList.push({ | 214 | ruleChainActionsList.push({ |
215 | onAction: function ($event, item) { | 215 | onAction: function ($event, item) { |
216 | - setDefaultRootEdgeRuleChain($event, item); | 216 | + vm.grid.deleteItem($event, item); |
217 | }, | 217 | }, |
218 | - name: function() { return $translate.instant('rulechain.set-default-root-edge') }, | ||
219 | - details: function() { return $translate.instant('rulechain.set-default-root-edge') }, | ||
220 | - icon: "flag", | 218 | + name: function() { return $translate.instant('action.delete') }, |
219 | + details: function() { return $translate.instant('rulechain.delete') }, | ||
220 | + icon: "delete", | ||
221 | isEnabled: isNonRootRuleChain | 221 | isEnabled: isNonRootRuleChain |
222 | }); | 222 | }); |
223 | 223 | ||
@@ -243,9 +243,9 @@ export default function RuleChainsController(ruleChainService, userService, edge | @@ -243,9 +243,9 @@ export default function RuleChainsController(ruleChainService, userService, edge | ||
243 | }); | 243 | }); |
244 | vm.ruleChainGridConfig.addItemActions.push({ | 244 | vm.ruleChainGridConfig.addItemActions.push({ |
245 | onAction: function ($event) { | 245 | onAction: function ($event) { |
246 | - importExport.importRuleChain($event, types.edgeRuleChainType).then( | 246 | + importExport.importRuleChain($event, types.ruleChainType.edge).then( |
247 | function(ruleChainImport) { | 247 | function(ruleChainImport) { |
248 | - $state.go('home.ruleChains.importRuleChain', {ruleChainImport:ruleChainImport, ruleChainType: types.edgeRuleChainType}); | 248 | + $state.go('home.ruleChains.importRuleChain', {ruleChainImport:ruleChainImport, ruleChainType: types.ruleChainType.edge}); |
249 | } | 249 | } |
250 | ); | 250 | ); |
251 | }, | 251 | }, |
@@ -383,9 +383,9 @@ export default function RuleChainsController(ruleChainService, userService, edge | @@ -383,9 +383,9 @@ export default function RuleChainsController(ruleChainService, userService, edge | ||
383 | function saveRuleChain(ruleChain) { | 383 | function saveRuleChain(ruleChain) { |
384 | if (angular.isUndefined(ruleChain.type)) { | 384 | if (angular.isUndefined(ruleChain.type)) { |
385 | if (vm.ruleChainsScope === 'edges') { | 385 | if (vm.ruleChainsScope === 'edges') { |
386 | - ruleChain.type = types.edgeRuleChainType; | 386 | + ruleChain.type = types.ruleChainType.edge; |
387 | } else { | 387 | } else { |
388 | - ruleChain.type = types.coreRuleChainType; | 388 | + ruleChain.type = types.ruleChainType.core; |
389 | } | 389 | } |
390 | } | 390 | } |
391 | return ruleChainService.saveRuleChain(ruleChain); | 391 | return ruleChainService.saveRuleChain(ruleChain); |
@@ -395,13 +395,13 @@ export default function RuleChainsController(ruleChainService, userService, edge | @@ -395,13 +395,13 @@ export default function RuleChainsController(ruleChainService, userService, edge | ||
395 | if ($event) { | 395 | if ($event) { |
396 | $event.stopPropagation(); | 396 | $event.stopPropagation(); |
397 | } | 397 | } |
398 | - | 398 | + var ruleChainParams = {ruleChainId: ruleChain.id.id}; |
399 | if (vm.ruleChainsScope === 'edge') { | 399 | if (vm.ruleChainsScope === 'edge') { |
400 | - $state.go('home.edges.ruleChains.ruleChain', {ruleChainId: ruleChain.id.id, edgeId: vm.edge.id.id}); | 400 | + $state.go('home.edges.ruleChains.ruleChain', Object.assign(ruleChainParams, edgeId = vm.edge.id.id)); |
401 | } else if (vm.ruleChainsScope === 'edges') { | 401 | } else if (vm.ruleChainsScope === 'edges') { |
402 | - $state.go('home.ruleChains.edge.ruleChain', {ruleChainId: ruleChain.id.id}); | 402 | + $state.go('home.ruleChains.edge.ruleChain', ruleChainParams); |
403 | } else { | 403 | } else { |
404 | - $state.go('home.ruleChains.core.ruleChain', {ruleChainId: ruleChain.id.id}); | 404 | + $state.go('home.ruleChains.core.ruleChain', ruleChainParams); |
405 | } | 405 | } |
406 | } | 406 | } |
407 | 407 |
@@ -24,7 +24,6 @@ | @@ -24,7 +24,6 @@ | ||
24 | <md-tab label="{{ 'rulechain.details' | translate }}"> | 24 | <md-tab label="{{ 'rulechain.details' | translate }}"> |
25 | <tb-rule-chain rule-chain="vm.grid.operatingItem()" | 25 | <tb-rule-chain rule-chain="vm.grid.operatingItem()" |
26 | is-edit="vm.grid.detailsConfig.isDetailsEditMode" | 26 | is-edit="vm.grid.detailsConfig.isDetailsEditMode" |
27 | - rule-chain-scope="vm.ruleChainsScope" | ||
28 | is-read-only="vm.grid.isDetailsReadOnly(vm.grid.operatingItem())" | 27 | is-read-only="vm.grid.isDetailsReadOnly(vm.grid.operatingItem())" |
29 | the-form="vm.grid.detailsForm" | 28 | the-form="vm.grid.detailsForm" |
30 | on-set-root-rule-chain="vm.setRootRuleChain(event, vm.grid.detailsConfig.currentItem)" | 29 | on-set-root-rule-chain="vm.setRootRuleChain(event, vm.grid.detailsConfig.currentItem)" |