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/04/02 17:52:57 UTC

[incubator-dlab] branch DLAB-1571 updated (41c26c1 -> 9d71130)

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

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


    from 41c26c1  Merge pull request #690 from apache/DLAB-1685
     new ce458a1  [DLAB-1491]: Fix page refresh
     new 9959aab  [DLAB-1491, 1682]: Fixed administrative page appear for user who has not permission,Fixed billing header
     new 9d71130  Merge remote-tracking branch 'origin/DLAB-1571' into DLAB-1571

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:
 .../administration/project/project.component.ts    |  3 +-
 .../reporting-grid/reporting-grid.component.html   |  2 +-
 .../reporting-grid/reporting-grid.component.scss   |  5 ++-
 .../reporting-grid/reporting-grid.component.ts     |  6 ++--
 .../src/app/reporting/reporting.component.ts       | 39 ++++++++++------------
 .../src/app/resources/resources.component.ts       | 14 ++++++--
 .../confirmation-dialog.model.ts                   | 16 +++++----
 7 files changed, 46 insertions(+), 39 deletions(-)


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


[incubator-dlab] 02/03: [DLAB-1491, 1682]: Fixed administrative page appear for user who has not permission, Fixed billing header

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

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

commit 9959aabd8de47f77469b652f78d742a726f023c6
Author: Dmytro Gnatyshyn <di...@ukr.net>
AuthorDate: Thu Apr 2 20:52:15 2020 +0300

    [DLAB-1491, 1682]: Fixed administrative page appear for user who has not permission,Fixed billing header
---
 .../src/app/administration/project/project.component.ts |  3 +--
 .../reporting-grid/reporting-grid.component.html        |  2 +-
 .../reporting-grid/reporting-grid.component.scss        |  5 ++++-
 .../reporting-grid/reporting-grid.component.ts          |  6 ++----
 .../webapp/src/app/reporting/reporting.component.ts     | 17 ++++++++---------
 .../confirmation-dialog/confirmation-dialog.model.ts    | 16 ++++++++++------
 6 files changed, 26 insertions(+), 23 deletions(-)

diff --git a/services/self-service/src/main/resources/webapp/src/app/administration/project/project.component.ts b/services/self-service/src/main/resources/webapp/src/app/administration/project/project.component.ts
index 9833a40..d9b855e 100644
--- a/services/self-service/src/main/resources/webapp/src/app/administration/project/project.component.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/administration/project/project.component.ts
@@ -124,8 +124,7 @@ export class ProjectComponent implements OnInit, OnDestroy {
     if ( action === 'terminate') {
       const projectsResources = this.resources
         .filter(resource => resource.project === data.project_name )[0].exploratory
-        .filter(expl => expl.status !== 'terminated' && expl.status !== 'terminating');
-
+        .filter(expl => expl.status !== 'terminated' && expl.status !== 'terminating' && expl.status !== 'failed');
       let termResources = [];
       data.endpoint.forEach(v => {
         termResources = [...termResources, ...projectsResources.filter(resource => resource.endpoint === v)];
diff --git a/services/self-service/src/main/resources/webapp/src/app/reporting/reporting-grid/reporting-grid.component.html b/services/self-service/src/main/resources/webapp/src/app/reporting/reporting-grid/reporting-grid.component.html
index 0eb86a4..b1392f3 100644
--- a/services/self-service/src/main/resources/webapp/src/app/reporting/reporting-grid/reporting-grid.component.html
+++ b/services/self-service/src/main/resources/webapp/src/app/reporting/reporting-grid/reporting-grid.component.html
@@ -208,7 +208,7 @@
     </ng-container>
     <ng-container matColumnDef="actions" stickyEnd>
       <th mat-header-cell *matHeaderCellDef>
-        <div class="actions">
+        <div class="actions th_charges">
           <button mat-icon-button class="btn reset" (click)="resetFiltering(); isFiltered = !isFiltered">
             <i class="material-icons">close</i>
           </button>
diff --git a/services/self-service/src/main/resources/webapp/src/app/reporting/reporting-grid/reporting-grid.component.scss b/services/self-service/src/main/resources/webapp/src/app/reporting/reporting-grid/reporting-grid.component.scss
index 1e8082b..cb0833c 100644
--- a/services/self-service/src/main/resources/webapp/src/app/reporting/reporting-grid/reporting-grid.component.scss
+++ b/services/self-service/src/main/resources/webapp/src/app/reporting/reporting-grid/reporting-grid.component.scss
@@ -67,6 +67,9 @@
     &.header-row {
       th {
         font-size: 11px;
+        .label{
+          padding-left: 0;
+        }
       }
     }
   }
@@ -116,7 +119,7 @@
   }
 
   .th_charges {
-    width: 8%;
+    width: 10%;
     min-width: 140px;
     padding-right: 15px;
     text-align: right;
diff --git a/services/self-service/src/main/resources/webapp/src/app/reporting/reporting-grid/reporting-grid.component.ts b/services/self-service/src/main/resources/webapp/src/app/reporting/reporting-grid/reporting-grid.component.ts
index 3d99814..159ed56 100644
--- a/services/self-service/src/main/resources/webapp/src/app/reporting/reporting-grid/reporting-grid.component.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/reporting/reporting-grid/reporting-grid.component.ts
@@ -18,9 +18,7 @@
  */
 
 import {Component, OnInit, Output, EventEmitter, ViewChild, Input} from '@angular/core';
-
-import { DICTIONARY, ReportingConfigModel } from '../../../dictionary/global.dictionary';
-import {logger} from 'codelyzer/util/logger';
+import { ReportingConfigModel } from '../../../dictionary/global.dictionary';
 
 @Component({
   selector: 'dlab-reporting-grid',
@@ -30,7 +28,6 @@ import {logger} from 'codelyzer/util/logger';
 
 })
 export class ReportingGridComponent implements OnInit {
-  readonly DICTIONARY = DICTIONARY;
 
   filterConfiguration: ReportingConfigModel;
   filteredReportData: ReportingConfigModel = new ReportingConfigModel([], [], [], [], [], '', '', '', []);
@@ -46,6 +43,7 @@ export class ReportingGridComponent implements OnInit {
   @Output() resetRangePicker: EventEmitter<boolean> = new EventEmitter();
   displayedColumns: string[] = ['name', 'user', 'project', 'type', 'status', 'shape', 'service', 'charge'];
   displayedFilterColumns: string[] = ['name-filter', 'user-filter', 'project-filter', 'type-filter', 'status-filter', 'shape-filter', 'service-filter', 'actions'];
+  filtered: any;
 
   ngOnInit() {}
 
diff --git a/services/self-service/src/main/resources/webapp/src/app/reporting/reporting.component.ts b/services/self-service/src/main/resources/webapp/src/app/reporting/reporting.component.ts
index 872c3a5..cd44999 100644
--- a/services/self-service/src/main/resources/webapp/src/app/reporting/reporting.component.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/reporting/reporting.component.ts
@@ -77,20 +77,14 @@ export class ReportingComponent implements OnInit, OnDestroy {
   ) { }
 
   ngOnInit() {
-    this.rebuildBillingReport();
+    this.getEnvironmentHealthStatus();
+    this.buildBillingReport();
   }
 
   ngOnDestroy() {
     this.clearStorage();
   }
 
-  initBilling() {
-    this.getEnvironmentHealthStatus();
-    if (this.admin) {
-      this.rebuildBillingReport();
-    }
-  }
-
   getGeneralBillingData() {
     setTimeout(() => {this.progressBarService.startProgressBar(); } , 0);
     this.billingReportService.getGeneralBillingData(this.reportData)
@@ -120,6 +114,11 @@ export class ReportingComponent implements OnInit, OnDestroy {
 
   rebuildBillingReport(): void {
     this.checkAutorize();
+    this.buildBillingReport();
+
+  }
+
+  buildBillingReport() {
     this.clearStorage();
     this.resetRangePicker();
     this.reportData.defaultConfigurations();
@@ -137,7 +136,7 @@ export class ReportingComponent implements OnInit, OnDestroy {
     this.billingReportService.downloadReport(this.reportData)
       .subscribe(
         data => FileUtils.downloadFile(data),
-        error => this.toastr.error('Billing report export failed!', 'Oops!'));
+        () => this.toastr.error('Billing report export failed!', 'Oops!'));
   }
 
   getDefaultFilterConfiguration(data): void {
diff --git a/services/self-service/src/main/resources/webapp/src/app/shared/modal-dialog/confirmation-dialog/confirmation-dialog.model.ts b/services/self-service/src/main/resources/webapp/src/app/shared/modal-dialog/confirmation-dialog/confirmation-dialog.model.ts
index 1bfcd06..9f92ef3 100644
--- a/services/self-service/src/main/resources/webapp/src/app/shared/modal-dialog/confirmation-dialog/confirmation-dialog.model.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/shared/modal-dialog/confirmation-dialog/confirmation-dialog.model.ts
@@ -70,15 +70,19 @@ export class ConfirmationDialogModel {
 
 
   private stopExploratory(): Observable<{}> {
-    return this.manageAction
-      ? this.manageEnvironmentsService.environmentManagement(this.notebook.user, 'stop', this.notebook.project, this.notebook.name)
-      : this.userResourceService.suspendExploratoryEnvironment(this.notebook, 'stop');
+    // return this.manageAction
+    //   ?
+      return this.manageEnvironmentsService.environmentManagement(this.notebook.user, 'stop', this.notebook.project, this.notebook.name);
+      // : this.userResourceService.suspendExploratoryEnvironment(this.notebook, 'stop');
   }
 
   private terminateExploratory(): Observable<{}> {
-    return this.manageAction
-      ? this.manageEnvironmentsService.environmentManagement(this.notebook.user, 'terminate', this.notebook.project,  this.notebook.name)
-      : this.userResourceService.suspendExploratoryEnvironment(this.notebook, 'terminate');
+    // return this.manageAction
+    //   ?
+      return this.manageEnvironmentsService.environmentManagement(
+        this.notebook.user, 'terminate', this.notebook.project,  this.notebook.name
+      );
+      // : this.userResourceService.suspendExploratoryEnvironment(this.notebook, 'terminate');
   }
 
   private stopEdgeNode(): Observable<{}> {


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


[incubator-dlab] 03/03: Merge remote-tracking branch 'origin/DLAB-1571' into DLAB-1571

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

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

commit 9d71130d1a63155500734318e119af5c87cdb15a
Merge: 9959aab 41c26c1
Author: Dmytro Gnatyshyn <di...@ukr.net>
AuthorDate: Thu Apr 2 20:52:42 2020 +0300

    Merge remote-tracking branch 'origin/DLAB-1571' into DLAB-1571

 .../src/general/lib/os/debian/ssn_lib.py           |  8 ++---
 .../com/epam/dlab/backendapi/roles/UserRoles.java  |  8 +++--
 .../service/impl/BillingServiceImpl.java           |  4 +--
 .../impl/InfrastructureInfoServiceImpl.java        | 34 ++++++++++++----------
 4 files changed, 31 insertions(+), 23 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-1491]: Fix page refresh

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

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

commit ce458a15a24833714565ea425e9b3dcce4c5f77c
Author: Dmytro Gnatyshyn <di...@ukr.net>
AuthorDate: Thu Apr 2 11:51:43 2020 +0300

    [DLAB-1491]: Fix page refresh
---
 .../src/app/reporting/reporting.component.ts       | 40 ++++++++++------------
 .../src/app/resources/resources.component.ts       | 14 ++++++--
 2 files changed, 29 insertions(+), 25 deletions(-)

diff --git a/services/self-service/src/main/resources/webapp/src/app/reporting/reporting.component.ts b/services/self-service/src/main/resources/webapp/src/app/reporting/reporting.component.ts
index 3d04931..872c3a5 100644
--- a/services/self-service/src/main/resources/webapp/src/app/reporting/reporting.component.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/reporting/reporting.component.ts
@@ -20,8 +20,7 @@
 
 import { Component, OnInit, OnDestroy, ViewChild } from '@angular/core';
 import { ToastrService } from 'ngx-toastr';
-
-import {BillingReportService, HealthStatusService} from '../core/services';
+import {ApplicationSecurityService, BillingReportService, HealthStatusService} from '../core/services';
 import { ReportingGridComponent } from './reporting-grid/reporting-grid.component';
 import { ToolbarComponent } from './toolbar/toolbar.component';
 
@@ -29,7 +28,6 @@ import { FileUtils } from '../core/util';
 import { DICTIONARY, ReportingConfigModel } from '../../dictionary/global.dictionary';
 import {ProgressBarService} from '../core/services/progress-bar.service';
 
-
 @Component({
   selector: 'dlab-reporting',
   template: `
@@ -75,16 +73,24 @@ export class ReportingComponent implements OnInit, OnDestroy {
     private healthStatusService: HealthStatusService,
     public toastr: ToastrService,
     private progressBarService: ProgressBarService,
+    private applicationSecurityService: ApplicationSecurityService,
   ) { }
 
   ngOnInit() {
-    this.getEnvironmentHealthStatus();
+    this.rebuildBillingReport();
   }
 
   ngOnDestroy() {
     this.clearStorage();
   }
 
+  initBilling() {
+    this.getEnvironmentHealthStatus();
+    if (this.admin) {
+      this.rebuildBillingReport();
+    }
+  }
+
   getGeneralBillingData() {
     setTimeout(() => {this.progressBarService.startProgressBar(); } , 0);
     this.billingReportService.getGeneralBillingData(this.reportData)
@@ -113,12 +119,20 @@ export class ReportingComponent implements OnInit, OnDestroy {
   }
 
   rebuildBillingReport(): void {
+    this.checkAutorize();
     this.clearStorage();
     this.resetRangePicker();
     this.reportData.defaultConfigurations();
     this.getGeneralBillingData();
   }
 
+  private checkAutorize() {
+    this.applicationSecurityService.isLoggedIn().subscribe( () => {
+        this.getEnvironmentHealthStatus();
+      }
+    );
+  }
+
   exportBillingReport(): void {
     this.billingReportService.downloadReport(this.reportData)
       .subscribe(
@@ -145,23 +159,6 @@ export class ReportingComponent implements OnInit, OnDestroy {
       if (item.shape && types.indexOf(item.shape)) {
         shapes.push(item.shape);
       }
-        // if (item.shapes.indexOf('Master') > -1) {
-        //   for (let shape of item.shapes.split('\n')) {
-        //     shape = shape.replace('Master: ', '');
-        //     shape = shape.replace(/Slave:\s+\d+ x /, '');
-        //     shape = shape.replace(/\s+/g, '');
-        //
-        //     shapes.indexOf(shape) === -1 && shapes.push(shape);
-        //   }
-        // } else if (item.shapes.match(/\d x \S+/)) {
-        //   const parsedShape = item.shapes.match(/\d x \S+/)[0].split(' x ')[1];
-        //   if (shapes.indexOf(parsedShape) === -1) {
-        //     shapes.push(parsedShape);
-        //   }
-        // } else {
-        //   shapes.indexOf(item.shapes) === -1 && shapes.push(item.shapes);
-        // }
-      // }
 
       if (item.product && services.indexOf(item.product) === -1)
         services.push(item.product);
@@ -199,7 +196,6 @@ export class ReportingComponent implements OnInit, OnDestroy {
       .subscribe((result: any) => {
         this.billingEnabled = result.billingEnabled;
         this.admin = result.admin;
-        this.rebuildBillingReport();
       });
   }
 }
diff --git a/services/self-service/src/main/resources/webapp/src/app/resources/resources.component.ts b/services/self-service/src/main/resources/webapp/src/app/resources/resources.component.ts
index bab05a7..c619ada 100644
--- a/services/self-service/src/main/resources/webapp/src/app/resources/resources.component.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/resources/resources.component.ts
@@ -24,7 +24,7 @@ import { MatDialog } from '@angular/material/dialog';
 import { ResourcesGridComponent } from './resources-grid/resources-grid.component';
 import { ExploratoryEnvironmentCreateComponent } from './exploratory/create-environment';
 import { Exploratory } from './resources-grid/resources-grid.model';
-import { HealthStatusService, ProjectService } from '../core/services';
+import {ApplicationSecurityService, HealthStatusService, ProjectService} from '../core/services';
 import { ManageUngitComponent } from './manage-ungit/manage-ungit.component';
 import { Project } from './../administration/project/project.component';
 
@@ -45,7 +45,8 @@ export class ResourcesComponent implements OnInit {
     public toastr: ToastrService,
     private healthStatusService: HealthStatusService,
     private dialog: MatDialog,
-    private projectService: ProjectService
+    private projectService: ProjectService,
+    private applicationSecurityService: ApplicationSecurityService
   ) { }
 
   ngOnInit() {
@@ -62,7 +63,7 @@ export class ResourcesComponent implements OnInit {
   public refreshGrid(): void {
     this.resourcesGrid.buildGrid();
     this.getProjects();
-    this.getEnvironmentHealthStatus();
+    this.checkAutorize();
     this.exploratoryEnvironments = this.resourcesGrid.environments;
   }
 
@@ -93,6 +94,13 @@ export class ResourcesComponent implements OnInit {
     this.projectService.getUserProjectsList().subscribe((projects: any) => this.projects = projects);
   }
 
+  private checkAutorize() {
+   this.applicationSecurityService.isLoggedIn().subscribe( () => {
+     this.getEnvironmentHealthStatus();
+     }
+   );
+  }
+
 
   private getEnvironmentHealthStatus() {
     this.healthStatusService.getEnvironmentHealthStatus().subscribe(


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