You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datalab.apache.org by dg...@apache.org on 2021/02/19 12:59:45 UTC

[incubator-datalab] 01/04: Fix odahu requests

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

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

commit 114160210874f52e19b1c2fbd545514cddc8c989
Author: Dmytro_Gnatyshyn <di...@ukr.net>
AuthorDate: Fri Feb 19 11:15:37 2021 +0200

    Fix odahu requests
---
 .../create-odahu-claster/create-odahu-cluster.component.ts  | 13 ++++++++-----
 .../src/app/administration/odahu/odahu-data.service.ts      |  5 +----
 .../webapp/src/app/administration/odahu/odahu.component.ts  |  2 +-
 .../src/main/resources/webapp/src/app/app.routing.module.ts |  8 ++++----
 .../app/core/services/applicationServiceFacade.service.ts   |  3 +++
 .../webapp/src/app/shared/navbar/navbar.component.html      | 10 +++++-----
 6 files changed, 22 insertions(+), 19 deletions(-)

diff --git a/services/self-service/src/main/resources/webapp/src/app/administration/odahu/create-odahu-claster/create-odahu-cluster.component.ts b/services/self-service/src/main/resources/webapp/src/app/administration/odahu/create-odahu-claster/create-odahu-cluster.component.ts
index 20e84b4..4010e78 100644
--- a/services/self-service/src/main/resources/webapp/src/app/administration/odahu/create-odahu-claster/create-odahu-cluster.component.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/administration/odahu/create-odahu-claster/create-odahu-cluster.component.ts
@@ -66,13 +66,16 @@ export class CreateOdahuClusterComponent implements OnInit {
   }
 
   public setEndpoints(project): void {
+    console.log(project);
+    console.log(this.data);
     this.endpoints = project.endpoints
-      .filter(e => e.status === 'RUNNING' && !this.data.some(odahu => odahu.status !== 'FAILED'
-        && odahu.status !== 'TERMINATED'
-        && odahu.endpoint === e.name
-        && odahu.project === project.name)
-      )
+      // .filter(e => e.status === 'RUNNING' && !this.data.some(odahu => odahu.status !== 'FAILED'
+      //   && odahu.status !== 'TERMINATED'
+      //   && odahu.endpoint === e.name
+      //   && odahu.project === project.name)
+      // )
       .map(e => e.name);
+    console.log(project.endpoints);
   }
 
   private initFormModel(): void {
diff --git a/services/self-service/src/main/resources/webapp/src/app/administration/odahu/odahu-data.service.ts b/services/self-service/src/main/resources/webapp/src/app/administration/odahu/odahu-data.service.ts
index d8a30a6..1875cc1 100644
--- a/services/self-service/src/main/resources/webapp/src/app/administration/odahu/odahu-data.service.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/administration/odahu/odahu-data.service.ts
@@ -3,10 +3,7 @@ import {BehaviorSubject, Observable} from 'rxjs';
 import {OdahuDeploymentService} from '../../core/services';
 
 
-@Injectable({
-  providedIn: 'root'
-})
-
+@Injectable()
 export class OdahuDataService {
   _odahuClasters = new BehaviorSubject<any>(null);
 
diff --git a/services/self-service/src/main/resources/webapp/src/app/administration/odahu/odahu.component.ts b/services/self-service/src/main/resources/webapp/src/app/administration/odahu/odahu.component.ts
index 642b311..f591452 100644
--- a/services/self-service/src/main/resources/webapp/src/app/administration/odahu/odahu.component.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/administration/odahu/odahu.component.ts
@@ -3,7 +3,7 @@ import {OdahuDataService} from './odahu-data.service';
 import {Subscription} from 'rxjs';
 import {MatDialog} from '@angular/material/dialog';
 import {ToastrService} from 'ngx-toastr';
-import {CreateOdahuClusterComponent} from './create-odahu-claster/create-odahu-cluster.component';
+import {CreateOdahuClusterComponent} from './create-odahu-claster';
 import {HealthStatusService, OdahuDeploymentService} from '../../core/services';
 
 export interface OdahuCluster {
diff --git a/services/self-service/src/main/resources/webapp/src/app/app.routing.module.ts b/services/self-service/src/main/resources/webapp/src/app/app.routing.module.ts
index f25f5ae..0387a34 100644
--- a/services/self-service/src/main/resources/webapp/src/app/app.routing.module.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/app.routing.module.ts
@@ -64,10 +64,10 @@ const routes: Routes = [{
       canActivate: [AuthorizationGuard, AdminGuard],
     },
      {
-    //   path: 'odahu',
-    //   component: OdahuComponent,
-    //   canActivate: [AuthorizationGuard, AdminGuard],
-    // }, {
+      path: 'odahu',
+      component: OdahuComponent,
+      canActivate: [AuthorizationGuard, AdminGuard],
+    }, {
       path: 'roles',
       component: RolesComponent,
       canActivate: [AuthorizationGuard, AdminGuard],
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 86374b0..7d91013 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
@@ -779,6 +779,9 @@ export class ApplicationServiceFacade {
     this.requestRegistry.Add(ApplicationServiceFacade.ENDPOINT, '/api/endpoint');
     this.requestRegistry.Add(ApplicationServiceFacade.ENDPOINT_CONNECTION, '/api/endpoint/url/');
 
+    //Odahu
+    this.requestRegistry.Add(ApplicationServiceFacade.ODAHU, '/api/odahu');
+
     // audit
     this.requestRegistry.Add(ApplicationServiceFacade.AUDIT, '/api/audit');
 
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 931fb4a..648d41d 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
@@ -88,11 +88,11 @@
               <span *ngIf="isExpanded; else projects">Projects</span>
               <ng-template #projects><i class="material-icons">dns</i></ng-template>
             </a>
-<!--            <a class="sub-nav-item" [style.margin-left.px]="isExpanded ? '30' : '0'" [routerLink]="['/odahu']"-->
-<!--               [routerLinkActive]="['active']" [routerLinkActiveOptions]="{exact:true}">-->
-<!--              <span *ngIf="isExpanded; else odahu">Odahu deployment</span>-->
-<!--              <ng-template #odahu><i class="material-icons">get_app</i></ng-template>-->
-<!--            </a>-->
+            <a class="sub-nav-item" [style.margin-left.px]="isExpanded ? '30' : '0'" [routerLink]="['/odahu']"
+               [routerLinkActive]="['active']" [routerLinkActiveOptions]="{exact:true}">
+              <span *ngIf="isExpanded; else odahu">Odahu deployment</span>
+              <ng-template #odahu><i class="material-icons">get_app</i></ng-template>
+            </a>
             <a class="sub-nav-item" [style.margin-left.px]="isExpanded ? '30' : '0'"
               [routerLink]="['/environment_management']" [routerLinkActive]="['active']"
               [routerLinkActiveOptions]="{exact:true}">


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