Fixed issue 'Reload Configuration' option is also enabled on database node while it should only be enabled on server node

This commit is contained in:
Neel Patel 2016-05-09 23:22:35 +05:30 committed by Akshay Joshi
parent 176b99c90b
commit 8cfca280d4

View File

@ -44,7 +44,7 @@ function($, _, S, pgAdmin, pgBrowser, alertify) {
name: 'reload_configuration', node: 'server', module: this,
applies: ['tools', 'context'], callback: 'reload_configuration',
category: 'reload', priority: 6, label: '{{ _('Reload Configuration...') }}',
icon: 'fa fa-repeat', enable : 'is_connected'
icon: 'fa fa-repeat', enable : 'enable_reload_config'
}]);
pgBrowser.messages['PRIV_GRANTEE_NOT_SPECIFIED'] =
@ -58,6 +58,12 @@ function($, _, S, pgAdmin, pgBrowser, alertify) {
is_connected: function(node) {
return (node && node.connected == true);
},
enable_reload_config: function(node) {
if (node && node._type == "server" && node.connected == true) {
return true;
}
return false;
},
callbacks: {
/* Connect the server */
connect_server: function(args){