Initial Commit - NG UI
* Roboto and font-awesome fonts are added in package.json
* Replace Nginx alpine varient to stable
* Devops files are added
* Docker file aligned as per community reviews
* Enhancement - NS primitive, Azure inclusion and domain name
* RWD changes
Change-Id: If543efbf127964cbd8f4be4c5a67260c91407fd9
Signed-off-by: kumaran.m <kumaran.m@tataelxsi.co.in>
diff --git a/src/app/utilities/vim-accounts-action/VimAccountsActionComponent.html b/src/app/utilities/vim-accounts-action/VimAccountsActionComponent.html
new file mode 100644
index 0000000..7491d59
--- /dev/null
+++ b/src/app/utilities/vim-accounts-action/VimAccountsActionComponent.html
@@ -0,0 +1,46 @@
+<!--
+Copyright 2020 TATA ELXSI
+
+Licensed under the Apache License, Version 2.0 (the 'License');
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+Author: KUMARAN M (kumaran.m@tataelxsi.co.in), RAJESH S (rajesh.s@tataelxsi.co.in), BARATH KUMAR R (barath.r@tataelxsi.co.in)
+-->
+<div class="btn-group list action" role="group">
+ <ng-template #popTitle>
+ <span class="text-primary"><strong>{{'PAGE.DASHBOARD.RUNNINGINSTANCES' | translate}}</strong></span>
+ <button class="button-xs close" type="button" (click)="p.close()">
+ <i class="fas fa-times-circle text-danger"></i>
+ </button>
+ </ng-template>
+ <ng-template #popContent>
+ <ul class="list-group">
+ <li class="list-group-item text-left p-1 border-0" *ngFor="let instanceDetails of showInstanceDetails">
+ <a class="d-block text-truncate" target="_parent"
+ routerLink="/instances/ns/{{instanceDetails._id}}"><i class="fa-sitemap fas icons"></i> {{instanceDetails.name}}</a>
+ </li>
+ </ul>
+ </ng-template>
+ <button type="button" class="btn btn-primary" (click)="vimInfo()" placement="top" container="body"
+ ngbTooltip="{{'INFO' | translate}}">
+ <i class="fas fa-info icons"></i>
+ </button>
+ <button type="button" class="btn btn-primary" (click)="deleteVIMAccount()" placement="top" container="body"
+ ngbTooltip="{{'DELETE' | translate}}">
+ <i class="far fa-trash-alt icons"></i>
+ </button>
+ <button type="button" placement="left" container="body" [ngbPopover]="popContent" triggers="manual" #p="ngbPopover"
+ (click)="p.open()" [autoClose]="'outside'" [popoverTitle]="popTitle" class="btn btn-primary"
+ popoverClass="runninginstances" [disabled]="!showMapIcon">
+ <i class="fas fa-layer-group"></i>
+ </button>
+</div>
\ No newline at end of file
diff --git a/src/app/utilities/vim-accounts-action/VimAccountsActionComponent.scss b/src/app/utilities/vim-accounts-action/VimAccountsActionComponent.scss
new file mode 100644
index 0000000..021d205
--- /dev/null
+++ b/src/app/utilities/vim-accounts-action/VimAccountsActionComponent.scss
@@ -0,0 +1,17 @@
+/*
+ Copyright 2020 TATA ELXSI
+
+ Licensed under the Apache License, Version 2.0 (the 'License');
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ Author: KUMARAN M (kumaran.m@tataelxsi.co.in), RAJESH S (rajesh.s@tataelxsi.co.in), BARATH KUMAR R (barath.r@tataelxsi.co.in)
+*/
\ No newline at end of file
diff --git a/src/app/utilities/vim-accounts-action/VimAccountsActionComponent.ts b/src/app/utilities/vim-accounts-action/VimAccountsActionComponent.ts
new file mode 100644
index 0000000..57f1f64
--- /dev/null
+++ b/src/app/utilities/vim-accounts-action/VimAccountsActionComponent.ts
@@ -0,0 +1,104 @@
+/*
+ Copyright 2020 TATA ELXSI
+
+ Licensed under the Apache License, Version 2.0 (the 'License');
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ Author: KUMARAN M (kumaran.m@tataelxsi.co.in), RAJESH S (rajesh.s@tataelxsi.co.in), BARATH KUMAR R (barath.r@tataelxsi.co.in)
+*/
+/**
+ * @file Vim AccountsAction Component
+ */
+import { Component, Injector, OnInit } from '@angular/core';
+import { Router } from '@angular/router';
+import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap';
+import { MODALCLOSERESPONSEDATA } from 'CommonModel';
+import { DeleteComponent } from 'DeleteComponent';
+import { NSInstanceDetails } from 'NSInstanceModel';
+import { SharedService } from 'SharedService';
+import { VIMData } from 'VimAccountModel';
+
+/**
+ * Creating component
+ * @Component takes VimAccountsActionComponent.html as template url
+ */
+@Component({
+ selector: 'app-vim-accounts-action',
+ templateUrl: './VimAccountsActionComponent.html',
+ styleUrls: ['./VimAccountsActionComponent.scss']
+})
+/** Exporting a class @exports VimAccountsActionComponent */
+export class VimAccountsActionComponent implements OnInit {
+ /** To get the value from the vimAccounts via valuePrepareFunction default Property of ng-smarttable @public */
+ public value: VIMData;
+
+ /** To inject services @public */
+ public injector: Injector;
+
+ /** To show Instances running @public */
+ public showMapIcon: boolean = false;
+
+ /** To show Details Instances running @public */
+ public showInstanceDetails: {}[];
+
+ /** Instance of the modal service @private */
+ private modalService: NgbModal;
+
+ /** Holds teh instance of AuthService class of type AuthService @private */
+ private router: Router;
+
+ /** Variables holds NS ID @private */
+ private vimID: string;
+
+ /** Contains all methods related to shared @private */
+ private sharedService: SharedService;
+
+ constructor(injector: Injector) {
+ this.injector = injector;
+ this.modalService = this.injector.get(NgbModal);
+ this.router = this.injector.get(Router);
+ this.sharedService = this.injector.get(SharedService);
+ }
+ /** Lifecyle Hooks the trigger before component is instantiate @public */
+ public ngOnInit(): void {
+ this.getInstancesDetails();
+ }
+
+ /** Delete VIM Account @public */
+ public deleteVIMAccount(): void {
+ const modalRef: NgbModalRef = this.modalService.open(DeleteComponent, {backdrop: 'static'});
+ modalRef.result.then((result: MODALCLOSERESPONSEDATA) => {
+ if (result) {
+ this.sharedService.callData();
+ }
+ }).catch();
+ }
+
+ /** On navigate to Info VimAccount @public */
+ public vimInfo(): void {
+ this.vimID = this.value.identifier;
+ this.router.navigate(['/vim/info', this.vimID]).catch(() => {
+ // Catch Navigation Error
+ });
+ }
+
+ /** To show the Instances Info for the particular VimAccount @public */
+ public getInstancesDetails(): void {
+ this.showInstanceDetails = [];
+ this.value.instancesData.filter((item: NSInstanceDetails) => {
+ if (item.datacenter === this.value.identifier) {
+ this.showMapIcon = true;
+ this.showInstanceDetails.push(item);
+ }
+ });
+ }
+}