1931220f7518a8a7c3ef70db9cdead4c15a63b77
[usecase-ui.git] /
1 <!--
2     Copyright (C) 2019 CMCC, Inc. and others. All rights reserved.
3
4     Licensed under the Apache License, Version 2.0 (the "License");
5     you may not use this file except in compliance with the License.
6     You may obtain a copy of the License at
7
8             http://www.apache.org/licenses/LICENSE-2.0
9
10     Unless required by applicable law or agreed to in writing, software
11     distributed under the License is distributed on an "AS IS" BASIS,
12     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13     See the License for the specific language governing permissions and
14     limitations under the License.
15 -->
16 <nz-modal [(nzVisible)]="showModal" [nzTitle]="title" (nzOnCancel)="handleCancel()" (nzOnOk)="handleOk()"
17   nzWidth="648px" nzHeight="800px">
18   <form nz-form [formGroup]="validateForm" (ngSubmit)="submitForm()">
19     <nz-form-item>
20       <nz-form-label [nzSpan]="8" nzFor="name" nzRequired>Knowledge Base Name</nz-form-label>
21       <nz-form-control [nzSpan]="12">
22         <input type="text" nz-input formControlName="name" placeholder="Please input knowledge base name">
23         <nz-form-explain *ngIf="validateForm.get('name').dirty && validateForm.get('name').errors">
24           Please input knowledge base name!
25         </nz-form-explain>
26       </nz-form-control>
27     </nz-form-item>
28     <nz-form-item>
29       <nz-form-label [nzSpan]="8" nzFor="description">Knowledge Base Description</nz-form-label>
30       <nz-form-control [nzSpan]="12">
31         <textarea rows="2" nz-input formControlName="description"></textarea>
32       </nz-form-control>
33     </nz-form-item>
34     <nz-form-item>
35       <nz-form-label [nzSpan]="8" nzFor="selectedOperator" nzRequired>Operator Name</nz-form-label>
36       <nz-form-control [nzSpan]="12">
37         <nz-select name="selectedOperator" nzPlaceHolder="Select Operator" formControlName="selectedOperator"
38           (ngModelChange)="handleOperatorChange($event)">
39           <nz-option *ngFor="let operator of operators" [nzValue]="operator"
40             [nzLabel]="operator.operatorName"></nz-option>
41         </nz-select>
42         <nz-form-explain
43           *ngIf="validateForm.get('selectedOperator').dirty && validateForm.get('selectedOperator').errors">Please
44           select operator!</nz-form-explain>
45       </nz-form-control>
46     </nz-form-item>
47     <nz-form-item>
48       <nz-form-label [nzSpan]="8" nzFor="selectedPlatform" nzRequired>MaaS Platform Name</nz-form-label>
49       <nz-form-control [nzSpan]="12">
50         <nz-select nzPlaceHolder="Select MaaS" formControlName="selectedPlatform">
51           <nz-option *ngFor="let platform of filteredPlatforms" [nzValue]="platform"
52             [nzLabel]="platform.maaSPlatformName"></nz-option>
53         </nz-select>
54         <nz-form-explain
55           *ngIf="validateForm.get('selectedPlatform').dirty && validateForm.get('selectedPlatform').errors">Please
56           select maas platform!</nz-form-explain>
57       </nz-form-control>
58     </nz-form-item>
59     <nz-form-item>
60       <nz-form-label [nzSpan]="8" nzFor="fileList" nzRequired>File Upload</nz-form-label>
61       <nz-form-control [nzSpan]="12">
62         <nz-upload [(nzFileList)]="fileList" [nzBeforeUpload]="beforeUpload">
63           <button nz-button>
64             <i class="anticon anticon-upload"></i>
65             <span>Select File</span>
66           </button>
67         </nz-upload>
68       </nz-form-control>
69     </nz-form-item>
70   </form>
71 </nz-modal>