Allow setting ssh connection key file, fix connection ui
This commit is contained in:
@@ -14,14 +14,14 @@ import (
|
||||
)
|
||||
|
||||
type Bookmark struct {
|
||||
Url string `json:"url"` // Postgres connection URL
|
||||
Host string `json:"host"` // Server hostname
|
||||
Port int `json:"port"` // Server port
|
||||
User string `json:"user"` // Database user
|
||||
Password string `json:"password"` // User password
|
||||
Database string `json:"database"` // Database name
|
||||
Ssl string `json:"ssl"` // Connection SSL mode
|
||||
Ssh shared.SSHInfo `json:"ssh"` // SSH tunnel config
|
||||
Url string `json:"url"` // Postgres connection URL
|
||||
Host string `json:"host"` // Server hostname
|
||||
Port int `json:"port"` // Server port
|
||||
User string `json:"user"` // Database user
|
||||
Password string `json:"password"` // User password
|
||||
Database string `json:"database"` // Database name
|
||||
Ssl string `json:"ssl"` // Connection SSL mode
|
||||
Ssh *shared.SSHInfo `json:"ssh"` // SSH tunnel config
|
||||
}
|
||||
|
||||
func (b Bookmark) SSHInfoIsEmpty() bool {
|
||||
@@ -71,6 +71,10 @@ func readServerConfig(path string) (Bookmark, error) {
|
||||
bookmark.Ssl = "disable"
|
||||
}
|
||||
|
||||
if bookmark.Ssh != nil && bookmark.Ssh.Port == "" {
|
||||
bookmark.Ssh.Port = "22"
|
||||
}
|
||||
|
||||
return bookmark, err
|
||||
}
|
||||
|
||||
|
||||
@@ -95,12 +95,12 @@ func Test_GetBookmark(t *testing.T) {
|
||||
}
|
||||
|
||||
func Test_Bookmark_SSHInfoIsEmpty(t *testing.T) {
|
||||
emptySSH := shared.SSHInfo{
|
||||
emptySSH := &shared.SSHInfo{
|
||||
Host: "",
|
||||
Port: "",
|
||||
User: "",
|
||||
}
|
||||
populatedSSH := shared.SSHInfo{
|
||||
populatedSSH := &shared.SSHInfo{
|
||||
Host: "localhost",
|
||||
Port: "8080",
|
||||
User: "postgres",
|
||||
|
||||
Reference in New Issue
Block a user