Skip to content

Commit db78d48

Browse files
committed
v3.2.3
1 parent 70aafa0 commit db78d48

13 files changed

Lines changed: 124 additions & 249 deletions

File tree

app/localWebServer.js

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -260,19 +260,19 @@ class localServer {
260260
socket.emit(_uuid, ...data);
261261
};
262262
this.requestPool.set(uuid, socket);
263-
saveLog(`doingRequest on ${uuid}`);
264263
if (this.CoNETConnectCalss) {
264+
saveLog(`doingRequest on ${uuid}`);
265265
return this.CoNETConnectCalss.requestCoNET_v1(uuid, request, _callBack);
266266
}
267-
return socket.emit('systemErr');
267+
saveLog(`doingRequest on ${uuid} but have not CoNETConnectCalss need restart! socket.emit ( 'systemErr' )`);
268+
socket.emit('systemErr');
268269
});
269270
socket.on('getFilesFromImap', (files, CallBack1) => {
270271
const uuid = Uuid.v4();
271272
CallBack1(uuid);
272273
const _callBack = (...data) => {
273274
socket.emit(uuid, ...data);
274275
};
275-
console.log(`socket.on ('getFilesFromImap')`, files);
276276
if (typeof files !== 'string' || !files.length) {
277277
return _callBack(new Error('invalidRequest'));
278278
}
@@ -376,8 +376,12 @@ class localServer {
376376
socket.on('checkPemPassword', (password, CallBack1) => {
377377
const uuid = Uuid.v4();
378378
CallBack1(uuid);
379-
const passwordFail = (...data) => {
380-
return socket.emit(uuid, null, ...data);
379+
this.sessionHashPool.push(sessionHash = Crypto.randomBytes(10).toString('hex'));
380+
const passwordFail = (err) => {
381+
if (err) {
382+
return socket.emit(uuid, null, err);
383+
}
384+
return socket.emit(uuid, null, err, this.Pbkdf2Password, sessionHash);
381385
};
382386
if (!this.config.keypair || !this.config.keypair.publicKey) {
383387
console.log(`checkPemPassword !this.config.keypair`);
@@ -392,6 +396,7 @@ class localServer {
392396
console.log(`savedPasswrod !== password `);
393397
return passwordFail(true);
394398
}
399+
return passwordFail(this.imapConnectData);
395400
}
396401
return Async.waterfall([
397402
next => Tool.getPbkdf2(this.config, password, next),
@@ -402,6 +407,7 @@ class localServer {
402407
(key, next) => {
403408
//console.log ( `checkPemPassword Tool.getKeyPairInfo success!`)
404409
if (!key.passwordOK) {
410+
this.Pbkdf2Password = null;
405411
saveLog(`[${clientName}] on checkPemPassword had try password! [${password}]`);
406412
return passwordFail(true);
407413
}
@@ -424,13 +430,12 @@ class localServer {
424430
return saveLog(`Tool.makeGpgKeyOption return err [${err && err.message ? err.message : null}]`);
425431
}
426432
}
427-
this.sessionHashPool.push(sessionHash = Crypto.randomBytes(10).toString('hex'));
428-
//console.log (`this.sessionHashPool.push!\n${ this.sessionHashPool }\n${ this.sessionHashPool.length }`)
433+
// console.log (`this.sessionHashPool.push!\n${ this.sessionHashPool }\n${ this.sessionHashPool.length }`)
429434
this.listenAfterPassword(socket, sessionHash);
430435
try {
431436
this.imapConnectData = JSON.parse(data);
432437
this.localConnected.set(clientName, clientObj);
433-
return passwordFail(this.imapConnectData, this.Pbkdf2Password, sessionHash);
438+
return passwordFail(this.imapConnectData);
434439
}
435440
catch (ex) {
436441
return passwordFail(null);
@@ -441,7 +446,7 @@ class localServer {
441446
CallBack1();
442447
console.log(`on deleteKeyPairNext`);
443448
const thisConnect = this.localConnected.get(clientName);
444-
if (this.localConnected.size > 1 && !thisConnect.login) {
449+
if (this.localConnected.size > 1 && thisConnect && !thisConnect.login) {
445450
console.log(`this.localConnected = [${Util.inspect(this.localConnected, false, 2, true)}], thisConnect.login = [${thisConnect.login}]`);
446451
return this.socketServer.emit('deleteKeyPairNoite');
447452
}

app/localWebServer.ts

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,6 @@ export default class localServer {
145145
let sendMail = false
146146
const _exitFunction = err => {
147147
console.trace ( `makeConnect on _exitFunction err this.CoNETConnectCalss destroy!`, err )
148-
149148
this.CoNETConnectCalss = null
150149

151150
}
@@ -274,18 +273,19 @@ export default class localServer {
274273

275274
socket.on ( 'doingRequest', ( uuid, request, CallBack1 ) => {
276275
const _uuid = Uuid.v4()
277-
CallBack1( _uuid )
276+
CallBack1 ( _uuid )
278277

279278
const _callBack = ( ...data ) => {
280279
socket.emit ( _uuid, ...data )
281280
}
282281
this.requestPool.set ( uuid, socket )
283-
saveLog (`doingRequest on ${ uuid }`)
282+
284283
if ( this.CoNETConnectCalss ) {
284+
saveLog (`doingRequest on ${ uuid }`)
285285
return this.CoNETConnectCalss.requestCoNET_v1 ( uuid, request, _callBack )
286286
}
287-
return socket.emit ('systemErr')
288-
287+
saveLog ( `doingRequest on ${ uuid } but have not CoNETConnectCalss need restart! socket.emit ( 'systemErr' )`)
288+
socket.emit ( 'systemErr' )
289289
})
290290

291291
socket.on ( 'getFilesFromImap', ( files: string, CallBack1 ) => {
@@ -295,7 +295,7 @@ export default class localServer {
295295
const _callBack = ( ...data ) => {
296296
socket.emit ( uuid, ...data )
297297
}
298-
console.log ( `socket.on ('getFilesFromImap')`, files )
298+
299299
if ( typeof files !== 'string' || !files.length ) {
300300
return _callBack ( new Error ('invalidRequest'))
301301
}
@@ -421,10 +421,16 @@ export default class localServer {
421421
socket.on ( 'checkPemPassword', ( password: string, CallBack1 ) => {
422422
const uuid = Uuid.v4()
423423
CallBack1 ( uuid )
424+
this.sessionHashPool.push ( sessionHash = Crypto.randomBytes ( 10 ).toString ('hex'))
424425

425-
const passwordFail = ( ...data ) => {
426-
return socket.emit ( uuid, null, ...data )
426+
const passwordFail = ( err ) => {
427+
if ( err ) {
428+
return socket.emit ( uuid, null, err )
429+
}
430+
return socket.emit ( uuid, null, err, this.Pbkdf2Password, sessionHash )
431+
427432
}
433+
428434
if ( !this.config.keypair || !this.config.keypair.publicKey ) {
429435
console.log ( `checkPemPassword !this.config.keypair` )
430436

@@ -439,7 +445,10 @@ export default class localServer {
439445
console.log ( `savedPasswrod !== password `)
440446
return passwordFail ( true )
441447
}
442-
448+
449+
return passwordFail ( this.imapConnectData )
450+
451+
443452
}
444453

445454
return Async.waterfall ([
@@ -451,6 +460,7 @@ export default class localServer {
451460
( key, next ) => {
452461
//console.log ( `checkPemPassword Tool.getKeyPairInfo success!`)
453462
if ( ! key.passwordOK ) {
463+
this.Pbkdf2Password = null
454464
saveLog ( `[${ clientName }] on checkPemPassword had try password! [${ password }]` )
455465
return passwordFail ( true )
456466
}
@@ -475,14 +485,14 @@ export default class localServer {
475485
}
476486
}
477487

478-
this.sessionHashPool.push ( sessionHash = Crypto.randomBytes (10).toString ('hex'))
479-
//console.log (`this.sessionHashPool.push!\n${ this.sessionHashPool }\n${ this.sessionHashPool.length }`)
488+
489+
// console.log (`this.sessionHashPool.push!\n${ this.sessionHashPool }\n${ this.sessionHashPool.length }`)
480490
this.listenAfterPassword ( socket, sessionHash )
481491
try {
482492
this.imapConnectData = JSON.parse ( data )
483493
this.localConnected.set ( clientName, clientObj )
484494

485-
return passwordFail ( this.imapConnectData, this.Pbkdf2Password, sessionHash )
495+
return passwordFail ( this.imapConnectData )
486496
} catch ( ex ) {
487497
return passwordFail ( null )
488498
}
@@ -496,7 +506,7 @@ export default class localServer {
496506
console.log ( `on deleteKeyPairNext` )
497507
const thisConnect = this.localConnected.get ( clientName )
498508

499-
if ( this.localConnected.size > 1 && ! thisConnect.login ) {
509+
if ( this.localConnected.size > 1 && thisConnect && ! thisConnect.login ) {
500510
console.log (`this.localConnected = [${ Util.inspect( this.localConnected, false, 2, true )}], thisConnect.login = [${ thisConnect.login }]`)
501511
return this.socketServer.emit ( 'deleteKeyPairNoite' )
502512
}

app/public/scripts/appCosearch.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,9 @@ let appScript = {
137137
});
138138
},
139139
search_form: (self, event) => {
140+
if (self.showInputLoading()) {
141+
return;
142+
}
140143
if (!_view.CanadaBackground()) {
141144
_view.CanadaBackground(true);
142145
}

app/public/scripts/appCosearch.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,11 @@ let appScript = {
160160
},
161161

162162
search_form: ( self, event ) => {
163+
164+
if ( self.showInputLoading()) {
165+
return
166+
}
167+
163168
if ( !_view.CanadaBackground ()) {
164169
_view.CanadaBackground ( true )
165170
}

app/public/scripts/home.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,9 @@ var view_layout;
391391
* T/t = Translate (t is relative, T is absolute) R/r = rotate(r is relative, R is absolute) S/s = scale(s is relative, S is absolute)
392392
*/
393393
svgDemo_showLanguage() {
394+
if (!this.sectionWelcome()) {
395+
return;
396+
}
394397
let i = 0;
395398
const changeLanguage = () => {
396399
if (++i === 1) {

app/public/scripts/home.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,6 @@ module view_layout {
332332
})
333333
}
334334
})
335-
336335

337336
}
338337

@@ -476,7 +475,9 @@ module view_layout {
476475
*/
477476

478477
private svgDemo_showLanguage () {
479-
478+
if ( !this.sectionWelcome()) {
479+
return
480+
}
480481
let i = 0
481482
const changeLanguage = () => {
482483
if ( ++i === 1 ) {

app/public/scripts/openpgp.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)