Cleanup and handle stats that are not yet ready
This commit is contained in:
parent
3d070ddf35
commit
568c94e341
23
core/wfc.js
23
core/wfc.js
|
@ -152,9 +152,9 @@ exports.getModule = class WaitingForCallerModule extends MenuModule {
|
||||||
}
|
}
|
||||||
|
|
||||||
_refreshStats(cb) {
|
_refreshStats(cb) {
|
||||||
const fileAreaStats = StatLog.getSystemStat(SysProps.FileBaseAreaStats);
|
const fileAreaStats = StatLog.getSystemStat(SysProps.FileBaseAreaStats) || {};
|
||||||
const sysMemStats = StatLog.getSystemStat(SysProps.SystemMemoryStats);
|
const sysMemStats = StatLog.getSystemStat(SysProps.SystemMemoryStats) || {};
|
||||||
const sysLoadStats = StatLog.getSystemStat(SysProps.SystemLoadStats);
|
const sysLoadStats = StatLog.getSystemStat(SysProps.SystemLoadStats) || {};
|
||||||
const lastLoginStats = StatLog.getSystemStat(SysProps.LastLogin);
|
const lastLoginStats = StatLog.getSystemStat(SysProps.LastLogin);
|
||||||
|
|
||||||
const now = moment();
|
const now = moment();
|
||||||
|
@ -197,10 +197,10 @@ exports.getModule = class WaitingForCallerModule extends MenuModule {
|
||||||
lastLoginTime : moment(lastLoginStats.timestamp).format(this.getTimeFormat()),
|
lastLoginTime : moment(lastLoginStats.timestamp).format(this.getTimeFormat()),
|
||||||
lastLogin : moment(lastLoginStats.timestamp).format(this._dateTimeFormat('lastLogin')),
|
lastLogin : moment(lastLoginStats.timestamp).format(this._dateTimeFormat('lastLogin')),
|
||||||
|
|
||||||
totalMemoryBytes : sysMemStats.totalBytes,
|
totalMemoryBytes : sysMemStats.totalBytes || 0,
|
||||||
freeMemoryBytes : sysMemStats.freeBytes,
|
freeMemoryBytes : sysMemStats.freeBytes || 0,
|
||||||
systemAvgLoad : sysLoadStats.average,
|
systemAvgLoad : sysLoadStats.average || 0,
|
||||||
systemCurrentLoad : sysLoadStats.current,
|
systemCurrentLoad : sysLoadStats.current || 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
return cb(null);
|
return cb(null);
|
||||||
|
@ -212,10 +212,12 @@ exports.getModule = class WaitingForCallerModule extends MenuModule {
|
||||||
return cb(null);
|
return cb(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
const nodeStatusItems = getActiveConnectionList(false).slice(0, nodeStatusView.dimens.height).map(ac => {
|
const nodeStatusItems = getActiveConnectionList(false)
|
||||||
|
.slice(0, nodeStatusView.dimens.height)
|
||||||
|
.map(ac => {
|
||||||
// Handle pre-authenticated
|
// Handle pre-authenticated
|
||||||
if (!ac.authenticated) {
|
if (!ac.authenticated) {
|
||||||
ac.text = ac.userName = 'Pre Auth';
|
ac.text = ac.userName = '*Pre Auth*';
|
||||||
ac.action = 'Logging In';
|
ac.action = 'Logging In';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -248,7 +250,8 @@ exports.getModule = class WaitingForCallerModule extends MenuModule {
|
||||||
return cb(null);
|
return cb(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
const quickLogTimestampFormat = this.config.quickLogTimestampFormat ||
|
const quickLogTimestampFormat =
|
||||||
|
this.config.quickLogTimestampFormat ||
|
||||||
this.getDateTimeFormat('short');
|
this.getDateTimeFormat('short');
|
||||||
|
|
||||||
const levelIndicators = this.config.quickLogLevelIndicators ||
|
const levelIndicators = this.config.quickLogLevelIndicators ||
|
||||||
|
|
Loading…
Reference in New Issue