fix: restore clamav version to stats menu

i had to move over scanner logic to its own module last time,
so i commented out the stats entry as i was cleaning it up, but forgot
to re-add it after finishing it
This commit is contained in:
Bobby 2022-10-08 18:46:18 +07:00
parent 9d464c6894
commit effdf8c607
No known key found for this signature in database
GPG Key ID: 941839794CBF5A09

View File

@ -3,6 +3,7 @@ const si = require('systeminformation')
const paths = require('./../pathsController')
const perms = require('./../permissionController')
const Constants = require('./Constants')
const ScannerManager = require('./ScannerManager')
const logger = require('./../../logger')
const self = {
@ -12,6 +13,10 @@ const self = {
},
Type: Object.freeze({
// Should contain key value: string | number
// Client is expected to automatically assume this type
// if "type" attribute is not specified (number should also be localized)
AUTO: 'auto',
// Should contain key value: number
UPTIME: 'uptime',
// Should contain key value: number
@ -92,20 +97,11 @@ self.getSystemInfo = async () => {
self.getServiceInfo = async () => {
const nodeUptime = process.uptime()
/*
if (self.scan.instance) {
try {
self.scan.version = await self.scan.instance.getVersion().then(s => s.trim())
} catch (error) {
logger.error(error)
self.scan.version = 'Errored when querying version.'
}
}
*/
return {
'Node.js': `${process.versions.node}`,
// Scanner: self.scan.version || 'N/A',
Scanner: ScannerManager.instance
? ScannerManager.version
: { value: null, type: self.Type.UNAVAILABLE },
'Memory Usage': {
value: process.memoryUsage().rss,
type: self.Type.BYTE