thingsboard/ui-ngx/src/app/modules/home/pages/admin/admin-routing.module.ts

104 lines
3.0 KiB
TypeScript
Raw Normal View History

2019-08-12 19:34:23 +03:00
///
2020-02-20 10:26:43 +02:00
/// Copyright © 2016-2020 The Thingsboard Authors
2019-08-12 19:34:23 +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.
///
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
2019-08-12 19:34:23 +03:00
import { MailServerComponent } from '@modules/home/pages/admin/mail-server.component';
import { ConfirmOnExitGuard } from '@core/guards/confirm-on-exit.guard';
import { Authority } from '@shared/models/authority.enum';
import { GeneralSettingsComponent } from '@modules/home/pages/admin/general-settings.component';
import { SecuritySettingsComponent } from '@modules/home/pages/admin/security-settings.component';
2020-07-09 13:47:35 +03:00
import { OAuth2SettingsComponent } from '@home/pages/admin/oauth2-settings.component';
2019-08-12 19:34:23 +03:00
const routes: Routes = [
{
path: 'settings',
data: {
2020-10-12 10:58:28 +03:00
auth: [Authority.SYS_ADMIN],
2019-08-12 19:34:23 +03:00
breadcrumb: {
label: 'admin.system-settings',
icon: 'settings'
}
},
children: [
{
path: '',
2020-09-21 16:10:00 +03:00
redirectTo: 'general',
2019-08-12 19:34:23 +03:00
pathMatch: 'full'
},
{
path: 'general',
component: GeneralSettingsComponent,
canDeactivate: [ConfirmOnExitGuard],
data: {
auth: [Authority.SYS_ADMIN],
title: 'admin.general-settings',
breadcrumb: {
label: 'admin.general',
icon: 'settings_applications'
}
}
},
{
path: 'outgoing-mail',
component: MailServerComponent,
canDeactivate: [ConfirmOnExitGuard],
data: {
auth: [Authority.SYS_ADMIN],
title: 'admin.outgoing-mail-settings',
breadcrumb: {
label: 'admin.outgoing-mail',
icon: 'mail'
}
}
},
{
path: 'security-settings',
component: SecuritySettingsComponent,
canDeactivate: [ConfirmOnExitGuard],
data: {
auth: [Authority.SYS_ADMIN],
title: 'admin.security-settings',
breadcrumb: {
label: 'admin.security-settings',
icon: 'security'
}
}
2020-07-09 13:47:35 +03:00
},
{
2020-09-08 17:05:13 +03:00
path: 'oauth2',
2020-07-09 13:47:35 +03:00
component: OAuth2SettingsComponent,
canDeactivate: [ConfirmOnExitGuard],
data: {
2020-09-21 16:10:00 +03:00
auth: [Authority.SYS_ADMIN],
2020-09-08 17:05:13 +03:00
title: 'admin.oauth2.oauth2',
2020-07-09 13:47:35 +03:00
breadcrumb: {
2020-09-08 17:05:13 +03:00
label: 'admin.oauth2.oauth2',
2020-07-09 13:47:35 +03:00
icon: 'security'
}
}
2019-08-12 19:34:23 +03:00
}
]
}
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class AdminRoutingModule { }