dankgrinder 7.64.0 → 7.66.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.
- package/lib/dashboard.js +6 -3
- package/lib/grinder.js +1 -1
- package/package.json +1 -1
package/lib/dashboard.js
CHANGED
|
@@ -59,7 +59,7 @@ function fmtUptime(startTime) {
|
|
|
59
59
|
// ── Render ──────────────────────────────────────────────────────
|
|
60
60
|
|
|
61
61
|
function renderDashboard(ctx) {
|
|
62
|
-
if (!ctx.dashboardStarted || ctx.workers.length === 0 || ctx.dashboardRendering) return;
|
|
62
|
+
if (!ctx.dashboardStarted || ctx.workers.length === 0 || ctx.dashboardRendering || ctx.shutdownCalled) return;
|
|
63
63
|
|
|
64
64
|
initColors(ctx);
|
|
65
65
|
|
|
@@ -141,7 +141,7 @@ function renderDashboard(ctx) {
|
|
|
141
141
|
const statsRow = [
|
|
142
142
|
`${G}${fmtCoins(aggCoins)}${_} ${D}coins${_}`,
|
|
143
143
|
`${G}${successRate}%${_} ${D}success${_}`,
|
|
144
|
-
`${W}${fmtCoins(sessionPeakCoins)}${_} ${D}peak${_}`,
|
|
144
|
+
`${W}${fmtCoins(ctx.sessionPeakCoins)}${_} ${D}peak${_}`,
|
|
145
145
|
ctx.isNewHigh ? `${Au}★ NEW HIGH${_}` : '',
|
|
146
146
|
].filter(Boolean).join(` ${D}│${_} `);
|
|
147
147
|
|
|
@@ -269,10 +269,13 @@ function renderDashboard(ctx) {
|
|
|
269
269
|
rows.push(`${A}${BOX.dbl}${BOX.dh.repeat(tw - 2)}${BOX.dbr}${_}`);
|
|
270
270
|
|
|
271
271
|
// ── Flush ────────────────────────────────────────────────────
|
|
272
|
-
|
|
272
|
+
// Clear entire screen buffer first so old startup logs don't bleed through
|
|
273
|
+
process.stdout.write('\x1b[2J\x1b[H');
|
|
274
|
+
process.stdout.write(_c.hide);
|
|
273
275
|
for (const row of rows) {
|
|
274
276
|
process.stdout.write(`${_c.clearLine}\r${row}\n`);
|
|
275
277
|
}
|
|
278
|
+
process.stdout.write(_c.show);
|
|
276
279
|
const leftover = ctx.dashboardLines - rows.length;
|
|
277
280
|
if (leftover > 0) {
|
|
278
281
|
process.stdout.write(`\x1b[${leftover}B\x1b[2K`);
|
package/lib/grinder.js
CHANGED