Skip to content

Commit b57784b

Browse files
peterpeter
authored andcommitted
v2.0.1
1 parent cc46601 commit b57784b

File tree

13 files changed

+65
-737
lines changed

13 files changed

+65
-737
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
[WInXP or npm install](https://github.com/QTGate/QTGate-Desktop-Client/wiki/WInXP%E4%BB%A5%E5%8F%8ANPM%E7%92%B0%E5%A2%83%E4%B8%8B%E5%AE%89%E8%A3%9DCoNET)
2121

2222
## Description
23-
![http protocol](/resources/CoPlatform2.png?raw=true)
23+
![http protocol](/resources/CoPlatform3.png?raw=true)
2424
### CoNET platform as product of [CoNET](https://github.com/QTGate/CoNET) provides a series of services that allows users to improve their security, privacy and freedom on the Internet
2525
- All other devices may use CoNET platform service via local website after launching CoNET platform.
2626
- CoNET platform provide a local DNS server that allowing its users to keep PRIVACY and ENCRYPTION.

app/localWebServer.ts

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ export default class localServer {
474474
socket.on ( 'getAvaliableRegion', CallBack1 => {
475475

476476
CallBack1 ()
477-
477+
console.log (`on getAvaliableRegion`)
478478
if ( this.connectCommand && this.connectCommand.length ) {
479479
console.log (`getAvaliableRegion have this.connectCommand `)
480480
//socket.emit ('getAvaliableRegion', this.regionV1, this.dataTransfer, this.config )
@@ -503,25 +503,12 @@ export default class localServer {
503503
}
504504
this.dataTransfer = res.dataTransfer
505505

506-
saveLog ( `getAvaliableRegion got return Args [2] [${ JSON.stringify ( res.Args[2] )}]`)
506+
console.log (`dataTransfer `, Util.inspect ( this.dataTransfer, false, 2, true ))
507507
socket.emit ( 'getAvaliableRegion', res.Args[2], res.dataTransfer, this.config )
508508

509509
// Have gateway connect!
510510
//this.saveConfig ()
511511

512-
if ( res.Args[ 1 ]) {
513-
saveLog (`getAvaliableRegion got return Args [1] [${ JSON.stringify ( res.Args[1] )}]`)
514-
/*
515-
if ( ! this.proxyServer || ! this.connectCommand ) {
516-
const arg: IConnectCommand[] = this.connectCommand = res.Args[1]
517-
arg.forEach ( n => {
518-
n.localServerIp = Encrypto.getLocalInterface ()[0]
519-
})
520-
this.makeOpnConnect ( arg )
521-
}
522-
*/
523-
return socket.emit ( 'QTGateGatewayConnectRequest', -1, res.Args[ 1 ] )
524-
}
525512

526513
this.regionV1 = res.Args[2]
527514
})
@@ -1131,7 +1118,7 @@ export default class localServer {
11311118
this.localConnected.set ( client, { socket: socket, login: false, listenAfterPasswd: false } )
11321119

11331120
socket.once ( 'disconnect', reason => {
1134-
saveLog ( `socketServerConnected ${ client } on disconnect`)
1121+
//saveLog ( `socketServerConnected ${ client } on disconnect`)
11351122
return this.localConnected.delete ( client )
11361123
})
11371124

@@ -1387,7 +1374,7 @@ export default class localServer {
13871374
this.config.newVersion = ver
13881375
this.config.newVerReady = true
13891376
return Tool.saveConfig ( this.config, err => {
1390-
1377+
13911378
})
13921379
})
13931380

app/public/scripts/CoGate.ts

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
declare const Cleave
22
declare const StripeCheckout
3-
const Stripe_publicKey = 'pk_test_eVOSOJHeYmAznyxbZ4durBXh'
3+
const Stripe_publicKey = 'pk_test_uV27MTvcPM147KFo3HazbunU'
44

55
class coGateRegion {
66
public QTConnectData = ko.observable ( null )
@@ -460,6 +460,7 @@ class CoGateClass {
460460
interface PlanArray {
461461
name: string
462462
}
463+
463464
const planArray = [
464465
{
465466
name:'free',
@@ -553,13 +554,21 @@ const planArray = [
553554

554555

555556
class planUpgrade {
557+
558+
public annually: string
559+
public annuallyMonth: string
560+
public totalAmount: KnockoutComputed< string >
561+
public currentPromoIndex: number
562+
563+
564+
556565
public currentPromo: KnockoutObservable < CoPromo > = ko.observable (null)
557566
private plan = planArray[ this.planNumber ]
558567
public showNote = ko.observable ( false )
559568
public detailArea = ko.observable ( true )
560569
public _promo = this.dataTransfer.promo[0]
561570
public _promoFor = this._promo.promoFor
562-
571+
public currentPlan = ko.observable ( planArray [ planArray.findIndex ( function (n){ return n.name === this.dataTransfer.productionPackage})] )
563572

564573

565574
//public annually = this.promo ? Math.round ( this.promoPrice * this.plan.annually * 100 )/100 : this.plan.annually
@@ -583,15 +592,14 @@ class planUpgrade {
583592
public showSuccessPayment = ko.observable ( false )
584593
public cardExpirationYearFolder_Error = ko.observable ( false )
585594
public cancel_Amount = ko.observable (0)
586-
public totalAmount
587-
public currentPromoIndex: number
588-
public paymentError = ko.observable ( false )
589-
590-
public annually: string
591-
public annuallyMonth: string
592595
public planExpirationYear = ko.observable ('')
593596
public planExpirationMonth = ko.observable ('')
594597
public planExpirationDay = ko.observable ('')
598+
599+
public paymentError = ko.observable ( false )
600+
601+
602+
595603

596604
private clearPaymentError () {
597605
this.cardNumberFolder_Error ( false )
@@ -826,8 +834,9 @@ class CoGateAccount {
826834
public username = this.dataTransfer.account
827835
public productionPackage = this.dataTransfer.productionPackage
828836
public promo = this.dataTransfer.promo[0]
829-
public currentPlan = findCurrentPlan ( this.productionPackage )
837+
public currentPlan = planArray[findCurrentPlan ( this.productionPackage )]
830838
public freeAccount = ko.observable ( /^free$/i.test(this.dataTransfer.productionPackage ))
839+
public userPlan = ko.observable ( this.dataTransfer.productionPackage.toUpperCase() )
831840
public planArray = ko.observableArray ( planArray )
832841
public planUpgrade: KnockoutObservable < planUpgrade > = ko.observable ( null )
833842
public promoButton = ko.observable ( false )
@@ -906,9 +915,10 @@ class CoGateAccount {
906915
}
907916

908917
constructor ( private dataTransfer: iTransferData, public exit: () => void ) {
909-
910-
this.planArray()[ this.currentPlan === 0 ? 1 : this.currentPlan ].tail ( true )
911-
for ( let i = this.currentPlan + 1; i < planArray.length; i ++ ) {
918+
const plan = findCurrentPlan ( this.productionPackage )
919+
920+
this.planArray()[ plan === 0 ? 1 : plan ].tail ( true )
921+
for ( let i = plan + 1; i < planArray.length; i ++ ) {
912922
this.planArray()[i].showButton ( true )
913923
}
914924
}

app/public/scripts/twitter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ socketIo.emit11 = function ( eventName: string, ...args ) {
4444

4545
const localTimeOut = setTimeout ( function () {
4646
let uu = eventName
47-
twitter_view.systemError()
47+
//twitter_view.systemError()
4848
}, 10000 )
4949

5050
const _CallBack = function ( err ) {

app/tools/coNETConnect.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ export default class extends Imap.imapPeer {
106106
console.log (`exit1 cancel already Exit [${ err }]`)
107107
}
108108

109-
constructor ( public imapData: IinputData, private sockerServer: SocketIo.Server, private openKeyOption, public doNetSendConnectMail: boolean,
109+
constructor ( public imapData: IinputData, private sockerServer: SocketIO.Server, private openKeyOption, public doNetSendConnectMail: boolean,
110110
private cmdResponse: ( cmd: QTGateAPIRequestCommand ) => void, public _exit: ( err ) => void ) {
111111
super ( imapData, imapData.clientFolder, imapData.serverFolder, ( encryptText: string, CallBack ) => {
112112

0 commit comments

Comments
 (0)