hedgequantx 2.7.30 → 2.7.32
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/package.json +1 -1
- package/src/app.js +4 -6
- package/src/services/cliproxy/manager.js +32 -9
package/package.json
CHANGED
package/src/app.js
CHANGED
|
@@ -175,11 +175,12 @@ const run = async () => {
|
|
|
175
175
|
const boxWidth = getLogoWidth();
|
|
176
176
|
const innerWidth = boxWidth - 2;
|
|
177
177
|
|
|
178
|
-
// Show loading inside the box
|
|
179
|
-
console.log(chalk.cyan('╠' + '═'.repeat(innerWidth) + '╣'));
|
|
178
|
+
// Show loading inside the box (no extra borders)
|
|
180
179
|
const loadingText = ' LOADING DASHBOARD...';
|
|
181
180
|
const loadingPad = innerWidth - loadingText.length;
|
|
182
|
-
|
|
181
|
+
console.log(chalk.cyan('╠' + '═'.repeat(innerWidth) + '╣'));
|
|
182
|
+
console.log(chalk.cyan('║') + chalk.yellow(loadingText) + ' '.repeat(loadingPad) + chalk.cyan('║'));
|
|
183
|
+
console.log(chalk.cyan('╚' + '═'.repeat(innerWidth) + '╝'));
|
|
183
184
|
|
|
184
185
|
const restored = await connections.restoreFromStorage();
|
|
185
186
|
|
|
@@ -187,9 +188,6 @@ const run = async () => {
|
|
|
187
188
|
currentService = connections.getAll()[0].service;
|
|
188
189
|
await refreshStats();
|
|
189
190
|
}
|
|
190
|
-
|
|
191
|
-
// Clear loading line
|
|
192
|
-
process.stdout.write('\r' + ' '.repeat(boxWidth + 2) + '\r');
|
|
193
191
|
|
|
194
192
|
// Main loop
|
|
195
193
|
while (true) {
|
|
@@ -28,24 +28,47 @@ const DEFAULT_PORT = 8317;
|
|
|
28
28
|
const CALLBACK_PORT = 54545;
|
|
29
29
|
|
|
30
30
|
/**
|
|
31
|
-
* Detect if running in headless/VPS environment (no
|
|
31
|
+
* Detect if running in headless/VPS environment (no browser access)
|
|
32
32
|
* @returns {boolean}
|
|
33
33
|
*/
|
|
34
34
|
const isHeadless = () => {
|
|
35
|
-
//
|
|
36
|
-
if (process.env.
|
|
37
|
-
|
|
35
|
+
// 1. SSH connection = definitely VPS/remote
|
|
36
|
+
if (process.env.SSH_CLIENT || process.env.SSH_TTY || process.env.SSH_CONNECTION) {
|
|
37
|
+
return true;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// 2. Docker/container environment
|
|
41
|
+
if (process.env.DOCKER_CONTAINER || process.env.KUBERNETES_SERVICE_HOST) {
|
|
42
|
+
return true;
|
|
43
|
+
}
|
|
38
44
|
|
|
39
|
-
//
|
|
40
|
-
if (process.env.
|
|
45
|
+
// 3. Common CI/CD environments
|
|
46
|
+
if (process.env.CI || process.env.GITHUB_ACTIONS || process.env.GITLAB_CI) {
|
|
47
|
+
return true;
|
|
48
|
+
}
|
|
41
49
|
|
|
42
|
-
// Check
|
|
50
|
+
// 4. Check for display on Linux
|
|
43
51
|
if (process.platform === 'linux') {
|
|
44
|
-
//
|
|
52
|
+
// Has display = local with GUI
|
|
53
|
+
if (process.env.DISPLAY || process.env.WAYLAND_DISPLAY) {
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
// No display on Linux = likely headless/VPS
|
|
45
57
|
return true;
|
|
46
58
|
}
|
|
47
59
|
|
|
48
|
-
// macOS
|
|
60
|
+
// 5. macOS - check if running in terminal with GUI access
|
|
61
|
+
if (process.platform === 'darwin') {
|
|
62
|
+
// macOS always has GUI unless SSH (checked above)
|
|
63
|
+
return false;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// 6. Windows - usually has GUI
|
|
67
|
+
if (process.platform === 'win32') {
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// Default: assume local
|
|
49
72
|
return false;
|
|
50
73
|
};
|
|
51
74
|
|