Skip to content

Commit 0e301f7

Browse files
peterpeter
authored andcommitted
v1.2.6
1 parent 2afccf2 commit 0e301f7

File tree

6 files changed

+26
-41
lines changed

6 files changed

+26
-41
lines changed

app/proxyServer.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -462,9 +462,10 @@ export class proxyServer {
462462

463463
const index = this.multipleGateway.findIndex ( n => { return n.containerUUID === data.containerUUID })
464464
if ( index < 0 ) {
465-
return saveLog (`on changeDocker [${ data.containerUUID }] but can't find this uuid`)
465+
this.multipleGateway.push ( data )
466+
return saveLog (`on changeDocker [${ data.containerUUID }] Add it`)
466467
}
467-
this.multipleGateway [ index ]= data
468+
this.multipleGateway [ index ] = data
468469
}
469470

470471
}

app/public/scripts/home.js

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3711,25 +3711,12 @@ var view_layout;
37113711
socketIo.on('qtGateConnect', (data) => {
37123712
return this.qtGateConnectEvent(data);
37133713
});
3714-
// gateway disconnect!
3715-
socketIo.on('disconnectClickCallBack', resopn => {
3716-
this.disconnecting(true);
3717-
if (this.selectedQTGateRegion()) {
3718-
this.selectedQTGateRegion().showConnectedArea(false);
3719-
this.ConnectGatewayShow(false);
3720-
this.disconnecting(false);
3721-
return this.selectedQTGateRegionCancel();
3722-
}
3723-
});
37243714
socketIo.once('reconnect_error', err => {
37253715
if (this.modalContent().length)
37263716
return;
37273717
this.modalContent(infoDefine[this.languageIndex()].emailConform.formatError[10]);
37283718
return $('.ui.basic.modal').modal('setting', 'closable', false).modal('show');
37293719
});
3730-
socketIo.on('disconnectClickCallBack', () => {
3731-
return this.desconnectCallBack();
3732-
});
37333720
socketIo.on('QTGateGatewayConnectRequest', (err, data) => {
37343721
return this.QTGateGatewayConnectRequestCallBack(this, err, data);
37353722
});
@@ -4299,7 +4286,11 @@ var view_layout;
42994286
return clearTimeout(this.doingProcessBarTime);
43004287
}
43014288
getAvaliableRegion() {
4289+
if (this.pingCheckLoading()) {
4290+
return;
4291+
}
43024292
this.pingCheckLoading(true);
4293+
this.showRegionData(false);
43034294
socketIo.emit('getAvaliableRegion', (region, dataTransfer, config) => {
43044295
if (region && region.length)
43054296
return this.getAvaliableRegionCallBack(region, dataTransfer, config);
@@ -4310,12 +4301,13 @@ var view_layout;
43104301
this.ConnectGatewayShow(false);
43114302
this.selectedQTGateRegionCancel();
43124303
this.disconnecting(false);
4313-
socketIo.emit('getAvaliableRegion', (region, dataTransfer, config) => {
4314-
return this.getAvaliableRegionCallBack(region, dataTransfer, config);
4315-
});
4304+
return this.getAvaliableRegion();
43164305
}
43174306
disconnectClick() {
43184307
this.disconnecting(true);
4308+
socketIo.once('disconnectClickCallBack', () => {
4309+
return this.desconnectCallBack();
4310+
});
43194311
return socketIo.emit('disconnectClick');
43204312
}
43214313
exit() {

app/public/scripts/home.ts

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3809,18 +3809,6 @@ module view_layout {
38093809

38103810
})
38113811

3812-
// gateway disconnect!
3813-
socketIo.on ( 'disconnectClickCallBack', resopn => {
3814-
this.disconnecting ( true )
3815-
if ( this.selectedQTGateRegion()) {
3816-
this.selectedQTGateRegion().showConnectedArea( false )
3817-
this.ConnectGatewayShow ( false )
3818-
this.disconnecting ( false )
3819-
return this.selectedQTGateRegionCancel ()
3820-
}
3821-
3822-
})
3823-
38243812

38253813
socketIo.once ( 'reconnect_error', err => {
38263814
if ( this.modalContent().length )
@@ -3829,9 +3817,6 @@ module view_layout {
38293817
return $( '.ui.basic.modal').modal ('setting', 'closable', false).modal ( 'show' )
38303818
})
38313819

3832-
socketIo.on ( 'disconnectClickCallBack', () => {
3833-
return this.desconnectCallBack ()
3834-
})
38353820

38363821
socketIo.on ( 'QTGateGatewayConnectRequest', ( err, data ) => {
38373822
return this.QTGateGatewayConnectRequestCallBack ( this, err, data )
@@ -4549,7 +4534,11 @@ module view_layout {
45494534
}
45504535

45514536
public getAvaliableRegion () {
4552-
this.pingCheckLoading( true )
4537+
if ( this.pingCheckLoading ( )) {
4538+
return
4539+
}
4540+
this.pingCheckLoading ( true )
4541+
this.showRegionData ( false )
45534542
socketIo.emit ( 'getAvaliableRegion', ( region: string [], dataTransfer: iTransferData, config: install_config ) => {
45544543
if ( region && region.length )
45554544
return this.getAvaliableRegionCallBack ( region, dataTransfer, config )
@@ -4561,10 +4550,7 @@ module view_layout {
45614550
this.ConnectGatewayShow ( false )
45624551
this.selectedQTGateRegionCancel ()
45634552
this.disconnecting ( false )
4564-
socketIo.emit ( 'getAvaliableRegion', ( region: string [], dataTransfer: iTransferData, config: install_config ) => {
4565-
4566-
return this.getAvaliableRegionCallBack ( region, dataTransfer, config )
4567-
})
4553+
return this.getAvaliableRegion ()
45684554
}
45694555

45704556
public getCurrentPlan = ko.computed (() => {
@@ -4604,6 +4590,10 @@ module view_layout {
46044590

46054591
public disconnectClick () {
46064592
this.disconnecting ( true )
4593+
4594+
socketIo.once ( 'disconnectClickCallBack', () => {
4595+
return this.desconnectCallBack ()
4596+
})
46074597
return socketIo.emit ( 'disconnectClick')
46084598
}
46094599

app/server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -662,6 +662,7 @@ class localServer {
662662
error: null,
663663
requestSerial: Crypto1.randomBytes(8).toString('hex')
664664
};
665+
console.log(`socket.on ( 'getAvaliableRegion')`);
665666
return this.QTClass.request(com, (err, res) => {
666667
if (err) {
667668
console.log(err);
@@ -671,7 +672,6 @@ class localServer {
671672
this.config.freeUser = /free/i.test(res.dataTransfer.productionPackage);
672673
}
673674
CallBack(res.Args[0], res.dataTransfer, this.config);
674-
saveLog(`getAvaliableRegion ${JSON.stringify(res)} `);
675675
// Have gateway connect!
676676
this.saveConfig();
677677
if (res.Args[1]) {

app/server.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -701,6 +701,9 @@ export class localServer {
701701
error: null,
702702
requestSerial: Crypto1.randomBytes(8).toString('hex')
703703
}
704+
705+
console.log (`socket.on ( 'getAvaliableRegion')`)
706+
704707
return this.QTClass.request ( com, ( err: number, res: QTGateAPIRequestCommand ) => {
705708
if ( err ) {
706709
console.log ( err )
@@ -711,7 +714,6 @@ export class localServer {
711714
}
712715

713716
CallBack ( res.Args[0], res.dataTransfer, this.config )
714-
saveLog ( `getAvaliableRegion ${ JSON.stringify ( res )} `)
715717

716718
// Have gateway connect!
717719
this.saveConfig ()

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "qtgate",
3-
"version": "1.2.5",
3+
"version": "1.2.6",
44
"license": "MIT",
55
"description": "QTGate desktop client",
66
"scripts": {

0 commit comments

Comments
 (0)