fix(core): update
This commit is contained in:
@ -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]
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -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 };
|
||||
|
Reference in New Issue
Block a user