| 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 | 92379ec | 2025-06-13 17:29:35 +0530 | [diff] [blame] | 38 | import { K8sInfoComponent } from 'K8sInfoComponent'; |
| SANDHYA.JS | 2657011 | 2024-07-05 21:35:46 +0530 | [diff] [blame] | 39 | import { K8sInfraConfigAddComponent } from 'K8sInfraConfigAddComponent'; |
| 40 | import { K8sInfraConfigProfileComponent } from 'K8sInfraConfigProfileComponent'; |
| 41 | import { K8sInfraControllerProfileComponent } from 'K8sInfraControllerProfileComponent'; |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 42 | import { K8sRepositoryComponent } from 'K8sRepositoryComponent'; |
| SANDHYA.JS | 2657011 | 2024-07-05 21:35:46 +0530 | [diff] [blame] | 43 | import { K8sResourceProfileComponent } from 'K8sResourceProfileComponent'; |
| 44 | import { KSUAddComponent } from 'KSUAddComponent'; |
| 45 | import { KSUComponent } from 'KSUComponent'; |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 46 | import { LoaderModule } from 'LoaderModule'; |
| 47 | import { Ng2SmartTableModule } from 'ng2-smart-table'; |
| SANDHYA.JS | 92379ec | 2025-06-13 17:29:35 +0530 | [diff] [blame] | 48 | import { NodeAddComponent } from 'NodeAddComponent'; |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 49 | import { PagePerRowModule } from 'PagePerRowModule'; |
| 50 | import { PageReloadModule } from 'PageReloadModule'; |
| 51 | |
| 52 | /** To halndle project information */ |
| 53 | const projectInfo: {} = { title: '{project}', url: '/' }; |
| 54 | |
| 55 | /** |
| 56 | * configures routers |
| 57 | */ |
| 58 | const routes: Routes = [ |
| 59 | { |
| 60 | path: '', |
| 61 | component: K8sComponent, |
| 62 | children: [ |
| 63 | { |
| 64 | path: 'cluster', |
| 65 | data: { |
| 66 | breadcrumb: [{ title: 'PAGE.DASHBOARD.DASHBOARD', url: '/' }, { title: 'PAGE.DASHBOARD.PROJECTS', url: '/projects' }, |
| 67 | projectInfo, { title: 'PAGE.K8S.MENUK8SCLUSTER', url: null }] |
| 68 | }, |
| 69 | component: K8sClusterComponent |
| 70 | }, |
| 71 | { |
| SANDHYA.JS | 92379ec | 2025-06-13 17:29:35 +0530 | [diff] [blame] | 72 | path: 'details/:id', |
| 73 | data: { |
| 74 | breadcrumb: [{ title: 'PAGE.DASHBOARD.DASHBOARD', url: '/' }, { title: 'PAGE.DASHBOARD.PROJECTS', url: '/projects' }, |
| 75 | projectInfo, { title: 'PAGE.K8S.MENUK8SCLUSTER', url: '/k8s/cluster' }, { title: '{id}', url: null }] |
| 76 | }, |
| 77 | component: K8sInfoComponent |
| 78 | }, |
| 79 | { |
| SANDHYA.JS | 2657011 | 2024-07-05 21:35:46 +0530 | [diff] [blame] | 80 | path: 'infra-config-profile', |
| 81 | data: { |
| 82 | breadcrumb: [{ title: 'PAGE.DASHBOARD.DASHBOARD', url: '/' }, { title: 'PAGE.DASHBOARD.PROJECTS', url: '/projects' }, |
| 83 | projectInfo, { title: 'PAGE.K8S.INFRACONFIG', url: null }] |
| 84 | }, |
| 85 | component: K8sInfraConfigProfileComponent |
| 86 | }, |
| 87 | { |
| 88 | path: 'infra-controller-profile', |
| 89 | data: { |
| 90 | breadcrumb: [{ title: 'PAGE.DASHBOARD.DASHBOARD', url: '/' }, { title: 'PAGE.DASHBOARD.PROJECTS', url: '/projects' }, |
| 91 | projectInfo, { title: 'PAGE.K8S.INFRACONTROLLER', url: null }] |
| 92 | }, |
| 93 | component: K8sInfraControllerProfileComponent |
| 94 | }, |
| 95 | { |
| 96 | path: 'app-profile', |
| 97 | data: { |
| 98 | breadcrumb: [{ title: 'PAGE.DASHBOARD.DASHBOARD', url: '/' }, { title: 'PAGE.DASHBOARD.PROJECTS', url: '/projects' }, |
| 99 | projectInfo, { title: 'PAGE.K8S.APP', url: null }] |
| 100 | }, |
| 101 | component: K8sAppProfileComponent |
| 102 | }, |
| 103 | { |
| 104 | path: 'resource-profile', |
| 105 | data: { |
| 106 | breadcrumb: [{ title: 'PAGE.DASHBOARD.DASHBOARD', url: '/' }, { title: 'PAGE.DASHBOARD.PROJECTS', url: '/projects' }, |
| 107 | projectInfo, { title: 'PAGE.K8S.RESOURCE', url: null }] |
| 108 | }, |
| 109 | component: K8sResourceProfileComponent |
| 110 | }, |
| 111 | { |
| 112 | path: 'ksu', |
| 113 | data: { |
| 114 | breadcrumb: [{ title: 'PAGE.DASHBOARD.DASHBOARD', url: '/' }, { title: 'PAGE.DASHBOARD.PROJECTS', url: '/projects' }, |
| 115 | projectInfo, { title: 'PAGE.K8S.KSU', url: null }] |
| 116 | }, |
| 117 | component: KSUComponent |
| 118 | }, |
| 119 | { |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 120 | path: 'repo', |
| 121 | data: { |
| 122 | breadcrumb: [{ title: 'PAGE.DASHBOARD.DASHBOARD', url: '/' }, { title: 'PAGE.DASHBOARD.PROJECTS', url: '/projects' }, |
| 123 | projectInfo, { title: 'PAGE.K8S.MENUK8SREPO', url: null }] |
| 124 | }, |
| 125 | component: K8sRepositoryComponent |
| 126 | } |
| 127 | ] |
| 128 | } |
| 129 | ]; |
| 130 | /** |
| 131 | * Creating @NgModule component for Modules |
| 132 | */ |
| 133 | @NgModule({ |
| 134 | imports: [ |
| 135 | ReactiveFormsModule.withConfig({ warnOnNgModelWithFormControl: 'never' }), |
| 136 | FormsModule, |
| 137 | CommonModule, |
| 138 | HttpClientModule, |
| 139 | NgSelectModule, |
| 140 | Ng2SmartTableModule, |
| 141 | TranslateModule, |
| 142 | RouterModule.forChild(routes), |
| 143 | NgbModule, |
| 144 | PagePerRowModule, |
| 145 | LoaderModule, |
| 146 | PageReloadModule |
| 147 | ], |
| 148 | declarations: [ |
| 149 | K8sComponent, |
| 150 | K8sClusterComponent, |
| 151 | K8sRepositoryComponent, |
| 152 | K8sActionComponent, |
| 153 | K8sAddClusterComponent, |
| SANDHYA.JS | 2657011 | 2024-07-05 21:35:46 +0530 | [diff] [blame] | 154 | K8sAddRepoComponent, |
| 155 | K8sAttachProfileComponent, |
| 156 | K8sInfraConfigProfileComponent, |
| 157 | K8sInfraControllerProfileComponent, |
| 158 | K8sInfraConfigAddComponent, |
| 159 | K8sAppProfileComponent, |
| 160 | K8sResourceProfileComponent, |
| 161 | KSUComponent, |
| SANDHYA.JS | 92379ec | 2025-06-13 17:29:35 +0530 | [diff] [blame] | 162 | KSUAddComponent, |
| 163 | K8sInfoComponent, |
| 164 | NodeAddComponent, |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 165 | ], |
| 166 | providers: [DataService], |
| SANDHYA.JS | 0a34dfa | 2023-04-25 23:59:41 +0530 | [diff] [blame] | 167 | schemas: [CUSTOM_ELEMENTS_SCHEMA] |
| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 168 | }) |
| 169 | /** Exporting a class @exports K8sModule */ |
| 170 | export class K8sModule { |
| 171 | /** Variables declared to avoid state-less class */ |
| 172 | private k8sModule: string; |
| 173 | } |