mirror of
https://github.com/mikedilger/gossip.git
synced 2024-09-19 19:46:50 +00:00
Start of showing relays and connect button (we also need to know if we are already connected)
This commit is contained in:
parent
84bac254b1
commit
9ec7c80792
@ -1,7 +1,29 @@
|
|||||||
use super::GossipUi;
|
use super::GossipUi;
|
||||||
|
use crate::globals::GLOBALS;
|
||||||
use eframe::egui;
|
use eframe::egui;
|
||||||
use egui::{Context, Ui};
|
use egui::{Align, Context, Layout, ScrollArea, Ui};
|
||||||
|
|
||||||
pub(super) fn update(_app: &mut GossipUi, _ctx: &Context, _frame: &mut eframe::Frame, ui: &mut Ui) {
|
pub(super) fn update(_app: &mut GossipUi, _ctx: &Context, _frame: &mut eframe::Frame, ui: &mut Ui) {
|
||||||
ui.label("RELAYS PAGE - Coming Soon".to_string());
|
ui.add_space(8.0);
|
||||||
|
ui.heading("Relays known");
|
||||||
|
ui.add_space(18.0);
|
||||||
|
|
||||||
|
let relays = GLOBALS.relays.blocking_lock().clone();
|
||||||
|
|
||||||
|
ScrollArea::vertical().show(ui, |ui| {
|
||||||
|
for (_, relay) in relays.iter() {
|
||||||
|
ui.horizontal(|ui| {
|
||||||
|
ui.label(&relay.url);
|
||||||
|
|
||||||
|
ui.with_layout(Layout::right_to_left(Align::Center), |ui| {
|
||||||
|
if ui.button("CONNECT").clicked() {
|
||||||
|
ui.label("TBD");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
ui.add_space(12.0);
|
||||||
|
ui.separator();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user