nodestatus-server 1.2.7-beta.2 → 1.2.7-beta.4
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.
- package/bin/status-server-run.js +34 -24
- package/bin/status-server.js +10 -1
- package/build/app.js +1875 -1297
- package/build/dist/classic-theme/assets/{index-75b2bf1d.js → index-331c683d.js} +5 -5
- package/build/dist/classic-theme/index.html +1 -1
- package/build/dist/hotaru-admin/assets/{LayoutHandler-f3a343bd.js → LayoutHandler-4ab98254.js} +10 -10
- package/build/dist/hotaru-admin/assets/{Login-f981d11a.js → Login-b137505a.js} +1 -1
- package/build/dist/hotaru-admin/assets/UserOutlined-c7a36e46.js +14 -0
- package/build/dist/hotaru-admin/assets/{index-fc9231c6.js → index-e73521eb.js} +3 -3
- package/build/dist/hotaru-admin/index.html +1 -1
- package/build/dist/hotaru-theme/assets/{index-acb175d2.js → index-d4dd98f1.js} +1 -1
- package/build/dist/hotaru-theme/index.html +1 -1
- package/package.json +11 -11
- package/prisma/.env +0 -1
- package/prisma/schema.prisma +2 -3
- package/scripts/init.js +3 -2
- package/build/dist/hotaru-admin/assets/UserOutlined-61bab922.js +0 -14
package/bin/status-server-run.js
CHANGED
|
@@ -3,28 +3,38 @@ const path = require('path');
|
|
|
3
3
|
|
|
4
4
|
const args = process.argv.slice(2).join(' ');
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
pm2.disconnect();
|
|
6
|
+
const cp = require('child_process');
|
|
7
|
+
const { platform } = require('os');
|
|
8
|
+
const { resolve } = require('path');
|
|
9
|
+
|
|
10
|
+
cp.spawn(platform() === 'win32' ? 'npm.cmd' : 'npm', ['run', 'prestart'], {
|
|
11
|
+
env: process.env,
|
|
12
|
+
cwd: resolve(__dirname, '../'),
|
|
13
|
+
stdio: 'inherit'
|
|
14
|
+
}).on('close', () => {
|
|
15
|
+
try {
|
|
16
|
+
const pm2 = require('pm2');
|
|
17
|
+
pm2.connect(error => {
|
|
18
|
+
if (error) {
|
|
19
|
+
console.log(error);
|
|
20
|
+
process.exit(2);
|
|
22
21
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
22
|
+
pm2.start(
|
|
23
|
+
{
|
|
24
|
+
name: 'nodestatus',
|
|
25
|
+
script: path.resolve(__dirname, '../build/app.js'),
|
|
26
|
+
args
|
|
27
|
+
},
|
|
28
|
+
error => {
|
|
29
|
+
if (error) throw error.message;
|
|
30
|
+
pm2.disconnect();
|
|
31
|
+
}
|
|
32
|
+
);
|
|
33
|
+
});
|
|
34
|
+
} catch (error) {
|
|
35
|
+
console.log(`[ERROR]: ${error.message || error}`);
|
|
36
|
+
console.log('Something wrong. Please check if you have installed pm2 correctly.');
|
|
37
|
+
console.log('Fallback to non-pm2 daemon');
|
|
38
|
+
require('../build/app');
|
|
39
|
+
}
|
|
40
|
+
});
|
package/bin/status-server.js
CHANGED
|
@@ -1,2 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
const cp = require('child_process');
|
|
4
|
+
const { platform } = require('os');
|
|
5
|
+
const { resolve } = require('path');
|
|
6
|
+
|
|
7
|
+
cp.spawn(platform() === 'win32' ? 'npm.cmd' : 'npm', ['run', 'start'], {
|
|
8
|
+
env: process.env,
|
|
9
|
+
cwd: resolve(__dirname, '../'),
|
|
10
|
+
stdio: 'inherit'
|
|
11
|
+
});
|