Add some default connection parameters.

pull/3/head
Dave Page 2016-03-10 15:58:17 +00:00
parent 17ed27fbcd
commit f95b9f06ca
2 changed files with 9 additions and 4 deletions

View File

@ -22,7 +22,7 @@ import pgadmin.browser.server_groups as sg
from pgadmin.utils.crypto import encrypt
from config import PG_DEFAULT_DRIVER
from pgadmin.browser.server_groups.servers.types import ServerType
import config
def has_any(data, keys):
"""
@ -535,11 +535,16 @@ class ServerNode(PGChildNodeView):
This property defines (if javascript) exists for this node.
Override this property for your own logic.
"""
username = 'postgres'
if config.SERVER_MODE is True:
username = current_user.email.split('@')[0]
return make_response(
render_template(
"servers/servers.js",
server_types=ServerType.types(),
_=gettext
_=gettext,
username=username,
),
200, {'Content-Type': 'application/x-javascript'}
)

View File

@ -141,8 +141,8 @@ function($, _, S, pgAdmin, pgBrowser, alertify) {
sslmode: 'prefer',
host: null,
port: 5432,
db: null,
username: null,
db: 'postgres',
username: '{{ username }}',
role: null
},
schema: [{