Added route for edge dashboard

This commit is contained in:
Artem Babak 2020-12-11 11:31:05 +02:00
parent fee5034e46
commit a6a0a65d25
3 changed files with 40 additions and 9 deletions

View File

@ -357,7 +357,10 @@ export class DashboardsTableConfigResolver implements Resolve<EntityTableConfig<
}
if (this.config.componentsData.dashboardScope === 'customer') {
this.router.navigateByUrl(`customers/${this.config.componentsData.customerId}/dashboards/${dashboard.id.id}`);
} else {
} else if (this.config.componentsData.dashboardScope === 'edge') {
this.router.navigateByUrl(`edges/${this.config.componentsData.edgeId}/dashboards/${dashboard.id.id}`);
}
else {
this.router.navigateByUrl(`dashboards/${dashboard.id.id}`);
}
}

View File

@ -24,6 +24,9 @@ import { DevicesTableConfigResolver } from "@home/pages/device/devices-table-con
import { EntityViewsTableConfigResolver } from "@home/pages/entity-view/entity-views-table-config.resolver";
import { DashboardsTableConfigResolver } from "@home/pages/dashboard/dashboards-table-config.resolver";
import { RuleChainsTableConfigResolver } from "@home/pages/rulechain/rulechains-table-config.resolver";
import { DashboardPageComponent } from "@home/pages/dashboard/dashboard-page.component";
import { dashboardBreadcumbLabelFunction, DashboardResolver } from "@home/pages/dashboard/dashboard-routing.module";
import { BreadCrumbConfig } from "@shared/components/breadcrumb";
const routes: Routes = [
{
@ -108,19 +111,43 @@ const routes: Routes = [
},
{
path: ':edgeId/dashboards',
component: EntitiesTableComponent,
data: {
auth: [Authority.TENANT_ADMIN, Authority.CUSTOMER_USER],
dashboardsType: 'edge',
breadcrumb: {
label: 'edge.dashboards',
icon: 'dashboard'
}
},
resolve: {
entitiesTableConfig: DashboardsTableConfigResolver
}
}]
children: [
{
path: '',
component: EntitiesTableComponent,
data: {
auth: [Authority.TENANT_ADMIN],
dashboardsType: 'edge'
},
resolve: {
entitiesTableConfig: DashboardsTableConfigResolver
},
},
{
path: ':dashboardId',
component: DashboardPageComponent,
data: {
breadcrumb: {
labelFunction: dashboardBreadcumbLabelFunction,
icon: 'dashboard'
} as BreadCrumbConfig<DashboardPageComponent>,
auth: [Authority.TENANT_ADMIN, Authority.CUSTOMER_USER],
title: 'edge.dashboard',
widgetEditMode: false
},
resolve: {
dashboard: DashboardResolver
}
}
]
},
]
}]
@NgModule({

View File

@ -1005,7 +1005,8 @@
"any-edge": "Any edge",
"no-edge-types-matching": "No edge types matching '{{entitySubtype}}' were found.",
"edge-type-list-empty": "No device types selected.",
"edge-types": "Edge types"
"edge-types": "Edge types",
"dashboard": "Edge dashboard"
},
"error": {
"unable-to-connect": "Unable to connect to the server! Please check your internet connection.",