mirror of
https://github.com/Cyrix126/gupaxx.git
synced 2024-11-16 15:27:46 +00:00
status: enable p2pool/xmrig "Image" stats
These couldn't be fit in before since there wasn't enough space. They still can't all fit in, but the most important ones can be after adjusting the font sizes and height spacing.
This commit is contained in:
parent
3991c26d76
commit
9d66a20360
7 changed files with 73 additions and 46 deletions
2
Cargo.lock
generated
2
Cargo.lock
generated
|
@ -1798,7 +1798,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "gupax"
|
name = "gupax"
|
||||||
version = "1.0.0"
|
version = "1.0.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"arti-client",
|
"arti-client",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "gupax"
|
name = "gupax"
|
||||||
version = "1.0.0"
|
version = "1.0.1"
|
||||||
authors = ["hinto-janaiyo <hinto.janaiyo@protonmail.com>"]
|
authors = ["hinto-janaiyo <hinto.janaiyo@protonmail.com>"]
|
||||||
description = "GUI for P2Pool+XMRig"
|
description = "GUI for P2Pool+XMRig"
|
||||||
documentation = "https://github.com/hinto-janaiyo/gupax"
|
documentation = "https://github.com/hinto-janaiyo/gupax"
|
||||||
|
|
|
@ -154,13 +154,17 @@ pub const STATUS_P2POOL_HASHRATE: &str = "The total amount of hashrate your P2Po
|
||||||
pub const STATUS_P2POOL_SHARES: &str = "The total amount of shares found on P2Pool";
|
pub const STATUS_P2POOL_SHARES: &str = "The total amount of shares found on P2Pool";
|
||||||
pub const STATUS_P2POOL_EFFORT: &str = "The average amount of effort needed to find a share, and the current effort";
|
pub const STATUS_P2POOL_EFFORT: &str = "The average amount of effort needed to find a share, and the current effort";
|
||||||
pub const STATUS_P2POOL_CONNECTIONS: &str = "The total amount of miner connections on this P2Pool";
|
pub const STATUS_P2POOL_CONNECTIONS: &str = "The total amount of miner connections on this P2Pool";
|
||||||
|
pub const STATUS_P2POOL_MONERO_NODE: &str = "The Monero node being used by P2Pool";
|
||||||
|
pub const STATUS_P2POOL_POOL: &str = "The P2Pool sidechain you're currently connected to";
|
||||||
|
pub const STATUS_P2POOL_ADDRESS: &str = "The Monero address P2Pool will send payouts to";
|
||||||
//--
|
//--
|
||||||
pub const STATUS_XMRIG_UPTIME: &str = "How long XMRig has been online";
|
pub const STATUS_XMRIG_UPTIME: &str = "How long XMRig has been online";
|
||||||
pub const STATUS_XMRIG_CPU: &str = "The average CPU load of XMRig";
|
pub const STATUS_XMRIG_CPU: &str = "The average CPU load of XMRig. [1.0] represents 1 thread is maxed out, e.g: If you have 8 threads, [4.0] means half your threads are maxed out.";
|
||||||
pub const STATUS_XMRIG_HASHRATE: &str = "The average hashrate of XMRig";
|
pub const STATUS_XMRIG_HASHRATE: &str = "The average hashrate of XMRig";
|
||||||
pub const STATUS_XMRIG_DIFFICULTY: &str = "The current difficulty of the job XMRig is working on";
|
pub const STATUS_XMRIG_DIFFICULTY: &str = "The current difficulty of the job XMRig is working on";
|
||||||
pub const STATUS_XMRIG_SHARES: &str = "The amount of accepted and rejected shares";
|
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_POOL: &str = "The pool XMRig is currently mining to";
|
||||||
|
pub const STATUS_XMRIG_THREADS: &str = "The amount of threads XMRig is currently using";
|
||||||
|
|
||||||
// Gupax
|
// Gupax
|
||||||
pub const GUPAX_UPDATE: &str = "Check for updates on Gupax, P2Pool, and XMRig via GitHub's API and upgrade automatically";
|
pub const GUPAX_UPDATE: &str = "Check for updates on Gupax, P2Pool, and XMRig via GitHub's API and upgrade automatically";
|
||||||
|
|
|
@ -329,6 +329,15 @@ impl Helper {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Takes in a 95-char Monero address, returns the first and last
|
||||||
|
// 6 characters separated with dots like so: [4abcde...abcdef]
|
||||||
|
fn head_tail_of_monero_address(address: &str) -> String {
|
||||||
|
if address.len() < 95 { return "???".to_string() }
|
||||||
|
let head = &address[0..5];
|
||||||
|
let tail = &address[89..95];
|
||||||
|
head.to_owned() + "..." + tail
|
||||||
|
}
|
||||||
|
|
||||||
// Takes in some [State/P2pool] and parses it to build the actual command arguments.
|
// Takes in some [State/P2pool] and parses it to build the actual command arguments.
|
||||||
// Returns the [Vec] of actual arguments, and mutates the [ImgP2pool] for the main GUI thread
|
// Returns the [Vec] of actual arguments, and mutates the [ImgP2pool] for the main GUI thread
|
||||||
// It returns a value... and mutates a deeply nested passed argument... this is some pretty bad code...
|
// It returns a value... and mutates a deeply nested passed argument... this is some pretty bad code...
|
||||||
|
@ -351,12 +360,11 @@ impl Helper {
|
||||||
args.push("--no-color".to_string()); // Remove color escape sequences, Gupax terminal can't parse it :(
|
args.push("--no-color".to_string()); // Remove color escape sequences, Gupax terminal can't parse it :(
|
||||||
args.push("--mini".to_string()); // P2Pool Mini
|
args.push("--mini".to_string()); // P2Pool Mini
|
||||||
*helper.lock().unwrap().img_p2pool.lock().unwrap() = ImgP2pool {
|
*helper.lock().unwrap().img_p2pool.lock().unwrap() = ImgP2pool {
|
||||||
mini: true,
|
mini: "P2Pool Mini".to_string(),
|
||||||
address: state.address.clone(),
|
address: Self::head_tail_of_monero_address(&state.address),
|
||||||
host: ip.to_string(),
|
host: ip.to_string(),
|
||||||
rpc: rpc.to_string(),
|
rpc: rpc.to_string(),
|
||||||
zmq: zmq.to_string(),
|
zmq: zmq.to_string(),
|
||||||
log_level: "3".to_string(),
|
|
||||||
out_peers: "10".to_string(),
|
out_peers: "10".to_string(),
|
||||||
in_peers: "10".to_string(),
|
in_peers: "10".to_string(),
|
||||||
};
|
};
|
||||||
|
@ -370,19 +378,20 @@ impl Helper {
|
||||||
let mut last = "";
|
let mut last = "";
|
||||||
let lock = helper.lock().unwrap();
|
let lock = helper.lock().unwrap();
|
||||||
let mut p2pool_image = lock.img_p2pool.lock().unwrap();
|
let mut p2pool_image = lock.img_p2pool.lock().unwrap();
|
||||||
|
let mut mini = false;
|
||||||
for arg in state.arguments.split_whitespace() {
|
for arg in state.arguments.split_whitespace() {
|
||||||
match last {
|
match last {
|
||||||
"--mini" => p2pool_image.mini = true,
|
"--mini" => { mini = true; p2pool_image.mini = "P2Pool Mini".to_string(); },
|
||||||
"--wallet" => p2pool_image.address = arg.to_string(),
|
"--wallet" => p2pool_image.address = Self::head_tail_of_monero_address(arg),
|
||||||
"--host" => p2pool_image.host = arg.to_string(),
|
"--host" => p2pool_image.host = arg.to_string(),
|
||||||
"--rpc-port" => p2pool_image.rpc = arg.to_string(),
|
"--rpc-port" => p2pool_image.rpc = arg.to_string(),
|
||||||
"--zmq-port" => p2pool_image.zmq = arg.to_string(),
|
"--zmq-port" => p2pool_image.zmq = arg.to_string(),
|
||||||
"--loglevel" => p2pool_image.log_level = arg.to_string(),
|
|
||||||
"--out-peers" => p2pool_image.out_peers = arg.to_string(),
|
"--out-peers" => p2pool_image.out_peers = arg.to_string(),
|
||||||
"--in-peers" => p2pool_image.in_peers = arg.to_string(),
|
"--in-peers" => p2pool_image.in_peers = arg.to_string(),
|
||||||
"--data-api" => api_path = PathBuf::from(arg),
|
"--data-api" => api_path = PathBuf::from(arg),
|
||||||
_ => (),
|
_ => (),
|
||||||
}
|
}
|
||||||
|
if !mini { p2pool_image.mini = "P2Pool Main".to_string(); }
|
||||||
args.push(arg.to_string());
|
args.push(arg.to_string());
|
||||||
last = arg;
|
last = arg;
|
||||||
}
|
}
|
||||||
|
@ -400,12 +409,11 @@ impl Helper {
|
||||||
args.push("--no-color".to_string()); // Remove color escape sequences
|
args.push("--no-color".to_string()); // Remove color escape sequences
|
||||||
if state.mini { args.push("--mini".to_string()); }; // Mini
|
if state.mini { args.push("--mini".to_string()); }; // Mini
|
||||||
*helper.lock().unwrap().img_p2pool.lock().unwrap() = ImgP2pool {
|
*helper.lock().unwrap().img_p2pool.lock().unwrap() = ImgP2pool {
|
||||||
mini: state.mini,
|
mini: if state.mini { "P2Pool Mini".to_string() } else { "P2Pool Main".to_string() },
|
||||||
address: state.address.clone(),
|
address: Self::head_tail_of_monero_address(&state.address),
|
||||||
host: state.selected_ip.to_string(),
|
host: state.selected_ip.to_string(),
|
||||||
rpc: state.selected_rpc.to_string(),
|
rpc: state.selected_rpc.to_string(),
|
||||||
zmq: state.selected_zmq.to_string(),
|
zmq: state.selected_zmq.to_string(),
|
||||||
log_level: state.log_level.to_string(),
|
|
||||||
out_peers: state.out_peers.to_string(),
|
out_peers: state.out_peers.to_string(),
|
||||||
in_peers: state.in_peers.to_string(),
|
in_peers: state.in_peers.to_string(),
|
||||||
};
|
};
|
||||||
|
@ -1333,14 +1341,13 @@ impl P2poolRegex {
|
||||||
// No need for an [Arc<Mutex>] since the Helper thread doesn't need this information.
|
// No need for an [Arc<Mutex>] since the Helper thread doesn't need this information.
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub struct ImgP2pool {
|
pub struct ImgP2pool {
|
||||||
pub mini: bool, // Did the user start on the mini-chain?
|
pub mini: String, // Did the user start on the mini-chain?
|
||||||
pub address: String, // What address is the current p2pool paying out to? (This gets shortened to [4xxxxx...xxxxxx])
|
pub address: String, // What address is the current p2pool paying out to? (This gets shortened to [4xxxxx...xxxxxx])
|
||||||
pub host: String, // What monerod are we using?
|
pub host: String, // What monerod are we using?
|
||||||
pub rpc: String, // What is the RPC port?
|
pub rpc: String, // What is the RPC port?
|
||||||
pub zmq: String, // What is the ZMQ port?
|
pub zmq: String, // What is the ZMQ port?
|
||||||
pub out_peers: String, // How many out-peers?
|
pub out_peers: String, // How many out-peers?
|
||||||
pub in_peers: String, // How many in-peers?
|
pub in_peers: String, // How many in-peers?
|
||||||
pub log_level: String, // What log level?
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for ImgP2pool {
|
impl Default for ImgP2pool {
|
||||||
|
@ -1352,14 +1359,13 @@ impl Default for ImgP2pool {
|
||||||
impl ImgP2pool {
|
impl ImgP2pool {
|
||||||
pub fn new() -> Self {
|
pub fn new() -> Self {
|
||||||
Self {
|
Self {
|
||||||
mini: true,
|
mini: String::from("???"),
|
||||||
address: String::new(),
|
address: String::from("???"),
|
||||||
host: String::new(),
|
host: String::from("???"),
|
||||||
rpc: String::new(),
|
rpc: String::from("???"),
|
||||||
zmq: String::new(),
|
zmq: String::from("???"),
|
||||||
out_peers: String::new(),
|
out_peers: String::from("???"),
|
||||||
in_peers: String::new(),
|
in_peers: String::from("???"),
|
||||||
log_level: String::new(),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1585,8 +1591,8 @@ impl Default for ImgXmrig {
|
||||||
impl ImgXmrig {
|
impl ImgXmrig {
|
||||||
pub fn new() -> Self {
|
pub fn new() -> Self {
|
||||||
Self {
|
Self {
|
||||||
threads: "1".to_string(),
|
threads: "???".to_string(),
|
||||||
url: "127.0.0.1:3333 (Local P2Pool)".to_string(),
|
url: "???".to_string(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1599,7 +1605,6 @@ pub struct PubXmrigApi {
|
||||||
pub worker_id: String,
|
pub worker_id: String,
|
||||||
pub resources: HumanNumber,
|
pub resources: HumanNumber,
|
||||||
pub hashrate: HumanNumber,
|
pub hashrate: HumanNumber,
|
||||||
pub pool: String,
|
|
||||||
pub diff: HumanNumber,
|
pub diff: HumanNumber,
|
||||||
pub accepted: HumanNumber,
|
pub accepted: HumanNumber,
|
||||||
pub rejected: HumanNumber,
|
pub rejected: HumanNumber,
|
||||||
|
@ -1619,7 +1624,6 @@ impl PubXmrigApi {
|
||||||
worker_id: "???".to_string(),
|
worker_id: "???".to_string(),
|
||||||
resources: HumanNumber::unknown(),
|
resources: HumanNumber::unknown(),
|
||||||
hashrate: HumanNumber::unknown(),
|
hashrate: HumanNumber::unknown(),
|
||||||
pool: "???".to_string(),
|
|
||||||
diff: HumanNumber::unknown(),
|
diff: HumanNumber::unknown(),
|
||||||
accepted: HumanNumber::unknown(),
|
accepted: HumanNumber::unknown(),
|
||||||
rejected: HumanNumber::unknown(),
|
rejected: HumanNumber::unknown(),
|
||||||
|
@ -1657,7 +1661,6 @@ impl PubXmrigApi {
|
||||||
worker_id: private.worker_id,
|
worker_id: private.worker_id,
|
||||||
resources: HumanNumber::from_load(private.resources.load_average),
|
resources: HumanNumber::from_load(private.resources.load_average),
|
||||||
hashrate: HumanNumber::from_hashrate(private.hashrate.total),
|
hashrate: HumanNumber::from_hashrate(private.hashrate.total),
|
||||||
pool: private.connection.pool,
|
|
||||||
diff: HumanNumber::from_u128(private.connection.diff),
|
diff: HumanNumber::from_u128(private.connection.diff),
|
||||||
accepted: HumanNumber::from_u128(private.connection.accepted),
|
accepted: HumanNumber::from_u128(private.connection.accepted),
|
||||||
rejected: HumanNumber::from_u128(private.connection.rejected),
|
rejected: HumanNumber::from_u128(private.connection.rejected),
|
||||||
|
@ -1714,7 +1717,6 @@ impl Resources {
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
struct Connection {
|
struct Connection {
|
||||||
pool: String,
|
|
||||||
diff: u128,
|
diff: u128,
|
||||||
accepted: u128,
|
accepted: u128,
|
||||||
rejected: u128,
|
rejected: u128,
|
||||||
|
@ -1722,7 +1724,6 @@ struct Connection {
|
||||||
impl Connection {
|
impl Connection {
|
||||||
fn new() -> Self {
|
fn new() -> Self {
|
||||||
Self {
|
Self {
|
||||||
pool: String::new(),
|
|
||||||
diff: 0,
|
diff: 0,
|
||||||
accepted: 0,
|
accepted: 0,
|
||||||
rejected: 0,
|
rejected: 0,
|
||||||
|
@ -2022,7 +2023,6 @@ r#"{
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"connection": {
|
"connection": {
|
||||||
"pool": "localhost:3333",
|
|
||||||
"diff": 123,
|
"diff": 123,
|
||||||
"accepted": 123,
|
"accepted": 123,
|
||||||
"rejected": 123
|
"rejected": 123
|
||||||
|
|
18
src/main.rs
18
src/main.rs
|
@ -1262,7 +1262,7 @@ impl eframe::App for App {
|
||||||
self.error_state.reset();
|
self.error_state.reset();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
Okay|WindowsAdmin|Debug => if key.is_esc() || ui.add_sized([width, height], Button::new("Okay")).clicked() { self.error_state.reset(); },
|
Okay|WindowsAdmin => if key.is_esc() || ui.add_sized([width, height], Button::new("Okay")).clicked() { self.error_state.reset(); },
|
||||||
Debug => if key.is_esc() { self.error_state.reset(); },
|
Debug => if key.is_esc() { self.error_state.reset(); },
|
||||||
Quit => if ui.add_sized([width, height], Button::new("Quit")).clicked() { exit(1); },
|
Quit => if ui.add_sized([width, height], Button::new("Quit")).clicked() { exit(1); },
|
||||||
}
|
}
|
||||||
|
@ -1579,10 +1579,14 @@ Gupax PATH: {}\n
|
||||||
P2Pool PATH: {}\n
|
P2Pool PATH: {}\n
|
||||||
XMRig PATH: {}\n
|
XMRig PATH: {}\n
|
||||||
P2Pool console byte length: {}\n
|
P2Pool console byte length: {}\n
|
||||||
XMRig console byte length: {}\n\n\n
|
XMRig console byte length: {}\n
|
||||||
--------------------- WORKING STATE ---------------------
|
------------------------------------------ P2POOL IMAGE ------------------------------------------
|
||||||
{:#?}\n\n\n
|
{:#?}\n
|
||||||
--------------------- ORIGINAL STATE ---------------------
|
------------------------------------------ XMRIG IMAGE ------------------------------------------
|
||||||
|
{:#?}\n
|
||||||
|
------------------------------------------ WORKING STATE ------------------------------------------
|
||||||
|
{:#?}\n
|
||||||
|
------------------------------------------ ORIGINAL STATE ------------------------------------------
|
||||||
{:#?}",
|
{:#?}",
|
||||||
GUPAX_VERSION,
|
GUPAX_VERSION,
|
||||||
P2POOL_VERSION,
|
P2POOL_VERSION,
|
||||||
|
@ -1609,6 +1613,8 @@ XMRig console byte length: {}\n\n\n
|
||||||
self.state.gupax.absolute_xmrig_path.display(),
|
self.state.gupax.absolute_xmrig_path.display(),
|
||||||
self.p2pool_api.lock().unwrap().output.len(),
|
self.p2pool_api.lock().unwrap().output.len(),
|
||||||
self.xmrig_api.lock().unwrap().output.len(),
|
self.xmrig_api.lock().unwrap().output.len(),
|
||||||
|
self.p2pool_img.lock().unwrap(),
|
||||||
|
self.xmrig_img.lock().unwrap(),
|
||||||
self.state,
|
self.state,
|
||||||
self.og.lock().unwrap(),
|
self.og.lock().unwrap(),
|
||||||
);
|
);
|
||||||
|
@ -1643,7 +1649,7 @@ XMRig console byte length: {}\n\n\n
|
||||||
}
|
}
|
||||||
Tab::Status => {
|
Tab::Status => {
|
||||||
debug!("App | Entering [Status] Tab");
|
debug!("App | Entering [Status] Tab");
|
||||||
Status::show(&self.pub_sys, &self.p2pool_api, &self.xmrig_api, &self.p2pool_img, &self.xmrig_img, p2pool_is_alive, xmrig_is_alive, self.width, self.height, ctx, ui);
|
Status::show(&self.pub_sys, &self.p2pool_api, &self.xmrig_api, &self.p2pool_img, &self.xmrig_img, p2pool_is_alive, xmrig_is_alive, self.max_threads, self.width, self.height, ctx, ui);
|
||||||
}
|
}
|
||||||
Tab::Gupax => {
|
Tab::Gupax => {
|
||||||
debug!("App | Entering [Gupax] Tab");
|
debug!("App | Entering [Gupax] Tab");
|
||||||
|
|
|
@ -26,7 +26,9 @@ use crate::{
|
||||||
use std::sync::{Arc,Mutex};
|
use std::sync::{Arc,Mutex};
|
||||||
use log::*;
|
use log::*;
|
||||||
use egui::{
|
use egui::{
|
||||||
Label,RichText,TextStyle
|
Label,RichText,TextStyle,
|
||||||
|
TextStyle::Monospace,
|
||||||
|
TextStyle::Name,
|
||||||
};
|
};
|
||||||
|
|
||||||
// Main data structure for the Status tab
|
// Main data structure for the Status tab
|
||||||
|
@ -34,7 +36,7 @@ use egui::{
|
||||||
pub struct Status {}
|
pub struct Status {}
|
||||||
|
|
||||||
impl Status {
|
impl Status {
|
||||||
pub fn show(sys: &Arc<Mutex<Sys>>, p2pool_api: &Arc<Mutex<PubP2poolApi>>, xmrig_api: &Arc<Mutex<PubXmrigApi>>, _p2pool_img: &Arc<Mutex<ImgP2pool>>, _xmrig_img: &Arc<Mutex<ImgXmrig>>, p2pool_alive: bool, xmrig_alive: bool, width: f32, height: f32, _ctx: &egui::Context, ui: &mut egui::Ui) {
|
pub fn show(sys: &Arc<Mutex<Sys>>, p2pool_api: &Arc<Mutex<PubP2poolApi>>, xmrig_api: &Arc<Mutex<PubXmrigApi>>, p2pool_img: &Arc<Mutex<ImgP2pool>>, xmrig_img: &Arc<Mutex<ImgXmrig>>, p2pool_alive: bool, xmrig_alive: bool, max_threads: usize, width: f32, height: f32, _ctx: &egui::Context, ui: &mut egui::Ui) {
|
||||||
let width = (width/3.0)-(SPACE*1.666);
|
let width = (width/3.0)-(SPACE*1.666);
|
||||||
let min_height = height/1.14;
|
let min_height = height/1.14;
|
||||||
let height = height/25.0;
|
let height = height/25.0;
|
||||||
|
@ -43,7 +45,8 @@ pub fn show(sys: &Arc<Mutex<Sys>>, p2pool_api: &Arc<Mutex<PubP2poolApi>>, xmrig_
|
||||||
ui.group(|ui| { ui.vertical(|ui| {
|
ui.group(|ui| { ui.vertical(|ui| {
|
||||||
debug!("Status Tab | Rendering [Gupax]");
|
debug!("Status Tab | Rendering [Gupax]");
|
||||||
ui.set_min_height(min_height);
|
ui.set_min_height(min_height);
|
||||||
ui.add_sized([width, height*2.0], Label::new(RichText::new("[Gupax]").color(LIGHT_GRAY).text_style(TextStyle::Name("MonospaceLarge".into())))).on_hover_text("Gupax is online");
|
ui.add_sized([width, height], Label::new(RichText::new("[Gupax]").color(LIGHT_GRAY).text_style(TextStyle::Name("MonospaceLarge".into())))).on_hover_text("Gupax is online");
|
||||||
|
ui.style_mut().override_text_style = Some(Monospace);
|
||||||
let sys = sys.lock().unwrap();
|
let sys = sys.lock().unwrap();
|
||||||
ui.add_sized([width, height], Label::new(RichText::new("Uptime").underline().color(BONE))).on_hover_text(STATUS_GUPAX_UPTIME);
|
ui.add_sized([width, height], Label::new(RichText::new("Uptime").underline().color(BONE))).on_hover_text(STATUS_GUPAX_UPTIME);
|
||||||
ui.add_sized([width, height], Label::new(sys.gupax_uptime.to_string()));
|
ui.add_sized([width, height], Label::new(sys.gupax_uptime.to_string()));
|
||||||
|
@ -64,7 +67,9 @@ pub fn show(sys: &Arc<Mutex<Sys>>, p2pool_api: &Arc<Mutex<PubP2poolApi>>, xmrig_
|
||||||
debug!("Status Tab | Rendering [P2Pool]");
|
debug!("Status Tab | Rendering [P2Pool]");
|
||||||
ui.set_enabled(p2pool_alive);
|
ui.set_enabled(p2pool_alive);
|
||||||
ui.set_min_height(min_height);
|
ui.set_min_height(min_height);
|
||||||
ui.add_sized([width, height*2.0], Label::new(RichText::new("[P2Pool]").color(LIGHT_GRAY).text_style(TextStyle::Name("MonospaceLarge".into())))).on_hover_text("P2Pool is online").on_disabled_hover_text("P2Pool is offline");
|
ui.add_sized([width, height], Label::new(RichText::new("[P2Pool]").color(LIGHT_GRAY).text_style(TextStyle::Name("MonospaceLarge".into())))).on_hover_text("P2Pool is online").on_disabled_hover_text("P2Pool is offline");
|
||||||
|
let height = height/1.4;
|
||||||
|
ui.style_mut().override_text_style = Some(Name("MonospaceSmall".into()));
|
||||||
let api = p2pool_api.lock().unwrap();
|
let api = p2pool_api.lock().unwrap();
|
||||||
ui.add_sized([width, height], Label::new(RichText::new("Uptime").underline().color(BONE))).on_hover_text(STATUS_P2POOL_UPTIME);
|
ui.add_sized([width, height], Label::new(RichText::new("Uptime").underline().color(BONE))).on_hover_text(STATUS_P2POOL_UPTIME);
|
||||||
ui.add_sized([width, height], Label::new(format!("{}", api.uptime)));
|
ui.add_sized([width, height], Label::new(format!("{}", api.uptime)));
|
||||||
|
@ -76,12 +81,20 @@ pub fn show(sys: &Arc<Mutex<Sys>>, p2pool_api: &Arc<Mutex<PubP2poolApi>>, xmrig_
|
||||||
ui.add_sized([width, height], Label::new(RichText::new("XMR Mined").underline().color(BONE))).on_hover_text(STATUS_P2POOL_XMR);
|
ui.add_sized([width, height], Label::new(RichText::new("XMR Mined").underline().color(BONE))).on_hover_text(STATUS_P2POOL_XMR);
|
||||||
ui.add_sized([width, height], Label::new(format!("Total: {:.13} XMR", api.xmr)));
|
ui.add_sized([width, height], Label::new(format!("Total: {:.13} XMR", api.xmr)));
|
||||||
ui.add_sized([width, height], Label::new(format!("[{:.7}/hour]\n[{:.7}/day]\n[{:.7}/month]", api.xmr_hour, api.xmr_day, api.xmr_month)));
|
ui.add_sized([width, height], Label::new(format!("[{:.7}/hour]\n[{:.7}/day]\n[{:.7}/month]", api.xmr_hour, api.xmr_day, api.xmr_month)));
|
||||||
ui.add_sized([width, height], Label::new(RichText::new("Hashrate [15m/1h/24h]").underline().color(BONE))).on_hover_text(STATUS_P2POOL_HASHRATE);
|
ui.add_sized([width, height], Label::new(RichText::new("Hashrate (15m/1h/24h)").underline().color(BONE))).on_hover_text(STATUS_P2POOL_HASHRATE);
|
||||||
ui.add_sized([width, height], Label::new(format!("[{} H/s] [{} H/s] [{} H/s]", api.hashrate_15m, api.hashrate_1h, api.hashrate_24h)));
|
ui.add_sized([width, height], Label::new(format!("[{} H/s]\n[{} H/s]\n[{} H/s]", api.hashrate_15m, api.hashrate_1h, api.hashrate_24h)));
|
||||||
ui.add_sized([width, height], Label::new(RichText::new("Miners Connected").underline().color(BONE))).on_hover_text(STATUS_P2POOL_CONNECTIONS);
|
ui.add_sized([width, height], Label::new(RichText::new("Miners Connected").underline().color(BONE))).on_hover_text(STATUS_P2POOL_CONNECTIONS);
|
||||||
ui.add_sized([width, height], Label::new(format!("{}", api.connections)));
|
ui.add_sized([width, height], Label::new(format!("{}", api.connections)));
|
||||||
ui.add_sized([width, height], Label::new(RichText::new("Effort").underline().color(BONE))).on_hover_text(STATUS_P2POOL_EFFORT);
|
ui.add_sized([width, height], Label::new(RichText::new("Effort").underline().color(BONE))).on_hover_text(STATUS_P2POOL_EFFORT);
|
||||||
ui.add_sized([width, height], Label::new(format!("[Average: {}] [Current: {}]", api.average_effort, api.current_effort)));
|
ui.add_sized([width, height], Label::new(format!("[Average: {}] [Current: {}]", api.average_effort, api.current_effort)));
|
||||||
|
let img = p2pool_img.lock().unwrap();
|
||||||
|
ui.add_sized([width, height], Label::new(RichText::new("Monero Node").underline().color(BONE))).on_hover_text(STATUS_P2POOL_MONERO_NODE);
|
||||||
|
ui.add_sized([width, height], Label::new(format!("[IP: {}]\n[RPC: {}] [ZMQ: {}]", &img.host, &img.rpc, &img.zmq)));
|
||||||
|
ui.add_sized([width, height], Label::new(RichText::new("Sidechain").underline().color(BONE))).on_hover_text(STATUS_P2POOL_POOL);
|
||||||
|
ui.add_sized([width, height], Label::new(&img.mini));
|
||||||
|
ui.add_sized([width, height], Label::new(RichText::new("Address").underline().color(BONE))).on_hover_text(STATUS_P2POOL_ADDRESS);
|
||||||
|
ui.add_sized([width, height], Label::new(&img.address));
|
||||||
|
drop(img);
|
||||||
drop(api);
|
drop(api);
|
||||||
})});
|
})});
|
||||||
// [XMRig]
|
// [XMRig]
|
||||||
|
@ -89,7 +102,8 @@ pub fn show(sys: &Arc<Mutex<Sys>>, p2pool_api: &Arc<Mutex<PubP2poolApi>>, xmrig_
|
||||||
debug!("Status Tab | Rendering [XMRig]");
|
debug!("Status Tab | Rendering [XMRig]");
|
||||||
ui.set_enabled(xmrig_alive);
|
ui.set_enabled(xmrig_alive);
|
||||||
ui.set_min_height(min_height);
|
ui.set_min_height(min_height);
|
||||||
ui.add_sized([width, height*2.0], Label::new(RichText::new("[XMRig]").color(LIGHT_GRAY).text_style(TextStyle::Name("MonospaceLarge".into())))).on_hover_text("XMRig is online").on_disabled_hover_text("XMRig is offline");
|
ui.add_sized([width, height], Label::new(RichText::new("[XMRig]").color(LIGHT_GRAY).text_style(TextStyle::Name("MonospaceLarge".into())))).on_hover_text("XMRig is online").on_disabled_hover_text("XMRig is offline");
|
||||||
|
ui.style_mut().override_text_style = Some(Monospace);
|
||||||
let api = xmrig_api.lock().unwrap();
|
let api = xmrig_api.lock().unwrap();
|
||||||
ui.add_sized([width, height], Label::new(RichText::new("Uptime").underline().color(BONE))).on_hover_text(STATUS_XMRIG_UPTIME);
|
ui.add_sized([width, height], Label::new(RichText::new("Uptime").underline().color(BONE))).on_hover_text(STATUS_XMRIG_UPTIME);
|
||||||
ui.add_sized([width, height], Label::new(format!("{}", api.uptime)));
|
ui.add_sized([width, height], Label::new(format!("{}", api.uptime)));
|
||||||
|
@ -100,9 +114,11 @@ pub fn show(sys: &Arc<Mutex<Sys>>, p2pool_api: &Arc<Mutex<PubP2poolApi>>, xmrig_
|
||||||
ui.add_sized([width, height], Label::new(RichText::new("Difficulty").underline().color(BONE))).on_hover_text(STATUS_XMRIG_DIFFICULTY);
|
ui.add_sized([width, height], Label::new(RichText::new("Difficulty").underline().color(BONE))).on_hover_text(STATUS_XMRIG_DIFFICULTY);
|
||||||
ui.add_sized([width, height], Label::new(format!("{}", api.diff)));
|
ui.add_sized([width, height], Label::new(format!("{}", api.diff)));
|
||||||
ui.add_sized([width, height], Label::new(RichText::new("Shares").underline().color(BONE))).on_hover_text(STATUS_XMRIG_SHARES);
|
ui.add_sized([width, height], Label::new(RichText::new("Shares").underline().color(BONE))).on_hover_text(STATUS_XMRIG_SHARES);
|
||||||
ui.add_sized([width, height], Label::new(format!("[Accepted: {}]\n[Rejected: {}]", api.accepted, api.rejected)));
|
ui.add_sized([width, height], Label::new(format!("[Accepted: {}] [Rejected: {}]", api.accepted, api.rejected)));
|
||||||
ui.add_sized([width, height], Label::new(RichText::new("Pool").underline().color(BONE))).on_hover_text(STATUS_XMRIG_POOL);
|
ui.add_sized([width, height], Label::new(RichText::new("Pool").underline().color(BONE))).on_hover_text(STATUS_XMRIG_POOL);
|
||||||
ui.add_sized([width, height], Label::new(api.pool.to_string()));
|
ui.add_sized([width, height], Label::new(&xmrig_img.lock().unwrap().url));
|
||||||
|
ui.add_sized([width, height], Label::new(RichText::new("Threads").underline().color(BONE))).on_hover_text(STATUS_XMRIG_THREADS);
|
||||||
|
ui.add_sized([width, height], Label::new(format!("{}/{}", &xmrig_img.lock().unwrap().threads, max_threads)));
|
||||||
drop(api);
|
drop(api);
|
||||||
})});
|
})});
|
||||||
});
|
});
|
||||||
|
|
|
@ -13,6 +13,7 @@ sudo -v
|
||||||
|
|
||||||
# get old GUPAX_VER
|
# get old GUPAX_VER
|
||||||
OLD_VER="v$(grep -m1 "version" Cargo.toml | grep -o "[0-9].[0-9].[0-9]")"
|
OLD_VER="v$(grep -m1 "version" Cargo.toml | grep -o "[0-9].[0-9].[0-9]")"
|
||||||
|
OLD_VER_NUM="$(grep -m1 "version" Cargo.toml | grep -o "[0-9].[0-9].[0-9]")"
|
||||||
|
|
||||||
# get p2pool/xmrig version
|
# get p2pool/xmrig version
|
||||||
P2POOL_VERSION="$(grep "P2POOL_VERSION" src/constants.rs | grep -o "\"v[0-9].*\"")"
|
P2POOL_VERSION="$(grep "P2POOL_VERSION" src/constants.rs | grep -o "\"v[0-9].*\"")"
|
||||||
|
@ -20,7 +21,7 @@ XMRIG_VERSION="$(grep "XMRIG_VERSION" src/constants.rs | grep -o "\"v[0-9].*\"")
|
||||||
|
|
||||||
# sed change
|
# sed change
|
||||||
sed -i "s/$OLD_VER/$1/g" README.md
|
sed -i "s/$OLD_VER/$1/g" README.md
|
||||||
sed -i "s/$OLD_VER/$1/" Cargo.toml
|
sed -i 's/^version = "$OLD_VER_NUM"/$1/' Cargo.toml
|
||||||
|
|
||||||
# changelog
|
# changelog
|
||||||
cat << EOM > CHANGELOG.md.new
|
cat << EOM > CHANGELOG.md.new
|
||||||
|
|
Loading…
Reference in a new issue