diff --git a/ui/src/app/customer/customer-fieldset.tpl.html b/ui/src/app/customer/customer-fieldset.tpl.html
index 11b2d58fb8..a23959ef96 100644
--- a/ui/src/app/customer/customer-fieldset.tpl.html
+++ b/ui/src/app/customer/customer-fieldset.tpl.html
@@ -19,6 +19,7 @@
{{ 'customer.manage-assets' | translate }}
{{ 'customer.manage-devices' | translate }}
{{ 'customer.manage-dashboards' | translate }}
+{{ 'customer.manage-edges' | translate }}
{{ 'customer.delete' | translate }}
diff --git a/ui/src/app/customer/customer.controller.js b/ui/src/app/customer/customer.controller.js
index 42a3801efa..c61962f9f3 100644
--- a/ui/src/app/customer/customer.controller.js
+++ b/ui/src/app/customer/customer.controller.js
@@ -77,6 +77,20 @@ export default function CustomerController(customerService, $state, $stateParams
},
icon: "dashboard"
},
+ {
+ onAction: function ($event, item) {
+ openCustomerEdges($event, item);
+ },
+ name: function() { return $translate.instant('edge.edges') },
+ details: function(customer) {
+ if (customer && customer.additionalInfo && customer.additionalInfo.isPublic) {
+ return $translate.instant('customer.manage-public-edges')
+ } else {
+ return $translate.instant('customer.manage-customer-edges')
+ }
+ },
+ icon: "router"
+ },
{
onAction: function ($event, item) {
vm.grid.deleteItem($event, item);
@@ -147,6 +161,7 @@ export default function CustomerController(customerService, $state, $stateParams
vm.openCustomerAssets = openCustomerAssets;
vm.openCustomerDevices = openCustomerDevices;
vm.openCustomerDashboards = openCustomerDashboards;
+ vm.openCustomerEdges = openCustomerEdges;
function deleteCustomerTitle(customer) {
return $translate.instant('customer.delete-customer-title', {customerTitle: customer.title});
@@ -216,4 +231,11 @@ export default function CustomerController(customerService, $state, $stateParams
$state.go('home.customers.dashboards', {customerId: customer.id.id});
}
+ function openCustomerEdges($event, customer) {
+ if ($event) {
+ $event.stopPropagation();
+ }
+ $state.go('home.customers.edges', {customerId: customer.id.id});
+ }
+
}
diff --git a/ui/src/app/customer/customer.directive.js b/ui/src/app/customer/customer.directive.js
index ff1befaf9e..33245654bb 100644
--- a/ui/src/app/customer/customer.directive.js
+++ b/ui/src/app/customer/customer.directive.js
@@ -55,6 +55,7 @@ export default function CustomerDirective($compile, $templateCache, $translate,
onManageAssets: '&',
onManageDevices: '&',
onManageDashboards: '&',
+ onManageEdges: '&',
onDeleteCustomer: '&'
}
};
diff --git a/ui/src/app/customer/customers.tpl.html b/ui/src/app/customer/customers.tpl.html
index 396fc6734b..755425a2ff 100644
--- a/ui/src/app/customer/customers.tpl.html
+++ b/ui/src/app/customer/customers.tpl.html
@@ -29,6 +29,7 @@
on-manage-assets="vm.openCustomerAssets(event, vm.grid.detailsConfig.currentItem)"
on-manage-devices="vm.openCustomerDevices(event, vm.grid.detailsConfig.currentItem)"
on-manage-dashboards="vm.openCustomerDashboards(event, vm.grid.detailsConfig.currentItem)"
+ on-manage-edges="vm.openCustomerEdges(event, vm.grid.detailsConfig.currentItem)"
on-delete-customer="vm.grid.deleteItem(event, vm.grid.detailsConfig.currentItem)">
diff --git a/ui/src/app/edge/edge.routes.js b/ui/src/app/edge/edge.routes.js
index 1afd319609..e3443d1211 100644
--- a/ui/src/app/edge/edge.routes.js
+++ b/ui/src/app/edge/edge.routes.js
@@ -161,5 +161,28 @@ export default function EdgeRoutes($stateProvider, types) {
ncyBreadcrumb: {
label: '{"icon": "dashboard", "label": "{{ vm.dashboard.title }}", "translate": "false"}'
}
+ })
+ .state('home.customers.edges', {
+ url: '/:customerId/edges',
+ params: {'topIndex': 0},
+ module: 'private',
+ auth: ['TENANT_ADMIN'],
+ views: {
+ "content@home": {
+ templateUrl: edgesTemplate,
+ controllerAs: 'vm',
+ controller: 'EdgeController'
+ }
+ },
+ data: {
+ edgesType: 'customer',
+ searchEnabled: true,
+ searchByEntitySubtype: true,
+ searchEntityType: types.entityType.edge,
+ pageTitle: 'customer.edges'
+ },
+ ncyBreadcrumb: {
+ label: '{"icon": "router", "label": "{{ vm.customerEdgesTitle }}", "translate": "false"}'
+ }
});
}
diff --git a/ui/src/app/locale/locale.constant-en_US.json b/ui/src/app/locale/locale.constant-en_US.json
index f8d1c8568a..a86d4b2ffd 100644
--- a/ui/src/app/locale/locale.constant-en_US.json
+++ b/ui/src/app/locale/locale.constant-en_US.json
@@ -441,6 +441,7 @@
"manage-assets": "Manage assets",
"manage-devices": "Manage devices",
"manage-dashboards": "Manage dashboards",
+ "manage-edges": "Manage edges",
"title": "Title",
"title-required": "Title is required.",
"description": "Description",
@@ -812,6 +813,8 @@
"assign-edges-text": "Assign { count, plural, 1 {1 edge} other {# edges} } to customer",
"unassign-edge-title": "Are you sure you want to unassign the edge '{{edgeName}}'?",
"unassign-edge-text": "After the confirmation the edge will be unassigned and won't be accessible by the customer.",
+ "unassign-edges-title": "Are you sure you want to unassign { count, plural, 1 {1 edge} other {# edges} }?",
+ "unassign-edges-text": "After the confirmation all selected edges will be unassigned and won't be accessible by the customer.",
"make-public": "Make edge public",
"make-public-edge-title": "Are you sure you want to make the edge '{{edgeName}}' public?",
"make-public-edge-text": "After the confirmation the edge and all its data will be made public and accessible by others.",