feat(mining): persistent start/stop error caption + timeout-aware pool status
- A mining start/stop/pool failure now sets a persistent App::mining_last_error_ (cleared on the next attempt), rendered as a red caption with "Press Mine to try again" below the Mine button (plus a Dismiss, and a Windows-Defender "How to fix" on an AV block), so a crashed/blocked/failed miner is no longer just a button that "did nothing" once its toast faded. Two more hardcoded English strings (pool-payout-invalid, AV-blocked) moved to i18n. - Pool connection status is now a persistent "Status" row in the pool stats card (PoolMiningState.running_since / last_error): it flips from "Connecting…" to "Can't reach pool — check the URL" after a 30s timeout instead of sitting on red forever, and no longer vanishes once logs arrive. The old transient banner in mining_tab.cpp was removed. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -335,24 +335,9 @@ static void RenderMiningTabContent(App* app)
|
||||
isMiningActive, s_pool_mode, availWidth, glassSpec, sHdr, gapOver);
|
||||
|
||||
// ================================================================
|
||||
// POOL CONNECTION STATUS — inline indicator (pool mode, no log)
|
||||
// ================================================================
|
||||
if (s_pool_mode && state.pool_mining.log_lines.empty() && state.pool_mining.xmrig_running) {
|
||||
ImFont* iconFont = Type().iconSmall();
|
||||
const char* dotIcon = ICON_MD_CIRCLE;
|
||||
ImU32 dotCol = state.pool_mining.connected ? WithAlpha(Success(), 200) : WithAlpha(Error(), 200);
|
||||
const char* statusText = state.pool_mining.connected
|
||||
? (state.pool_mining.pool_url.empty() ? TR("mining_connected") : state.pool_mining.pool_url.c_str())
|
||||
: TR("mining_connecting");
|
||||
|
||||
ImVec2 pos = ImGui::GetCursorScreenPos();
|
||||
ImVec2 dotSz = iconFont->CalcTextSizeA(iconFont->LegacySize, 1000.0f, 0.0f, dotIcon);
|
||||
dl->AddText(iconFont, iconFont->LegacySize, pos, dotCol, dotIcon);
|
||||
dl->AddText(capFont, capFont->LegacySize,
|
||||
ImVec2(pos.x + dotSz.x + 4 * dp, pos.y + (dotSz.y - capFont->LegacySize) * 0.5f),
|
||||
OnSurfaceMedium(), statusText);
|
||||
ImGui::Dummy(ImVec2(availWidth, capFont->LegacySize + 4 * dp));
|
||||
}
|
||||
// (Pool connection status now lives as a persistent, timeout-aware row in RenderLeftPoolCard
|
||||
// (mining_stats.cpp) — the old transient "Connecting" banner that vanished once logs arrived and
|
||||
// sat on red forever on failure was removed.)
|
||||
}
|
||||
|
||||
} // namespace ui
|
||||
|
||||
Reference in New Issue
Block a user