You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dlab.apache.org by dg...@apache.org on 2020/01/28 16:35:18 UTC

[incubator-dlab] branch DLAB-1357 updated (acdf862 -> 722ff6e)

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

dgnatyshyn pushed a change to branch DLAB-1357
in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git.


    from acdf862  Added start/stop/terminate features
     new 248cb1c  [DLAB-1357]: Odahu grid style fixed
     new 79a5018  Merge branch 'DLAB-1357' of github.com:apache/incubator-dlab into DLAB-1357
     new 722ff6e  [DLAB-1357]: Added stop/start action for ODAHU

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../legion-deployment-data.service.ts              |  6 ++--
 .../legion-deployment.component.ts                 | 22 ++++++------
 .../legion-list/legion-list.component.html         | 40 +++++++++++-----------
 .../legion-list/legion-list.component.scss         |  4 +++
 .../legion-list/legion-list.component.ts           | 13 +++++--
 .../services/applicationServiceFacade.service.ts   |  6 ++++
 .../app/core/services/legion-deployment.service.ts | 10 +++++-
 7 files changed, 63 insertions(+), 38 deletions(-)


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


[incubator-dlab] 01/03: [DLAB-1357]: Odahu grid style fixed

Posted by dg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 248cb1c0e94741b2de60046b53c70638c09657ea
Author: Dmytro Gnatyshyn <di...@ukr.net>
AuthorDate: Tue Jan 28 15:45:04 2020 +0200

    [DLAB-1357]: Odahu grid style fixed
---
 .../legion-deployment/legion-list/legion-list.component.html      | 8 ++++----
 .../legion-deployment/legion-list/legion-list.component.scss      | 4 ++++
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/services/self-service/src/main/resources/webapp/src/app/administration/legion-deployment/legion-list/legion-list.component.html b/services/self-service/src/main/resources/webapp/src/app/administration/legion-deployment/legion-list/legion-list.component.html
index 9929294..a981af4 100644
--- a/services/self-service/src/main/resources/webapp/src/app/administration/legion-deployment/legion-list/legion-list.component.html
+++ b/services/self-service/src/main/resources/webapp/src/app/administration/legion-deployment/legion-list/legion-list.component.html
@@ -1,16 +1,16 @@
 
 <table mat-table [dataSource]="dataSource" class="legion-clasters-table mat-elevation-z6 selection">
   <ng-container matColumnDef="name">
-    <th mat-header-cell *matHeaderCellDef class="name"> Project name </th>
-    <td mat-cell *matCellDef="let element" class="name">
+    <th mat-header-cell *matHeaderCellDef class="project"> Project name </th>
+    <td mat-cell *matCellDef="let element" class="project">
       <span *ngIf="element && element.project">{{element.project}}</span>
     </td>
     <td mat-footer-cell *matFooterCellDef></td>
   </ng-container>
 
   <ng-container matColumnDef="endpoint-url">
-    <th mat-header-cell *matHeaderCellDef class="endpoint-url"> Endpoint </th>
-    <td mat-cell *matCellDef="let element" class="endpoint-url">
+    <th mat-header-cell *matHeaderCellDef class="endpoint"> Endpoint </th>
+    <td mat-cell *matCellDef="let element" class="endpoint">
       <span *ngIf="element && element.endpoint" matTooltip="{{element.endpoint}}" [matTooltipPosition]="'above'">
         {{element.endpoint}}
       </span>
diff --git a/services/self-service/src/main/resources/webapp/src/app/administration/legion-deployment/legion-list/legion-list.component.scss b/services/self-service/src/main/resources/webapp/src/app/administration/legion-deployment/legion-list/legion-list.component.scss
index 6481052..7cfaef8 100644
--- a/services/self-service/src/main/resources/webapp/src/app/administration/legion-deployment/legion-list/legion-list.component.scss
+++ b/services/self-service/src/main/resources/webapp/src/app/administration/legion-deployment/legion-list/legion-list.component.scss
@@ -1,6 +1,10 @@
 .legion-clasters-table {
   width: 100%;
 
+  .project, .endpoint, .legion-name, .legion-status{
+    width: 23%;
+  }
+
   td.settings {
     position: relative;
     vertical-align: middle !important;


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


[incubator-dlab] 03/03: [DLAB-1357]: Added stop/start action for ODAHU

Posted by dg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 722ff6e5b20349130eb2153c6a56bb07950f6657
Author: Dmytro Gnatyshyn <di...@ukr.net>
AuthorDate: Tue Jan 28 18:34:39 2020 +0200

    [DLAB-1357]: Added stop/start action for ODAHU
---
 .../legion-deployment-data.service.ts              |  6 ++--
 .../legion-deployment.component.ts                 | 22 +++++++--------
 .../legion-list/legion-list.component.html         | 32 +++++++++++-----------
 .../legion-list/legion-list.component.ts           | 13 +++++++--
 .../services/applicationServiceFacade.service.ts   |  6 ++++
 .../app/core/services/legion-deployment.service.ts | 10 ++++++-
 6 files changed, 55 insertions(+), 34 deletions(-)

diff --git a/services/self-service/src/main/resources/webapp/src/app/administration/legion-deployment/legion-deployment-data.service.ts b/services/self-service/src/main/resources/webapp/src/app/administration/legion-deployment/legion-deployment-data.service.ts
index ddce4e7..83dfeaf 100644
--- a/services/self-service/src/main/resources/webapp/src/app/administration/legion-deployment/legion-deployment-data.service.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/administration/legion-deployment/legion-deployment-data.service.ts
@@ -1,6 +1,6 @@
 import { Injectable } from '@angular/core';
-import {BehaviorSubject, Observable} from "rxjs";
-import {LegionDeploymentService} from "../../core/services";
+import {BehaviorSubject, Observable} from 'rxjs';
+import {LegionDeploymentService} from '../../core/services';
 
 
 @Injectable({
@@ -21,7 +21,7 @@ export class LegionDeploymentDataService {
   private getClastersList(): void {
    this.legionDeploymentService.getOduhuClustersList().subscribe(
       (response: any ) => {
-        return this._legionClasters.next(response)
+        return this._legionClasters.next(response);
       });
   }
 }
diff --git a/services/self-service/src/main/resources/webapp/src/app/administration/legion-deployment/legion-deployment.component.ts b/services/self-service/src/main/resources/webapp/src/app/administration/legion-deployment/legion-deployment.component.ts
index 98c5753..f6fffe0 100644
--- a/services/self-service/src/main/resources/webapp/src/app/administration/legion-deployment/legion-deployment.component.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/administration/legion-deployment/legion-deployment.component.ts
@@ -1,16 +1,16 @@
 import { Component, OnInit } from '@angular/core';
-import {LegionDeploymentDataService} from "./legion-deployment-data.service";
-import {Subscription} from "rxjs";
-import {MatDialog} from "@angular/material/dialog";
-import {ToastrService} from "ngx-toastr";
-import {CreateLegionClusterComponent} from "./create-legion-claster/create-legion-cluster.component";
-import {HealthStatusService, LegionDeploymentService} from "../../core/services";
+import {LegionDeploymentDataService} from './legion-deployment-data.service';
+import {Subscription} from 'rxjs';
+import {MatDialog} from '@angular/material/dialog';
+import {ToastrService} from 'ngx-toastr';
+import {CreateLegionClusterComponent} from './create-legion-claster/create-legion-cluster.component';
+import {HealthStatusService, LegionDeploymentService} from '../../core/services';
 
-// export interface OdahuCluster {
-//   name: string;
-//   project: string;
-//   endpoint: string;
-// }
+export interface OdahuCluster {
+  name: string;
+  project: string;
+  endpoint: string;
+}
 
 @Component({
   selector: 'dlab-legion-deployment',
diff --git a/services/self-service/src/main/resources/webapp/src/app/administration/legion-deployment/legion-list/legion-list.component.html b/services/self-service/src/main/resources/webapp/src/app/administration/legion-deployment/legion-list/legion-list.component.html
index a981af4..11325bc 100644
--- a/services/self-service/src/main/resources/webapp/src/app/administration/legion-deployment/legion-list/legion-list.component.html
+++ b/services/self-service/src/main/resources/webapp/src/app/administration/legion-deployment/legion-list/legion-list.component.html
@@ -1,6 +1,6 @@
 
 <table mat-table [dataSource]="dataSource" class="legion-clasters-table mat-elevation-z6 selection">
-  <ng-container matColumnDef="name">
+  <ng-container matColumnDef="project">
     <th mat-header-cell *matHeaderCellDef class="project"> Project name </th>
     <td mat-cell *matCellDef="let element" class="project">
       <span *ngIf="element && element.project">{{element.project}}</span>
@@ -41,36 +41,36 @@
       <bubble-up #actions class="list-menu" position="bottom-left" alternative="top-left">
         <ul class="list-unstyled">
           <div class="active-items"></div>
-          <li class="project-seting-item">
+          <li class="project-seting-item" *ngIf="element.status === 'STOPPED'" (click)="odahuAction(element, 'start')">
             <i class="material-icons">play_circle_outline</i>
             <a class="action">
               Start
             </a>
           </li>
-          <li class="project-seting-item">
+          <li class="project-seting-item" *ngIf="element.status === 'RUNNING'" (click)="odahuAction(element, 'stop')">
             <i class="material-icons">pause_circle_outline</i>
             <a class="action" >
               Stop
             </a>
           </li>
-          <li class="project-seting-item ">
+          <li class="project-seting-item" (click)="odahuAction(element, 'terminate')">
             <i class="material-icons">phonelink_off</i>
             <a class="action">
               Terminate
             </a>
           </li>
-          <li class="project-seting-item">
-            <i class="material-icons">arrow_downward</i>
-            <a>
-              Scale-down
-            </a>
-          </li>
-          <li class="project-seting-item">
-            <i class="material-icons">arrow_upward</i>
-            <a  class="action">
-              Scale-up
-            </a>
-          </li>
+          <!--<li class="project-seting-item">-->
+            <!--<i class="material-icons">arrow_downward</i>-->
+            <!--<a>-->
+              <!--Scale-down-->
+            <!--</a>-->
+          <!--</li>-->
+          <!--<li class="project-seting-item">-->
+            <!--<i class="material-icons">arrow_upward</i>-->
+            <!--<a  class="action">-->
+              <!--Scale-up-->
+            <!--</a>-->
+          <!--</li>-->
         </ul>
       </bubble-up>
     </td>
diff --git a/services/self-service/src/main/resources/webapp/src/app/administration/legion-deployment/legion-list/legion-list.component.ts b/services/self-service/src/main/resources/webapp/src/app/administration/legion-deployment/legion-list/legion-list.component.ts
index e31d67a..106fc7c 100644
--- a/services/self-service/src/main/resources/webapp/src/app/administration/legion-deployment/legion-list/legion-list.component.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/administration/legion-deployment/legion-list/legion-list.component.ts
@@ -1,7 +1,8 @@
 import { Component, OnInit } from '@angular/core';
-import {Subscription} from "rxjs";
-import {LegionDeploymentDataService} from "../legion-deployment-data.service";
+import {Subscription} from 'rxjs';
+import {LegionDeploymentDataService} from '../legion-deployment-data.service';
 import { MatTableDataSource } from '@angular/material/table';
+import {LegionDeploymentService} from '../../../core/services';
 
 @Component({
   selector: 'legion-list',
@@ -12,10 +13,11 @@ export class LegionListComponent implements OnInit {
   private legionClustersList: any[];
   private subscriptions: Subscription = new Subscription();
   public dataSource: MatTableDataSource<any>;
-  displayedColumns: string[] = ['name', 'endpoint-url', 'legion-name', 'legion-status', "actions"];
+  displayedColumns: string[] = ['project', 'endpoint-url', 'legion-name', 'legion-status', 'actions'];
 
   constructor(
     private legionDeploymentDataService: LegionDeploymentDataService,
+    private legionDeploymentService: LegionDeploymentService
   ) { }
 
   ngOnInit() {
@@ -28,4 +30,9 @@ export class LegionListComponent implements OnInit {
       }));
   }
 
+  private odahuAction(element: any, action: string) {
+    this.legionDeploymentService.odahuAction(element,  action).subscribe(v =>
+      this.legionDeploymentDataService.updateClasters()
+    );
+  }
 }
diff --git a/services/self-service/src/main/resources/webapp/src/app/core/services/applicationServiceFacade.service.ts b/services/self-service/src/main/resources/webapp/src/app/core/services/applicationServiceFacade.service.ts
index 413f525..5c4e6c9 100644
--- a/services/self-service/src/main/resources/webapp/src/app/core/services/applicationServiceFacade.service.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/core/services/applicationServiceFacade.service.ts
@@ -613,6 +613,12 @@ export class ApplicationServiceFacade {
         null);
     }
 
+  public odahuStartStop(data, params): Observable<any> {
+    return this.buildRequest(HTTPMethod.POST,
+      this.requestRegistry.Item(ApplicationServiceFacade.ODAHU) + `/${params}`,
+      data);
+  }
+
   private setupRegistry(): void {
     this.requestRegistry = new Dictionary<string>();
 
diff --git a/services/self-service/src/main/resources/webapp/src/app/core/services/legion-deployment.service.ts b/services/self-service/src/main/resources/webapp/src/app/core/services/legion-deployment.service.ts
index 8ff928a..1b0872e 100644
--- a/services/self-service/src/main/resources/webapp/src/app/core/services/legion-deployment.service.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/core/services/legion-deployment.service.ts
@@ -1,5 +1,5 @@
 import { Injectable } from '@angular/core';
-import {from, Observable} from "rxjs";
+import {Observable} from 'rxjs';
 import { map, catchError } from 'rxjs/operators';
 import { ApplicationServiceFacade } from './applicationServiceFacade.service';
 import { ErrorUtils } from '../util';
@@ -24,4 +24,12 @@ export class LegionDeploymentService {
         map(response => response),
         catchError(ErrorUtils.handleServiceError));
   }
+
+  public odahuAction(data, action) {
+    return this.applicationServiceFacade
+        .odahuStartStop(data, action)
+        .pipe(
+            map(response => response),
+            catchError(ErrorUtils.handleServiceError));
+  }
 }


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


[incubator-dlab] 02/03: Merge branch 'DLAB-1357' of github.com:apache/incubator-dlab into DLAB-1357

Posted by dg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 79a501862a506755e8e7ba1dfd992acef8333360
Merge: 248cb1c acdf862
Author: Dmytro Gnatyshyn <di...@ukr.net>
AuthorDate: Tue Jan 28 16:32:55 2020 +0200

    Merge branch 'DLAB-1357' of github.com:apache/incubator-dlab into DLAB-1357

 .../com/epam/dlab/dto/base/odahu/OdahuResult.java  |  1 -
 .../com/epam/dlab/dto/odahu/ActionOdahuDTO.java}   | 18 +++---
 .../response/handlers/OdahuCallbackHandler.java    |  7 ++-
 .../dlab/backendapi/resources/OdahuResource.java   | 23 ++++++-
 .../epam/dlab/backendapi/service/OdahuService.java |  7 +++
 .../backendapi/service/impl/OdahuServiceImpl.java  | 19 ++++++
 .../resources/mock_response/gcp/odahu_start.json   |  9 +++
 .../resources/mock_response/gcp/odahu_stop.json    |  9 +++
 .../mock_response/gcp/odahu_terminate.json         |  9 +++
 .../{CreateOdahuDTO.java => OdahuActionDTO.java}   |  2 +-
 .../dlab/backendapi/resources/OdahuResource.java   | 37 +++++++++--
 .../epam/dlab/backendapi/service/OdahuService.java | 10 ++-
 .../backendapi/service/impl/OdahuServiceImpl.java  | 73 ++++++++++++++++++----
 .../epam/dlab/backendapi/util/RequestBuilder.java  | 15 ++++-
 14 files changed, 203 insertions(+), 36 deletions(-)


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