fix(core): update

This commit is contained in:
2019-09-08 16:15:10 +02:00
parent 34bee225d5
commit 8d1b302e70
5 changed files with 26 additions and 4 deletions

View File

@ -133,4 +133,14 @@ export class SmartNetwork {
const result = plugins.os.networkInterfaces();
return result;
}
public async getDefaultGateway(): Promise<{ipv4: plugins.os.NetworkInterfaceInfo, ipv6: plugins.os.NetworkInterfaceInfo}> {
const defaultGatewayName = await plugins.systeminformation.networkInterfaceDefault();
const gateways = await this.getGateways();
const defaultGateway = gateways[defaultGatewayName];
return {
ipv4: defaultGateway[0],
ipv6: defaultGateway[1]
};
}
}

View File

@ -12,7 +12,8 @@ import * as smartstring from '@pushrocks/smartstring';
export { smartpromise, smartstring };
// @third party scope
const speedtestNet = require('speedtest-net');
import * as portscanner from 'portscanner';
import speedtestNet from 'speedtest-net';
import * as systeminformation from 'systeminformation';
export { speedtestNet, portscanner };
export { speedtestNet, portscanner, systeminformation };