fedimint_gateway_ui/
general.rs

1use fedimint_gateway_common::GatewayInfo;
2use maud::{Markup, html};
3
4pub fn render(gateway_info: &GatewayInfo) -> Markup {
5    html!(
6        div class="card h-100" {
7            div class="card-header dashboard-header" { "Gateway Network Information" }
8
9            div class="card-body" {
10
11                div id="status" class="alert alert-info" {
12                    "Status: " strong { (gateway_info.gateway_state.clone()) }
13                }
14
15                @if gateway_info.registrations.is_empty() {
16                    div class="alert alert-secondary" {
17                        "No registrations found."
18                    }
19                } @else {
20                    table class="table table-sm" {
21                        thead {
22                            tr {
23                                th { "Protocol" }
24                                th { "Details" }
25                            }
26                        }
27                        tbody {
28                            @for (protocol, (url, pubkey)) in &gateway_info.registrations {
29                                tr {
30                                    td class="align-middle fw-bold" {
31                                        (format!("{:?}", protocol))
32                                    }
33
34                                    td {
35                                        table class="table table-borderless table-sm mb-0" {
36                                            tbody {
37                                                tr {
38                                                    td class="fw-semibold pe-2" { "URL:" }
39                                                    td { (url.to_string()) }
40                                                }
41                                                tr {
42                                                    td class="fw-semibold pe-2" { "ID:" }
43                                                    td { (pubkey.to_string()) }
44                                                }
45                                            }
46                                        }
47                                    }
48                                }
49                            }
50                        }
51                    }
52                }
53            }
54        }
55    )
56}