diff --git a/ui/src/app/api/component-descriptor.service.js b/ui/src/app/api/component-descriptor.service.js
index b4cacf4991..1069eef33d 100644
--- a/ui/src/app/api/component-descriptor.service.js
+++ b/ui/src/app/api/component-descriptor.service.js
@@ -28,31 +28,31 @@ function ComponentDescriptorService($http, $q) {
return service;
- function getComponentDescriptorsByTypes(componentTypes, ruleChainType) {
+ function getComponentDescriptorsByTypes(componentTypes, type) {
var deferred = $q.defer();
var result = [];
- if (!componentsByType[ruleChainType]) {
- componentsByType[ruleChainType] = {};
+ if (!componentsByType[type]) {
+ componentsByType[type] = {};
}
for (var i=componentTypes.length-1;i>=0;i--) {
var componentType = componentTypes[i];
- if (componentsByType[ruleChainType][componentType]) {
- result = result.concat(componentsByType[ruleChainType][componentType]);
+ if (componentsByType[type][componentType]) {
+ result = result.concat(componentsByType[type][componentType]);
componentTypes.splice(i, 1);
}
}
if (!componentTypes.length) {
deferred.resolve(result);
} else {
- var url = '/api/components?componentTypes=' + componentTypes.join(',') + '&ruleChainType=' + ruleChainType;
+ var url = '/api/components?componentTypes=' + componentTypes.join(',') + '&ruleChainType=' + type;
$http.get(url, null).then(function success(response) {
var components = response.data;
for (var i = 0; i < components.length; i++) {
var component = components[i];
- var componentsList = componentsByType[ruleChainType][component.type];
+ var componentsList = componentsByType[type][component.type];
if (!componentsList) {
componentsList = [];
- componentsByType[ruleChainType][component.type] = componentsList;
+ componentsByType[type][component.type] = componentsList;
}
componentsList.push(component);
componentsByClazz[component.clazz] = component;
diff --git a/ui/src/app/api/rule-chain.service.js b/ui/src/app/api/rule-chain.service.js
index 78c891ba06..af9cfe436a 100644
--- a/ui/src/app/api/rule-chain.service.js
+++ b/ui/src/app/api/rule-chain.service.js
@@ -311,7 +311,7 @@ function RuleChainService($http, $q, $filter, $ocLazyLoad, $translate, types, co
}
function getEdgesRuleChains(pageLink, config) {
- return getRuleChains(pageLink, config, types.edgeRuleChainType);
+ return getRuleChains(pageLink, config, types.ruleChainType.edge);
}
function getEdgeRuleChains(edgeId, pageLink, config) {
diff --git a/ui/src/app/common/types.constant.js b/ui/src/app/common/types.constant.js
index 969042bbd4..2f3f42c2ad 100644
--- a/ui/src/app/common/types.constant.js
+++ b/ui/src/app/common/types.constant.js
@@ -393,7 +393,15 @@ export default angular.module('thingsboard.types', [])
edge: "EDGE",
user: "USER",
customer: "CUSTOMER",
- relation: "RELATION"
+ relation: "RELATION",
+ entityGroup: "ENTITY_GROUP",
+ schedulerEvent: "SCHEDULER_EVENT",
+ whiteLabeling: "WHITE_LABELING",
+ loginWhiteLabeling: "LOGIN_WHITE_LABELING",
+ customTranslation: "CUSTOM_TRANSLATION",
+ widgetsBundle: "WIDGETS_BUNDLE",
+ widgetType: "WIDGET_TYPE",
+ adminSettings: "ADMIN_SETTINGS"
},
edgeEventAction: {
updated: "UPDATED",
@@ -786,8 +794,10 @@ export default angular.module('thingsboard.types', [])
clientSide: false
}
},
- coreRuleChainType: "CORE",
- edgeRuleChainType: "EDGE",
+ ruleChainType: {
+ core: "CORE",
+ edge: "EDGE"
+ },
ruleNodeTypeComponentTypes: ["FILTER", "ENRICHMENT", "TRANSFORMATION", "ACTION", "EXTERNAL"],
ruleChainNodeComponent: {
type: 'RULE_CHAIN',
diff --git a/ui/src/app/dashboard/add-dashboards-to-edge.controller.js b/ui/src/app/dashboard/add-dashboards-to-edge.controller.js
index ff579d492f..e5dcc00b33 100644
--- a/ui/src/app/dashboard/add-dashboards-to-edge.controller.js
+++ b/ui/src/app/dashboard/add-dashboards-to-edge.controller.js
@@ -53,13 +53,7 @@ export default function AddDashboardsToEdgeController(dashboardService, types, $
fetchMoreItems_: function () {
if (vm.dashboards.hasNext && !vm.dashboards.pending) {
vm.dashboards.pending = true;
- var fetchDashboardsPromise;
- if (edgeCustomerId === vm.types.id.nullUid) {
- fetchDashboardsPromise = dashboardService.getTenantDashboards(vm.dashboards.nextPageLink);
- } else {
- fetchDashboardsPromise = dashboardService.getCustomerDashboards(edgeCustomerId, vm.dashboards.nextPageLink);
- }
- fetchDashboardsPromise.then(
+ dashboardService.getTenantDashboards(vm.dashboards.nextPageLink).then(
function success(dashboards) {
vm.dashboards.data = vm.dashboards.data.concat(dashboards.data);
vm.dashboards.nextPageLink = dashboards.nextPageLink;
diff --git a/ui/src/app/dashboard/dashboards.controller.js b/ui/src/app/dashboard/dashboards.controller.js
index 6d61029b84..12a4d1cee0 100644
--- a/ui/src/app/dashboard/dashboards.controller.js
+++ b/ui/src/app/dashboard/dashboards.controller.js
@@ -708,14 +708,7 @@ export function DashboardsController(userService, dashboardService, customerServ
$event.stopPropagation();
}
var pageSize = 10;
- var fetchDashboardsPromise;
- if (vm.edgeCustomerId.id === vm.types.id.nullUid) {
- fetchDashboardsPromise = dashboardService.getTenantDashboards({limit: pageSize, textSearch: ''});
- } else {
- fetchDashboardsPromise = dashboardService.getCustomerDashboards(vm.edgeCustomerId.id, {limit: pageSize, textSearch: ''});
- }
-
- fetchDashboardsPromise.then(
+ dashboardService.getTenantDashboards({limit: pageSize, textSearch: ''}).then(
function success(_dashboards) {
var dashboards = {
pageSize: pageSize,
diff --git a/ui/src/app/edge/edge.routes.js b/ui/src/app/edge/edge.routes.js
index e3443d1211..bcba2cffe1 100644
--- a/ui/src/app/edge/edge.routes.js
+++ b/ui/src/app/edge/edge.routes.js
@@ -21,6 +21,8 @@ import devicesTemplate from "../device/devices.tpl.html";
import assetsTemplate from "../asset/assets.tpl.html";
import dashboardsTemplate from "../dashboard/dashboards.tpl.html";
import dashboardTemplate from "../dashboard/dashboard.tpl.html";
+import ruleChainsTemplate from "../rulechain/rulechains.tpl.html";
+import ruleChainTemplate from "../rulechain/rulechain.tpl.html";
/* eslint-enable import/no-unresolved, import/default */
@@ -49,8 +51,7 @@ export default function EdgeRoutes($stateProvider, types) {
ncyBreadcrumb: {
label: '{"icon": "transform", "label": "edge.edges"}'
}
- })
- .state('home.edges.entityViews', {
+ }).state('home.edges.entityViews', {
url: '/:edgeId/entityViews',
params: {'topIndex': 0},
module: 'private',
@@ -72,8 +73,7 @@ export default function EdgeRoutes($stateProvider, types) {
ncyBreadcrumb: {
label: '{"icon": "view_quilt", "label": "edge.entity-views"}'
}
- })
- .state('home.edges.devices', {
+ }).state('home.edges.devices', {
url: '/:edgeId/devices',
params: {'topIndex': 0},
module: 'private',
@@ -95,8 +95,7 @@ export default function EdgeRoutes($stateProvider, types) {
ncyBreadcrumb: {
label: '{"icon": "devices_other", "label": "edge.devices"}'
}
- })
- .state('home.edges.assets', {
+ }).state('home.edges.assets', {
url: '/:edgeId/assets',
params: {'topIndex': 0},
module: 'private',
@@ -118,29 +117,27 @@ export default function EdgeRoutes($stateProvider, types) {
ncyBreadcrumb: {
label: '{"icon": "domain", "label": "edge.assets"}'
}
- })
- .state('home.edges.dashboards', {
- url: '/:edgeId/dashboards',
- params: {'topIndex': 0},
- module: 'private',
- auth: ['TENANT_ADMIN'],
- views: {
- "content@home": {
- templateUrl: dashboardsTemplate,
- controllerAs: 'vm',
- controller: 'DashboardsController'
+ }).state('home.edges.dashboards', {
+ url: '/:edgeId/dashboards',
+ params: {'topIndex': 0},
+ module: 'private',
+ auth: ['TENANT_ADMIN'],
+ views: {
+ "content@home": {
+ templateUrl: dashboardsTemplate,
+ controllerAs: 'vm',
+ controller: 'DashboardsController'
+ }
+ },
+ data: {
+ dashboardsType: 'edge',
+ searchEnabled: true,
+ pageTitle: 'edge.dashboards'
+ },
+ ncyBreadcrumb: {
+ label: '{"icon": "dashboard", "label": "edge.dashboards"}'
}
- },
- data: {
- dashboardsType: 'edge',
- searchEnabled: true,
- pageTitle: 'edge.dashboards'
- },
- ncyBreadcrumb: {
- label: '{"icon": "dashboard", "label": "edge.dashboards"}'
- }
- })
- .state('home.edges.dashboards.dashboard', {
+ }).state('home.edges.dashboards.dashboard', {
url: '/:dashboardId?state',
reloadOnSearch: false,
module: 'private',
@@ -161,8 +158,7 @@ export default function EdgeRoutes($stateProvider, types) {
ncyBreadcrumb: {
label: '{"icon": "dashboard", "label": "{{ vm.dashboard.title }}", "translate": "false"}'
}
- })
- .state('home.customers.edges', {
+ }).state('home.customers.edges', {
url: '/:customerId/edges',
params: {'topIndex': 0},
module: 'private',
@@ -184,5 +180,62 @@ export default function EdgeRoutes($stateProvider, types) {
ncyBreadcrumb: {
label: '{"icon": "router", "label": "{{ vm.customerEdgesTitle }}", "translate": "false"}'
}
+ }).state('home.edges.ruleChains', {
+ url: '/:edgeId/ruleChains',
+ params: {'topIndex': 0},
+ module: 'private',
+ auth: ['TENANT_ADMIN'],
+ views: {
+ "content@home": {
+ templateUrl: ruleChainsTemplate,
+ controllerAs: 'vm',
+ controller: 'RuleChainsController'
+ }
+ },
+ data: {
+ searchEnabled: true,
+ pageTitle: 'edge.rulechains',
+ ruleChainsType: 'edge'
+ },
+ ncyBreadcrumb: {
+ label: '{"icon": "settings_ethernet", "label": "rulechain.edge-rulechains"}'
+ }
+ }).state('home.edges.ruleChains.ruleChain', {
+ url: '/:ruleChainId',
+ reloadOnSearch: false,
+ module: 'private',
+ auth: ['SYS_ADMIN', 'TENANT_ADMIN'],
+ views: {
+ "content@home": {
+ templateUrl: ruleChainTemplate,
+ controller: 'RuleChainController',
+ controllerAs: 'vm'
+ }
+ },
+ resolve: {
+ ruleChain:
+ /*@ngInject*/
+ function($stateParams, ruleChainService) {
+ return ruleChainService.getRuleChain($stateParams.ruleChainId);
+ },
+ ruleChainMetaData:
+ /*@ngInject*/
+ function($stateParams, ruleChainService) {
+ return ruleChainService.getRuleChainMetaData($stateParams.ruleChainId);
+ },
+ ruleNodeComponents:
+ /*@ngInject*/
+ function($stateParams, ruleChainService) {
+ return ruleChainService.getRuleNodeComponents(types.ruleChainType.edge);
+ }
+ },
+ data: {
+ import: false,
+ searchEnabled: false,
+ pageTitle: 'edge.rulechain'
+ },
+ ncyBreadcrumb: {
+ label: '{"icon": "settings_ethernet", "label": "{{ vm.ruleChain.name }}", "translate": "false"}'
+ }
});
}
diff --git a/ui/src/app/event/event-row-edge-event.tpl.html b/ui/src/app/event/event-row-edge-event.tpl.html
index d47ca55b81..6cc06d0cc3 100644
--- a/ui/src/app/event/event-row-edge-event.tpl.html
+++ b/ui/src/app/event/event-row-edge-event.tpl.html
@@ -16,12 +16,12 @@
-->
{{ event.createdTime | date : 'yyyy-MM-dd HH:mm:ss' }}
-{{ event.edgeEventType }}
-{{ event.edgeEventAction }}
+{{ event.type }}
+{{ event.action }}
{{ event.entityId }}
{{ updateStatus(event.createdTime) | translate }}
-
diff --git a/ui/src/app/event/event-row.directive.js b/ui/src/app/event/event-row.directive.js
index e1266323ed..39f3f46622 100644
--- a/ui/src/app/event/event-row.directive.js
+++ b/ui/src/app/event/event-row.directive.js
@@ -106,9 +106,9 @@ export default function EventRowDirective($compile, $templateCache, $mdDialog, $
contentType = null;
}
var content = '';
- switch(scope.event.edgeEventType) {
+ switch(scope.event.type) {
case types.edgeEventType.relation:
- content = angular.toJson(scope.event.entityBody);
+ content = angular.toJson(scope.event.body);
showDialog();
break;
case types.edgeEventType.ruleChainMetaData:
@@ -121,7 +121,7 @@ export default function EventRowDirective($compile, $templateCache, $mdDialog, $
});
break;
default:
- content = entityService.getEntity(scope.event.edgeEventType, scope.event.entityId, {ignoreErrors: true}).then(
+ content = entityService.getEntity(scope.event.type, scope.event.entityId, {ignoreErrors: true}).then(
function success(info) {
showDialog();
return angular.toJson(info);
@@ -150,6 +150,12 @@ export default function EventRowDirective($compile, $templateCache, $mdDialog, $
}
}
+ scope.checkEdgeEventType = function (type) {
+ return !(type === types.edgeEventType.widgetType ||
+ type === types.edgeEventType.adminSettings ||
+ type === types.edgeEventType.widgetsBundle );
+ }
+
scope.checkTooltip = function($event) {
var el = $event.target;
var $el = angular.element(el);
diff --git a/ui/src/app/import-export/import-export.service.js b/ui/src/app/import-export/import-export.service.js
index 04aa8805a1..dc0fbf1ea7 100644
--- a/ui/src/app/import-export/import-export.service.js
+++ b/ui/src/app/import-export/import-export.service.js
@@ -257,9 +257,6 @@ export default function ImportExport($log, $translate, $q, $mdDialog, $document,
ruleChain.firstRuleNodeId = null;
}
ruleChain.root = false;
- delete ruleChain.assignedEdgesText;
- delete ruleChain.assignedEdges;
- delete ruleChain.assignedEdgesIds;
return ruleChain;
}
diff --git a/ui/src/app/locale/locale.constant-de_DE.json b/ui/src/app/locale/locale.constant-de_DE.json
index 62f0bc5156..9e822188ee 100644
--- a/ui/src/app/locale/locale.constant-de_DE.json
+++ b/ui/src/app/locale/locale.constant-de_DE.json
@@ -67,7 +67,7 @@
"general-settings": "Allgemeine Einstellungen",
"outgoing-mail": "E-Mail Versand",
"outgoing-mail-settings": "Konfiguration des Postausgangsservers",
- "system-settings": "Systeminstellungen",
+ "system-settings": "Systemeinstellungen",
"test-mail-sent": "Test E-Mail wurde erfolgreich versendet!",
"base-url": "Basis-URL",
"base-url-required": "Basis-URL ist erforderlich.",
diff --git a/ui/src/app/rulechain/add-rulechains-to-edge.controller.js b/ui/src/app/rulechain/add-rulechains-to-edge.controller.js
index 236c44b091..df05c47eee 100644
--- a/ui/src/app/rulechain/add-rulechains-to-edge.controller.js
+++ b/ui/src/app/rulechain/add-rulechains-to-edge.controller.js
@@ -54,7 +54,7 @@ export default function AddRuleChainsToEdgeController(ruleChainService, $mdDialo
vm.ruleChains.pending = true;
ruleChainService.getEdgesRuleChains(vm.ruleChains.nextPageLink).then(
function success(ruleChains) {
- vm.ruleChains.data = ruleChains.data;
+ vm.ruleChains.data = vm.ruleChains.data.concat(ruleChains.data);
vm.ruleChains.nextPageLink = ruleChains.nextPageLink;
vm.ruleChains.hasNext = ruleChains.hasNext;
if (vm.ruleChains.hasNext) {
diff --git a/ui/src/app/rulechain/rulechain-fieldset.tpl.html b/ui/src/app/rulechain/rulechain-fieldset.tpl.html
index a85a423358..4afd6ee96e 100644
--- a/ui/src/app/rulechain/rulechain-fieldset.tpl.html
+++ b/ui/src/app/rulechain/rulechain-fieldset.tpl.html
@@ -36,11 +36,6 @@
-
-
-
-