public exploratoryAction()

in services/self-service/src/main/resources/webapp/src/app/resources/resources-grid/resources-grid.component.ts [254:301]


  public exploratoryAction(data, action: string): void {
    const resource = this.getResourceByName(data.name, data.project);
    if (action === 'deploy') {
      this.dialog.open(ComputationalResourceCreateDialogComponent, { data:
        {
          notebook: resource,
          full_list: this.environments
        },
        panelClass: 'modal-xxl'
      })
        .afterClosed().subscribe((res) => {
        res && this.buildGrid();
      });
    } else if (action === 'run') {
      this.userResourceService
        .runExploratoryEnvironment({ notebook_instance_name: data.name, project_name: data.project })
        .subscribe(
          () => this.buildGrid(),
          error => this.toastr.error(error.message || 'Exploratory starting failed!', 'Oops!'));
    } else if (action === 'stop') {
      const compute =  data.resources.filter(cluster => cluster.status === 'running');
      this.dialog.open(ConfirmationDialogComponent,
        { data: { notebook: data, compute, type: ConfirmationDialogType.StopExploratory }, panelClass: 'modal-sm' })
        .afterClosed().subscribe((res) => {
        res && this.buildGrid();
      });
    } else if (action === 'terminate') {
      const compute =  data.resources.filter(cluster => cluster.status === 'running' || cluster.status === 'stopped');
      this.dialog.open(ConfirmationDialogComponent, { data:
        {
          notebook: data,
          compute,
          type: ConfirmationDialogType.TerminateExploratory
        },
        panelClass: 'modal-sm'
      })
        .afterClosed().subscribe((res) => res && this.buildGrid());
    } else if (action === 'install') {
      this.dialog.open(InstallLibrariesComponent, { data: data, panelClass: 'modal-fullscreen' })
        .afterClosed().subscribe((res) => res && this.buildGrid());
    } else if (action === 'schedule') {
      this.dialog.open(SchedulerComponent, { data: { notebook: data, type: 'EXPLORATORY' }, panelClass: 'modal-xl-s' })
        .afterClosed().subscribe((res) => res && this.buildGrid());
    } else if (action === 'ami') {
      this.dialog.open(AmiCreateDialogComponent, { data: data, panelClass: 'modal-sm' })
        .afterClosed().subscribe((res) => res && this.buildGrid());
    }
  }