2019-09-17 13:05:27 +03:00
|
|
|
/*
|
2020-03-17 18:43:22 +02:00
|
|
|
* Copyright © 2016-2020 The Thingsboard Authors
|
2019-09-17 13:05:27 +03:00
|
|
|
*
|
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
|
*
|
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
*
|
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
|
* limitations under the License.
|
|
|
|
|
*/
|
|
|
|
|
/* eslint-disable import/no-unresolved, import/default */
|
|
|
|
|
|
|
|
|
|
import edgesTemplate from './edges.tpl.html';
|
2020-06-01 14:30:44 +03:00
|
|
|
import entityViewsTemplate from "../entity-view/entity-views.tpl.html";
|
|
|
|
|
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";
|
2019-09-17 13:05:27 +03:00
|
|
|
|
|
|
|
|
/* eslint-enable import/no-unresolved, import/default */
|
|
|
|
|
|
|
|
|
|
/*@ngInject*/
|
2019-10-08 18:47:34 +03:00
|
|
|
export default function EdgeRoutes($stateProvider, types) {
|
2019-09-17 13:05:27 +03:00
|
|
|
$stateProvider
|
|
|
|
|
.state('home.edges', {
|
|
|
|
|
url: '/edges',
|
|
|
|
|
params: {'topIndex': 0},
|
|
|
|
|
module: 'private',
|
2019-10-08 18:47:34 +03:00
|
|
|
auth: ['TENANT_ADMIN', 'CUSTOMER_USER'],
|
|
|
|
|
views: {
|
|
|
|
|
"content@home": {
|
|
|
|
|
templateUrl: edgesTemplate,
|
|
|
|
|
controller: 'EdgeController',
|
|
|
|
|
controllerAs: 'vm'
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
data: {
|
|
|
|
|
edgesType: 'tenant',
|
|
|
|
|
searchEnabled: true,
|
|
|
|
|
searchByEntitySubtype: true,
|
|
|
|
|
searchEntityType: types.entityType.edge,
|
|
|
|
|
pageTitle: 'edge.edges'
|
|
|
|
|
},
|
|
|
|
|
ncyBreadcrumb: {
|
|
|
|
|
label: '{"icon": "transform", "label": "edge.edges"}'
|
|
|
|
|
}
|
|
|
|
|
})
|
2020-06-01 14:30:44 +03:00
|
|
|
.state('home.edges.entityViews', {
|
|
|
|
|
url: '/:edgeId/entityViews',
|
2019-10-08 18:47:34 +03:00
|
|
|
params: {'topIndex': 0},
|
|
|
|
|
module: 'private',
|
2019-09-17 13:05:27 +03:00
|
|
|
auth: ['TENANT_ADMIN'],
|
|
|
|
|
views: {
|
|
|
|
|
"content@home": {
|
2020-06-01 14:30:44 +03:00
|
|
|
templateUrl: entityViewsTemplate,
|
2019-09-17 13:05:27 +03:00
|
|
|
controllerAs: 'vm',
|
2020-06-01 14:30:44 +03:00
|
|
|
controller: 'EntityViewController'
|
2019-09-17 13:05:27 +03:00
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
data: {
|
2020-06-01 14:30:44 +03:00
|
|
|
entityViewsType: 'edge',
|
2019-09-17 13:05:27 +03:00
|
|
|
searchEnabled: true,
|
2019-10-08 18:47:34 +03:00
|
|
|
searchByEntitySubtype: true,
|
2020-06-01 14:30:44 +03:00
|
|
|
searchEntityType: types.entityType.entityView,
|
|
|
|
|
pageTitle: 'edge.entity-views'
|
|
|
|
|
},
|
|
|
|
|
ncyBreadcrumb: {
|
|
|
|
|
label: '{"icon": "view_quilt", "label": "edge.entity-views"}'
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.state('home.edges.devices', {
|
|
|
|
|
url: '/:edgeId/devices',
|
|
|
|
|
params: {'topIndex': 0},
|
|
|
|
|
module: 'private',
|
|
|
|
|
auth: ['TENANT_ADMIN'],
|
|
|
|
|
views: {
|
|
|
|
|
"content@home": {
|
|
|
|
|
templateUrl: devicesTemplate,
|
|
|
|
|
controllerAs: 'vm',
|
|
|
|
|
controller: 'DeviceController'
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
data: {
|
|
|
|
|
devicesType: 'edge',
|
|
|
|
|
searchEnabled: true,
|
|
|
|
|
searchByEntitySubtype: true,
|
|
|
|
|
searchEntityType: types.entityType.device,
|
|
|
|
|
pageTitle: 'edge.devices'
|
|
|
|
|
},
|
|
|
|
|
ncyBreadcrumb: {
|
|
|
|
|
label: '{"icon": "devices_other", "label": "edge.devices"}'
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.state('home.edges.assets', {
|
|
|
|
|
url: '/:edgeId/assets',
|
|
|
|
|
params: {'topIndex': 0},
|
|
|
|
|
module: 'private',
|
|
|
|
|
auth: ['TENANT_ADMIN'],
|
|
|
|
|
views: {
|
|
|
|
|
"content@home": {
|
|
|
|
|
templateUrl: assetsTemplate,
|
|
|
|
|
controllerAs: 'vm',
|
|
|
|
|
controller: 'AssetController'
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
data: {
|
|
|
|
|
assetsType: 'edge',
|
|
|
|
|
searchEnabled: true,
|
|
|
|
|
searchByEntitySubtype: true,
|
|
|
|
|
searchEntityType: types.entityType.asset,
|
|
|
|
|
pageTitle: 'edge.assets'
|
|
|
|
|
},
|
|
|
|
|
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'
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
data: {
|
|
|
|
|
dashboardsType: 'edge',
|
|
|
|
|
searchEnabled: true,
|
|
|
|
|
pageTitle: 'edge.dashboards'
|
|
|
|
|
},
|
|
|
|
|
ncyBreadcrumb: {
|
|
|
|
|
label: '{"icon": "dashboard", "label": "edge.dashboards"}'
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.state('home.edges.dashboards.dashboard', {
|
|
|
|
|
url: '/:dashboardId?state',
|
|
|
|
|
reloadOnSearch: false,
|
|
|
|
|
module: 'private',
|
|
|
|
|
auth: ['TENANT_ADMIN', 'CUSTOMER_USER'],
|
|
|
|
|
views: {
|
|
|
|
|
"content@home": {
|
|
|
|
|
templateUrl: dashboardTemplate,
|
|
|
|
|
controller: 'DashboardController',
|
|
|
|
|
controllerAs: 'vm'
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
data: {
|
|
|
|
|
widgetEditMode: false,
|
|
|
|
|
searchEnabled: false,
|
|
|
|
|
pageTitle: 'dashboard.dashboard',
|
|
|
|
|
dashboardsType: 'edge',
|
2019-09-17 13:05:27 +03:00
|
|
|
},
|
|
|
|
|
ncyBreadcrumb: {
|
2020-06-01 14:30:44 +03:00
|
|
|
label: '{"icon": "dashboard", "label": "{{ vm.dashboard.title }}", "translate": "false"}'
|
2019-09-17 13:05:27 +03:00
|
|
|
}
|
2020-08-27 11:05:13 +03:00
|
|
|
})
|
|
|
|
|
.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"}'
|
|
|
|
|
}
|
2019-09-17 13:05:27 +03:00
|
|
|
});
|
|
|
|
|
}
|