Sean Condon | a00bf38 | 2018-06-23 07:54:01 +0100 | [diff] [blame] | 1 | /* |
Sean Condon | 28ecc5f | 2018-06-25 12:50:16 +0100 | [diff] [blame] | 2 | * Copyright 2018-present Open Networking Foundation |
Sean Condon | a00bf38 | 2018-06-23 07:54:01 +0100 | [diff] [blame] | 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | import { NgModule } from '@angular/core'; |
| 17 | import { Routes, RouterModule } from '@angular/router'; |
Sean Condon | 87b7850 | 2018-09-17 20:53:24 +0100 | [diff] [blame] | 18 | import { FmGui2LibModule } from 'fm-gui2-lib'; |
Sean Condon | a00bf38 | 2018-06-23 07:54:01 +0100 | [diff] [blame] | 19 | |
Sean Condon | 28ecc5f | 2018-06-25 12:50:16 +0100 | [diff] [blame] | 20 | /** |
| 21 | * The set of Routes in the application - can be chosen from nav menu or |
| 22 | * elsewhere like tabular icon for flows etc |
| 23 | */ |
Sean Condon | a00bf38 | 2018-06-23 07:54:01 +0100 | [diff] [blame] | 24 | const onosRoutes: Routes = [ |
| 25 | { |
Bhavesh | 72ead49 | 2018-07-19 16:29:18 +0530 | [diff] [blame] | 26 | path: 'app', |
Sean Condon | a00bf38 | 2018-06-23 07:54:01 +0100 | [diff] [blame] | 27 | loadChildren: 'app/view/apps/apps.module#AppsModule' |
| 28 | }, |
| 29 | { |
prai | 9d44596 | 2018-07-27 13:27:43 +0530 | [diff] [blame] | 30 | path: 'processor', |
| 31 | loadChildren: 'app/view/processor/processor.module#ProcessorModule' |
| 32 | }, |
| 33 | { |
Bhavesh Kumar | d0b8bae | 2018-07-31 16:56:43 +0530 | [diff] [blame] | 34 | path: 'settings', |
| 35 | loadChildren: 'app/view/settings/settings.module#SettingsModule' |
| 36 | }, |
| 37 | { |
| 38 | path: 'partition', |
| 39 | loadChildren: 'app/view/partition/partition.module#PartitionModule' |
| 40 | }, |
| 41 | { |
Priyanka H M | fa5b77a | 2018-07-27 12:43:44 +0530 | [diff] [blame] | 42 | path: 'cluster', |
| 43 | loadChildren: 'app/view/cluster/cluster.module#ClusterModule' |
| 44 | }, |
| 45 | { |
Bhavesh | 72ead49 | 2018-07-19 16:29:18 +0530 | [diff] [blame] | 46 | path: 'device', |
Sean Condon | a00bf38 | 2018-06-23 07:54:01 +0100 | [diff] [blame] | 47 | loadChildren: 'app/view/device/device.module#DeviceModule' |
| 48 | }, |
| 49 | { |
Bhavesh | 72ead49 | 2018-07-19 16:29:18 +0530 | [diff] [blame] | 50 | path: 'link', |
| 51 | loadChildren: 'app/view/link/link.module#LinkModule' |
| 52 | }, |
| 53 | { |
| 54 | path: 'host', |
| 55 | loadChildren: 'app/view/host/host.module#HostModule' |
| 56 | }, |
| 57 | { |
prai | 9d44596 | 2018-07-27 13:27:43 +0530 | [diff] [blame] | 58 | path: 'intent', |
| 59 | loadChildren: 'app/view/intent/intent.module#IntentModule' |
| 60 | }, |
| 61 | { |
Bhavesh | 72ead49 | 2018-07-19 16:29:18 +0530 | [diff] [blame] | 62 | path: 'tunnel', |
| 63 | loadChildren: 'app/view/tunnel/tunnel.module#TunnelModule' |
| 64 | }, |
| 65 | { |
| 66 | path: 'flow', |
| 67 | loadChildren: 'app/view/flow/flow.module#FlowModule' |
| 68 | }, |
| 69 | { |
| 70 | path: 'port', |
| 71 | loadChildren: 'app/view/port/port.module#PortModule' |
| 72 | }, |
| 73 | { |
| 74 | path: 'group', |
| 75 | loadChildren: 'app/view/group/group.module#GroupModule' |
| 76 | }, |
| 77 | { |
| 78 | path: 'meter', |
| 79 | loadChildren: 'app/view/meter/meter.module#MeterModule' |
| 80 | }, |
Sean Condon | f4f54a1 | 2018-10-10 23:25:46 +0100 | [diff] [blame] | 81 | { |
| 82 | path: 'topo', |
| 83 | loadChildren: 'app/view/topology/topology.module#TopologyModule' |
| 84 | }, |
Sean Condon | 87b7850 | 2018-09-17 20:53:24 +0100 | [diff] [blame] | 85 | /* Comment out below section for running locally with 'ng serve' when developing */ |
| 86 | { |
| 87 | path: 'alarmTable', |
| 88 | loadChildren: 'fm-gui2-lib#FmGui2LibModule' |
| 89 | }, |
Bhavesh | 72ead49 | 2018-07-19 16:29:18 +0530 | [diff] [blame] | 90 | { |
Sean Condon | a00bf38 | 2018-06-23 07:54:01 +0100 | [diff] [blame] | 91 | path: '', |
Bhavesh | 72ead49 | 2018-07-19 16:29:18 +0530 | [diff] [blame] | 92 | redirectTo: 'device', // Default to devices view - change to topo in future |
Sean Condon | a00bf38 | 2018-06-23 07:54:01 +0100 | [diff] [blame] | 93 | pathMatch: 'full' |
| 94 | } |
| 95 | ]; |
| 96 | |
| 97 | /** |
| 98 | * ONOS GUI -- Main Routing Module - allows modules to be lazy loaded |
| 99 | * |
| 100 | * See https://angular.io/guide/lazy-loading-ngmodules |
| 101 | * for the theory of operation |
| 102 | */ |
| 103 | @NgModule({ |
| 104 | imports: [ |
Sean Condon | 87b7850 | 2018-09-17 20:53:24 +0100 | [diff] [blame] | 105 | RouterModule.forRoot(onosRoutes, { useHash : true }) |
Sean Condon | a00bf38 | 2018-06-23 07:54:01 +0100 | [diff] [blame] | 106 | ], |
| 107 | exports: [RouterModule], |
| 108 | providers: [] |
| 109 | }) |
| 110 | export class OnosRoutingModule { } |