Don't ask before connecting to servers or databases, just do it like pgAdmin 3.

pull/3/head
Dave Page 2016-02-12 16:46:56 +00:00
parent 47fc43c23f
commit 131043d7cb
2 changed files with 13 additions and 29 deletions

View File

@ -316,18 +316,7 @@ function($, _, S, pgAdmin, pgBrowser, Alertify) {
})
});
function connect_to_database(obj, data, tree, item, interactive) {
if (interactive) {
Alertify.confirm(
'{{ _('Connect to Database') }}',
'{{ _('Do you want to connect the database?') }}',
function(evt) {
connect(obj, data, tree, item);
},
function() {});
}
else{
connect(obj, data, tree, item)
}
};
function connect(obj, data, tree, item) {
var onFailure = function(xhr, status, error, _model, _data, _tree, _item) {

View File

@ -335,25 +335,20 @@ function($, _, S, pgAdmin, pgBrowser, alertify) {
});
}
alertify.confirm(
'{{ _('Connect to server') }}',
'{{ _('Do you want to connect the server?') }}',
function(evt) {
url = obj.generate_url(item, "connect", data, true);
$.post(url)
.done(
function(res) {
if (res.success == 1) {
return onSuccess(res, obj, data, tree, item);
}
})
.fail(
function(xhr, status, error) {
return onFailure(xhr, status, error, obj, data, tree, item);
});
},
function() {});
url = obj.generate_url(item, "connect", data, true);
$.post(url)
.done(
function(res) {
if (res.success == 1) {
return onSuccess(res, obj, data, tree, item);
}
})
.fail(
function(xhr, status, error) {
return onFailure(xhr, status, error, obj, data, tree, item);
});
}
/* Send PING to indicate that session is alive */
function server_status(server_id)
{