mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Fixed an issue on a new connection when the server is disconnected and we are trying to connect it using the new connection model.
This commit is contained in:
committed by
Akshay Joshi
parent
49b139bb75
commit
2b7e3ce64e
@@ -95,7 +95,11 @@ export default function newConnectionDialogModel(response, sgid, sid) {
|
||||
control: Backform.Select2Control.extend({
|
||||
connect: function(self) {
|
||||
let local_self = self;
|
||||
if(!alertify.connectServer){
|
||||
|
||||
if(alertify.connectServer) {
|
||||
delete alertify.connectServer;
|
||||
}
|
||||
|
||||
alertify.dialog('connectServer', function factory() {
|
||||
return {
|
||||
main: function(
|
||||
@@ -149,9 +153,11 @@ export default function newConnectionDialogModel(response, sgid, sid) {
|
||||
}
|
||||
});
|
||||
loadingDiv.addClass('d-none');
|
||||
alertify.connectServer().destroy();
|
||||
})
|
||||
.fail(function(xhr) {
|
||||
loadingDiv.addClass('d-none');
|
||||
alertify.connectServer().destroy();
|
||||
alertify.connectServer('Connect to server', xhr.responseJSON.result, local_self.getValueFromDOM());
|
||||
});
|
||||
} else {
|
||||
@@ -162,12 +168,12 @@ export default function newConnectionDialogModel(response, sgid, sid) {
|
||||
local_self.model.attributes.user = null;
|
||||
local_self.model.attributes.role = null;
|
||||
Backform.Select2Control.prototype.onChange.apply(local_self, arguments);
|
||||
alertify.connectServer().destroy();
|
||||
}
|
||||
closeEvent.close = true;
|
||||
},
|
||||
};
|
||||
});
|
||||
}
|
||||
},
|
||||
render: function() {
|
||||
let self = this;
|
||||
|
Reference in New Issue
Block a user