You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dlab.apache.org by an...@apache.org on 2019/06/13 15:42:25 UTC

[incubator-dlab] branch feature/projects updated: [DLAB-805]: computational resources limits fixes

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

ankovalyshyn pushed a commit to branch feature/projects
in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git


The following commit(s) were added to refs/heads/feature/projects by this push:
     new 951bb38  [DLAB-805]: computational resources limits fixes
951bb38 is described below

commit 951bb38bb030051c8c5aca69897735f33fe77f89
Author: Andriana Kovalyshyn <An...@epam.com>
AuthorDate: Thu Jun 13 18:42:14 2019 +0300

    [DLAB-805]: computational resources limits fixes
---
 ...mputational-resource-create-dialog.component.ts | 40 ++++------------------
 1 file changed, 6 insertions(+), 34 deletions(-)

diff --git a/services/self-service/src/main/resources/webapp/src/app/resources/computational/computational-resource-create-dialog/computational-resource-create-dialog.component.ts b/services/self-service/src/main/resources/webapp/src/app/resources/computational/computational-resource-create-dialog/computational-resource-create-dialog.component.ts
index 5f1a385..12c0abf 100644
--- a/services/self-service/src/main/resources/webapp/src/app/resources/computational/computational-resource-create-dialog/computational-resource-create-dialog.component.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/resources/computational/computational-resource-create-dialog/computational-resource-create-dialog.component.ts
@@ -87,7 +87,9 @@ export class ComputationalResourceCreateDialogComponent implements OnInit {
 
   ngOnInit() {
     this.initFormModel();
-    this.open(this.data.notebook, this.data.full_list);
+    this.notebook_instance = this.data.notebook;
+    this.full_list = this.data.full_list;
+    this.getTemplates(this.notebook_instance.project);
   }
 
 
@@ -211,31 +213,6 @@ export class ComputationalResourceCreateDialogComponent implements OnInit {
     return false;
   }
 
-  public open(notebook_instance, full_list): void {
-    this.notebook_instance = notebook_instance;
-    this.full_list = full_list;
-    this.getTemplates(this.notebook_instance.project);
-    // this.model = new ComputationalResourceCreateModel('', 0, '', '', notebook_instance.name,
-    //   response => {
-    //     if (response.status === HTTP_STATUS_CODES.OK) {
-    //       this.dialogRef.close();
-    //       this.buildGrid.emit();
-    //     }
-    //   },
-    //   error => this.toastr.error(error.message || 'Computational resource creation failed!', 'Oops!'),
-    //   () => {},
-    //   () => {
-    //     // this.bindDialog.modalClass += !this.model.availableTemplates ? 'reset' : '';
-    //     // this.dialogRef.updateSize('40%', '80%');
-
-    //     this.ref.detectChanges();
-
-    //     this.setDefaultParams();
-        this.getComputationalResourceLimits();
-    //   },
-    //   this.userResourceService);
-  }
-
   public preemptibleCounter($event, action): void {
     $event.preventDefault();
 
@@ -264,7 +241,7 @@ export class ComputationalResourceCreateDialogComponent implements OnInit {
   }
 
   private getComputationalResourceLimits(): void {
-    if (this.cluster_types.length && this.selectedImage && this.selectedImage.image) {
+    if (this.selectedImage && this.selectedImage.image) {
       const activeImage = DICTIONARY[this.selectedImage.image];
 
       this.minInstanceNumber = this.selectedImage.limits[activeImage.total_instance_number_min];
@@ -282,7 +259,7 @@ export class ComputationalResourceCreateDialogComponent implements OnInit {
         this.spotInstancesSelect.nativeElement['checked'] = true;
         this.selectSpotInstances();
       }
-      debugger;
+
       this.resourceForm.controls['instance_number'].setValue(this.minInstanceNumber);
       this.resourceForm.controls['preemptible_instance_number'].setValue(this.minPreemptibleInstanceNumber);
     }
@@ -389,14 +366,9 @@ export class ComputationalResourceCreateDialogComponent implements OnInit {
       cluster_types => {
         this.cluster_types = cluster_types;
         this.selectedImage = cluster_types[0];
+        this.getComputationalResourceLimits();
         this.filterShapes();
         this.resourceForm.get('template_name').setValue(this.selectedImage.template_name)
       });
   }
-
-
-
-
-
-
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@dlab.apache.org
For additional commands, e-mail: commits-help@dlab.apache.org