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/02/18 14:26:35 UTC

[incubator-dlab] branch DLAB-1541 updated: [DLAB-1541]: Changed routes on UI

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

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


The following commit(s) were added to refs/heads/DLAB-1541 by this push:
     new 349897e  [DLAB-1541]: Changed routes on UI
349897e is described below

commit 349897eadd9b8efdec7c14908d5e3023fc87dc68
Author: Dmytro Gnatyshyn <di...@ukr.net>
AuthorDate: Tue Feb 18 16:26:09 2020 +0200

    [DLAB-1541]: Changed routes on UI
---
 .../services/dataengineConfiguration.service.ts    | 16 +++++++--------
 .../core/services/librariesInstallation.service.ts | 12 +++++------
 .../src/app/core/services/scheduler.service.ts     |  8 ++++----
 .../src/app/core/services/userResource.service.ts  |  6 +++---
 .../cluster-details/cluster-details.component.ts   |  4 ++--
 .../computational-resources-list.component.ts      |  2 +-
 .../ami-create-dialog.component.ts                 |  3 ++-
 .../detail-dialog/detail-dialog.component.ts       |  4 ++--
 .../install-libraries.component.ts                 |  4 ++--
 .../install-libraries/install-libraries.model.ts   |  9 ++++++---
 .../app/resources/scheduler/scheduler.component.ts | 23 +++++++++++-----------
 .../src/app/resources/scheduler/scheduler.model.ts | 12 +++++------
 12 files changed, 54 insertions(+), 49 deletions(-)

diff --git a/services/self-service/src/main/resources/webapp/src/app/core/services/dataengineConfiguration.service.ts b/services/self-service/src/main/resources/webapp/src/app/core/services/dataengineConfiguration.service.ts
index fe61c75..5d35eec 100644
--- a/services/self-service/src/main/resources/webapp/src/app/core/services/dataengineConfiguration.service.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/core/services/dataengineConfiguration.service.ts
@@ -28,8 +28,8 @@ import { ErrorUtils } from '../util';
 export class DataengineConfigurationService {
   constructor(private applicationServiceFacade: ApplicationServiceFacade) {}
 
-  public getClusterConfiguration(exploratory, cluster, provider): Observable<{}> {
-    const url = `/${exploratory}/${cluster}/config`;
+  public getClusterConfiguration(project, exploratory, cluster, provider): Observable<{}> {
+    const url = `/${project}/${exploratory}/${cluster}/config`;
     return this.applicationServiceFacade
       .buildGetClusterConfiguration(url, provider)
       .pipe(
@@ -37,8 +37,8 @@ export class DataengineConfigurationService {
         catchError(ErrorUtils.handleServiceError));
   }
 
-  public editClusterConfiguration(data, exploratory, cluster, provider): Observable<{}> {
-    const url = `/dataengine/${exploratory}/${cluster}/config`;
+  public editClusterConfiguration(data, project, exploratory, cluster, provider): Observable<{}> {
+    const url = `/dataengine/${project}/${exploratory}/${cluster}/config`;
     return this.applicationServiceFacade
       .buildEditClusterConfiguration(url, data, provider)
       .pipe(
@@ -46,8 +46,8 @@ export class DataengineConfigurationService {
         catchError(ErrorUtils.handleServiceError));
   }
 
-  public getExploratorySparkConfiguration(exploratory): Observable<{}> {
-    const url = `/${exploratory}/cluster/config`;
+  public getExploratorySparkConfiguration(project, exploratory): Observable<{}> {
+    const url = `/${project}/${exploratory}/cluster/config`;
     return this.applicationServiceFacade
       .buildGetExploratorySparkConfiguration(url)
       .pipe(
@@ -55,8 +55,8 @@ export class DataengineConfigurationService {
         catchError(ErrorUtils.handleServiceError));
   }
 
-  public editExploratorySparkConfiguration(data, exploratory): Observable<{}> {
-    const url = `/${exploratory}/reconfigure`;
+  public editExploratorySparkConfiguration(data, project, exploratory): Observable<{}> {
+    const url = `/${project}/${exploratory}/reconfigure`;
     return this.applicationServiceFacade
       .buildEditExploratorySparkConfiguration(url, data)
       .pipe(
diff --git a/services/self-service/src/main/resources/webapp/src/app/core/services/librariesInstallation.service.ts b/services/self-service/src/main/resources/webapp/src/app/core/services/librariesInstallation.service.ts
index d4f8942..2119b1a 100644
--- a/services/self-service/src/main/resources/webapp/src/app/core/services/librariesInstallation.service.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/core/services/librariesInstallation.service.ts
@@ -28,8 +28,8 @@ import { ApplicationServiceFacade } from './applicationServiceFacade.service';
 export class LibrariesInstallationService {
   constructor(private applicationServiceFacade: ApplicationServiceFacade) {}
 
-  public getGroupsList(exploratory, computational?): Observable<Response> {
-    let body = `?exploratory_name=${exploratory}`;
+  public getGroupsList(project, exploratory, computational?): Observable<Response> {
+    let body = `?project_name=${project}&exploratory_name=${exploratory}`;
     if (computational) body += `&computational_name=${computational}`;
 
     return this.applicationServiceFacade
@@ -65,8 +65,8 @@ export class LibrariesInstallationService {
         catchError(ErrorUtils.handleServiceError));
   }
 
-  public getInstalledLibrariesList(exploratory): Observable<{}> {
-    const body = `?exploratory_name=${exploratory}`;
+  public getInstalledLibrariesList(project, exploratory): Observable<{}> {
+    const body = `?project_name=${project}&exploratory_name=${exploratory}`;
 
     return this.applicationServiceFacade
       .buildGetInstalledLibrariesList(body)
@@ -75,8 +75,8 @@ export class LibrariesInstallationService {
         catchError(ErrorUtils.handleServiceError));
   }
 
-  public getInstalledLibsByResource(exploratory, computational?): Observable<{}> {
-    let body = `?exploratory_name=${exploratory}`;
+  public getInstalledLibsByResource(project, exploratory, computational?): Observable<{}> {
+    let body = `?project_name=${project}&exploratory_name=${exploratory}`;
     if (computational) body += `&computational_name=${computational}`;
 
     return this.applicationServiceFacade
diff --git a/services/self-service/src/main/resources/webapp/src/app/core/services/scheduler.service.ts b/services/self-service/src/main/resources/webapp/src/app/core/services/scheduler.service.ts
index c595486..a854305 100644
--- a/services/self-service/src/main/resources/webapp/src/app/core/services/scheduler.service.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/core/services/scheduler.service.ts
@@ -29,8 +29,8 @@ import { ScheduleSchema } from '../../resources/scheduler/scheduler.model';
 export class SchedulerService {
   constructor(private applicationServiceFacade: ApplicationServiceFacade) {}
 
-  public getExploratorySchedule(notebook, resource?): Observable<{}> {
-    const param = resource ? `/${notebook}/${resource}` : `/${notebook}`;
+  public getExploratorySchedule(project, notebook, resource?): Observable<{}> {
+    const param = resource ? `/${project}/${notebook}/${resource}` : `/${project}/${notebook}`;
     return this.applicationServiceFacade
       .buildGetExploratorySchedule(param)
       .pipe(
@@ -38,8 +38,8 @@ export class SchedulerService {
         catchError(ErrorUtils.handleServiceError));
   }
 
-  public setExploratorySchedule(notebook, data, resource?): Observable<ScheduleSchema> {
-    const param = resource ? `/${notebook}/${resource}` : `/${notebook}`;
+  public setExploratorySchedule(project, notebook, data, resource?): Observable<ScheduleSchema> {
+    const param = resource ? `/${project}/${notebook}/${resource}` : `/${project}/${notebook}`;
     return this.applicationServiceFacade
       .buildSetExploratorySchedule(param, data)
       .pipe(
diff --git a/services/self-service/src/main/resources/webapp/src/app/core/services/userResource.service.ts b/services/self-service/src/main/resources/webapp/src/app/core/services/userResource.service.ts
index a41bd29..c69959f 100644
--- a/services/self-service/src/main/resources/webapp/src/app/core/services/userResource.service.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/core/services/userResource.service.ts
@@ -81,7 +81,7 @@ export class UserResourceService {
   }
 
   public suspendExploratoryEnvironment(notebook: any, action): Observable<{}> {
-    const url = '/' + notebook.name + '/' + action;
+    const url = '/' + notebook.project + '/' + notebook.name + '/' + action;
 
     return this.applicationServiceFacade
       .buildSuspendExploratoryEnvironmentRequest(JSON.stringify(url))
@@ -108,8 +108,8 @@ export class UserResourceService {
         catchError(ErrorUtils.handleServiceError));
   }
 
-  public suspendComputationalResource(notebookName: string, computationalResourceName: string, provider: string): Observable<{}> {
-    const body = JSON.stringify('/' + notebookName + '/' + computationalResourceName + '/terminate');
+  public suspendComputationalResource(projectName: string, notebookName: string, computationalResourceName: string, provider: string): Observable<{}> {
+    const body = JSON.stringify('/' + projectName + '/' + notebookName + '/' + computationalResourceName + '/terminate');
     return this.applicationServiceFacade
       .buildDeleteComputationalResourcesRequest(body, provider)
       .pipe(
diff --git a/services/self-service/src/main/resources/webapp/src/app/resources/computational/cluster-details/cluster-details.component.ts b/services/self-service/src/main/resources/webapp/src/app/resources/computational/cluster-details/cluster-details.component.ts
index 75ea01e..11002e1 100644
--- a/services/self-service/src/main/resources/webapp/src/app/resources/computational/cluster-details/cluster-details.component.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/resources/computational/cluster-details/cluster-details.component.ts
@@ -91,14 +91,14 @@ export class DetailComputationalResourcesComponent implements OnInit {
 
   public getClusterConfiguration(): void {
     this.dataengineConfigurationService
-      .getClusterConfiguration(this.environment.name, this.resource.computational_name, this.PROVIDER)
+      .getClusterConfiguration(this.environment.project, this.environment.name, this.resource.computational_name, this.PROVIDER)
       .subscribe((result: any) => this.config = result,
         error => this.toastr.error(error.message || 'Configuration loading failed!', 'Oops!'));
   }
 
   public editClusterConfiguration(data): void {
     this.dataengineConfigurationService
-      .editClusterConfiguration(data.configuration_parameters, this.environment.name, this.resource.computational_name, this.PROVIDER)
+      .editClusterConfiguration(data.configuration_parameters, this.environment.project, this.environment.name, this.resource.computational_name, this.PROVIDER)
       .subscribe(result => {
         this.dialogRef.close();
       },
diff --git a/services/self-service/src/main/resources/webapp/src/app/resources/computational/computational-resources-list/computational-resources-list.component.ts b/services/self-service/src/main/resources/webapp/src/app/resources/computational/computational-resources-list/computational-resources-list.component.ts
index f7bfa1d..7bc5126 100644
--- a/services/self-service/src/main/resources/webapp/src/app/resources/computational/computational-resources-list/computational-resources-list.component.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/resources/computational/computational-resources-list/computational-resources-list.component.ts
@@ -60,7 +60,7 @@ export class ComputationalResourcesListComponent {
             });
         } else if (result && action === 'terminate') {
           this.userResourceService
-            .suspendComputationalResource(this.environment.name, resource.computational_name, this.environment.cloud_provider)
+            .suspendComputationalResource(this.environment.project, this.environment.name, resource.computational_name, this.environment.cloud_provider)
             .subscribe(() => {
               this.rebuildGrid();
             });
diff --git a/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/ami-create-dialog/ami-create-dialog.component.ts b/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/ami-create-dialog/ami-create-dialog.component.ts
index ff17382..0ec266e 100644
--- a/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/ami-create-dialog/ami-create-dialog.component.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/ami-create-dialog/ami-create-dialog.component.ts
@@ -66,7 +66,8 @@ export class AmiCreateDialogComponent implements OnInit {
     this.createAMIForm = this._fb.group({
       name: ['', [Validators.required, Validators.pattern(this.namePattern), this.providerMaxLength, this.checkDuplication.bind(this)]],
       description: [''],
-      exploratory_name: [this.notebook.name]
+      exploratory_name: [this.notebook.name],
+      project_name: [this.notebook.project]
     });
   }
 
diff --git a/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/detail-dialog/detail-dialog.component.ts b/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/detail-dialog/detail-dialog.component.ts
index 1fa43ca..db097f3 100644
--- a/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/detail-dialog/detail-dialog.component.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/detail-dialog/detail-dialog.component.ts
@@ -76,7 +76,7 @@ export class DetailDialogComponent implements OnInit {
 
   public getClusterConfiguration(): void {
     this.dataengineConfigurationService
-      .getExploratorySparkConfiguration(this.notebook.name)
+      .getExploratorySparkConfiguration(this.notebook.project, this.notebook.name)
       .subscribe(
         (result: any) => this.config = result,
         error => this.toastr.error(error.message || 'Configuration loading failed!', 'Oops!'));
@@ -95,7 +95,7 @@ export class DetailDialogComponent implements OnInit {
 
   public editClusterConfiguration(data): void {
     this.dataengineConfigurationService
-      .editExploratorySparkConfiguration(data.configuration_parameters, this.notebook.name)
+      .editExploratorySparkConfiguration(data.configuration_parameters, this.notebook.project, this.notebook.name)
       .subscribe(result => {
         this.dialogRef.close();
       },
diff --git a/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/install-libraries/install-libraries.component.ts b/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/install-libraries/install-libraries.component.ts
index 05956a3..7bfc2c1 100644
--- a/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/install-libraries/install-libraries.component.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/install-libraries/install-libraries.component.ts
@@ -104,7 +104,7 @@ export class InstallLibrariesComponent implements OnInit, OnDestroy {
   }
 
   uploadLibGroups(): void {
-    this.librariesInstallationService.getGroupsList(this.notebook.name, this.model.computational_name)
+    this.librariesInstallationService.getGroupsList(this.notebook.project, this.notebook.name, this.model.computational_name)
       .subscribe(
         response => {
           this.libsUploadingStatus(response);
@@ -268,7 +268,7 @@ export class InstallLibrariesComponent implements OnInit, OnDestroy {
   }
 
   private getInstalledLibsByResource() {
-    this.librariesInstallationService.getInstalledLibsByResource(this.notebook.name, this.model.computational_name)
+    this.librariesInstallationService.getInstalledLibsByResource(this.notebook.project, this.notebook.name, this.model.computational_name)
       .subscribe((data: any) => this.destination.libs = data);
   }
 
diff --git a/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/install-libraries/install-libraries.model.ts b/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/install-libraries/install-libraries.model.ts
index 6d0369e..c47673b 100644
--- a/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/install-libraries/install-libraries.model.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/resources/exploratory/install-libraries/install-libraries.model.ts
@@ -56,7 +56,8 @@ export class InstallLibrariesModel {
   }
 
   public getLibrariesList(group: string, query: string): Observable<{}> {
-    let lib_query: any = {
+    const lib_query: any = {
+      project_name: this.notebook.project,
       exploratory_name: this.notebook.name,
       group: group,
       start_with: query
@@ -75,12 +76,14 @@ export class InstallLibrariesModel {
 
   public getInstalledLibrariesList(notebook): Observable<{}> {
     return this.librariesInstallationService.getInstalledLibrariesList(
-      notebook.name
+      notebook.project, notebook.name
     );
   }
 
   private installLibraries(retry?: Library, item?): Observable<{}> {
-    let lib_list: any = {
+    console.log(this.notebook.project);
+    const lib_list: any = {
+      project_name: this.notebook.project,
       exploratory_name: this.notebook.name,
       libs: retry ? retry : this.selectedLibs
     };
diff --git a/services/self-service/src/main/resources/webapp/src/app/resources/scheduler/scheduler.component.ts b/services/self-service/src/main/resources/webapp/src/app/resources/scheduler/scheduler.component.ts
index 20b8ce5..0df2a59 100644
--- a/services/self-service/src/main/resources/webapp/src/app/resources/scheduler/scheduler.component.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/resources/scheduler/scheduler.component.ts
@@ -88,7 +88,7 @@ export class SchedulerComponent implements OnInit {
 
   public open(notebook, type, resource?): void {
     this.notebook = notebook;
-
+    console.log(this.notebook)
     this.zones = _moment.tz.names()
       .map(item => [_moment.tz(item).format('Z'), item])
       .sort()
@@ -116,11 +116,11 @@ export class SchedulerComponent implements OnInit {
 
         if (this.destination.type === 'СOMPUTATIONAL') {
           this.allowInheritView = true;
-          this.getExploratorySchedule(this.notebook.name, this.destination.computational_name);
+          this.getExploratorySchedule(this.notebook.project, this.notebook.name, this.destination.computational_name);
           this.checkParentInherit();
         } else if (this.destination.type === 'EXPLORATORY') {
           this.allowInheritView = this.checkIsActiveSpark();
-          this.getExploratorySchedule(this.notebook.name);
+          this.getExploratorySchedule(this.notebook.project, this.notebook.name);
         }
       },
       this.schedulerService
@@ -139,7 +139,7 @@ export class SchedulerComponent implements OnInit {
     this.inherit = $event.checked;
 
     if (this.destination.type === 'СOMPUTATIONAL' && this.inherit) {
-      this.getExploratorySchedule(this.notebook.name);
+      this.getExploratorySchedule(this.notebook.project, this.notebook.name);
       this.schedulerForm.get('startDate').disable();
     } else {
       this.schedulerForm.get('startDate').enable();
@@ -248,18 +248,19 @@ export class SchedulerComponent implements OnInit {
     };
 
     if (this.destination.type === 'СOMPUTATIONAL') {
-      this.model.confirmAction(this.notebook.name, parameters, this.destination.computational_name);
+      this.model.confirmAction(this.notebook.project, this.notebook.name, parameters, this.destination.computational_name);
     } else {
       parameters['consider_inactivity'] = this.considerInactivity;
-      this.model.confirmAction(this.notebook.name, parameters);
+      this.model.confirmAction(this.notebook.project, this.notebook.name, parameters);
     }
   }
 
   private setScheduleByInactivity() {
+    console.log(this.notebook)
     const data = { sync_start_required: this.parentInherit, check_inactivity_required: this.enableIdleTime, max_inactivity: this.schedulerForm.controls.inactivityTime.value };
     (this.destination.type === 'СOMPUTATIONAL')
-      ? this.setInactivity(this.notebook.name, data, this.destination.computational_name)
-      : this.setInactivity(this.notebook.name, { ...data, consider_inactivity: this.considerInactivity });
+      ? this.setInactivity(this.notebook.project, this.notebook.name, data, this.destination.computational_name)
+      : this.setInactivity(this.notebook.project, this.notebook.name, { ...data, consider_inactivity: this.considerInactivity });
   }
 
   private formInit(start?: string, end?: string, terminate?: string) {
@@ -272,8 +273,8 @@ export class SchedulerComponent implements OnInit {
     });
   }
 
-  private getExploratorySchedule(resource, resource2?) {
-    this.schedulerService.getExploratorySchedule(resource, resource2).subscribe(
+  private getExploratorySchedule(project, resource, resource2?) {
+    this.schedulerService.getExploratorySchedule(project, resource, resource2).subscribe(
       (params: ScheduleSchema) => {
         if (params) {
           params.start_days_repeat.filter(key => (this.selectedStartWeekDays[key.toLowerCase()] = true));
@@ -302,7 +303,7 @@ export class SchedulerComponent implements OnInit {
   }
 
   private checkParentInherit() {
-    this.schedulerService.getExploratorySchedule(this.notebook.name)
+    this.schedulerService.getExploratorySchedule(this.notebook.project, this.notebook.name)
       .subscribe((res: any) => this.parentInherit = res.sync_start_required);
   }
 
diff --git a/services/self-service/src/main/resources/webapp/src/app/resources/scheduler/scheduler.model.ts b/services/self-service/src/main/resources/webapp/src/app/resources/scheduler/scheduler.model.ts
index f83be29..c0093ee 100644
--- a/services/self-service/src/main/resources/webapp/src/app/resources/scheduler/scheduler.model.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/resources/scheduler/scheduler.model.ts
@@ -61,13 +61,13 @@ export class SchedulerModel {
     if (this.continueWith) this.continueWith();
   }
 
-  private scheduleInstance(notebook, params, resourse) {
-    return this.schedulerService.setExploratorySchedule(notebook, params, resourse);
+  private scheduleInstance(project, notebook, params, resourse) {
+    return this.schedulerService.setExploratorySchedule(project, notebook, params, resourse);
   }
 
   public setInactivityTime(params) {
-    const [notebook, data, resource] = params;
-    return this.scheduleInstance(notebook, data, resource);
+    const [project, notebook, data, resource] = params;
+    return this.scheduleInstance(project, notebook, data, resource);
   }
 
   public resetSchedule(notebook, resourse) {
@@ -75,8 +75,8 @@ export class SchedulerModel {
   }
 
   private prepareModel(fnProcessResults: any, fnProcessErrors: any): void {
-    this.confirmAction = (notebook, data, resourse?) =>
-      this.scheduleInstance(notebook, data, resourse).subscribe(
+    this.confirmAction = (project, notebook, data, resourse?) =>
+      this.scheduleInstance(project, notebook, data, resourse).subscribe(
         response => fnProcessResults(response),
         error => fnProcessErrors(error)
       );


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