1- const os = require ( "node:os" ) ;
21const fs = require ( "node:fs" ) ;
3- const si = require ( "systeminformation" ) ;
4- const Log = require ( "./logger" ) ; // needed with relative path because logSystemInformation is called in an own process in app.js
2+ const Log = require ( "logger" ) ;
53
64const modulePositions = [ ] ; // will get list from index.html
75const regionRegEx = / " r e g i o n ( [ ^ " ] * ) / i;
@@ -10,37 +8,6 @@ const discoveredPositionsJSFilename = "js/positions.js";
108
119module . exports = {
1210
13- async logSystemInformation ( mirrorVersion ) {
14- try {
15- const system = await si . system ( ) ;
16- const osInfo = await si . osInfo ( ) ;
17- const versions = await si . versions ( ) ;
18-
19- const usedNodeVersion = process . version . replace ( "v" , "" ) ;
20- const installedNodeVersion = versions . node ;
21- const totalRam = ( os . totalmem ( ) / 1024 / 1024 ) . toFixed ( 2 ) ;
22- const freeRam = ( os . freemem ( ) / 1024 / 1024 ) . toFixed ( 2 ) ;
23- const usedRam = ( ( os . totalmem ( ) - os . freemem ( ) ) / 1024 / 1024 ) . toFixed ( 2 ) ;
24-
25- let systemDataString = [
26- "\n#### System Information ####" ,
27- `- SYSTEM: manufacturer: ${ system . manufacturer } ; model: ${ system . model } ; virtual: ${ system . virtual } ; MM: ${ mirrorVersion } ` ,
28- `- OS: platform: ${ osInfo . platform } ; distro: ${ osInfo . distro } ; release: ${ osInfo . release } ; arch: ${ osInfo . arch } ; kernel: ${ versions . kernel } ` ,
29- `- VERSIONS: electron: ${ process . versions . electron } ; used node: ${ usedNodeVersion } ; installed node: ${ installedNodeVersion } ; npm: ${ versions . npm } ; pm2: ${ versions . pm2 } ` ,
30- `- ENV: XDG_SESSION_TYPE: ${ process . env . XDG_SESSION_TYPE } ; MM_CONFIG_FILE: ${ process . env . MM_CONFIG_FILE } ` ,
31- ` WAYLAND_DISPLAY: ${ process . env . WAYLAND_DISPLAY } ; DISPLAY: ${ process . env . DISPLAY } ; ELECTRON_ENABLE_GPU: ${ process . env . ELECTRON_ENABLE_GPU } ` ,
32- `- RAM: total: ${ totalRam } MB; free: ${ freeRam } MB; used: ${ usedRam } MB` ,
33- `- OTHERS: uptime: ${ Math . floor ( os . uptime ( ) / 60 ) } minutes; timeZone: ${ Intl . DateTimeFormat ( ) . resolvedOptions ( ) . timeZone } `
34- ] . join ( "\n" ) ;
35- Log . info ( systemDataString ) ;
36-
37- // Return is currently only for tests
38- return systemDataString ;
39- } catch ( error ) {
40- Log . error ( error ) ;
41- }
42- } ,
43-
4411 // return all available module positions
4512 getAvailableModulePositions ( ) {
4613 return modulePositions ;
0 commit comments