mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Don't ask before connecting to servers or databases, just do it like pgAdmin 3.
This commit is contained in:
parent
47fc43c23f
commit
131043d7cb
@ -316,18 +316,7 @@ function($, _, S, pgAdmin, pgBrowser, Alertify) {
|
|||||||
})
|
})
|
||||||
});
|
});
|
||||||
function connect_to_database(obj, data, tree, item, interactive) {
|
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)
|
connect(obj, data, tree, item)
|
||||||
}
|
|
||||||
};
|
};
|
||||||
function connect(obj, data, tree, item) {
|
function connect(obj, data, tree, item) {
|
||||||
var onFailure = function(xhr, status, error, _model, _data, _tree, _item) {
|
var onFailure = function(xhr, status, error, _model, _data, _tree, _item) {
|
||||||
|
@ -335,25 +335,20 @@ function($, _, S, pgAdmin, pgBrowser, alertify) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
alertify.confirm(
|
url = obj.generate_url(item, "connect", data, true);
|
||||||
'{{ _('Connect to server') }}',
|
$.post(url)
|
||||||
'{{ _('Do you want to connect the server?') }}',
|
.done(
|
||||||
function(evt) {
|
function(res) {
|
||||||
url = obj.generate_url(item, "connect", data, true);
|
if (res.success == 1) {
|
||||||
$.post(url)
|
return onSuccess(res, obj, data, tree, item);
|
||||||
.done(
|
}
|
||||||
function(res) {
|
})
|
||||||
if (res.success == 1) {
|
.fail(
|
||||||
return onSuccess(res, obj, data, tree, item);
|
function(xhr, status, error) {
|
||||||
}
|
return onFailure(xhr, status, error, obj, data, tree, item);
|
||||||
})
|
});
|
||||||
.fail(
|
|
||||||
function(xhr, status, error) {
|
|
||||||
return onFailure(xhr, status, error, obj, data, tree, item);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
function() {});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Send PING to indicate that session is alive */
|
/* Send PING to indicate that session is alive */
|
||||||
function server_status(server_id)
|
function server_status(server_id)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user