From 08108454ea1031944f0e72c466a2dea54d962e00 Mon Sep 17 00:00:00 2001 From: Cyrix126 Date: Fri, 3 Jan 2025 14:48:01 +0100 Subject: [PATCH] feat: Status, add miners connected to Proxy column --- src/app/panels/middle/status/processes.rs | 4 ++++ src/helper/xrig/xmrig_proxy.rs | 3 +++ src/utils/constants.rs | 1 + 3 files changed, 8 insertions(+) diff --git a/src/app/panels/middle/status/processes.rs b/src/app/panels/middle/status/processes.rs index 6b11b43..43c89de 100644 --- a/src/app/panels/middle/status/processes.rs +++ b/src/app/panels/middle/status/processes.rs @@ -267,6 +267,10 @@ fn xmrig_proxy( "[Accepted: {}]\n[Rejected: {}]", api.accepted, api.rejected )); + ui.label(RichText::new("Miners Connected").underline().color(BONE)) + .on_hover_text(STATUS_PROXY_CONNECTIONS); + ui.label(api.miners.to_string()); + ui.label(RichText::new("Pool").underline().color(BONE)) .on_hover_text(STATUS_XMRIG_PROXY_POOL); ui.label(api.node.to_string()); diff --git a/src/helper/xrig/xmrig_proxy.rs b/src/helper/xrig/xmrig_proxy.rs index d53c648..6a198f6 100644 --- a/src/helper/xrig/xmrig_proxy.rs +++ b/src/helper/xrig/xmrig_proxy.rs @@ -510,6 +510,7 @@ pub struct PubXmrigProxyApi { pub hashrate_1h: f32, pub hashrate_12h: f32, pub hashrate_24h: f32, + pub miners: u16, pub node: String, } @@ -531,6 +532,7 @@ impl PubXmrigProxyApi { hashrate_1h: 0.0, hashrate_12h: 0.0, hashrate_24h: 0.0, + miners: 0, node: UNKNOWN_DATA.to_string(), } } @@ -604,6 +606,7 @@ impl PubXmrigProxyApi { hashrate_1h: private.hashrate.total[2], hashrate_12h: private.hashrate.total[3], hashrate_24h: private.hashrate.total[4], + miners: private.miners.now, ..std::mem::take(&mut *public) } } diff --git a/src/utils/constants.rs b/src/utils/constants.rs index b37d30c..de84a8d 100644 --- a/src/utils/constants.rs +++ b/src/utils/constants.rs @@ -249,6 +249,7 @@ pub const STATUS_XMRIG_DIFFICULTY: &str = "The current difficulty of the job XMR pub const STATUS_XMRIG_SHARES: &str = "The amount of accepted and rejected shares"; pub const STATUS_XMRIG_POOL: &str = "The pool XMRig is currently mining to"; pub const STATUS_XMRIG_THREADS: &str = "The amount of threads XMRig is currently using"; +pub const STATUS_PROXY_CONNECTIONS: &str = "The total amount of miner connections on this Proxy"; //-- pub const STATUS_XVB_TIME_REMAIN: &str = "Minutes left before end of round"; pub const STATUS_XVB_ROUND_TYPE: &str = "The current round type";