Automatically hide ssh fields if bookmark does not have ssh config
This commit is contained in:
parent
bd207a3551
commit
eccb430a9b
@ -20,7 +20,7 @@ type Bookmark struct {
|
|||||||
Password string `json:"password"` // User password
|
Password string `json:"password"` // User password
|
||||||
Database string `json:"database"` // Database name
|
Database string `json:"database"` // Database name
|
||||||
Ssl string `json:"ssl"` // Connection SSL mode
|
Ssl string `json:"ssl"` // Connection SSL mode
|
||||||
Ssh shared.SSHInfo `json:"ssh,omitempty"`
|
Ssh shared.SSHInfo `json:"ssh"` // SSH tunnel config
|
||||||
}
|
}
|
||||||
|
|
||||||
func readServerConfig(path string) (Bookmark, error) {
|
func readServerConfig(path string) (Bookmark, error) {
|
||||||
|
File diff suppressed because one or more lines are too long
@ -941,7 +941,7 @@ $(document).ready(function() {
|
|||||||
$("#pg_db").val(item.database);
|
$("#pg_db").val(item.database);
|
||||||
$("#connection_ssl").val(item.ssl);
|
$("#connection_ssl").val(item.ssl);
|
||||||
|
|
||||||
if (item.ssh) {
|
if (Object.keys(item.ssh).length > 0) {
|
||||||
$("#ssh_host").val(item.ssh.host);
|
$("#ssh_host").val(item.ssh.host);
|
||||||
$("#ssh_port").val(item.ssh.port);
|
$("#ssh_port").val(item.ssh.port);
|
||||||
$("#ssh_user").val(item.ssh.user);
|
$("#ssh_user").val(item.ssh.user);
|
||||||
@ -953,6 +953,7 @@ $(document).ready(function() {
|
|||||||
$("#ssh_port").val("");
|
$("#ssh_port").val("");
|
||||||
$("#ssh_user").val("");
|
$("#ssh_user").val("");
|
||||||
$("#ssh_password").val("");
|
$("#ssh_password").val("");
|
||||||
|
$(".connection-ssh-group").hide();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user