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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
|
<cd-modal [modalRef]="activeModal">
<ng-container i18n
class="modal-title">Import Bootstrap Token</ng-container>
<ng-container class="modal-content">
<form name="importBootstrapForm"
class="form"
#formDir="ngForm"
[formGroup]="importBootstrapForm"
novalidate>
<div class="modal-body">
<p>
<ng-container i18n>To import a bootstrap token which was created
by a peer site cluster, provide the local site's name, select
which pools will have mirroring enabled, provide the generated
token, and click <kbd>Import</kbd>.</ng-container>
</p>
<div class="form-group">
<label class="col-form-label required"
for="siteName"
i18n>Site Name</label>
<input class="form-control"
type="text"
placeholder="Name..."
i18n-placeholder
id="siteName"
name="siteName"
formControlName="siteName"
autofocus>
<span *ngIf="importBootstrapForm.showError('siteName', formDir, 'required')"
class="invalid-feedback"
i18n>This field is required.</span>
</div>
<div class="form-group">
<label class="col-form-label"
for="direction">
<span i18n>Direction</span>
</label>
<select id="direction"
name="direction"
class="form-control"
formControlName="direction">
<option *ngFor="let direction of directions"
[value]="direction.key">{{ direction.desc }}</option>
</select>
</div>
<div class="form-group"
formGroupName="pools">
<label class="col-form-label required"
for="pools"
i18n>Pools</label>
<div class="custom-control custom-checkbox"
*ngFor="let pool of pools">
<input type="checkbox"
class="custom-control-input"
id="{{ pool.name }}"
name="{{ pool.name }}"
formControlName="{{ pool.name }}">
<label class="custom-control-label"
for="{{ pool.name }}">{{ pool.name }}</label>
</div>
<span *ngIf="importBootstrapForm.showError('pools', formDir, 'requirePool')"
class="invalid-feedback"
i18n>At least one pool is required.</span>
</div>
<div class="form-group">
<label class="col-form-label required"
for="token"
i18n>Token</label>
<textarea class="form-control resize-vertical"
placeholder="Generated token..."
i18n-placeholder
id="token"
formControlName="token">
</textarea>
<span *ngIf="importBootstrapForm.showError('token', formDir, 'required')"
class="invalid-feedback"
i18n>This field is required.</span>
<span *ngIf="importBootstrapForm.showError('token', formDir, 'invalidToken')"
class="invalid-feedback"
i18n>The token is invalid.</span>
</div>
</div>
<div class="modal-footer">
<cd-form-button-panel (submitActionEvent)="import()"
[form]="importBootstrapForm"
[submitText]="actionLabels.SUBMIT"></cd-form-button-panel>
</div>
</form>
</ng-container>
</cd-modal>
|