blob: d60f504e094cc110ebcd355767b2dbd9db9915f7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
|
<!--
Copyright (C) 2019 CMCC, Inc. and others. All rights reserved.
Licensed 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.
-->
<nz-modal [(nzVisible)]="showModal" [nzTitle]="title" (nzOnCancel)="handleCancel()" (nzOnOk)="handleOk()" [nzFooter]="modalFooter"
nzWidth="648px" nzHeight="800px">
<form nz-form [formGroup]="validateForm">
<nz-form-item>
<nz-form-label [nzSpan]="8" nzFor="name" nzRequired>Knowledge Base Name</nz-form-label>
<nz-form-control [nzSpan]="12">
<input type="text" nz-input formControlName="name" maxlength="255" placeholder="Please input knowledge base name">
<nz-form-explain *ngIf="validateForm.get('name').dirty && validateForm.get('name').errors">
<ng-container *ngIf="validateForm.get('name').hasError('required')">
Please input knowledge base name!
</ng-container>
<ng-container *ngIf="validateForm.get('name').hasError('duplicated')">
{{ 'maas.nameDuplicateTip' | translate}}
</ng-container>
</nz-form-explain>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSpan]="8" nzFor="description">Knowledge Base Description</nz-form-label>
<nz-form-control [nzSpan]="12">
<textarea #textarea id="myTextarea" rows="2" nz-input formControlName="description" maxlength="255" (input)="maasService.updateCharCount(textarea,charCount)"></textarea>
<div #charCount id="charCount">0/255</div>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSpan]="8" nzFor="selectedOperator" nzRequired>Operator Name</nz-form-label>
<nz-form-control [nzSpan]="12">
<nz-select name="selectedOperator" nzPlaceHolder="Select Operator" formControlName="selectedOperator"
(ngModelChange)="handleOperatorChange($event)">
<nz-option *ngFor="let operator of operators" [nzValue]="operator"
[nzLabel]="operator.operatorName"></nz-option>
</nz-select>
<nz-form-explain
*ngIf="validateForm.get('selectedOperator').dirty && validateForm.get('selectedOperator').errors">Please
select operator!</nz-form-explain>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSpan]="8" nzFor="selectedPlatform" nzRequired>MaaS Platform Name</nz-form-label>
<nz-form-control [nzSpan]="12">
<nz-select nzPlaceHolder="Select MaaS" formControlName="selectedPlatform">
<nz-option *ngFor="let platform of filteredPlatforms" [nzValue]="platform"
[nzLabel]="platform.maaSPlatformName"></nz-option>
</nz-select>
<nz-form-explain
*ngIf="validateForm.get('selectedPlatform').dirty && validateForm.get('selectedPlatform').errors">Please
select maas platform!</nz-form-explain>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSpan]="8" nzFor="fileList" nzRequired>File Upload</nz-form-label>
<nz-form-control [nzSpan]="12">
<nz-upload [nzFileList]="fileList" [nzBeforeUpload]="beforeUpload" [nzRemove]="handleRemove">
<button nz-button>
<i class="anticon anticon-upload"></i>
<span>Select File</span>
</button>
</nz-upload>
<nz-form-explain class="error" *ngIf="validateForm.get('fileList').dirty && validateForm.get('fileList').errors">Please upload file!</nz-form-explain>
</nz-form-control>
</nz-form-item>
</form>
<ng-template #modalFooter>
<button nz-button nzType="default" (click)="handleCancel()">Cancel</button>
<button nz-button nzType="primary" (click)="handleOk()" [nzLoading]="loading">OK</button>
</ng-template>
</nz-modal>
|