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

hshpak pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/incubator-datalab.git


The following commit(s) were added to refs/heads/develop by this push:
     new c18ad5b  added action Run
     new 5333b98  Merge pull request #1449 from 
GennadiyShpak/feat/DATALAB-2697/Support-possibility-to-start-instance
c18ad5b is described below

commit c18ad5bce9081e95b336c71b0258fb6091777ff3
Author: Hennadii_Shpak <[email protected]>
AuthorDate: Wed Mar 9 15:42:01 2022 +0200

    added action Run
---
 .../app/administration/management/management.component.html  | 12 ++++++++++--
 .../app/administration/management/management.component.scss  |  6 ++++++
 .../app/administration/management/management.component.ts    | 10 ++++++----
 3 files changed, 22 insertions(+), 6 deletions(-)

diff --git 
a/services/self-service/src/main/resources/webapp/src/app/administration/management/management.component.html
 
b/services/self-service/src/main/resources/webapp/src/app/administration/management/management.component.html
index 4a4cf55..6b88976 100644
--- 
a/services/self-service/src/main/resources/webapp/src/app/administration/management/management.component.html
+++ 
b/services/self-service/src/main/resources/webapp/src/app/administration/management/management.component.html
@@ -34,13 +34,21 @@
           </button>
           </span>
         <div class="action-menu" *ngIf="isActionsOpen">
+          <button
+            type="button" 
+            class="butt action-menu-item"
+            mat-raised-button
+            (click)="resourseAction('start');$event.stopPropagation()"
+          >
+            Run
+          </button>
           <span>
             <button
               type="button" 
               class="butt action-menu-item"
-              [ngClass]="{'disabled': selectedRunning.length === 0  || 
selectedStopped.length !== 0 }"
+              [ngClass]="{'disabled': !selectedRunning }"
               mat-raised-button
-              [disabled]="selectedRunning.length === 0"
+              [disabled]="!selectedRunning"
               (click)="resourseAction('stop');$event.stopPropagation()"
             >
               Stop
diff --git 
a/services/self-service/src/main/resources/webapp/src/app/administration/management/management.component.scss
 
b/services/self-service/src/main/resources/webapp/src/app/administration/management/management.component.scss
index b0e0c3f..f834e82 100644
--- 
a/services/self-service/src/main/resources/webapp/src/app/administration/management/management.component.scss
+++ 
b/services/self-service/src/main/resources/webapp/src/app/administration/management/management.component.scss
@@ -37,3 +37,9 @@
     }
   }
 }
+
+.action-menu-item:disabled {
+  color: rgba(180, 179, 179, 0.87) !important;
+  background-color: rgb(224, 224, 224);
+  opacity: 1;
+}
\ No newline at end of file
diff --git 
a/services/self-service/src/main/resources/webapp/src/app/administration/management/management.component.ts
 
b/services/self-service/src/main/resources/webapp/src/app/administration/management/management.component.ts
index e655021..339d7d0 100644
--- 
a/services/self-service/src/main/resources/webapp/src/app/administration/management/management.component.ts
+++ 
b/services/self-service/src/main/resources/webapp/src/app/administration/management/management.component.ts
@@ -55,8 +55,7 @@ export class ManagementComponent implements OnInit {
   public dialogRef: any;
   public selected: any[] = [];
   public isActionsOpen: boolean = false;
-  public selectedRunning: any[];
-  public selectedStopped: any[];
+  public selectedRunning: boolean;
 
   @ViewChild(ManagementGridComponent, { static: true }) managementGrid;
 
@@ -215,8 +214,7 @@ export class ManagementComponent implements OnInit {
       this.isActionsOpen = false;
     }
 
-    this.selectedRunning = this.selected.filter(item => item.status === 
'running');
-    this.selectedStopped = this.selected.filter(item => item.status === 
'stopped');
+    this.selectedRunning = this.selected.every(item => item.status === 
'running');
   }
 
   public toogleActions() {
@@ -298,6 +296,10 @@ export class ManagementComponent implements OnInit {
       notebooks = notebooks.filter(note => note.status !== 'stopped');
       return {...config, notebooks}
     }
+    if(action === ActionsType.start) {
+      notebooks = notebooks.filter(note => note.status === 'stopped');
+      return {...config, notebooks}
+    }
     return {...config, notebooks}
   }
 

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

Reply via email to