ui: fix date format and list items size
This commit is contained in:
parent
45652556bb
commit
2bcb69db02
3 changed files with 10 additions and 8 deletions
|
@ -154,7 +154,7 @@ impl NetworkTab for NetworkMetrics {
|
||||||
fn on_modal_ui(&mut self, ui: &mut egui::Ui, modal: &Modal, cb: &dyn PlatformCallbacks) {}
|
fn on_modal_ui(&mut self, ui: &mut egui::Ui, modal: &Modal, cb: &dyn PlatformCallbacks) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
const BLOCK_ITEM_HEIGHT: f32 = 78.30;
|
const BLOCK_ITEM_HEIGHT: f32 = 74.90;
|
||||||
|
|
||||||
/// Draw block difficulty item.
|
/// Draw block difficulty item.
|
||||||
fn block_item_ui(ui: &mut egui::Ui, db: &DiffBlock, rounding: [bool; 2]) {
|
fn block_item_ui(ui: &mut egui::Ui, db: &DiffBlock, rounding: [bool; 2]) {
|
||||||
|
@ -215,11 +215,11 @@ fn block_item_ui(ui: &mut egui::Ui, db: &DiffBlock, rounding: [bool; 2]) {
|
||||||
// Draw block time.
|
// Draw block time.
|
||||||
let block_time = NaiveDateTime::from_timestamp_opt(db.time as i64, 0).unwrap();
|
let block_time = NaiveDateTime::from_timestamp_opt(db.time as i64, 0).unwrap();
|
||||||
let block_datetime: DateTime<Utc> = DateTime::from_utc(block_time, Utc);
|
let block_datetime: DateTime<Utc> = DateTime::from_utc(block_time, Utc);
|
||||||
ui.heading(RichText::new(block_datetime.to_string())
|
ui.heading(RichText::new(block_datetime.format("%d/%m/%Y %H:%M:%S UTC").to_string())
|
||||||
.color(Colors::GRAY)
|
.color(Colors::GRAY)
|
||||||
.size(16.0));
|
.size(16.0));
|
||||||
});
|
});
|
||||||
ui.add_space(4.0);
|
ui.add_space(2.0);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
|
@ -214,7 +214,7 @@ impl NetworkTab for NetworkMining {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const WORKER_ITEM_HEIGHT: f32 = 77.0;
|
const WORKER_ITEM_HEIGHT: f32 = 76.0;
|
||||||
|
|
||||||
/// Draw worker statistics item.
|
/// Draw worker statistics item.
|
||||||
fn worker_item_ui(ui: &mut egui::Ui, ws: &WorkerStats, rounding: [bool; 2]) {
|
fn worker_item_ui(ui: &mut egui::Ui, ws: &WorkerStats, rounding: [bool; 2]) {
|
||||||
|
@ -299,7 +299,9 @@ fn worker_item_ui(ui: &mut egui::Ui, ws: &WorkerStats, rounding: [bool; 2]) {
|
||||||
let seen = ws.last_seen.duration_since(std::time::UNIX_EPOCH).unwrap().as_secs();
|
let seen = ws.last_seen.duration_since(std::time::UNIX_EPOCH).unwrap().as_secs();
|
||||||
let naive_datetime = NaiveDateTime::from_timestamp_opt(seen as i64, 0).unwrap();
|
let naive_datetime = NaiveDateTime::from_timestamp_opt(seen as i64, 0).unwrap();
|
||||||
let datetime: DateTime<Utc> = DateTime::from_utc(naive_datetime, Utc);
|
let datetime: DateTime<Utc> = DateTime::from_utc(naive_datetime, Utc);
|
||||||
let date_text = format!("{} {}", CLOCK_AFTERNOON, datetime);
|
let date_text = format!("{} {}",
|
||||||
|
CLOCK_AFTERNOON,
|
||||||
|
datetime.format("%d/%m/%Y %H:%M:%S UTC"));
|
||||||
ui.heading(RichText::new(date_text)
|
ui.heading(RichText::new(date_text)
|
||||||
.color(Colors::GRAY)
|
.color(Colors::GRAY)
|
||||||
.size(16.0));
|
.size(16.0));
|
||||||
|
|
|
@ -80,7 +80,7 @@ impl NetworkTab for NetworkNode {
|
||||||
columns[1].vertical_centered(|ui| {
|
columns[1].vertical_centered(|ui| {
|
||||||
let h_ts = stats.header_stats.latest_timestamp;
|
let h_ts = stats.header_stats.latest_timestamp;
|
||||||
View::rounded_box(ui,
|
View::rounded_box(ui,
|
||||||
format!("{}", h_ts.format("%d/%m/%Y %H:%M")),
|
h_ts.format("%d/%m/%Y %H:%M").to_string(),
|
||||||
t!("network_node.time_utc"),
|
t!("network_node.time_utc"),
|
||||||
[false, false, false, true]);
|
[false, false, false, true]);
|
||||||
});
|
});
|
||||||
|
@ -191,7 +191,7 @@ fn peer_item_ui(ui: &mut egui::Ui, peer: &PeerStats, rounding: [bool; 2]) {
|
||||||
ui.vertical(|ui| {
|
ui.vertical(|ui| {
|
||||||
// Draw round background.
|
// Draw round background.
|
||||||
let mut rect = ui.available_rect_before_wrap();
|
let mut rect = ui.available_rect_before_wrap();
|
||||||
rect.set_height(78.3);
|
rect.set_height(74.9);
|
||||||
ui.painter().rect(
|
ui.painter().rect(
|
||||||
rect,
|
rect,
|
||||||
Rounding {
|
Rounding {
|
||||||
|
@ -228,6 +228,6 @@ fn peer_item_ui(ui: &mut egui::Ui, peer: &PeerStats, rounding: [bool; 2]) {
|
||||||
let agent_text = format!("{} {}", DEVICES, &peer.user_agent);
|
let agent_text = format!("{} {}", DEVICES, &peer.user_agent);
|
||||||
ui.label(RichText::new(agent_text).color(Colors::GRAY).size(16.0));
|
ui.label(RichText::new(agent_text).color(Colors::GRAY).size(16.0));
|
||||||
});
|
});
|
||||||
ui.add_space(4.0);
|
ui.add_space(2.0);
|
||||||
});
|
});
|
||||||
}
|
}
|
Loading…
Reference in a new issue