1+ < mat-form-field appearance ="outline " class ="connectForm__hostname credentials-fieldset__1-3-columns ">
2+ < mat-label > Hostname</ mat-label >
3+ < input matInput name ="hostname " #hostname ="ngModel "
4+ data-testid ="connection-hostname-input "
5+ angulartics2On ="change "
6+ angularticsAction ="Connection creds {{ connection.id ? 'edit' : 'add' }}: hostname is edited "
7+ required hostnameValidator
8+ [readonly] ="readonly "
9+ [disabled] ="submitting "
10+ [(ngModel)] ="connection.host ">
11+ < mat-hint >
12+ E.g. < strong > < code > my-test-db.cvfuxe8nltiq.us-east-2.rds.amazonaws.com</ code > </ strong >
13+ < br />
14+ Connections from internal IPs (e.g. localhost) are not supported
15+ </ mat-hint >
16+
17+ < mat-error *ngIf ="hostname.errors?.isLocalhost && hostname.invalid ">
18+ To connect a database to an internal IP, use something like < strong > Pinggy</ strong >
19+ (< a [href] ="tunnelingServiceLink " target ="_blank " class ="credentials-fieldset__hint-link "> here's a guide</ a > ),
20+ or < button type ="button " (click) ="switchToAgent.emit() " class ="credentials-fieldset__hint-button "> click here</ button > to connect through an agent
21+ </ mat-error >
22+ < mat-error *ngIf ="hostname.errors?.isInvalidHostname && hostname.invalid "> Hostname is invalid</ mat-error >
23+ </ mat-form-field >
24+
25+ < mat-form-field appearance ="outline " class ="connectForm__port ">
26+ < mat-label > Port</ mat-label >
27+ < input matInput type ="number " name ="port " #port ="ngModel "
28+ data-testid ="connection-port-input "
29+ angulartics2On ="change "
30+ angularticsAction ="Connection creds {{ connection.id ? 'edit' : 'add' }}: port is edited "
31+ required
32+ [readonly] ="readonly "
33+ [disabled] ="submitting "
34+ [(ngModel)] ="connection.port ">
35+ < mat-error *ngIf ="port.errors?.required && (port.invalid && port.touched) "> Port should not be empty</ mat-error >
36+ </ mat-form-field >
37+
38+ < mat-form-field appearance ="outline " class ="credentials-fieldset__1-2-columns ">
39+ < mat-label > Username</ mat-label >
40+ < input matInput name ="username " #username ="ngModel "
41+ data-testid ="connection-username-input "
42+ angulartics2On ="change "
43+ angularticsAction ="Connection creds {{ connection.id ? 'edit' : 'add' }}: username is edited "
44+ required
45+ [readonly] ="readonly "
46+ [disabled] ="submitting "
47+ [(ngModel)] ="connection.username ">
48+ < mat-error *ngIf ="username.errors?.required && (username.invalid && username.touched) "> Username should not be empty</ mat-error >
49+ </ mat-form-field >
50+
51+ < mat-form-field appearance ="outline " class ="credentials-fieldset__3-4-columns ">
52+ < mat-label > Password</ mat-label >
53+ < input type ="password " matInput name ="password " #password ="ngModel "
54+ data-testid ="connection-password-input "
55+ angulartics2On ="change "
56+ angularticsAction ="Connection creds {{ connection.id ? 'edit' : 'add' }}: password is edited "
57+ [required] ="!connection.id || hostname.touched || port.touched "
58+ [readonly] ="readonly "
59+ [disabled] ="submitting "
60+ [(ngModel)] ="connection.password ">
61+ < mat-hint *ngIf ="connection.id && (hostname.pristine && port.pristine) "> To keep password the same keep this field blank</ mat-hint >
62+ < mat-hint *ngIf ="connection.id && (hostname.dirty || port.dirty) "> Password needed due to hostname/port change</ mat-hint >
63+ <!-- <mat-error *ngIf="email.errors.required && (email.invalid && email.touched)">Email should not be empty</mat-error> -->
64+ </ mat-form-field >
65+
66+ < mat-form-field appearance ="outline " class ="credentials-fieldset__1-4-columns ">
67+ < mat-label > Database Name</ mat-label >
68+ < input matInput name ="database " #database ="ngModel "
69+ data-testid ="connection-database-input "
70+ angulartics2On ="change "
71+ angularticsAction ="Connection creds {{ connection.id ? 'edit' : 'add' }}: database name is edited "
72+ required
73+ [readonly] ="readonly "
74+ [disabled] ="submitting "
75+ [(ngModel)] ="connection.database ">
76+ < mat-error *ngIf ="database.errors?.required && (database.invalid && database.touched) "> Name should not be empty</ mat-error >
77+ </ mat-form-field >
78+
79+ < mat-expansion-panel class ="credentials-fieldset__1-4-columns ">
80+ < mat-expansion-panel-header data-testid ="connection-advanced-settings-expansion-panel-header ">
81+ < mat-panel-title >
82+ Advanced settings
83+ </ mat-panel-title >
84+ </ mat-expansion-panel-header >
85+
86+ < div class ="advanced-settings ">
87+ < app-master-encryption-password
88+ class ="advanced-settings__fullLine "
89+ [masterKey] ="masterKey "
90+ [disabled] ="accessLevel === 'readonly' || submitting || connection?.isTestConnection "
91+ (onMasterKeyChange) ="handleMasterKeyChange($event) ">
92+ </ app-master-encryption-password >
93+
94+ < mat-checkbox class ="checkbox-line advanced-settings__fullLine " name ="ssh " #ssh ="ngModel "
95+ data-testid ="connection-ssh-checkbox "
96+ labelPosition ="after "
97+ angulartics2On ="click "
98+ angularticsAction ="Connection creds {{ connection.id ? 'edit' : 'add' }}: SSH is switched "
99+ [angularticsProperties] ="{'enable': connection.ssh} "
100+ [disabled] ="submitting || connection.isTestConnection "
101+ [(ngModel)] ="connection.ssh ">
102+ Use SSH tunnel
103+ </ mat-checkbox >
104+
105+ < mat-form-field *ngIf ="connection.ssh " appearance ="outline " floatLabel ="always " class ="advanced-settings__fullLine ">
106+ < mat-label > Private SSH key</ mat-label >
107+ < textarea matInput resizeToFitContent rows ="8 " name ="privateSSHKey " #privateSSHKey ="ngModel "
108+ placeholder ="Sensitive — write-only field "
109+ data-testid ="connection-ssh-key-textarea "
110+ angulartics2On ="change "
111+ angularticsAction ="Connection creds {{ connection.id ? 'edit' : 'add' }}: SSH key is edited "
112+ [required] ="connection.ssh && !connection.id " [readonly] ="accessLevel === 'readonly' && connection.id "
113+ [disabled] ="submitting "
114+ [(ngModel)] ="connection.privateSSHKey "
115+ > </ textarea >
116+ < mat-error *ngIf ="privateSSHKey.errors?.required && (privateSSHKey.invalid && privateSSHKey.touched) "> Private SSH key should not be empty</ mat-error >
117+ </ mat-form-field >
118+
119+ < mat-form-field *ngIf ="connection.ssh " appearance ="outline ">
120+ < mat-label > SSH host</ mat-label >
121+ < input matInput name ="sshHost " #sshHost ="ngModel "
122+ data-testid ="connection-ssh-host-input "
123+ angulartics2On ="change "
124+ angularticsAction ="Connection creds {{ connection.id ? 'edit' : 'add' }}: SSH host is edited "
125+ [required] ="connection.ssh " [readonly] ="accessLevel === 'readonly' && connection.id "
126+ [disabled] ="submitting "
127+ [(ngModel)] ="connection.sshHost ">
128+ < mat-error *ngIf ="sshHost.errors?.required && (sshHost.invalid && sshHost.touched) "> SSH host should not be empty</ mat-error >
129+ </ mat-form-field >
130+
131+ < mat-form-field *ngIf ="connection.ssh " appearance ="outline ">
132+ < mat-label > SSH port</ mat-label >
133+ < input matInput type ="number " name ="sshPort " #sshPort ="ngModel "
134+ data-testid ="connection-ssh-port-input "
135+ angulartics2On ="change "
136+ angularticsAction ="Connection creds {{ connection.id ? 'edit' : 'add' }}: SSH port is edited "
137+ [required] ="connection.ssh " [readonly] ="accessLevel === 'readonly' && connection.id "
138+ [disabled] ="submitting "
139+ [(ngModel)] ="connection.sshPort ">
140+ < mat-error *ngIf ="sshPort.errors?.required && (sshPort.invalid && sshPort.touched) "> SSH port should not be empty</ mat-error >
141+ </ mat-form-field >
142+
143+ < mat-form-field *ngIf ="connection.ssh " appearance ="outline " floatLabel ="always ">
144+ < mat-label > SSH username</ mat-label >
145+ < input matInput name ="sshUsername " #sshUsername ="ngModel "
146+ placeholder ="Sensitive — write-only field "
147+ data-testid ="connection-ssh-username-input "
148+ angulartics2On ="change "
149+ angularticsAction ="Connection creds {{ connection.id ? 'edit' : 'add' }}: SSH username is edited "
150+ [required] ="connection.ssh " [readonly] ="accessLevel === 'readonly' && connection.id "
151+ [disabled] ="submitting "
152+ [(ngModel)] ="connection.sshUsername ">
153+ < mat-error *ngIf ="sshUsername.errors?.required && (sshUsername.invalid && sshUsername.touched) "> SSH username should not be empty</ mat-error >
154+ </ mat-form-field >
155+
156+ < mat-checkbox class ="checkbox-line advanced-settings__fullLine " name ="ssl " #ssh ="ngModel "
157+ labelPosition ="after "
158+ data-testid ="connection-ssl-checkbox "
159+ angulartics2On ="click "
160+ angularticsAction ="Connection creds {{ connection.id ? 'edit' : 'add' }}: SSL is switched "
161+ [angularticsProperties] ="{'enable': connection.ssl} "
162+ [disabled] ="submitting || connection.isTestConnection "
163+ [(ngModel)] ="connection.ssl ">
164+ Check SSL certificate
165+ </ mat-checkbox >
166+
167+ < mat-form-field *ngIf ="connection.ssl " appearance ="outline " class ="advanced-settings__fullLine ">
168+ < mat-label > SSL certificate</ mat-label >
169+ < textarea matInput resizeToFitContent rows ="8 " name ="sslCert " #sslCert ="ngModel "
170+ data-testid ="connection-ssl-certificate-textarea "
171+ angulartics2On ="change "
172+ angularticsAction ="Connection creds {{ connection.id ? 'edit' : 'add' }}: SSL certificate is edited "
173+ [required] ="connection.ssl " [readonly] ="accessLevel === 'readonly' && connection.id "
174+ [disabled] ="submitting "
175+ [(ngModel)] ="connection.cert "
176+ > </ textarea >
177+ < mat-error *ngIf ="sslCert.errors?.required && (sslCert.invalid && sslCert.touched) "> SSL certificate should not be empty</ mat-error >
178+ </ mat-form-field >
179+ </ div >
180+ </ mat-expansion-panel >
0 commit comments