| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 1 | /* |
| 2 | Copyright 2020 TATA ELXSI |
| 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 | Author: KUMARAN M (kumaran.m@tataelxsi.co.in), RAJESH S (rajesh.s@tataelxsi.co.in), BARATH KUMAR R (barath.r@tataelxsi.co.in) |
| 17 | */ |
| 18 | /** |
| 19 | * @file K8s Module. |
| 20 | */ |
| 21 | import { CommonModule } from '@angular/common'; |
| 22 | import { HttpClientModule } from '@angular/common/http'; |
| 23 | import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core'; |
| 24 | import { FormsModule } from '@angular/forms'; |
| 25 | import { ReactiveFormsModule } from '@angular/forms'; |
| 26 | import { RouterModule, Routes } from '@angular/router'; |
| 27 | import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; |
| 28 | import { NgSelectModule } from '@ng-select/ng-select'; |
| 29 | import { TranslateModule } from '@ngx-translate/core'; |
| 30 | import { DataService } from 'DataService'; |
| 31 | import { K8sActionComponent } from 'K8sActionComponent'; |
| 32 | import { K8sAddClusterComponent } from 'K8sAddClusterComponent'; |
| 33 | import { K8sAddRepoComponent } from 'K8sAddRepoComponent'; |
| SANDHYA.JS | 2657011 | 2024-07-05 21:35:46 +0530 | [diff] [blame^] | 34 | import { K8sAppProfileComponent } from 'K8sAppProfileComponent'; |
| 35 | import { K8sAttachProfileComponent } from 'K8sAttachProfileComponent'; |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 36 | import { K8sClusterComponent } from 'K8sClusterComponent'; |
| 37 | import { K8sComponent } from 'K8sComponent'; |
| SANDHYA.JS | 2657011 | 2024-07-05 21:35:46 +0530 | [diff] [blame^] | 38 | import { K8sInfraConfigAddComponent } from 'K8sInfraConfigAddComponent'; |
| 39 | import { K8sInfraConfigProfileComponent } from 'K8sInfraConfigProfileComponent'; |
| 40 | import { K8sInfraControllerProfileComponent } from 'K8sInfraControllerProfileComponent'; |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 41 | import { K8sRepositoryComponent } from 'K8sRepositoryComponent'; |
| SANDHYA.JS | 2657011 | 2024-07-05 21:35:46 +0530 | [diff] [blame^] | 42 | import { K8sResourceProfileComponent } from 'K8sResourceProfileComponent'; |
| 43 | import { KSUAddComponent } from 'KSUAddComponent'; |
| 44 | import { KSUComponent } from 'KSUComponent'; |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 45 | import { LoaderModule } from 'LoaderModule'; |
| 46 | import { Ng2SmartTableModule } from 'ng2-smart-table'; |
| 47 | import { PagePerRowModule } from 'PagePerRowModule'; |
| 48 | import { PageReloadModule } from 'PageReloadModule'; |
| 49 | |
| 50 | /** To halndle project information */ |
| 51 | const projectInfo: {} = { title: '{project}', url: '/' }; |
| 52 | |
| 53 | /** |
| 54 | * configures routers |
| 55 | */ |
| 56 | const routes: Routes = [ |
| 57 | { |
| 58 | path: '', |
| 59 | component: K8sComponent, |
| 60 | children: [ |
| 61 | { |
| 62 | path: 'cluster', |
| 63 | data: { |
| 64 | breadcrumb: [{ title: 'PAGE.DASHBOARD.DASHBOARD', url: '/' }, { title: 'PAGE.DASHBOARD.PROJECTS', url: '/projects' }, |
| 65 | projectInfo, { title: 'PAGE.K8S.MENUK8SCLUSTER', url: null }] |
| 66 | }, |
| 67 | component: K8sClusterComponent |
| 68 | }, |
| 69 | { |
| SANDHYA.JS | 2657011 | 2024-07-05 21:35:46 +0530 | [diff] [blame^] | 70 | path: 'infra-config-profile', |
| 71 | data: { |
| 72 | breadcrumb: [{ title: 'PAGE.DASHBOARD.DASHBOARD', url: '/' }, { title: 'PAGE.DASHBOARD.PROJECTS', url: '/projects' }, |
| 73 | projectInfo, { title: 'PAGE.K8S.INFRACONFIG', url: null }] |
| 74 | }, |
| 75 | component: K8sInfraConfigProfileComponent |
| 76 | }, |
| 77 | { |
| 78 | path: 'infra-controller-profile', |
| 79 | data: { |
| 80 | breadcrumb: [{ title: 'PAGE.DASHBOARD.DASHBOARD', url: '/' }, { title: 'PAGE.DASHBOARD.PROJECTS', url: '/projects' }, |
| 81 | projectInfo, { title: 'PAGE.K8S.INFRACONTROLLER', url: null }] |
| 82 | }, |
| 83 | component: K8sInfraControllerProfileComponent |
| 84 | }, |
| 85 | { |
| 86 | path: 'app-profile', |
| 87 | data: { |
| 88 | breadcrumb: [{ title: 'PAGE.DASHBOARD.DASHBOARD', url: '/' }, { title: 'PAGE.DASHBOARD.PROJECTS', url: '/projects' }, |
| 89 | projectInfo, { title: 'PAGE.K8S.APP', url: null }] |
| 90 | }, |
| 91 | component: K8sAppProfileComponent |
| 92 | }, |
| 93 | { |
| 94 | path: 'resource-profile', |
| 95 | data: { |
| 96 | breadcrumb: [{ title: 'PAGE.DASHBOARD.DASHBOARD', url: '/' }, { title: 'PAGE.DASHBOARD.PROJECTS', url: '/projects' }, |
| 97 | projectInfo, { title: 'PAGE.K8S.RESOURCE', url: null }] |
| 98 | }, |
| 99 | component: K8sResourceProfileComponent |
| 100 | }, |
| 101 | { |
| 102 | path: 'ksu', |
| 103 | data: { |
| 104 | breadcrumb: [{ title: 'PAGE.DASHBOARD.DASHBOARD', url: '/' }, { title: 'PAGE.DASHBOARD.PROJECTS', url: '/projects' }, |
| 105 | projectInfo, { title: 'PAGE.K8S.KSU', url: null }] |
| 106 | }, |
| 107 | component: KSUComponent |
| 108 | }, |
| 109 | { |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 110 | path: 'repo', |
| 111 | data: { |
| 112 | breadcrumb: [{ title: 'PAGE.DASHBOARD.DASHBOARD', url: '/' }, { title: 'PAGE.DASHBOARD.PROJECTS', url: '/projects' }, |
| 113 | projectInfo, { title: 'PAGE.K8S.MENUK8SREPO', url: null }] |
| 114 | }, |
| 115 | component: K8sRepositoryComponent |
| 116 | } |
| 117 | ] |
| 118 | } |
| 119 | ]; |
| 120 | /** |
| 121 | * Creating @NgModule component for Modules |
| 122 | */ |
| 123 | @NgModule({ |
| 124 | imports: [ |
| 125 | ReactiveFormsModule.withConfig({ warnOnNgModelWithFormControl: 'never' }), |
| 126 | FormsModule, |
| 127 | CommonModule, |
| 128 | HttpClientModule, |
| 129 | NgSelectModule, |
| 130 | Ng2SmartTableModule, |
| 131 | TranslateModule, |
| 132 | RouterModule.forChild(routes), |
| 133 | NgbModule, |
| 134 | PagePerRowModule, |
| 135 | LoaderModule, |
| 136 | PageReloadModule |
| 137 | ], |
| 138 | declarations: [ |
| 139 | K8sComponent, |
| 140 | K8sClusterComponent, |
| 141 | K8sRepositoryComponent, |
| 142 | K8sActionComponent, |
| 143 | K8sAddClusterComponent, |
| SANDHYA.JS | 2657011 | 2024-07-05 21:35:46 +0530 | [diff] [blame^] | 144 | K8sAddRepoComponent, |
| 145 | K8sAttachProfileComponent, |
| 146 | K8sInfraConfigProfileComponent, |
| 147 | K8sInfraControllerProfileComponent, |
| 148 | K8sInfraConfigAddComponent, |
| 149 | K8sAppProfileComponent, |
| 150 | K8sResourceProfileComponent, |
| 151 | KSUComponent, |
| 152 | KSUAddComponent |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 153 | ], |
| 154 | providers: [DataService], |
| SANDHYA.JS | 0a34dfa | 2023-04-25 23:59:41 +0530 | [diff] [blame] | 155 | schemas: [CUSTOM_ELEMENTS_SCHEMA] |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 156 | }) |
| 157 | /** Exporting a class @exports K8sModule */ |
| 158 | export class K8sModule { |
| 159 | /** Variables declared to avoid state-less class */ |
| 160 | private k8sModule: string; |
| 161 | } |