1 <cd-modal [modalRef]="activeModal">
2 <ng-container i18n="form title"
3 class="modal-title">{{ action | titlecase }} Cluster
5 <ng-container class="modal-content">
6 <form name="remoteClusterForm"
8 [formGroup]="remoteClusterForm">
9 <div class="modal-body">
10 <cd-alert-panel *ngIf="connectionVerified !== undefined && !connectionVerified && connectionMessage !== 'Connection refused'"
13 i18n>{{ connectionMessage }}
15 <cd-alert-panel *ngIf="connectionVerified !== undefined && connectionVerified"
18 i18n>{{ connectionMessage }}
20 <div class="form-group row">
21 <label class="cd-col-form-label required"
22 for="remoteClusterUrl"
26 <p>Enter the Dashboard API URL. You can retrieve it from the CLI with: <b>{{ clusterApiUrlCmd }} </b>
27 <cd-copy-2-clipboard-button [source]="clusterApiUrlCmd"
28 [byId]="false"></cd-copy-2-clipboard-button>
33 <div class="cd-col-form-input">
34 <input class="form-control"
36 placeholder="https://localhost:4202"
38 name="remoteClusterUrl"
39 formControlName="remoteClusterUrl">
40 <span class="invalid-feedback"
41 *ngIf="remoteClusterForm.showError('remoteClusterUrl', frm, 'required')"
42 i18n>This field is required.
44 <span class="invalid-feedback"
45 *ngIf="remoteClusterForm.showError('remoteClusterUrl', frm, 'endpoint')"
46 i18n>Please enter a valid URL.
48 <span class="invalid-feedback"
49 *ngIf="remoteClusterForm.showError('remoteClusterUrl', frm, 'hubUrlCheck')"
50 i18n>The hub cluster cannot be connected.
54 <div class="form-group row">
55 <label class="cd-col-form-label required"
59 <div class="cd-col-form-input">
60 <input id="clusterAlias"
64 placeholder="Name/Text to uniquely identify cluster"
65 formControlName="clusterAlias">
66 <span class="invalid-feedback"
67 *ngIf="remoteClusterForm.showError('clusterAlias', frm, 'required')"
68 i18n>This field is required.
70 <span class="invalid-feedback"
71 *ngIf="remoteClusterForm.showError('clusterAlias', frm, 'uniqueName')"
72 i18n>The chosen alias name is already in use.
76 <div class="form-group row"
77 *ngIf="action !== 'edit'">
78 <label class="cd-col-form-label required"
82 <div class="cd-col-form-input">
87 formControlName="username">
88 <span class="invalid-feedback"
89 *ngIf="remoteClusterForm.showError('username', frm, 'required')"
90 i18n>This field is required.
92 <span class="invalid-feedback"
93 *ngIf="remoteClusterForm.showError('username', frm, 'uniqueUrlandUser')"
94 i18n>A cluster with the chosen user is already connected.
98 <div class="form-group row"
99 *ngIf="action !== 'edit'">
100 <label class="cd-col-form-label required"
104 <div class="cd-col-form-input">
105 <div class="input-group">
110 formControlName="password">
111 <span class="input-group-button">
112 <button type="button"
113 class="btn btn-light"
114 cdPasswordButton="password">
116 <cd-copy-2-clipboard-button source="password">
117 </cd-copy-2-clipboard-button>
119 <span class="invalid-feedback"
120 *ngIf="remoteClusterForm.showError('password', frm, 'required')"
121 i18n>This field is required.
126 <div class="form-group row"
127 *ngIf="action !== 'edit'">
128 <label class="cd-col-form-label"
130 i18n>Login Expiration</label>
131 <div class="cd-col-form-input">
132 <select class="form-select"
134 formControlName="ttl"
136 <option value="1">1 day</option>
137 <option value="7">1 week</option>
139 [selected]="true">15 days</option>
140 <option value="30">30 days</option>
145 <div class="form-group row"
146 *ngIf="action !== 'edit'">
147 <label class="cd-col-form-label required"
151 <div class="cd-col-form-input">
156 formControlName="apiToken">
157 <span class="invalid-feedback"
158 *ngIf="remoteClusterForm.showError('apiToken', frm, 'required')"
159 i18n>This field is required.</span>
162 <div class="form-group row"
163 *ngIf="action !== 'edit'">
164 <div class="cd-col-form-offset">
165 <div class="custom-control custom-checkbox">
166 <input class="custom-control-input"
169 [checked]="showToken"
170 (change)="toggleToken()"
171 formControlName="showToken">
172 <label class="custom-control-label"
174 i18n>Auth with token</label>
179 <div class="form-group row">
180 <div class="cd-col-form-offset">
181 <div class="custom-control custom-checkbox">
182 <input class="custom-control-input"
185 formControlName="ssl">
186 <label class="custom-control-label"
194 <div *ngIf="remoteClusterForm.controls.ssl.value"
195 class="form-group row">
196 <label class="cd-col-form-label"
198 <span i18n>Certificate</span>
199 <cd-helper i18n>The SSL certificate in PEM format.</cd-helper>
201 <div class="cd-col-form-input">
202 <textarea id="ssl_cert"
203 class="form-control resize-vertical text-monospace text-pre"
204 formControlName="ssl_cert"
208 (change)="fileUpload($event.target.files, 'ssl_cert')">
209 <span class="invalid-feedback"
210 *ngIf="remoteClusterForm.showError('ssl_cert', frm, 'required')"
211 i18n>This field is required.</span>
212 <span class="invalid-feedback"
213 *ngIf="remoteClusterForm.showError('ssl_cert', frm, 'pattern')"
214 i18n>Invalid SSL certificate.</span>
218 <div class="modal-footer">
219 <cd-form-button-panel (submitActionEvent)="onSubmit()"
220 [submitText]="(action | titlecase) + ' ' + 'Cluster'"
221 [form]="remoteClusterForm">
222 </cd-form-button-panel>