blob: 913353cbd20c3c2ccd4a52b21a621985b14fe045 [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.JS92379ec2025-06-13 17:29:35 +053038import { K8sInfoComponent } from 'K8sInfoComponent';
SANDHYA.JS26570112024-07-05 21:35:46 +053039import { K8sInfraConfigAddComponent } from 'K8sInfraConfigAddComponent';
40import { K8sInfraConfigProfileComponent } from 'K8sInfraConfigProfileComponent';
41import { K8sInfraControllerProfileComponent } from 'K8sInfraControllerProfileComponent';
kumaran.m3b4814a2020-05-01 19:48:54 +053042import { K8sRepositoryComponent } from 'K8sRepositoryComponent';
SANDHYA.JS26570112024-07-05 21:35:46 +053043import { K8sResourceProfileComponent } from 'K8sResourceProfileComponent';
44import { KSUAddComponent } from 'KSUAddComponent';
45import { KSUComponent } from 'KSUComponent';
kumaran.m3b4814a2020-05-01 19:48:54 +053046import { LoaderModule } from 'LoaderModule';
47import { Ng2SmartTableModule } from 'ng2-smart-table';
SANDHYA.JS92379ec2025-06-13 17:29:35 +053048import { NodeAddComponent } from 'NodeAddComponent';
kumaran.m3b4814a2020-05-01 19:48:54 +053049import { PagePerRowModule } from 'PagePerRowModule';
50import { PageReloadModule } from 'PageReloadModule';
51
52/** To halndle project information */
53const projectInfo: {} = { title: '{project}', url: '/' };
54
55/**
56 * configures routers
57 */
58const 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.JS92379ec2025-06-13 17:29:35 +053072 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.JS26570112024-07-05 21:35:46 +053080 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.m3b4814a2020-05-01 19:48:54 +0530120 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.JS26570112024-07-05 21:35:46 +0530154 K8sAddRepoComponent,
155 K8sAttachProfileComponent,
156 K8sInfraConfigProfileComponent,
157 K8sInfraControllerProfileComponent,
158 K8sInfraConfigAddComponent,
159 K8sAppProfileComponent,
160 K8sResourceProfileComponent,
161 KSUComponent,
SANDHYA.JS92379ec2025-06-13 17:29:35 +0530162 KSUAddComponent,
163 K8sInfoComponent,
164 NodeAddComponent,
kumaran.m3b4814a2020-05-01 19:48:54 +0530165 ],
166 providers: [DataService],
SANDHYA.JS0a34dfa2023-04-25 23:59:41 +0530167 schemas: [CUSTOM_ELEMENTS_SCHEMA]
kumaran.m3b4814a2020-05-01 19:48:54 +0530168})
169/** Exporting a class @exports K8sModule */
170export class K8sModule {
171 /** Variables declared to avoid state-less class */
172 private k8sModule: string;
173}