blob: 1c02d736dbbaccbd2dff1d0610b57b59de479268 [file] [log] [blame]
<!--
~ Licensed to the Apache Software Foundation (ASF) under one
~ or more contributor license agreements. See the NOTICE file
~ distributed with this work for additional information
~ regarding copyright ownership. The ASF licenses this file
~ to you under the Apache License, Version 2.0 (the
~ "License"); you may not use this file except in compliance
~ with the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing,
~ software distributed under the License is distributed on an
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
~ KIND, either express or implied. See the License for the
~ specific language governing permissions and limitations
~ under the License.
-->
<modal-dialog #bindDialog modalClass="modal-lg">
<modal-header>
<h4 class="modal-title" id="myModalLabel">Create analytical tool</h4>
</modal-header>
<modal-content>
<div class="content-box">
<form [formGroup]="createExploratoryEnvironmentForm"
(submit)="createExploratoryEnvironment_btnClick($event, createExploratoryEnvironmentForm.value)"
*ngIf="createExploratoryEnvironmentForm" novalidate>
<div class="control-group">
<label class="label">Select template</label>
<div class="control">
<dropdown-list #templatesList (selectedItem)="onUpdate($event)"></dropdown-list>
</div>
<div *ngIf="model.exploratoryEnvironmentTemplates" class="mt-5">
<small *ngIf="model.exploratoryEnvironmentTemplates && model.exploratoryEnvironmentTemplates.length > 0 && !templateDescription">
{{ model.exploratoryEnvironmentTemplates[0].description }}
</small>
<small *ngIf="templateDescription">{{ templateDescription }}</small>
</div>
</div>
<div class="control-group" *ngIf="userImages && userImages.length > 0">
<label class="label">Select {{ DICTIONARY.image }}</label>
<div class="control">
<dropdown-list #imagesList (selectedItem)="selectImage($event)"></dropdown-list>
</div>
</div>
<div class="control-group">
<label class="label">Name</label>
<div class="control">
<input [class.danger_field]="notebookExist || !createExploratoryEnvironmentForm?.controls['environment_name'].valid
&& createExploratoryEnvironmentForm?.controls['environment_name'].dirty
&& createExploratoryEnvironmentForm?.controls['environment_name'].hasError('duplication')" type="text"
class="form-control" placeholder="Enter Name" formControlName="environment_name">
<span class="danger_color" *ngIf="createExploratoryEnvironmentForm?.controls['environment_name'].hasError('duplication')">This name already exists.</span>
<span class="danger_color" *ngIf="!createExploratoryEnvironmentForm?.controls.environment_name.valid
&& createExploratoryEnvironmentForm?.controls['environment_name'].dirty
&& !createExploratoryEnvironmentForm?.controls['environment_name'].hasError('duplication')">Name
<span *ngIf="DICTIONARY.cloud_provider !== 'aws'">cannot be longer than 10 characters and</span> can only contain letters, numbers, hyphens and '_' but can not end with special characters
</span>
</div>
</div>
<div class="control-group">
<label class="label">{{ DICTIONARY.notebook_instance_size }}</label>
<div class="control">
<dropdown-list #shapesList (selectedItem)="onUpdate($event)"></dropdown-list>
</div>
</div>
<div class="checkbox-group" *ngIf="model.selectedItem.image !== 'docker.dlab-zeppelin'; else not_support">
<label>
<input #configurationNode type="checkbox" (change)="selectConfiguration()" /> Spark configurations
</label>
<div class="config-details" [ngClass]="{ show: configuration?.nativeElement['checked'] || false }">
<textarea formControlName="configuration_parameters" placeholder="Cluster configuration template, JSON" data-gramm_editor="false"></textarea>
<span class="danger_color" *ngIf="!createExploratoryEnvironmentForm?.controls.configuration_parameters.valid && createExploratoryEnvironmentForm?.controls['configuration_parameters'].dirty">Configuration parameters is not in a valid format</span>
</div>
</div>
<ng-template #not_support>
<small>Spark default configuration for Apache Zeppelin can not be changed from DLab UI. Currently it can be done directly through Apache Zeppelin interpreter menu.
For more details please refer for Apache Zeppelin <a href="https://zeppelin.apache.org/docs/0.8.0/usage/interpreter/overview.html" target="_blank">official documentation</a>.
</small>
</ng-template>
<div class="text-center m-top-30">
<button mat-raised-button type="button" class="butt action" (click)="close()">Cancel</button>
<button mat-raised-button type="submit" [disabled]="!createExploratoryEnvironmentForm?.valid || !this.environment_shape" class="butt butt-success action">Create</button>
</div>
</form>
</div>
</modal-content>
</modal-dialog>