This is an automated email from the ASF dual-hosted git repository.

dgnatyshyn pushed a commit to branch odahu-integration
in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git


The following commit(s) were added to refs/heads/odahu-integration by this push:
     new 567ee7e  [DLAB-1651]:  Added possibility to create Odahu cluster in 
case of cluster termination/fail in the same project
     new 408d722  Merge remote-tracking branch 'origin/odahu-integration' into 
odahu-integration
567ee7e is described below

commit 567ee7e179ee5c659201e68d4fa22b807b9843b2
Author: Dmytro Gnatyshyn <[email protected]>
AuthorDate: Tue Mar 31 11:18:52 2020 +0300

    [DLAB-1651]:  Added possibility to create Odahu cluster in case of cluster 
termination/fail in the same project
---
 .../create-legion-cluster.component.ts              | 21 ++++++++++-----------
 .../legion-deployment.component.html                |  8 --------
 2 files changed, 10 insertions(+), 19 deletions(-)

diff --git 
a/services/self-service/src/main/resources/webapp/src/app/administration/legion-deployment/create-legion-claster/create-legion-cluster.component.ts
 
b/services/self-service/src/main/resources/webapp/src/app/administration/legion-deployment/create-legion-claster/create-legion-cluster.component.ts
index 8cc9cf2..7aa941d 100644
--- 
a/services/self-service/src/main/resources/webapp/src/app/administration/legion-deployment/create-legion-claster/create-legion-cluster.component.ts
+++ 
b/services/self-service/src/main/resources/webapp/src/app/administration/legion-deployment/create-legion-claster/create-legion-cluster.component.ts
@@ -22,7 +22,7 @@ import { FormGroup, FormBuilder, Validators } from 
'@angular/forms';
 import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
 import { ToastrService } from 'ngx-toastr';
 
-import { Project } from '../../../administration/project/project.component';
+import { Project } from '../../project/project.component';
 import { ProjectService, LegionDeploymentService } from 
'../../../core/services';
 
 import { DICTIONARY } from '../../../../dictionary/global.dictionary';
@@ -41,8 +41,6 @@ export class CreateLegionClusterComponent implements OnInit {
 
   projects: Project[] = [];
   endpoints: Array<String> = [];
-  minInstanceNumber = 2;
-  maxInstanceNumber: number = 14;
 
   constructor(
     @Inject(MAT_DIALOG_DATA) public data: any,
@@ -59,20 +57,21 @@ export class CreateLegionClusterComponent implements OnInit 
{
     this.initFormModel();
   }
 
-  public getProjects(): void {
-    this.projectService.getProjectsList().subscribe((projects: any) => 
this.projects = projects);
-  }
-
   public getUserProjects(): void {
     this.projectService.getUserProjectsList(true).subscribe((projects: any) => 
{
-      console.log(projects);
-      this.projects = projects.filter(project => project.endpoints.length > 
project.odahu.length);
+      this.projects = projects.filter(project => {
+        return project.endpoints.length > project.odahu.filter(od => od.status 
!== 'FAILED' && od.status !== 'TERMINATED').length; }
+        );
     });
   }
 
   public setEndpoints(project): void {
     this.endpoints = project.endpoints
-      .filter(e => e.status === 'RUNNING' && !this.data.some(odahu => 
odahu.endpoint === e.name && odahu.project === project.name))
+      .filter(e => e.status === 'RUNNING' && !this.data.some(odahu => 
odahu.status !== 'FAILED'
+        && odahu.status !== 'TERMINATED'
+        && odahu.endpoint === e.name
+        && odahu.project === project.name)
+      )
       .map(e => e.name);
   }
 
@@ -87,7 +86,7 @@ export class CreateLegionClusterComponent implements OnInit {
 
   private createOdahuCluster(value): void {
     this.dialogRef.close();
-    this.legionDeploymentService.createOdahuNewCluster(value).subscribe(val => 
{
+    this.legionDeploymentService.createOdahuNewCluster(value).subscribe(() => {
       this.toastr.success('Odahu cluster creation is processing!', 'Success!');
       }, error => this.toastr.error(error.message || 'Odahu cluster creation 
failed!', 'Oops!')
     );
diff --git 
a/services/self-service/src/main/resources/webapp/src/app/administration/legion-deployment/legion-deployment.component.html
 
b/services/self-service/src/main/resources/webapp/src/app/administration/legion-deployment/legion-deployment.component.html
index 3b98588..1368180 100644
--- 
a/services/self-service/src/main/resources/webapp/src/app/administration/legion-deployment/legion-deployment.component.html
+++ 
b/services/self-service/src/main/resources/webapp/src/app/administration/legion-deployment/legion-deployment.component.html
@@ -26,14 +26,6 @@
       </button>
     </div>
     <div>
-<!--      <button mat-raised-button class="butt butt-tool mr-10">-->
-<!--        <span *ngIf="!activeFiltering">-->
-<!--          <i class="material-icons">visibility_off</i> Show active-->
-<!--        </span>-->
-<!--        <span *ngIf="activeFiltering">-->
-<!--          <i class="material-icons">visibility</i> Show all-->
-<!--        </span>-->
-<!--      </button>-->
       <button mat-raised-button class="butt" (click)="refreshGrid()">
         <i class="material-icons">autorenew</i>Refresh
       </button>


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to