Automatically hide ssh fields if bookmark does not have ssh config

This commit is contained in:
Dan Sosedoff 2016-01-20 20:10:17 -06:00
parent bd207a3551
commit eccb430a9b
3 changed files with 5 additions and 4 deletions

View File

@ -20,7 +20,7 @@ type Bookmark struct {
Password string `json:"password"` // User password
Database string `json:"database"` // Database name
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) {

File diff suppressed because one or more lines are too long

View File

@ -941,7 +941,7 @@ $(document).ready(function() {
$("#pg_db").val(item.database);
$("#connection_ssl").val(item.ssl);
if (item.ssh) {
if (Object.keys(item.ssh).length > 0) {
$("#ssh_host").val(item.ssh.host);
$("#ssh_port").val(item.ssh.port);
$("#ssh_user").val(item.ssh.user);
@ -953,6 +953,7 @@ $(document).ready(function() {
$("#ssh_port").val("");
$("#ssh_user").val("");
$("#ssh_password").val("");
$(".connection-ssh-group").hide();
}
});