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/14 16:01:36 UTC

[incubator-dlab] branch develop updated: [DLAB-1446]: Fixed UI tasks for cloud endpoint API (#525)

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

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


The following commit(s) were added to refs/heads/develop by this push:
     new 16cf217  [DLAB-1446]: Fixed UI tasks for cloud endpoint API (#525)
16cf217 is described below

commit 16cf2171c27f1fa44e012e31f47a55843b93ba33
Author: Dmytro Gnatyshyn <42...@users.noreply.github.com>
AuthorDate: Tue Jan 14 18:01:26 2020 +0200

    [DLAB-1446]: Fixed UI tasks for cloud endpoint API (#525)
---
 .../webapp/src/app/reporting/reporting.component.ts  |  4 ++--
 .../resources-grid/resources-grid.component.ts       |  6 +++---
 .../src/app/shared/navbar/navbar.component.html      | 14 ++++++++++++--
 .../src/app/shared/navbar/navbar.component.scss      | 12 +++++++++---
 .../webapp/src/app/swagger/swagger.component.ts      | 20 +++++++++++++++++++-
 5 files changed, 45 insertions(+), 11 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 01126b9..63257d5 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
@@ -27,7 +27,7 @@ import { ToolbarComponent } from './toolbar/toolbar.component';
 
 import { FileUtils } from '../core/util';
 import { DICTIONARY, ReportingConfigModel } from '../../dictionary/global.dictionary';
-import {ProgressBarService} from "../core/services/progress-bar.service";
+import {ProgressBarService} from '../core/services/progress-bar.service';
 
 @Component({
   selector: 'dlab-reporting',
@@ -85,7 +85,7 @@ export class ReportingComponent implements OnInit, OnDestroy {
   }
 
   getGeneralBillingData() {
-    setTimeout(() => {this.progressBarService.startProgressBar()} , 0);
+    setTimeout(() => {this.progressBarService.startProgressBar();} , 0);
     this.billingReportService.getGeneralBillingData(this.reportData)
       .subscribe(data => {
         this.data = data;
diff --git a/services/self-service/src/main/resources/webapp/src/app/resources/resources-grid/resources-grid.component.ts b/services/self-service/src/main/resources/webapp/src/app/resources/resources-grid/resources-grid.component.ts
index 8c49782..d5fd324 100644
--- a/services/self-service/src/main/resources/webapp/src/app/resources/resources-grid/resources-grid.component.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/resources/resources-grid/resources-grid.component.ts
@@ -39,7 +39,7 @@ import { ConfirmationDialogComponent } from '../../shared/modal-dialog/confirmat
 import { SchedulerComponent } from '../scheduler';
 
 import { DICTIONARY } from '../../../dictionary/global.dictionary';
-import {ProgressBarService} from "../../core/services/progress-bar.service";
+import {ProgressBarService} from '../../core/services/progress-bar.service';
 
 @Component({
   selector: 'resources-grid',
@@ -96,7 +96,7 @@ export class ResourcesGridComponent implements OnInit {
   }
 
   public buildGrid(): void {
-    setTimeout(() => {this.progressBarService.startProgressBar()} , 0);
+    setTimeout(() => {this.progressBarService.startProgressBar(); } , 0);
     this.userResourceService.getUserProvisionedResources()
       .subscribe((result: any) => {
         this.environments = ExploratoryModel.loadEnvironments(result);
@@ -134,7 +134,7 @@ export class ResourcesGridComponent implements OnInit {
   }
 
   public isResourcesInProgress(notebook) {
-    let env = this.getResourceByName(notebook.name);
+    const env = this.getResourceByName(notebook.name);
 
     if (env && env.resources.length) {
       return env.resources.filter(item => (item.status !== 'failed' && item.status !== 'terminated'
diff --git a/services/self-service/src/main/resources/webapp/src/app/shared/navbar/navbar.component.html b/services/self-service/src/main/resources/webapp/src/app/shared/navbar/navbar.component.html
index 919dadb..9485a87 100644
--- a/services/self-service/src/main/resources/webapp/src/app/shared/navbar/navbar.component.html
+++ b/services/self-service/src/main/resources/webapp/src/app/shared/navbar/navbar.component.html
@@ -104,8 +104,18 @@
         <div>
           <a class="nav-item" [routerLink]="['/swagger']" [routerLinkActive]="['active']"
             [routerLinkActiveOptions]="{exact:true}">
-            <img class="swagger-logo" src="../../../assets/svg/swagger-logo.svg" alt="Swagger Logo">
-            <span *ngIf="isExpanded; else resources">Cloud endpoint API</span>
+            <span *ngIf="isExpanded; else endpoint">Cloud Endpoint API</span>
+            <ng-template #endpoint>
+              <span>
+                <svg width="30px" height="27px" viewBox="0 0 256 256" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" preserveAspectRatio="xMidYMid">
+                  <g>
+                    <path d="M127.059657,255.996921 C58.8506544,255.526472 -0.457073619,198.918442 0.00265506057,126.998303 C0.444649399,57.7958628 57.9516598,-0.468967577 129.11002,0.00284555012 C198.267128,0.462386081 256.613109,57.8667711 255.995136,128.194199 C256.568091,197.883453 197.934268,256.489189 127.059657,255.996921 Z M127.059657,255.996921 C58.8506544,255.526472 -0.457073619,198.918442 0.00265506057,126.998303 C0.444649399,57.7958628 57.9516598,-0.468967577 129.11002,0.0028 [...]
+                    <path id="swager-bgr" d="M127.184644,238.997327 C68.0323765,238.589271 16.6036091,189.498744 17.0023028,127.131428 C17.3860285,67.1185953 67.2554,16.5917106 128.963117,17.0024872 C188.934544,17.4010221 239.531905,67.1825241 238.995778,128.169251 C239.492444,188.602381 188.64743,239.424426 127.184644,238.997327 Z M127.184644,238.997327 C68.0323765,238.589271 16.6036091,189.498744 17.0023028,127.131428 C17.3860285,67.1185953 67.2554,16.5917106 128.963117,17.0024872 C188 [...]
+                    <path d="M169.327319,127.956161 C169.042723,133.246373 164.421106,137.639224 159.866213,136.872586 C159.844426,136.872586 159.821277,136.872586 159.798128,136.872586 C154.753021,136.879395 150.658383,132.794288 150.652936,127.749182 C150.824511,122.690458 155.019915,118.703395 160.08,118.789182 C165.125106,118.813692 169.59966,123.077182 169.327319,127.956161 Z M88.2011915,179.220161 C90.1034894,179.27599 92.0071489,179.235139 94.2008511,179.235139 L94.2008511,193.021 [...]
+                  </g>
+                </svg>
+              </span>
+            </ng-template>
           </a>
         </div>
       </nav>
diff --git a/services/self-service/src/main/resources/webapp/src/app/shared/navbar/navbar.component.scss b/services/self-service/src/main/resources/webapp/src/app/shared/navbar/navbar.component.scss
index 1219c22..fd1e8e9 100644
--- a/services/self-service/src/main/resources/webapp/src/app/shared/navbar/navbar.component.scss
+++ b/services/self-service/src/main/resources/webapp/src/app/shared/navbar/navbar.component.scss
@@ -182,6 +182,9 @@ a.nav-item {
     background: none !important;
     color: #36afd5 !important;
   }
+  &:not(.has-children):hover #swager-bgr{
+    fill: #36afd5;
+  }
 
   &:not(:last-child)::after {
     content: ' ';
@@ -196,6 +199,9 @@ a.nav-item {
 
   &.active {
     color: #36afd5 !important;
+    svg #swager-bgr {
+      fill: #36afd5;
+    }
   }
 
   &.has-children {
@@ -301,10 +307,10 @@ mat-sidenav {
       justify-content: space-between;
       flex-direction: column;
 
-      .swagger-logo {
-        vertical-align: middle;
-        width: 30px;
+      svg {
+        width: 37px;
         padding: 0 2px 0 5px;
+        vertical-align: middle;
       }
     }
   }
diff --git a/services/self-service/src/main/resources/webapp/src/app/swagger/swagger.component.ts b/services/self-service/src/main/resources/webapp/src/app/swagger/swagger.component.ts
index f555000..5c3c612 100644
--- a/services/self-service/src/main/resources/webapp/src/app/swagger/swagger.component.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/swagger/swagger.component.ts
@@ -18,6 +18,8 @@
  */
 
 import { Component, OnInit } from '@angular/core';
+import {HealthStatusService} from '../core/services';
+import {ToastrService} from 'ngx-toastr';
 
 declare const SwaggerUIBundle: any;
 
@@ -27,8 +29,16 @@ declare const SwaggerUIBundle: any;
   styleUrls: ['./swagger.component.scss']
 })
 export class SwaggerComponent implements OnInit {
+  private healthStatus: any;
+
+  constructor(
+    private healthStatusService: HealthStatusService,
+    public toastr: ToastrService,
+    ) {
+  }
 
   ngOnInit(): void {
+    this.getEnvironmentHealthStatus();
     const ui = SwaggerUIBundle({
       dom_id: '#swagger-ui',
       layout: 'BaseLayout',
@@ -42,4 +52,12 @@ export class SwaggerComponent implements OnInit {
     });
   }
 
-}
\ No newline at end of file
+  private getEnvironmentHealthStatus() {
+    this.healthStatusService.getEnvironmentHealthStatus().subscribe(
+      (result: any) => {
+        this.healthStatus = result;
+      },
+      error => this.toastr.error(error.message, 'Oops!'));
+  }
+
+}


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