Skip to content

Commit 4241f00

Browse files
committed
v3.2.0
1 parent 67eb545 commit 4241f00

31 files changed

+1788
-616
lines changed

app/localWebServer.js

Lines changed: 111 additions & 103 deletions
Large diffs are not rendered by default.

app/localWebServer.ts

Lines changed: 163 additions & 147 deletions
Large diffs are not rendered by default.

app/public/css/page.css

Lines changed: 58 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -613,8 +613,8 @@ ul.plan-features {
613613

614614
.loaderCoNET {
615615
overflow: hidden;
616-
padding: 1em;
617-
margin: 1em;
616+
padding: 2em;
617+
position: relative;
618618
}
619619

620620
.loaderCoNET-div {
@@ -785,6 +785,8 @@ ul.plan-features {
785785
animation-fill-mode: forwards;
786786
}
787787

788+
789+
788790
.backgroundTransparent {
789791
background: rgba(255,255,255,0.01)!important;
790792
}
@@ -862,4 +864,57 @@ ul.plan-features {
862864

863865
.buttonUnActive {
864866
background: #e0e1e288 none!important;
865-
}
867+
}
868+
869+
@keyframes svg_Background {
870+
to { filter: blur(3px);}
871+
to { background: black ;}
872+
}
873+
874+
.svgBackground_Animation {
875+
-webkit-animation-name: svg_Background;
876+
-webkit-animation-duration: 0.5s;
877+
animation-name: svg_Background;
878+
animation-duration: 0.5s;
879+
animation-timing-function: ease-in;
880+
animation-fill-mode: forwards;
881+
}
882+
.terminalText {
883+
position: relative;
884+
display: inline-block;
885+
min-width: 360px;
886+
}
887+
888+
.terminalText::after {
889+
content: "";
890+
position: absolute;
891+
/* Remove display: inline-block if not required to be on the same line as text etc */
892+
display: inline-block;
893+
background-color:grey;
894+
top: 14px;
895+
margin-left: 2px;
896+
width: 10px;
897+
/* Set height to the line height of .text */
898+
height: 2px;
899+
/*
900+
Animation paramaters:
901+
blink = animation-name,
902+
1s = animation-duration,
903+
step-end = animation-timing-function,
904+
infinite = animation-iteration-count
905+
*/
906+
-webkit-animation: blink 1s step-end infinite;
907+
animation: blink 1s step-end infinite;
908+
}
909+
910+
@-webkit-keyframes blink {
911+
0% { opacity: 1.0; }
912+
50% { opacity: 0.0; }
913+
100% { opacity: 1.0; }
914+
}
915+
916+
@keyframes blink {
917+
0% { opacity: 1.0; }
918+
50% { opacity: 0.0; }
919+
100% { opacity: 1.0; }
920+
}

app/public/scripts/CoNETConnect.js

Lines changed: 174 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,12 @@ class CoNETConnect {
2525
this.connetcError = ko.observable(-1);
2626
this.connectedCoNET = ko.observable(false);
2727
this.maynotConnectConet = ko.observable(false);
28-
this.mayNotMakeImapConnect = ko.observable(false);
2928
this.Loading = ko.observable(false);
3029
this.listenFun = null;
30+
this.showTryAgain = ko.observable(false);
31+
this.showSendConnectMail = ko.observable(false);
32+
this.showNetworkError = ko.observable(false);
33+
this.infoTextArray = ko.observableArray([]);
3134
this.keyPairSign = ko.observable(null);
3235
const self = this;
3336
if (!confirmRisk) {
@@ -37,52 +40,191 @@ class CoNETConnect {
3740
this.imapConform();
3841
this.Loading(true);
3942
}
40-
this.listenFun = (err, stage) => {
41-
return self.listingConnectStage(err, stage);
42-
};
43-
_view.connectInformationMessage.socketIo.on('tryConnectCoNETStage', this.listenFun);
4443
}
4544
listingConnectStage(err, stage) {
4645
const self = this;
4746
this.showConnectCoNETProcess(true);
48-
let processBarCount = 0;
49-
if (typeof err === 'number' && err > -1) {
50-
this.connectStage(-1);
51-
this.ready(err);
52-
return this.connetcError(err);
47+
/*
48+
if ( typeof err === 'number' && err > -1 ) {
49+
this.connectStage ( -1 )
50+
this.ready ( err )
51+
_view.connectInformationMessage.socketIo.removeListener ( 'tryConnectCoNETStage', this.listenFun )
52+
return this.connetcError ( err )
5353
}
54-
if (stage === 4) {
55-
this.showConnectCoNETProcess(false);
56-
this.connectedCoNET(true);
57-
processBarCount = 67;
58-
if (!this.isKeypairBeSign) {
59-
if (!this.keyPairSign()) {
60-
let u = null;
61-
return this.keyPairSign(u = new keyPairSign((function () {
62-
self.keyPairSign(u = null);
63-
self.ready(null);
64-
})));
54+
*/
55+
switch (stage) {
56+
case 1: {
57+
const index = this.infoTextArray()[this.infoTextArray().length - 1];
58+
if (!index) {
59+
return;
6560
}
66-
return;
61+
index.text('connectedMailServer');
62+
return index.err(false);
63+
}
64+
/**
65+
* waiting pong
66+
*/
67+
case 2: {
68+
return this.infoTextArray.push({ text: ko.observable('waitingPong'), err: ko.observable(null) });
69+
}
70+
/**
71+
* sendConnectRequestMail
72+
*/
73+
case 3: {
74+
return this.infoTextArray.push({ text: ko.observable('sendConnectRequestMail'), err: ko.observable(null) });
75+
}
76+
/**
77+
* timeOut error!
78+
*/
79+
case 0: {
80+
self.Loading(false);
81+
self.showSendConnectMail(true);
82+
return self.infoTextArray.push({ text: ko.observable('timeOut'), err: ko.observable(true) });
83+
}
84+
/**
85+
* connected node
86+
*/
87+
case 4: {
88+
this.Loading(false);
89+
this.showConnectCoNETProcess(false);
90+
this.connectedCoNET(true);
91+
_view.connectInformationMessage.socketIo.removeListener('tryConnectCoNETStage', this.listenFun);
92+
if (!this.isKeypairBeSign) {
93+
if (!this.keyPairSign()) {
94+
let u = null;
95+
return this.keyPairSign(u = new keyPairSign((function () {
96+
self.keyPairSign(u = null);
97+
self.ready(null);
98+
})));
99+
}
100+
return;
101+
}
102+
_view.showIconBar(true);
103+
return this.ready(null);
104+
}
105+
/**
106+
* connectToMailServer
107+
*/
108+
case 5: {
109+
return this.infoTextArray.push({ text: ko.observable('connectToMailServer'), err: ko.observable(null) });
110+
}
111+
/**
112+
* Client error!
113+
*/
114+
case -1: {
115+
this.Loading(false);
116+
_view.connectInformationMessage.socketIo.removeListener('tryConnectCoNETStage', this.listenFun);
117+
return this.infoTextArray.push({ text: ko.observable('systemError'), err: ko.observable(true) });
118+
}
119+
/**
120+
* network error!
121+
*/
122+
case -2: {
123+
this.Loading(false);
124+
this.showNetworkError(true);
125+
return this.infoTextArray.push({ text: ko.observable('offline'), err: ko.observable(true) });
67126
}
68-
_view.showIconBar(true);
69-
return this.ready(null);
70-
}
71-
$('.keyPairProcessBar').progress({
72-
percent: processBarCount += 33
73-
});
74-
if (this.connectStage() === 3) {
75-
return;
76127
}
77-
return this.connectStage(stage);
78128
}
79129
returnToImapSetup() {
80130
return this.ready(0);
81131
}
132+
sendConnectMail() {
133+
this.Loading(true);
134+
this.showTryAgain(false);
135+
_view.connectInformationMessage.sockEmit('sendRequestMail', err => {
136+
if (err) {
137+
return this.listingConnectStage(null, -1);
138+
}
139+
});
140+
}
141+
tryAgain() {
142+
this.resetAll();
143+
this.infoTextArray([]);
144+
return this.imapConform();
145+
}
146+
resetAll() {
147+
this.showNetworkError(false);
148+
this.showSendConnectMail(false);
149+
this.showSendImapDataWarning(false);
150+
this.showTryAgain(false);
151+
}
82152
imapConform() {
153+
const self = this;
83154
this.showSendImapDataWarning(false);
84155
this.connetcError(-1);
85156
this.Loading(true);
86-
return _view.connectInformationMessage.sockEmit('tryConnectCoNET');
157+
//return this.test ()
158+
this.listenFun = (err, stage) => {
159+
return self.listingConnectStage(err, stage);
160+
};
161+
_view.connectInformationMessage.socketIo.on('tryConnectCoNETStage', this.listenFun);
162+
_view.connectInformationMessage.sockEmit('tryConnectCoNET', err => {
163+
if (err) {
164+
return this.listingConnectStage(null, -1);
165+
}
166+
});
167+
}
168+
/**
169+
* test unit
170+
*/
171+
test() {
172+
/**
173+
* localServerError
174+
*/
175+
/*
176+
this.listingConnectStage ( null, 5 )
177+
setTimeout (() => {
178+
this.listingConnectStage ( null, -1 )
179+
}, 3000 )
180+
/** */
181+
/**
182+
* connect to mail server error
183+
*/
184+
/*
185+
this.listingConnectStage ( null, 5 )
186+
setTimeout (() => {
187+
this.listingConnectStage ( null, -2 )
188+
}, 3000 )
189+
/** */
190+
/**
191+
* waiting pong
192+
*/
193+
/*
194+
this.listingConnectStage ( null, 5 )
195+
setTimeout (() => {
196+
this.listingConnectStage ( null, 1 )
197+
this.listingConnectStage ( null, 2 )
198+
}, 3000 )
199+
/** */
200+
/**
201+
* waiting pong error automatic send request mail
202+
*/
203+
/*
204+
this.listingConnectStage ( null, 5 )
205+
setTimeout (() => {
206+
this.listingConnectStage ( null, 1 )
207+
this.listingConnectStage ( null, 2 )
208+
setTimeout (() => {
209+
this.listingConnectStage ( null, 3 )
210+
})
211+
}, 3000 )
212+
/** */
213+
/**
214+
* waiting pong error automatic send request mail and timeout error
215+
*/
216+
/*
217+
this.listingConnectStage ( null, 5 )
218+
setTimeout (() => {
219+
this.listingConnectStage ( null, 1 )
220+
this.listingConnectStage ( null, 2 )
221+
setTimeout (() => {
222+
this.listingConnectStage ( null, 3 )
223+
setTimeout (() => {
224+
this.listingConnectStage ( null, 0 )
225+
}, 2000 )
226+
})
227+
}, 3000 )
228+
/** */
87229
}
88230
}

0 commit comments

Comments
 (0)