Added more information to the 'Database connected/disconnected' message. Fixes #4943.

pull/27/head
Karan Takalkar 2019-12-12 11:12:18 +05:30 committed by Akshay Joshi
parent 9bda583d5b
commit 53f418b9a2
3 changed files with 15 additions and 3 deletions

View File

@ -18,4 +18,5 @@ Bug fixes
*********
| `Issue #4506 <https://redmine.postgresql.org/issues/4506>`_ - Fix an issue where clicking on an empty textbox like fill factor or comments, considers it as change and enabled the save button.
| `Issue #4943 <https://redmine.postgresql.org/issues/4943>`_ - Added more information to the 'Database connected/disconnected' message.
| `Issue #5004 <https://redmine.postgresql.org/issues/5004>`_ - Fix vulnerability issues reported by 'yarn audit'. Replace the deprecated uglifyjs-webpack-plugin with a terser-webpack-plugin.

View File

@ -30,6 +30,7 @@ from pgadmin.utils.ajax import make_json_response, \
make_response as ajax_response, internal_server_error, unauthorized
from pgadmin.utils.driver import get_driver
from pgadmin.tools.sqleditor.utils.query_history import QueryHistory
from pgadmin.model import Server
class DatabaseModule(CollectionNodeModule):
@ -468,7 +469,9 @@ class DatabaseView(PGChildNodeView):
info=_("Database connected."),
data={
'icon': 'pg-icon-database',
'connected': True
'connected': True,
'info_prefix': '{0}/{1}'.
format(Server.query.filter_by(id=sid)[0].name, conn.db)
}
)
@ -478,7 +481,7 @@ class DatabaseView(PGChildNodeView):
# Release Connection
from pgadmin.utils.driver import get_driver
manager = get_driver(PG_DEFAULT_DRIVER).connection_manager(sid)
conn = manager.connection(did=did, auto_reconnect=True)
status = manager.release(did=did)
if not status:
@ -489,7 +492,9 @@ class DatabaseView(PGChildNodeView):
info=_("Database disconnected."),
data={
'icon': 'icon-database-not-connected',
'connected': False
'connected': False,
'info_prefix': '{0}/{1}'.
format(Server.query.filter_by(id=sid)[0].name, conn.db)
}
)

View File

@ -200,6 +200,9 @@ define('pgadmin.node.database', [
.done(function(res) {
if (res.success == 1) {
var prv_i = t.parent(i);
if(res.data.info_prefix) {
res.info = `${_.escape(res.data.info_prefix)} - ${res.info}`;
}
Alertify.success(res.info);
t.removeIcon(i);
data.connected = false;
@ -519,6 +522,9 @@ define('pgadmin.node.database', [
data.icon = res.data.icon;
tree.addIcon(item, {icon: data.icon});
}
if(res.data.info_prefix) {
res.info = `${_.escape(res.data.info_prefix)} - ${res.info}`;
}
Alertify.success(res.info);
obj.trigger('connected', obj, item, data);