blob: 4b9ff1520ba08dd7a455f773b29f8836987515bc [file] [log] [blame]
kumaran.m3b4814a2020-05-01 19:48:54 +05301/*
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 */
21import { CommonModule } from '@angular/common';
22import { HttpClientModule } from '@angular/common/http';
23import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
24import { FormsModule } from '@angular/forms';
25import { ReactiveFormsModule } from '@angular/forms';
26import { RouterModule, Routes } from '@angular/router';
27import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
28import { NgSelectModule } from '@ng-select/ng-select';
29import { TranslateModule } from '@ngx-translate/core';
30import { DataService } from 'DataService';
31import { K8sActionComponent } from 'K8sActionComponent';
32import { K8sAddClusterComponent } from 'K8sAddClusterComponent';
33import { K8sAddRepoComponent } from 'K8sAddRepoComponent';
SANDHYA.JS26570112024-07-05 21:35:46 +053034import { K8sAppProfileComponent } from 'K8sAppProfileComponent';
35import { K8sAttachProfileComponent } from 'K8sAttachProfileComponent';
kumaran.m3b4814a2020-05-01 19:48:54 +053036import { K8sClusterComponent } from 'K8sClusterComponent';
37import { K8sComponent } from 'K8sComponent';
SANDHYA.JS26570112024-07-05 21:35:46 +053038import { K8sInfraConfigAddComponent } from 'K8sInfraConfigAddComponent';
39import { K8sInfraConfigProfileComponent } from 'K8sInfraConfigProfileComponent';
40import { K8sInfraControllerProfileComponent } from 'K8sInfraControllerProfileComponent';
kumaran.m3b4814a2020-05-01 19:48:54 +053041import { K8sRepositoryComponent } from 'K8sRepositoryComponent';
SANDHYA.JS26570112024-07-05 21:35:46 +053042import { K8sResourceProfileComponent } from 'K8sResourceProfileComponent';
43import { KSUAddComponent } from 'KSUAddComponent';
44import { KSUComponent } from 'KSUComponent';
kumaran.m3b4814a2020-05-01 19:48:54 +053045import { LoaderModule } from 'LoaderModule';
46import { Ng2SmartTableModule } from 'ng2-smart-table';
47import { PagePerRowModule } from 'PagePerRowModule';
48import { PageReloadModule } from 'PageReloadModule';
49
50/** To halndle project information */
51const projectInfo: {} = { title: '{project}', url: '/' };
52
53/**
54 * configures routers
55 */
56const 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.JS26570112024-07-05 21:35:46 +053070 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.m3b4814a2020-05-01 19:48:54 +0530110 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.JS26570112024-07-05 21:35:46 +0530144 K8sAddRepoComponent,
145 K8sAttachProfileComponent,
146 K8sInfraConfigProfileComponent,
147 K8sInfraControllerProfileComponent,
148 K8sInfraConfigAddComponent,
149 K8sAppProfileComponent,
150 K8sResourceProfileComponent,
151 KSUComponent,
152 KSUAddComponent
kumaran.m3b4814a2020-05-01 19:48:54 +0530153 ],
154 providers: [DataService],
SANDHYA.JS0a34dfa2023-04-25 23:59:41 +0530155 schemas: [CUSTOM_ELEMENTS_SCHEMA]
kumaran.m3b4814a2020-05-01 19:48:54 +0530156})
157/** Exporting a class @exports K8sModule */
158export class K8sModule {
159 /** Variables declared to avoid state-less class */
160 private k8sModule: string;
161}