Don't ask before connecting to servers or databases, just do it like pgAdmin 3.
parent
47fc43c23f
commit
131043d7cb
|
@ -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) {
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue