Skip to content

Commit a9b9bc4

Browse files
peter xiepeter xie
authored andcommitted
rc
1 parent d16e414 commit a9b9bc4

File tree

5 files changed

+20
-27
lines changed

5 files changed

+20
-27
lines changed

app/server.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ const Imap = require("./imap");
3030
const freePort = require("portastic");
3131
const Stream = require("stream");
3232
//import * as Ping from 'net-ping'
33-
const netPing = require("net-ping");
3433
const buffer_1 = require("buffer");
3534
const openpgp = require('openpgp');
3635
const Express = require('express');
@@ -675,13 +674,16 @@ class localServer {
675674
remote.app.exit();
676675
});
677676
socket.on('pingCheck', CallBack => {
677+
if (process.platform === 'linux')
678+
return CallBack(new Error('not support'));
678679
saveLog(`socket.on ( 'pingCheck' )`);
679680
if (!this.regionV1 || this.pingChecking) {
680681
saveLog(`!this.regionV1 [${!this.regionV1}] || this.pingChecking [${this.pingChecking}]`);
681682
return CallBack();
682683
}
683684
this.pingChecking = true;
684685
try {
686+
const netPing = require('net-ping');
685687
const session = netPing.createSession();
686688
}
687689
catch (ex) {
@@ -1727,6 +1729,7 @@ const testPing = (hostIp, CallBack) => {
17271729
test.fill(hostIp);
17281730
saveLog(`start testPing [${hostIp}]`);
17291731
return Async.eachSeries(test, (n, next) => {
1732+
const netPing = require('net-ping');
17301733
const session = netPing.createSession();
17311734
session.pingHost(hostIp, (err, target, sent, rcvd) => {
17321735
session.close();

app/server.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ import * as Stream from 'stream'
3434
import { start } from 'repl'
3535
import { imapAccountTest } from './imap'
3636
//import * as Ping from 'net-ping'
37-
import * as netPing from 'net-ping'
37+
3838
import { Buffer } from 'buffer'
3939

4040
const openpgp = require ( 'openpgp' )
@@ -716,6 +716,8 @@ export class localServer {
716716
})
717717

718718
socket.on ( 'pingCheck', CallBack => {
719+
if ( process.platform === 'linux')
720+
return CallBack ( -1 )
719721
saveLog (`socket.on ( 'pingCheck' )`)
720722
if ( !this.regionV1 || this.pingChecking ) {
721723
saveLog (`!this.regionV1 [${ !this.regionV1 }] || this.pingChecking [${ this.pingChecking }]`)
@@ -724,6 +726,7 @@ export class localServer {
724726

725727
this.pingChecking = true
726728
try {
729+
const netPing = require ('net-ping')
727730
const session = netPing.createSession ()
728731
} catch (ex) {
729732
console.log (`netPing.createSession err`, ex )
@@ -2007,7 +2010,7 @@ const testPing = ( hostIp: string, CallBack ) => {
20072010
test.fill ( hostIp )
20082011
saveLog (`start testPing [${ hostIp }]`)
20092012
return Async.eachSeries ( test, ( n, next ) => {
2010-
2013+
const netPing = require ('net-ping')
20112014
const session = netPing.createSession ()
20122015
session.pingHost ( hostIp, ( err, target, sent, rcvd ) => {
20132016

index.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,11 @@ const handleSquirrelEvent = () => {
5050
} catch (error) {}
5151

5252
return spawnedProcess;
53-
};
54-
53+
}
54+
5555
const spawnUpdate = function(args) {
5656
return spawn(updateDotExe, args);
57-
};
57+
}
5858

5959
const squirrelEvent = process.argv[1];
6060
switch (squirrelEvent) {
@@ -86,8 +86,8 @@ const handleSquirrelEvent = () => {
8686
// we update to the new version - it's the opposite of
8787
// --squirrel-updated
8888

89-
app.quit();
90-
return true;
89+
app.quit()
90+
return true
9191
}
9292
}
9393

package-lock.json

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

package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "qtgate",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"license": "MIT",
55
"description": "QTGate desktop client",
66
"scripts": {
@@ -17,6 +17,9 @@
1717
"node": ">=50.9"
1818
},
1919
"build": {
20+
"squirrelWindows": {
21+
"remoteReleases": "https://github.com/QTGate/atOPN/releases/download/0.1.0/"
22+
},
2023
"appId": "com.qtgate.client",
2124
"win": {
2225
"target": [
@@ -57,13 +60,13 @@
5760
"cookie-parser": "^1.4.3",
5861
"express": "^4.16.2",
5962
"jquery": "^3.2.1",
60-
"net-ping": "^1.2.1",
6163
"node-uuid": "^1.4.8",
6264
"nodemailer": "^4.4.0",
6365
"openpgp": "^2.6.0",
6466
"portastic": "^1.0.1",
6567
"pug": "^2.0.0-rc.4",
6668
"raw-socket": "1.5.1",
69+
"net-ping": "^1.2.1",
6770
"socket.io": "^2.0.4"
6871
}
6972
}

0 commit comments

Comments
 (0)