mirror of
https://github.com/mikedilger/gossip.git
synced 2024-09-19 11:43:43 +00:00
ui: relays page: sorted
This commit is contained in:
parent
3fc0221413
commit
90563d4da6
@ -1,4 +1,5 @@
|
||||
use super::GossipUi;
|
||||
use crate::db::DbRelay;
|
||||
use crate::globals::GLOBALS;
|
||||
use eframe::egui;
|
||||
use egui::{Align, Context, Layout, ScrollArea, Ui};
|
||||
@ -8,10 +9,12 @@ pub(super) fn update(_app: &mut GossipUi, _ctx: &Context, _frame: &mut eframe::F
|
||||
ui.heading("Relays known");
|
||||
ui.add_space(18.0);
|
||||
|
||||
let relays = GLOBALS.relays.blocking_lock().clone();
|
||||
let mut relays = GLOBALS.relays.blocking_lock().clone();
|
||||
let mut relays: Vec<DbRelay> = relays.drain().map(|(_,relay)| relay).collect();
|
||||
relays.sort_by(|a,b| a.url.cmp(&b.url));
|
||||
|
||||
ScrollArea::vertical().show(ui, |ui| {
|
||||
for (_, relay) in relays.iter() {
|
||||
for relay in relays.iter() {
|
||||
ui.horizontal(|ui| {
|
||||
ui.label(&relay.url);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user