master
lza_menace 2 years ago
parent bd4b3fb8c2
commit 3ce72cb24f

@ -92,6 +92,14 @@ impl eframe::App for App {
}
}
if self.show_market_data {
egui::ComboBox::from_label("Pick currency base.")
.selected_text(format!("{}", self.market.denomination))
.show_ui(ui, |ui| {
ui.selectable_value(&mut self.market.denomination, "sats".to_owned(), "sats");
ui.selectable_value(&mut self.market.denomination, "usd".to_owned(), "usd");
ui.selectable_value(&mut self.market.denomination, "eth".to_owned(), "eth");
}
);
if self.market.last_check_time.elapsed().unwrap() > Duration::from_secs(120) {
println!("[+] refreshing WOW market data.");
self.market.last_cg_data = self.market.get_wow_market(self.tor_required);
@ -101,24 +109,26 @@ impl eframe::App for App {
let md = &m["market_data"];
ui.horizontal_wrapped(|ui| {
ui.vertical(|ui| {
ui.label("CURRENT PRICE");
ui.heading(egui::RichText::new(md["current_price"]["sats"].to_string()).strong());
ui.label("SATS");
});
ui.vertical(|ui| {
ui.label("ATH");
ui.heading(egui::RichText::new(md["ath"]["sats"].to_string()).strong());
ui.label("SATS");
});
ui.vertical(|ui| {
ui.label("ATL");
ui.heading(egui::RichText::new(md["atl"]["sats"].to_string()).strong());
ui.label("SATS");
ui.label("Current Price");
ui.heading(egui::RichText::new(md["current_price"][&self.market.denomination].to_string()).strong());
ui.label("All-Time High");
ui.heading(egui::RichText::new(md["ath"][&self.market.denomination].to_string()).strong());
ui.label("All-Time Low");
ui.heading(egui::RichText::new(md["atl"][&self.market.denomination].to_string()).strong());
ui.label("Total Volume");
ui.heading(egui::RichText::new(md["total_volume"][&self.market.denomination].to_string()).strong());
ui.label("Market Cap");
ui.heading(egui::RichText::new(md["market_cap"][&self.market.denomination].to_string()).strong());
});
ui.vertical(|ui| {
ui.label("MARKET CAP");
ui.heading(egui::RichText::new(md["market_cap"]["sats"].to_string()).strong());
ui.label("SATS");
ui.label("PriceChg% (~24hrs)");
ui.heading(egui::RichText::new(md["price_change_percentage_24h_in_currency"][&self.market.denomination].to_string()).strong());
ui.label("PriceChg% (~7d)");
ui.heading(egui::RichText::new(md["price_change_percentage_7d_in_currency"][&self.market.denomination].to_string()).strong());
ui.label("PriceChg% (~14d)");
ui.heading(egui::RichText::new(md["price_change_percentage_14d_in_currency"][&self.market.denomination].to_string()).strong());
ui.label("PriceChg% (~30d)");
ui.heading(egui::RichText::new(md["price_change_percentage_30d_in_currency"][&self.market.denomination].to_string()).strong());
});
});
}
@ -127,8 +137,8 @@ impl eframe::App for App {
// Show volume controls
egui::TopBottomPanel::bottom("radio_player").show(ctx, |ui| {
ui.heading(egui::RichText::new("WOW!Radio").color(egui::Color32::GREEN));
ui.label(egui::RichText::new("Your home for the most diabolical playlist of the century, made by the skeevers, scallywags, chupacabras, and whores of the Wownero community. Join da chat to peep da scoop.\n").color(egui::Color32::GREEN));
ui.heading(egui::RichText::new("WOW!Radio").color(egui::Color32::WHITE));
ui.label(egui::RichText::new("Your home for the most diabolical playlist of the century, made by the skeevers, scallywags, chupacabras, snails, and whores of the Wownero community. Join da chat to peep da scoop.\n").color(egui::Color32::WHITE));
ui.horizontal(|ui| {
if self.player.playing {
if ui.button("⏸").clicked() {
@ -195,7 +205,7 @@ impl eframe::App for App {
.size(18.0);
ui.label(rt);
let dur = self.player.exif_date.elapsed().unwrap();
if dur > Duration::from_secs(8) {
if dur > Duration::from_secs(15) {
self.player.exif_date = SystemTime::now();
self.player.stream_exif = self.player.get_song_meta().unwrap();
}

@ -7,14 +7,16 @@ use reqwest::{blocking::ClientBuilder, Proxy};
pub struct Market {
pub last_check_time: SystemTime,
pub last_cg_data: JsonValue
pub last_cg_data: JsonValue,
pub denomination: String
}
impl Market {
pub fn new() -> Self {
Self {
last_check_time: SystemTime::now() - Duration::from_secs(600),
last_cg_data: json::object!{}
last_cg_data: json::object!{},
denomination: "sats".to_owned()
}
}

@ -11,6 +11,7 @@ impl GuiTor {
return t
}
#[allow(dead_code)]
pub fn clear_log() -> std::io::Result<()> {
let r: std::io::Result<()> = std::fs::write(crate::TOR_LOG, "");
return r