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:
Nikhil Mohite
2020-10-12 17:14:42 +05:30
committed by Akshay Joshi
parent 49b139bb75
commit 2b7e3ce64e

View File

@@ -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;