@drocketxx/pm2me 1.1.5 → 1.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -59,7 +59,7 @@ router.get('/pm2/version-check', async (req, res) => {
59
59
  // Get latest version from npm registry
60
60
  let latestVersion = null;
61
61
  try {
62
- const { stdout } = await execAsync('npm view pm2 version');
62
+ const { stdout } = await execAsync('npm view pm2 version', { windowsHide: true });
63
63
  latestVersion = stdout.trim();
64
64
  } catch {
65
65
  latestVersion = null;
@@ -78,7 +78,7 @@ router.get('/pm2/version-check', async (req, res) => {
78
78
  router.post('/pm2/install-update', async (req, res) => {
79
79
  try {
80
80
  res.writeHead(200, { 'Content-Type': 'text/plain', 'Transfer-Encoding': 'chunked' });
81
- const child = exec('npm install -g pm2@latest');
81
+ const child = exec('npm install -g pm2@latest', { windowsHide: true });
82
82
  child.stdout.on('data', (d) => res.write(d));
83
83
  child.stderr.on('data', (d) => res.write(d));
84
84
  child.on('close', (code) => {
@@ -32,7 +32,7 @@ export const getSystemStats = async () => {
32
32
  const promises = [];
33
33
 
34
34
  // 1. CPU Usage (Every time)
35
- const cpuPromise = execPromise('powershell -Command "(Get-Counter \'\\Processor(_Total)\\% Processor Time\' -ErrorAction SilentlyContinue).CounterSamples.CookedValue"', { windowsHide: true })
35
+ const cpuPromise = execPromise('powershell -WindowStyle Hidden -Command "(Get-Counter \'\\Processor(_Total)\\% Processor Time\' -ErrorAction SilentlyContinue).CounterSamples.CookedValue"', { windowsHide: true })
36
36
  .then(({ stdout }) => {
37
37
  const realCpu = parseFloat(stdout.trim());
38
38
  if (!isNaN(realCpu)) cpuUsage = realCpu;
@@ -41,7 +41,7 @@ export const getSystemStats = async () => {
41
41
  promises.push(cpuPromise);
42
42
 
43
43
  // 2. Network Stats (Every time)
44
- const netPromise = execPromise('powershell -Command "Get-NetAdapterStatistics | Select-Object ReceivedBytes, SentBytes | ConvertTo-Json"', { windowsHide: true })
44
+ const netPromise = execPromise('powershell -WindowStyle Hidden -Command "Get-NetAdapterStatistics | Select-Object ReceivedBytes, SentBytes | ConvertTo-Json"', { windowsHide: true })
45
45
  .then(({ stdout }) => {
46
46
  const netData = JSON.parse(stdout);
47
47
  let totalRx = 0;
@@ -67,7 +67,7 @@ export const getSystemStats = async () => {
67
67
 
68
68
  // 3. Disk Stats (Cached)
69
69
  if (now - cachedDiskStats.lastFetch > DISK_CACHE_TTL) {
70
- const diskPromise = execPromise('powershell -Command "Get-Volume -DriveLetter C | Select-Object Size, SizeRemaining | ConvertTo-Json"', { windowsHide: true })
70
+ const diskPromise = execPromise('powershell -WindowStyle Hidden -Command "Get-Volume -DriveLetter C | Select-Object Size, SizeRemaining | ConvertTo-Json"', { windowsHide: true })
71
71
  .then(({ stdout }) => {
72
72
  const data = JSON.parse(stdout);
73
73
  if (data.Size > 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drocketxx/pm2me",
3
- "version": "1.1.5",
3
+ "version": "1.1.7",
4
4
  "description": "PM2 Deployment and Management System — Web UI for PM2 process management",
5
5
  "type": "module",
6
6
  "main": "backend/app.js",