ezpm2gui 1.6.0 → 1.8.0

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.
Files changed (41) hide show
  1. package/README.md +330 -321
  2. package/bin/ezpm2gui.js +8 -8
  3. package/bin/ezpm2gui.ts +51 -51
  4. package/bin/generate-ecosystem.js +35 -35
  5. package/bin/generate-ecosystem.ts +56 -56
  6. package/dist/server/config/cron-jobs.json +1 -0
  7. package/dist/server/config/project-configs.json +235 -236
  8. package/dist/server/config/remote-connections.json +3 -0
  9. package/dist/server/index.js +42 -3
  10. package/dist/server/routes/deployApplication.js +47 -45
  11. package/dist/server/routes/logStreaming.js +31 -24
  12. package/dist/server/routes/modules.js +55 -0
  13. package/dist/server/routes/pageAuth.js +3 -3
  14. package/dist/server/routes/remoteConnections.js +13 -9
  15. package/dist/server/routes/remoteMetrics.d.ts +3 -0
  16. package/dist/server/routes/remoteMetrics.js +84 -0
  17. package/dist/server/services/ProjectSetupService.d.ts +1 -1
  18. package/dist/server/services/ProjectSetupService.js +25 -9
  19. package/dist/server/utils/metrics-history.d.ts +21 -0
  20. package/dist/server/utils/metrics-history.js +68 -0
  21. package/dist/server/utils/remote-metrics-db.d.ts +29 -0
  22. package/dist/server/utils/remote-metrics-db.js +134 -0
  23. package/dist/server/utils/remote-metrics-poller.d.ts +8 -0
  24. package/dist/server/utils/remote-metrics-poller.js +67 -0
  25. package/package.json +86 -73
  26. package/scripts/postinstall.js +36 -36
  27. package/src/client/build/asset-manifest.json +6 -6
  28. package/src/client/build/favicon.ico +2 -2
  29. package/src/client/build/index.html +1 -1
  30. package/src/client/build/logo192.svg +7 -7
  31. package/src/client/build/logo512.svg +7 -7
  32. package/src/client/build/manifest.json +24 -24
  33. package/src/client/build/static/css/main.9decb204.css +5 -0
  34. package/src/client/build/static/css/main.9decb204.css.map +1 -0
  35. package/src/client/build/static/js/main.28a4a583.js +3 -0
  36. package/src/client/build/static/js/main.28a4a583.js.map +1 -0
  37. package/src/client/build/static/css/main.775772ee.css +0 -5
  38. package/src/client/build/static/css/main.775772ee.css.map +0 -1
  39. package/src/client/build/static/js/main.cbcb09c9.js +0 -3
  40. package/src/client/build/static/js/main.cbcb09c9.js.map +0 -1
  41. /package/src/client/build/static/js/{main.cbcb09c9.js.LICENSE.txt → main.28a4a583.js.LICENSE.txt} +0 -0
package/bin/ezpm2gui.js CHANGED
@@ -17,14 +17,14 @@ if (!fs_1.default.existsSync(serverPath)) {
17
17
  // Start the server
18
18
  const server = (0, child_process_1.spawn)('node', [serverPath], { stdio: 'inherit' });
19
19
  // Log startup message
20
- console.log('\x1b[36m%s\x1b[0m', `
21
- ╔════════════════════════════════════╗
22
- ║ EZ PM2 GUI Started ║
23
- ╚════════════════════════════════════╝
24
-
25
- Web interface available at: \x1b[1mhttp://localhost:3101\x1b[0m
26
-
27
- Press Ctrl+C to stop the server.
20
+ console.log('\x1b[36m%s\x1b[0m', `
21
+ ╔════════════════════════════════════╗
22
+ ║ EZ PM2 GUI Started ║
23
+ ╚════════════════════════════════════╝
24
+
25
+ Web interface available at: \x1b[1mhttp://localhost:3101\x1b[0m
26
+
27
+ Press Ctrl+C to stop the server.
28
28
  `);
29
29
  // Handle server process events
30
30
  server.on('error', (err) => {
package/bin/ezpm2gui.ts CHANGED
@@ -1,51 +1,51 @@
1
- #!/usr/bin/env node
2
- import { spawn, ChildProcess } from 'child_process';
3
- import path from 'path';
4
- import fs from 'fs';
5
-
6
- // Determine the path to the server executable
7
- const serverPath = path.join(__dirname, '../dist/server/index.js');
8
-
9
- // Check if the server file exists
10
- if (!fs.existsSync(serverPath)) {
11
- console.error('Error: Server executable not found. Please make sure the package is built correctly.');
12
- process.exit(1);
13
- }
14
-
15
- // Start the server
16
- const server: ChildProcess = spawn('node', [serverPath], { stdio: 'inherit' });
17
-
18
- // Log startup message
19
- console.log('\x1b[36m%s\x1b[0m', `
20
- ╔════════════════════════════════════╗
21
- ║ EZ PM2 GUI Started ║
22
- ╚════════════════════════════════════╝
23
-
24
- Web interface available at: \x1b[1mhttp://localhost:3101\x1b[0m
25
-
26
- Press Ctrl+C to stop the server.
27
- `);
28
-
29
- // Handle server process events
30
- server.on('error', (err: Error) => {
31
- console.error('Failed to start server:', err);
32
- process.exit(1);
33
- });
34
-
35
- server.on('exit', (code: number | null) => {
36
- if (code !== 0) {
37
- console.error(`Server process exited with code ${code}`);
38
- }
39
- process.exit(code || 0);
40
- });
41
-
42
- // Handle termination signals
43
- process.on('SIGINT', () => {
44
- console.log('\nShutting down EZ PM2 GUI...');
45
- server.kill();
46
- });
47
-
48
- process.on('SIGTERM', () => {
49
- console.log('\nShutting down EZ PM2 GUI...');
50
- server.kill();
51
- });
1
+ #!/usr/bin/env node
2
+ import { spawn, ChildProcess } from 'child_process';
3
+ import path from 'path';
4
+ import fs from 'fs';
5
+
6
+ // Determine the path to the server executable
7
+ const serverPath = path.join(__dirname, '../dist/server/index.js');
8
+
9
+ // Check if the server file exists
10
+ if (!fs.existsSync(serverPath)) {
11
+ console.error('Error: Server executable not found. Please make sure the package is built correctly.');
12
+ process.exit(1);
13
+ }
14
+
15
+ // Start the server
16
+ const server: ChildProcess = spawn('node', [serverPath], { stdio: 'inherit' });
17
+
18
+ // Log startup message
19
+ console.log('\x1b[36m%s\x1b[0m', `
20
+ ╔════════════════════════════════════╗
21
+ ║ EZ PM2 GUI Started ║
22
+ ╚════════════════════════════════════╝
23
+
24
+ Web interface available at: \x1b[1mhttp://localhost:3101\x1b[0m
25
+
26
+ Press Ctrl+C to stop the server.
27
+ `);
28
+
29
+ // Handle server process events
30
+ server.on('error', (err: Error) => {
31
+ console.error('Failed to start server:', err);
32
+ process.exit(1);
33
+ });
34
+
35
+ server.on('exit', (code: number | null) => {
36
+ if (code !== 0) {
37
+ console.error(`Server process exited with code ${code}`);
38
+ }
39
+ process.exit(code || 0);
40
+ });
41
+
42
+ // Handle termination signals
43
+ process.on('SIGINT', () => {
44
+ console.log('\nShutting down EZ PM2 GUI...');
45
+ server.kill();
46
+ });
47
+
48
+ process.on('SIGTERM', () => {
49
+ console.log('\nShutting down EZ PM2 GUI...');
50
+ server.kill();
51
+ });
@@ -6,41 +6,41 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  const fs_1 = __importDefault(require("fs"));
8
8
  const path_1 = __importDefault(require("path"));
9
- const ecosystemConfig = `
10
- module.exports = {
11
- apps : [
12
- {
13
- name: "my-api",
14
- script: "./api/index.js",
15
- instances: 2,
16
- exec_mode: "cluster",
17
- watch: false,
18
- env: {
19
- NODE_ENV: "production",
20
- PORT: 3000
21
- }
22
- },
23
- {
24
- name: "worker",
25
- script: "./workers/queue-processor.js",
26
- instances: 1,
27
- watch: false,
28
- env: {
29
- NODE_ENV: "production"
30
- }
31
- },
32
- {
33
- name: "cron-job",
34
- script: "./cron/scheduler.js",
35
- instances: 1,
36
- watch: false,
37
- cron_restart: "0 0 * * *",
38
- env: {
39
- NODE_ENV: "production"
40
- }
41
- }
42
- ]
43
- }
9
+ const ecosystemConfig = `
10
+ module.exports = {
11
+ apps : [
12
+ {
13
+ name: "my-api",
14
+ script: "./api/index.js",
15
+ instances: 2,
16
+ exec_mode: "cluster",
17
+ watch: false,
18
+ env: {
19
+ NODE_ENV: "production",
20
+ PORT: 3000
21
+ }
22
+ },
23
+ {
24
+ name: "worker",
25
+ script: "./workers/queue-processor.js",
26
+ instances: 1,
27
+ watch: false,
28
+ env: {
29
+ NODE_ENV: "production"
30
+ }
31
+ },
32
+ {
33
+ name: "cron-job",
34
+ script: "./cron/scheduler.js",
35
+ instances: 1,
36
+ watch: false,
37
+ cron_restart: "0 0 * * *",
38
+ env: {
39
+ NODE_ENV: "production"
40
+ }
41
+ }
42
+ ]
43
+ }
44
44
  `;
45
45
  // Get the output path
46
46
  const outputPath = process.argv[2] || 'ecosystem.config.js';
@@ -1,56 +1,56 @@
1
- #!/usr/bin/env node
2
- import fs from 'fs';
3
- import path from 'path';
4
-
5
- const ecosystemConfig = `
6
- module.exports = {
7
- apps : [
8
- {
9
- name: "my-api",
10
- script: "./api/index.js",
11
- instances: 2,
12
- exec_mode: "cluster",
13
- watch: false,
14
- env: {
15
- NODE_ENV: "production",
16
- PORT: 3000
17
- }
18
- },
19
- {
20
- name: "worker",
21
- script: "./workers/queue-processor.js",
22
- instances: 1,
23
- watch: false,
24
- env: {
25
- NODE_ENV: "production"
26
- }
27
- },
28
- {
29
- name: "cron-job",
30
- script: "./cron/scheduler.js",
31
- instances: 1,
32
- watch: false,
33
- cron_restart: "0 0 * * *",
34
- env: {
35
- NODE_ENV: "production"
36
- }
37
- }
38
- ]
39
- }
40
- `;
41
-
42
- // Get the output path
43
- const outputPath: string = process.argv[2] || 'ecosystem.config.js';
44
- const fullPath: string = path.resolve(process.cwd(), outputPath);
45
-
46
- try {
47
- // Write file
48
- fs.writeFileSync(fullPath, ecosystemConfig);
49
- console.log(`PM2 ecosystem file generated at: ${fullPath}`);
50
- console.log('\nTo start your PM2 processes with this configuration:');
51
- console.log(' pm2 start ecosystem.config.js');
52
- console.log('\nTo monitor your processes with EZ PM2 GUI:');
53
- console.log(' ezpm2gui');
54
- } catch (error) {
55
- console.error('Error generating ecosystem file:', error);
56
- }
1
+ #!/usr/bin/env node
2
+ import fs from 'fs';
3
+ import path from 'path';
4
+
5
+ const ecosystemConfig = `
6
+ module.exports = {
7
+ apps : [
8
+ {
9
+ name: "my-api",
10
+ script: "./api/index.js",
11
+ instances: 2,
12
+ exec_mode: "cluster",
13
+ watch: false,
14
+ env: {
15
+ NODE_ENV: "production",
16
+ PORT: 3000
17
+ }
18
+ },
19
+ {
20
+ name: "worker",
21
+ script: "./workers/queue-processor.js",
22
+ instances: 1,
23
+ watch: false,
24
+ env: {
25
+ NODE_ENV: "production"
26
+ }
27
+ },
28
+ {
29
+ name: "cron-job",
30
+ script: "./cron/scheduler.js",
31
+ instances: 1,
32
+ watch: false,
33
+ cron_restart: "0 0 * * *",
34
+ env: {
35
+ NODE_ENV: "production"
36
+ }
37
+ }
38
+ ]
39
+ }
40
+ `;
41
+
42
+ // Get the output path
43
+ const outputPath: string = process.argv[2] || 'ecosystem.config.js';
44
+ const fullPath: string = path.resolve(process.cwd(), outputPath);
45
+
46
+ try {
47
+ // Write file
48
+ fs.writeFileSync(fullPath, ecosystemConfig);
49
+ console.log(`PM2 ecosystem file generated at: ${fullPath}`);
50
+ console.log('\nTo start your PM2 processes with this configuration:');
51
+ console.log(' pm2 start ecosystem.config.js');
52
+ console.log('\nTo monitor your processes with EZ PM2 GUI:');
53
+ console.log(' ezpm2gui');
54
+ } catch (error) {
55
+ console.error('Error generating ecosystem file:', error);
56
+ }
@@ -0,0 +1 @@
1
+ []