2 Copyright 2020 TATA ELXSI
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
8 http://www.apache.org/licenses/LICENSE-2.0
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.
16 Author: KUMARAN M (kumaran.m@tataelxsi.co.in), RAJESH S (rajesh.s@tataelxsi.co.in), BARATH KUMAR R (barath.r@tataelxsi.co.in)
19 * @file Instance module
21 import { CommonModule } from '@angular/common';
22 import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
23 import { FlexLayoutModule } from '@angular/flex-layout';
24 import { FormsModule } from '@angular/forms';
25 import { ReactiveFormsModule } from '@angular/forms';
26 import { RouterModule, Routes } from '@angular/router';
27 import { CodemirrorModule } from '@ctrl/ngx-codemirror';
28 import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
29 import { NgSelectModule } from '@ng-select/ng-select';
30 import { TranslateModule } from '@ngx-translate/core';
31 import { AddPDUInstancesComponent } from 'AddPDUInstancesComponent';
32 import { DataService } from 'DataService';
33 import { HistoryOperationsComponent } from 'HistoryOperationsComponent';
34 import { InstancesComponent } from 'InstancesComponent';
35 import { LoaderModule } from 'LoaderModule';
36 import { NetsliceInstancesComponent } from 'NetsliceInstancesComponent';
37 import { SidebarModule } from 'ng-sidebar';
38 import { Ng2SmartTableModule } from 'ng2-smart-table';
39 import { NSInstancesComponent } from 'NSInstancesComponent';
40 import { NSPrimitiveComponent } from 'NSPrimitiveComponent';
41 import { NSTopologyComponent } from 'NSTopologyComponent';
42 import { PagePerRowModule } from 'PagePerRowModule';
43 import { PageReloadModule } from 'PageReloadModule';
44 import { PDUInstancesComponent } from 'PDUInstancesComponent';
45 import { VNFInstancesComponent } from 'VNFInstancesComponent';
47 /** To halndle project information */
48 const projectInfo: {} = { title: '{project}', url: '/' };
50 /** Exporting a function using Routes @exports routes */
51 const routes: Routes = [
54 component: InstancesComponent,
59 breadcrumb: [{ title: 'PAGE.DASHBOARD.DASHBOARD', url: '/' }, { title: 'PAGE.DASHBOARD.PROJECTS', url: '/projects' },
60 projectInfo, { title: 'NSINSTANCES', url: null }]
62 component: NSInstancesComponent
67 breadcrumb: [{ title: 'PAGE.DASHBOARD.DASHBOARD', url: '/' }, { title: 'PAGE.DASHBOARD.PROJECTS', url: '/projects' },
68 projectInfo, { title: 'VNFINSTANCES', url: null }]
70 component: VNFInstancesComponent
75 breadcrumb: [{ title: 'PAGE.DASHBOARD.DASHBOARD', url: '/' }, { title: 'PAGE.DASHBOARD.PROJECTS', url: '/projects' },
76 projectInfo, { title: 'PDUINSTANCES', url: null }]
78 component: PDUInstancesComponent
83 breadcrumb: [{ title: 'PAGE.DASHBOARD.DASHBOARD', url: '/' }, { title: 'PAGE.DASHBOARD.PROJECTS', url: '/projects' },
84 projectInfo, { title: 'PAGE.DASHBOARD.NETSLICEINSTANCE', url: null }]
86 component: NetsliceInstancesComponent
89 path: ':type/history-operations/:id',
91 breadcrumb: [{ title: 'PAGE.DASHBOARD.DASHBOARD', url: '/' }, { title: 'PAGE.DASHBOARD.PROJECTS', url: '/projects' },
92 projectInfo, { title: '{type}', url: '/instances/{type}' }, { title: '{id}', url: null }]
94 component: HistoryOperationsComponent
99 breadcrumb: [{ title: 'PAGE.DASHBOARD.DASHBOARD', url: '/' }, { title: 'PAGE.DASHBOARD.PROJECTS', url: '/projects' },
100 projectInfo, { title: 'NSINSTANCES', url: '/instances/ns' }, { title: '{id}', url: null }]
102 component: NSTopologyComponent
109 * An NgModule is a class adorned with the @NgModule decorator function.
110 * @NgModule takes a metadata object that tells Angular how to compile and run module code.
113 imports: [ReactiveFormsModule.withConfig({ warnOnNgModelWithFormControl: 'never' }), FormsModule, TranslateModule,
114 CodemirrorModule, CommonModule, Ng2SmartTableModule, FlexLayoutModule, RouterModule.forChild(routes), NgbModule,
115 NgSelectModule, PagePerRowModule, LoaderModule, SidebarModule.forRoot(), PageReloadModule],
116 declarations: [InstancesComponent, NSInstancesComponent, VNFInstancesComponent, PDUInstancesComponent, AddPDUInstancesComponent,
117 NetsliceInstancesComponent, HistoryOperationsComponent, NSTopologyComponent, NSPrimitiveComponent],
118 schemas: [CUSTOM_ELEMENTS_SCHEMA],
119 providers: [DataService],
120 entryComponents: [NSPrimitiveComponent, AddPDUInstancesComponent]
122 /** Exporting a class @exports InstancesModule */
123 export class InstancesModule {
124 /** Resolves state-less class */
125 private instancesModule: string;
127 * Lifecyle Hooks the trigger before component is instantiate
129 public ngOnInit(): void {
130 this.instancesModule = '';