@bulletproof-sh/ctrl-daemon 0.0.12 → 0.0.14
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/dist/index.js +12 -24
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4315,7 +4315,7 @@ var PANEL_MARGIN_X = 5;
|
|
|
4315
4315
|
var PANEL_MARGIN_Y = 3;
|
|
4316
4316
|
var PANEL_MIN_WIDTH = 40;
|
|
4317
4317
|
var PANEL_MIN_HEIGHT = 12;
|
|
4318
|
-
var PANEL_HEADER_HEIGHT =
|
|
4318
|
+
var PANEL_HEADER_HEIGHT = 9;
|
|
4319
4319
|
var LOG_RING_SIZE = 200;
|
|
4320
4320
|
var BORDER_GLOW_SPEED = 0.05;
|
|
4321
4321
|
var BOX = {
|
|
@@ -4383,8 +4383,8 @@ function startSpinner(text) {
|
|
|
4383
4383
|
function buildWebUrl(port, host) {
|
|
4384
4384
|
if (port === DEFAULT_WS_PORT)
|
|
4385
4385
|
return WEB_APP_BASE_URL;
|
|
4386
|
-
const
|
|
4387
|
-
return `${WEB_APP_BASE_URL}?daemon
|
|
4386
|
+
const clientHost = host === "0.0.0.0" ? "localhost" : host;
|
|
4387
|
+
return `${WEB_APP_BASE_URL}?daemon=ws://${clientHost}:${port}/ws`;
|
|
4388
4388
|
}
|
|
4389
4389
|
function printReady(port, host, version2, updateMsg) {
|
|
4390
4390
|
const versionStr = version2 ? ` ${DM}v${version2}${RS}` : "";
|
|
@@ -5331,33 +5331,21 @@ function renderPanel(buf, panel, logs, agentCount, clientCount, version2, webUrl
|
|
|
5331
5331
|
}
|
|
5332
5332
|
}
|
|
5333
5333
|
if (version2 && LOGO_LINES.length >= 3) {
|
|
5334
|
-
const
|
|
5334
|
+
const infoStr = `v${version2} \xB7 ${agentCount} agent${agentCount !== 1 ? "s" : ""} \xB7 ${clientCount} client${clientCount !== 1 ? "s" : ""}`;
|
|
5335
5335
|
const maxLen = innerWidth - (LOGO_LINES[2]?.length || 0) - 3;
|
|
5336
|
-
if (maxLen > 4) {
|
|
5337
|
-
const trimmed = vStr.slice(0, maxLen);
|
|
5338
|
-
const col = x + width - 2 - trimmed.length;
|
|
5339
|
-
writeString(buf, logoStartRow + 2, col, trimmed, CYAN_FG, false, true);
|
|
5340
|
-
}
|
|
5341
|
-
}
|
|
5342
|
-
if (LOGO_LINES.length >= 4) {
|
|
5343
|
-
const maxLen = innerWidth - (LOGO_LINES[3]?.length || 0) - 3;
|
|
5344
5336
|
if (maxLen > 10) {
|
|
5345
|
-
const trimmed =
|
|
5337
|
+
const trimmed = infoStr.slice(0, maxLen);
|
|
5346
5338
|
const col = x + width - 2 - trimmed.length;
|
|
5347
|
-
writeString(buf, logoStartRow +
|
|
5339
|
+
writeString(buf, logoStartRow + 2, col, trimmed, CYAN_FG, false, true);
|
|
5348
5340
|
}
|
|
5349
5341
|
}
|
|
5350
|
-
|
|
5351
|
-
|
|
5352
|
-
const
|
|
5353
|
-
const
|
|
5354
|
-
|
|
5355
|
-
const trimmed = statusStr.slice(0, maxCountLen);
|
|
5356
|
-
const countCol = x + width - 2 - trimmed.length;
|
|
5357
|
-
writeString(buf, logoStartRow + 4, countCol, trimmed, BRIGHT_GREEN_FG, false, false);
|
|
5358
|
-
}
|
|
5342
|
+
const urlRow = logoStartRow + LOGO_LINES.length;
|
|
5343
|
+
if (urlRow < y + height - 2) {
|
|
5344
|
+
const trimmed = webUrl.slice(0, innerWidth - 2);
|
|
5345
|
+
const col = x + 1 + Math.floor((innerWidth - trimmed.length) / 2);
|
|
5346
|
+
writeString(buf, urlRow, col, trimmed, CYAN_FG, false, false);
|
|
5359
5347
|
}
|
|
5360
|
-
const sepRow =
|
|
5348
|
+
const sepRow = urlRow + 1;
|
|
5361
5349
|
if (sepRow < y + height - 1) {
|
|
5362
5350
|
const sepBorderIdx = Math.floor(glowPosition) % perimeter;
|
|
5363
5351
|
setCell(buf, sepRow, x, BOX.teeLeft, borderColor(sepBorderIdx, perimeter), false, false);
|