]>
Commit | Line | Data |
---|---|---|
11fdf7f2 TL |
1 | import { CommonModule } from '@angular/common'; |
2 | import { NgModule } from '@angular/core'; | |
3 | import { FormsModule, ReactiveFormsModule } from '@angular/forms'; | |
4 | import { RouterModule, Routes } from '@angular/router'; | |
5 | ||
f67539c2 TL |
6 | import { TreeModule } from '@circlon/angular-tree-component'; |
7 | import { NgbNavModule, NgbPopoverModule, NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; | |
8 | import { NgxPipeFunctionModule } from 'ngx-pipe-function'; | |
11fdf7f2 | 9 | |
f67539c2 TL |
10 | import { ActionLabels, URLVerbs } from '~/app/shared/constants/app.constants'; |
11 | import { FeatureTogglesGuardService } from '~/app/shared/services/feature-toggles-guard.service'; | |
12 | import { SharedModule } from '~/app/shared/shared.module'; | |
eafe8130 | 13 | import { IscsiSettingComponent } from './iscsi-setting/iscsi-setting.component'; |
11fdf7f2 TL |
14 | import { IscsiTabsComponent } from './iscsi-tabs/iscsi-tabs.component'; |
15 | import { IscsiTargetDetailsComponent } from './iscsi-target-details/iscsi-target-details.component'; | |
16 | import { IscsiTargetDiscoveryModalComponent } from './iscsi-target-discovery-modal/iscsi-target-discovery-modal.component'; | |
17 | import { IscsiTargetFormComponent } from './iscsi-target-form/iscsi-target-form.component'; | |
18 | import { IscsiTargetImageSettingsModalComponent } from './iscsi-target-image-settings-modal/iscsi-target-image-settings-modal.component'; | |
19 | import { IscsiTargetIqnSettingsModalComponent } from './iscsi-target-iqn-settings-modal/iscsi-target-iqn-settings-modal.component'; | |
20 | import { IscsiTargetListComponent } from './iscsi-target-list/iscsi-target-list.component'; | |
21 | import { IscsiComponent } from './iscsi/iscsi.component'; | |
22 | import { MirroringModule } from './mirroring/mirroring.module'; | |
23 | import { OverviewComponent as RbdMirroringComponent } from './mirroring/overview/overview.component'; | |
24 | import { RbdConfigurationFormComponent } from './rbd-configuration-form/rbd-configuration-form.component'; | |
25 | import { RbdConfigurationListComponent } from './rbd-configuration-list/rbd-configuration-list.component'; | |
26 | import { RbdDetailsComponent } from './rbd-details/rbd-details.component'; | |
27 | import { RbdFormComponent } from './rbd-form/rbd-form.component'; | |
11fdf7f2 | 28 | import { RbdListComponent } from './rbd-list/rbd-list.component'; |
9f95a23c TL |
29 | import { RbdNamespaceFormModalComponent } from './rbd-namespace-form/rbd-namespace-form-modal.component'; |
30 | import { RbdNamespaceListComponent } from './rbd-namespace-list/rbd-namespace-list.component'; | |
31 | import { RbdPerformanceComponent } from './rbd-performance/rbd-performance.component'; | |
32 | import { RbdSnapshotFormModalComponent } from './rbd-snapshot-form/rbd-snapshot-form-modal.component'; | |
11fdf7f2 | 33 | import { RbdSnapshotListComponent } from './rbd-snapshot-list/rbd-snapshot-list.component'; |
9f95a23c | 34 | import { RbdTabsComponent } from './rbd-tabs/rbd-tabs.component'; |
11fdf7f2 TL |
35 | import { RbdTrashListComponent } from './rbd-trash-list/rbd-trash-list.component'; |
36 | import { RbdTrashMoveModalComponent } from './rbd-trash-move-modal/rbd-trash-move-modal.component'; | |
37 | import { RbdTrashPurgeModalComponent } from './rbd-trash-purge-modal/rbd-trash-purge-modal.component'; | |
38 | import { RbdTrashRestoreModalComponent } from './rbd-trash-restore-modal/rbd-trash-restore-modal.component'; | |
39 | ||
40 | @NgModule({ | |
11fdf7f2 TL |
41 | imports: [ |
42 | CommonModule, | |
43 | MirroringModule, | |
44 | FormsModule, | |
45 | ReactiveFormsModule, | |
f67539c2 TL |
46 | NgbNavModule, |
47 | NgbPopoverModule, | |
48 | NgbTooltipModule, | |
49 | NgxPipeFunctionModule, | |
11fdf7f2 TL |
50 | SharedModule, |
51 | RouterModule, | |
f67539c2 | 52 | TreeModule |
11fdf7f2 TL |
53 | ], |
54 | declarations: [ | |
55 | RbdListComponent, | |
56 | IscsiComponent, | |
eafe8130 | 57 | IscsiSettingComponent, |
11fdf7f2 TL |
58 | IscsiTabsComponent, |
59 | IscsiTargetListComponent, | |
60 | RbdDetailsComponent, | |
61 | RbdFormComponent, | |
9f95a23c TL |
62 | RbdNamespaceFormModalComponent, |
63 | RbdNamespaceListComponent, | |
11fdf7f2 | 64 | RbdSnapshotListComponent, |
9f95a23c | 65 | RbdSnapshotFormModalComponent, |
11fdf7f2 TL |
66 | RbdTrashListComponent, |
67 | RbdTrashMoveModalComponent, | |
11fdf7f2 TL |
68 | RbdTrashRestoreModalComponent, |
69 | RbdTrashPurgeModalComponent, | |
70 | IscsiTargetDetailsComponent, | |
71 | IscsiTargetFormComponent, | |
72 | IscsiTargetImageSettingsModalComponent, | |
73 | IscsiTargetIqnSettingsModalComponent, | |
74 | IscsiTargetDiscoveryModalComponent, | |
75 | RbdConfigurationListComponent, | |
9f95a23c TL |
76 | RbdConfigurationFormComponent, |
77 | RbdTabsComponent, | |
78 | RbdPerformanceComponent | |
11fdf7f2 TL |
79 | ], |
80 | exports: [RbdConfigurationListComponent, RbdConfigurationFormComponent] | |
81 | }) | |
82 | export class BlockModule {} | |
83 | ||
84 | /* The following breakdown is needed to allow importing block.module without | |
85 | the routes (e.g.: this module is imported by pool.module for RBD QoS | |
86 | components) | |
87 | */ | |
88 | const routes: Routes = [ | |
89 | { path: '', redirectTo: 'rbd', pathMatch: 'full' }, | |
90 | { | |
91 | path: 'rbd', | |
92 | canActivate: [FeatureTogglesGuardService], | |
93 | data: { breadcrumbs: 'Images' }, | |
94 | children: [ | |
9f95a23c TL |
95 | { path: '', component: RbdListComponent }, |
96 | { | |
97 | path: 'namespaces', | |
98 | component: RbdNamespaceListComponent, | |
99 | data: { breadcrumbs: 'Namespaces' } | |
100 | }, | |
101 | { | |
102 | path: 'trash', | |
103 | component: RbdTrashListComponent, | |
104 | data: { breadcrumbs: 'Trash' } | |
105 | }, | |
106 | { | |
107 | path: 'performance', | |
108 | component: RbdPerformanceComponent, | |
109 | data: { breadcrumbs: 'Overall Performance' } | |
110 | }, | |
11fdf7f2 TL |
111 | { |
112 | path: URLVerbs.CREATE, | |
113 | component: RbdFormComponent, | |
114 | data: { breadcrumbs: ActionLabels.CREATE } | |
115 | }, | |
116 | { | |
9f95a23c | 117 | path: `${URLVerbs.EDIT}/:image_spec`, |
11fdf7f2 TL |
118 | component: RbdFormComponent, |
119 | data: { breadcrumbs: ActionLabels.EDIT } | |
120 | }, | |
121 | { | |
9f95a23c | 122 | path: `${URLVerbs.CLONE}/:image_spec/:snap`, |
11fdf7f2 TL |
123 | component: RbdFormComponent, |
124 | data: { breadcrumbs: ActionLabels.CLONE } | |
125 | }, | |
126 | { | |
9f95a23c | 127 | path: `${URLVerbs.COPY}/:image_spec`, |
11fdf7f2 TL |
128 | component: RbdFormComponent, |
129 | data: { breadcrumbs: ActionLabels.COPY } | |
130 | }, | |
131 | { | |
9f95a23c | 132 | path: `${URLVerbs.COPY}/:image_spec/:snap`, |
11fdf7f2 TL |
133 | component: RbdFormComponent, |
134 | data: { breadcrumbs: ActionLabels.COPY } | |
135 | } | |
136 | ] | |
137 | }, | |
138 | { | |
139 | path: 'mirroring', | |
140 | component: RbdMirroringComponent, | |
141 | canActivate: [FeatureTogglesGuardService], | |
142 | data: { breadcrumbs: 'Mirroring' } | |
143 | }, | |
144 | // iSCSI | |
145 | { | |
146 | path: 'iscsi', | |
147 | canActivate: [FeatureTogglesGuardService], | |
148 | data: { breadcrumbs: 'iSCSI' }, | |
149 | children: [ | |
150 | { path: '', redirectTo: 'overview', pathMatch: 'full' }, | |
151 | { path: 'overview', component: IscsiComponent, data: { breadcrumbs: 'Overview' } }, | |
152 | { | |
153 | path: 'targets', | |
154 | data: { breadcrumbs: 'Targets' }, | |
155 | children: [ | |
156 | { path: '', component: IscsiTargetListComponent }, | |
157 | { | |
eafe8130 | 158 | path: URLVerbs.CREATE, |
11fdf7f2 | 159 | component: IscsiTargetFormComponent, |
eafe8130 | 160 | data: { breadcrumbs: ActionLabels.CREATE } |
11fdf7f2 TL |
161 | }, |
162 | { | |
163 | path: `${URLVerbs.EDIT}/:target_iqn`, | |
164 | component: IscsiTargetFormComponent, | |
165 | data: { breadcrumbs: ActionLabels.EDIT } | |
166 | } | |
167 | ] | |
168 | } | |
169 | ] | |
170 | } | |
171 | ]; | |
172 | ||
173 | @NgModule({ | |
174 | imports: [BlockModule, RouterModule.forChild(routes)] | |
175 | }) | |
176 | export class RoutedBlockModule {} |